Core/Spells: Rename SpellAttr4 to use official attribute names

Port From (https://github.com/TrinityCore/TrinityCore/commit/8d16a79dea4c0100d36e13b068c42499a3a48154)
This commit is contained in:
hondacrx
2022-06-01 13:37:39 -04:00
parent c5ed815f84
commit 62c2d34f1a
12 changed files with 154 additions and 134 deletions
+4
View File
@@ -1828,6 +1828,10 @@ namespace Game.Spells
if (target.GetGUID() != GetCasterGUID())
return 0;
if (!m_spellInfo.HasAttribute(SpellAttr4.AllowProcWhileSitting))
if (!target.IsStandState())
return 0;
bool success = RandomHelper.randChance(CalcProcChance(procEntry, eventInfo));
SetLastProcAttemptTime(now);
+6 -5
View File
@@ -5023,14 +5023,14 @@ namespace Game.Spells
damage = damageReducedArmor;
}
if (!GetSpellInfo().HasAttribute(SpellAttr4.FixedDamage))
if (!GetSpellInfo().HasAttribute(SpellAttr4.IgnoreDamageTakenModifiers))
{
if (GetSpellEffectInfo().IsTargetingArea() || GetSpellEffectInfo().IsAreaAuraEffect() || GetSpellEffectInfo().IsEffect(SpellEffectName.PersistentAreaAura))
damage = (uint)target.CalculateAOEAvoidance((int)damage, (uint)m_spellInfo.SchoolMask, GetBase().GetCastItemGUID());
}
int dmg = (int)damage;
if (!GetSpellInfo().HasAttribute(SpellAttr4.FixedDamage) && caster != null && caster.CanApplyResilience())
if (!GetSpellInfo().HasAttribute(SpellAttr4.IgnoreDamageTakenModifiers) && caster != null && caster.CanApplyResilience())
Unit.ApplyResilience(target, ref dmg);
damage = (uint)dmg;
@@ -5105,14 +5105,14 @@ namespace Game.Spells
damage = damageReducedArmor;
}
if (!GetSpellInfo().HasAttribute(SpellAttr4.FixedDamage))
if (!GetSpellInfo().HasAttribute(SpellAttr4.IgnoreDamageTakenModifiers))
{
if (GetSpellEffectInfo().IsTargetingArea() || GetSpellEffectInfo().IsAreaAuraEffect() || GetSpellEffectInfo().IsEffect(SpellEffectName.PersistentAreaAura))
damage = (uint)target.CalculateAOEAvoidance((int)damage, (uint)m_spellInfo.SchoolMask, GetBase().GetCastItemGUID());
}
int dmg = (int)damage;
if (!GetSpellInfo().HasAttribute(SpellAttr4.FixedDamage) && caster != null && caster.CanApplyResilience())
if (!GetSpellInfo().HasAttribute(SpellAttr4.IgnoreDamageTakenModifiers) && caster != null && caster.CanApplyResilience())
Unit.ApplyResilience(target, ref dmg);
damage = (uint)dmg;
@@ -5284,7 +5284,8 @@ namespace Game.Spells
{
gainedAmount = caster.ModifyPower(powerType, gainAmount);
// energize is not modified by threat modifiers
target.GetThreatManager().AddThreat(caster, gainedAmount * 0.5f, GetSpellInfo(), true);
if (!GetSpellInfo().HasAttribute(SpellAttr4.NoHelpfulThreat))
target.GetThreatManager().AddThreat(caster, gainedAmount * 0.5f, GetSpellInfo(), true);
}
// Drain Mana