本文整理汇总了C#中WoWUnit.IsBoss方法的典型用法代码示例。如果您正苦于以下问题:C# WoWUnit.IsBoss方法的具体用法?C# WoWUnit.IsBoss怎么用?C# WoWUnit.IsBoss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoWUnit
的用法示例。
在下文中一共展示了WoWUnit.IsBoss方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidUnit
static bool ValidUnit(WoWUnit p)
{
if (IgnoreMobs.Contains(p.Entry))
return false;
// Ignore shit we can't select/attack
if (!p.CanSelect || !p.Attackable)
return false;
// Ignore friendlies!
if (p.IsFriendly)
return false;
// Duh
if (p.Dead)
return false;
// Dummies/bosses are valid by default. Period.
if (p.IsTrainingDummy() || p.IsBoss())
return true;
// If its a pet, lets ignore it please.
if (p.IsPet || p.OwnedByRoot != null)
return false;
// And ignore critters/non-combat pets
if (p.IsNonCombatPet || p.IsCritter)
return false;
return true;
}
示例2: CheckTarget
private void CheckTarget(WoWUnit unit, ref WoWGuid prevGuid, string description, OnTargetChange onchg)
{
// there are moments where CurrentTargetGuid != 0 but CurrentTarget == null. following
// .. tries to handle by only checking CurrentTarget reference and treating null as guid = 0
if (unit == null)
{
if (prevGuid.IsValid)
{
prevGuid = WoWGuid.Empty;
onchg(unit);
if (SingularSettings.Debug)
Logger.WriteDebug(description + ": changed to: (null)");
}
}
else if (unit.Guid != prevGuid)
{
prevGuid = unit.Guid;
onchg(unit);
if (SingularSettings.Debug)
{
//Logger.WriteDebug( "GuidInfo: {0}", unit.Guid.ToString());
//Logger.WriteDebug("GuidInfo: {0:X4} {1:X4} {2:X4} {3:X4}", unit.Guid.Highest, unit.Guid.Higher, unit.Guid.Lower, unit.Guid.Lowest);
string info = "";
if (Styx.CommonBot.POI.BotPoi.Current.Guid == Me.CurrentTargetGuid)
info += string.Format(", IsBotPoi={0}", Styx.CommonBot.POI.BotPoi.Current.Type);
if (Styx.CommonBot.Targeting.Instance.TargetList.Contains(Me.CurrentTarget))
info += string.Format(", TargetIndex={0}", Styx.CommonBot.Targeting.Instance.TargetList.IndexOf(Me.CurrentTarget) + 1);
string playerInfo = "N";
if (unit.IsPlayer)
{
WoWPlayer p = unit.ToPlayer();
playerInfo = string.Format("Y, Friend={0}, IsPvp={1}, CtstPvp={2}, FfaPvp={3}", Me.IsHorde == p.IsHorde, p.IsPvPFlagged, p.ContestedPvPFlagged, p.IsFFAPvPFlagged);
}
else
{
info += string.Format(", creature={0}, tagme={1}, tagother={2}, tapall={3}",
unit.CreatureType,
unit.TaggedByMe.ToYN(),
unit.TaggedByOther.ToYN(),
unit.TappedByAllThreatLists.ToYN()
);
}
Logger.WriteDebug(description + ": changed to: {0} lvl={1} h={2:F1}%, maxh={3}, d={4:F1} yds, box={5:F1}, boss={6}, trivial={7}, player={8}, attackable={9}, neutral={10}, hostile={11}, entry={12}, faction={13}, loss={14}, facing={15}, blacklist={16}, combat={17}, flying={18}, abovgrnd={19}" + info,
unit.SafeName(),
unit.Level,
unit.HealthPercent,
unit.MaxHealth,
unit.Distance,
unit.CombatReach,
unit.IsBoss().ToYN(),
unit.IsTrivial().ToYN(),
playerInfo,
unit.Attackable.ToYN(),
unit.IsNeutral().ToYN(),
unit.IsHostile.ToYN(),
unit.Entry,
unit.FactionId,
unit.InLineOfSpellSight.ToYN(),
Me.IsSafelyFacing(unit).ToYN(),
Blacklist.Contains(unit.Guid, BlacklistFlags.Combat).ToYN(),
unit.Combat.ToYN(),
unit.IsFlying.ToYN(),
unit.IsAboveTheGround().ToYN()
);
}
}
}
示例3: ValidUnit
public static bool ValidUnit(WoWUnit p, bool showReason = false)
{
if (p == null || !p.IsValid)
return false;
if (StyxWoW.Me.IsInInstance && IgnoreMobs.Contains(p.Entry))
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} is an Instance Ignore Mob", p.SafeName());
return false;
}
// Ignore shit we can't select
if (!p.CanSelect )
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} cannot be Selected", p.SafeName());
return false;
}
// Ignore shit we can't attack
if (!p.Attackable)
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} cannot be Attacked", p.SafeName());
return false;
}
// Duh
if (p.IsDead)
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} is already Dead", p.SafeName());
return false;
}
// check for enemy players here as friendly only seems to work on npc's
if (p.IsPlayer)
return p.ToPlayer().IsHorde != StyxWoW.Me.IsHorde;
// Ignore friendlies!
if (p.IsFriendly)
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} is Friendly", p.SafeName());
return false;
}
// Dummies/bosses are valid by default. Period.
if (p.IsTrainingDummy() || p.IsBoss())
return true;
// If it is a pet/minion/totem, lets find the root of ownership chain
WoWUnit pOwner = GetPlayerParent(p);
// ignore if owner is player, alive, and not blacklisted then ignore (since killing owner kills it)
if (pOwner != null && pOwner.IsAlive && !Blacklist.Contains(pOwner, BlacklistFlags.Combat))
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} has a Player as Parent", p.SafeName());
return false;
}
// And ignore critters (except for those ferocious ones) /non-combat pets
if (p.IsNonCombatPet)
{
if (showReason) Logger.Write(invalidColor, "{0} is a Noncombat Pet", p.SafeName());
return false;
}
// And ignore critters (except for those ferocious ones) /non-combat pets
if (p.IsCritter && p.ThreatInfo.ThreatValue == 0 && !p.IsTargetingMyRaidMember)
{
if (showReason) Logger.Write(invalidColor, "{0} is a Critter", p.SafeName());
return false;
}
/*
if (p.CreatedByUnitGuid != 0 || p.SummonedByUnitGuid != 0)
return false;
*/
return true;
}
示例4: HmmContext
// always create passing the existing context so it is preserved for delegate usage
internal HmmContext(WoWUnit tank, WoWUnit target, object ctx)
{
this.tank = tank;
this.target = target;
this.context = ctx;
behind = target != null && target.IsBoss() && !Singular.Lists.BossList.AvoidRearBosses.Contains(target.Entry);
}
示例5: ValidUnit
public static bool ValidUnit(WoWUnit p, bool showReason = false)
{
if (p == null || !p.IsValid)
return false;
if (StyxWoW.Me.IsInInstance && IgnoreMobs.Contains(p.Entry))
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} is an Instance Ignore Mob", p.SafeName());
return false;
}
// Ignore shit we can't select
if (!p.CanSelect )
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} cannot be Selected", p.SafeName());
return false;
}
// Ignore shit we can't attack
if (!p.Attackable)
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} cannot be Attacked", p.SafeName());
return false;
}
// Duh
if (p.IsDead)
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} is already Dead", p.SafeName());
return false;
}
// check for enemy players here as friendly only seems to work on npc's
if (p.IsPlayer)
{
WoWPlayer pp = p.ToPlayer();
if (pp.IsHorde == StyxWoW.Me.IsHorde && !pp.IsHostile)
{
if (showReason)
Logger.Write(invalidColor, "invalid attack player {0} not a hostile enemy", p.SafeName());
return false;
}
if (!pp.CanWeAttack())
{
if (showReason)
Logger.Write(invalidColor, "invalid attack player {0} cannot be Attacked currently", p.SafeName());
return false;
}
return true;
}
// Ignore evading NPCs
if (p.IsEvading())
{
if (showReason)
Logger.Write(invalidColor, "invalid unit, {0} game flagged as evading", p.SafeName());
return false;
}
// Ignore friendlies!
if (p.IsFriendly)
{
if (showReason) Logger.Write(invalidColor, "invalid attack unit {0} is Friendly", p.SafeName());
return false;
}
// Dummies/bosses are valid by default. Period.
if (p.IsTrainingDummy() || p.IsBoss())
return true;
// If it is a pet/minion/totem, lets find the root of ownership chain
WoWPlayer pOwner = GetPlayerParent(p);
// ignore if owner is player, alive, and not blacklisted then ignore (since killing owner kills it)
// .. following .IsMe check to prevent treating quest mob summoned by us that we need to kill as invalid
if (pOwner != null && pOwner.IsAlive && !pOwner.IsMe)
{
if (!ValidUnit(pOwner))
{
if (showReason)
Logger.Write(invalidColor, "invalid attack unit {0} - pets parent not an attackable Player", p.SafeName());
return false;
}
if (!StyxWoW.Me.IsPvPFlagged)
{
if (showReason)
Logger.Write(invalidColor, "valid attackable player {0} but I am not PvP Flagged", p.SafeName());
return false;
}
if (Blacklist.Contains(pOwner, BlacklistFlags.Combat))
{
if (showReason)
Logger.Write(invalidColor, "invalid attack unit {0} - Parent blacklisted for combat", p.SafeName());
return false;
}
return true;
}
//.........这里部分代码省略.........