Core/Spells: rework part 4: iterate over effects first

Port From (https://github.com/TrinityCore/TrinityCore/commit/65dca120d34febdaa84a63e17f638ab0fa59b3df)
This commit is contained in:
hondacrx
2021-08-28 22:35:39 -04:00
parent 091272755c
commit e97ffa304d
6 changed files with 693 additions and 663 deletions
+4 -14
View File
@@ -2657,14 +2657,16 @@ namespace Game.Spells
public int GetDuration()
{
if (DurationEntry == null)
return 0;
return IsPassive() ? -1 : 0;
return (DurationEntry.Duration == -1) ? -1 : Math.Abs(DurationEntry.Duration);
}
public int GetMaxDuration()
{
if (DurationEntry == null)
return 0;
return IsPassive() ? -1 : 0;
return (DurationEntry.MaxDuration == -1) ? -1 : Math.Abs(DurationEntry.MaxDuration);
}
@@ -4021,18 +4023,6 @@ namespace Game.Spells
return false;
}
public bool IsFarUnitTargetEffect()
{
return (Effect == SpellEffectName.SummonPlayer)
|| (Effect == SpellEffectName.SummonRafFriend)
|| (Effect == SpellEffectName.Resurrect);
}
bool IsFarDestTargetEffect()
{
return Effect == SpellEffectName.TeleportUnits;
}
public bool IsUnitOwnedAuraEffect()
{
return IsAreaAuraEffect() || Effect == SpellEffectName.ApplyAura || Effect == SpellEffectName.ApplyAuraOnPet;