Some missed stuff.
This commit is contained in:
@@ -1660,12 +1660,12 @@ namespace Game.Entities
|
||||
|
||||
// check flags
|
||||
if (target.HasUnitFlag(UnitFlags.NonAttackable | UnitFlags.TaxiFlight | UnitFlags.NotAttackable1 | UnitFlags.Unk16)
|
||||
|| (!HasUnitFlag(UnitFlags.PvpAttackable) && target.HasUnitFlag(UnitFlags.ImmuneToNpc))
|
||||
|| (!target.HasUnitFlag(UnitFlags.PvpAttackable) && HasUnitFlag(UnitFlags.ImmuneToNpc)))
|
||||
|| (!HasUnitFlag(UnitFlags.PvpAttackable) && target.IsImmuneToNPC())
|
||||
|| (!target.HasUnitFlag(UnitFlags.PvpAttackable) && IsImmuneToNPC()))
|
||||
return false;
|
||||
|
||||
if ((bySpell == null || !bySpell.HasAttribute(SpellAttr8.AttackIgnoreImmuneToPCFlag))
|
||||
&& (HasUnitFlag(UnitFlags.PvpAttackable) && target.HasUnitFlag(UnitFlags.ImmuneToPc))
|
||||
&& (HasUnitFlag(UnitFlags.PvpAttackable) && target.IsImmuneToPC())
|
||||
// check if this is a world trigger cast - GOs are using world triggers to cast their spells, so we need to ignore their immunity flag here, this is a temp workaround, needs removal when go cast is implemented properly
|
||||
&& GetEntry() != SharedConst.WorldTrigger)
|
||||
return false;
|
||||
@@ -1782,12 +1782,12 @@ namespace Game.Entities
|
||||
{
|
||||
if (HasUnitFlag(UnitFlags.PvpAttackable))
|
||||
{
|
||||
if (target.HasUnitFlag(UnitFlags.ImmuneToPc))
|
||||
if (target.IsImmuneToPC())
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (target.HasUnitFlag(UnitFlags.ImmuneToNpc))
|
||||
if (target.IsImmuneToNPC())
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3115,7 +3115,9 @@ namespace Game.Entities
|
||||
return gain;
|
||||
}
|
||||
|
||||
void SetImmuneToAll(bool apply, bool keepCombat)
|
||||
public bool IsImmuneToAll() { return IsImmuneToPC() && IsImmuneToNPC(); }
|
||||
|
||||
public void SetImmuneToAll(bool apply, bool keepCombat)
|
||||
{
|
||||
if (apply)
|
||||
{
|
||||
@@ -3133,7 +3135,11 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
void SetImmuneToPC(bool apply, bool keepCombat)
|
||||
public virtual void SetImmuneToAll(bool apply) { SetImmuneToAll(apply, false); }
|
||||
|
||||
public bool IsImmuneToPC() { return HasUnitFlag(UnitFlags.ImmuneToPc); }
|
||||
|
||||
public void SetImmuneToPC(bool apply, bool keepCombat)
|
||||
{
|
||||
if (apply)
|
||||
{
|
||||
@@ -3163,7 +3169,11 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
void SetImmuneToNPC(bool apply, bool keepCombat)
|
||||
public virtual void SetImmuneToPC(bool apply) { SetImmuneToPC(apply, false); }
|
||||
|
||||
public bool IsImmuneToNPC() { return HasUnitFlag(UnitFlags.ImmuneToNpc); }
|
||||
|
||||
public void SetImmuneToNPC(bool apply, bool keepCombat)
|
||||
{
|
||||
if (apply)
|
||||
{
|
||||
@@ -3193,6 +3203,8 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetImmuneToNPC(bool apply) { SetImmuneToNPC(apply, false); }
|
||||
|
||||
public virtual float GetBlockPercent(uint attackerLevel) { return 30.0f; }
|
||||
|
||||
void UpdateReactives(uint p_time)
|
||||
|
||||
Reference in New Issue
Block a user