Core/Spells: Named and implemented most of SpellAttr8

Port From (https://github.com/TrinityCore/TrinityCore/commit/dc9361fcc2eb16a59b52dfd8b0d47dfc1bf639be)
This commit is contained in:
hondacrx
2024-02-01 18:59:34 -05:00
parent e37c9558ad
commit 5869fbaee0
10 changed files with 232 additions and 87 deletions
+14 -6
View File
@@ -61,7 +61,7 @@ namespace Game.Spells
// default amount calculation
int amount = 0;
if (!m_spellInfo.HasAttribute(SpellAttr8.MasteryAffectPoints) || MathFunctions.fuzzyEq(GetSpellEffectInfo().BonusCoefficient, 0.0f))
if (!m_spellInfo.HasAttribute(SpellAttr8.MasteryAffectsPoints) || MathFunctions.fuzzyEq(GetSpellEffectInfo().BonusCoefficient, 0.0f))
amount = GetSpellEffectInfo().CalcValue(caster, m_baseAmount, GetBase().GetOwner().ToUnit(), GetBase().GetCastItemId(), GetBase().GetCastItemLevel());
else if (caster != null && caster.IsTypeId(TypeId.Player))
amount = (int)(caster.ToPlayer().m_activePlayerData.Mastery * GetSpellEffectInfo().BonusCoefficient);
@@ -169,6 +169,8 @@ namespace Game.Spells
caster.ModSpellDurationTime(spellInfo, ref period);
else if (spellInfo.HasAttribute(SpellAttr5.SpellHasteAffectsPeriodic))
period = (int)(period * caster.m_unitData.ModCastingSpeed);
else if (spellInfo.HasAttribute(SpellAttr8.MeleeHasteAffectsPeriodic))
period = (int)(period * caster.m_unitData.ModHaste);
if (period == 0)
return 0.0f;
@@ -179,7 +181,7 @@ namespace Game.Spells
return totalTicks * CalculateEstimatedAmount(caster, target, spellInfo, spellEffectInfo, (int)amount, stack, null).GetValueOrDefault(amount);
}
public uint GetTotalTicks()
{
uint totalTicks = 0;
@@ -252,6 +254,8 @@ namespace Game.Spells
caster.ModSpellDurationTime(m_spellInfo, ref _period);
else if (m_spellInfo.HasAttribute(SpellAttr5.SpellHasteAffectsPeriodic))
_period = (int)(_period * caster.m_unitData.ModCastingSpeed);
else if (m_spellInfo.HasAttribute(SpellAttr8.MeleeHasteAffectsPeriodic))
_period = (int)(_period * caster.m_unitData.ModHaste);
}
}
else // prevent infinite loop on Update
@@ -365,7 +369,7 @@ namespace Game.Spells
HandleEffect(aurApp, handleMask, true, triggeredBy);
}
if (GetSpellInfo().HasAttribute(SpellAttr8.AuraSendAmount) || Aura.EffectTypeNeedsSendingAmount(GetAuraType()))
if (GetSpellInfo().HasAttribute(SpellAttr8.AuraPointsOnClient) || Aura.EffectTypeNeedsSendingAmount(GetAuraType()))
GetBase().SetNeedClientUpdateForTargets();
}
@@ -2519,7 +2523,7 @@ namespace Game.Spells
if (!apply && !target.IsFlying())
target.GetMotionMaster().MoveFall();
}
[AuraEffectHandler(AuraType.ModStunDisableGravity)]
void HandleAuraModStunAndDisableGravity(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
@@ -4826,7 +4830,7 @@ namespace Game.Spells
uint casterType = (uint)GetMiscValue();
if (casterType > 0)
caster = GetCaster();
caster?.CastSpell(aurApp.GetTarget(), GetSpellEffectInfo().TriggerSpell, new CastSpellExtraArgs(this));
}
@@ -5558,6 +5562,8 @@ namespace Game.Spells
{
Unit triggerCaster = aurApp.GetTarget();
Unit triggerTarget = eventInfo.GetProcTarget();
if (GetSpellInfo().HasAttribute(SpellAttr8.TargetProcsOnCaster) && eventInfo.GetTypeMask().HasFlag(ProcFlags.TakenHitMask))
triggerTarget = eventInfo.GetActor();
uint triggerSpellId = GetSpellEffectInfo().TriggerSpell;
if (triggerSpellId == 0)
@@ -5580,6 +5586,8 @@ namespace Game.Spells
{
Unit triggerCaster = aurApp.GetTarget();
Unit triggerTarget = eventInfo.GetProcTarget();
if (GetSpellInfo().HasAttribute(SpellAttr8.TargetProcsOnCaster) && eventInfo.GetTypeMask().HasFlag(ProcFlags.TakenHitMask))
triggerTarget = eventInfo.GetActor();
uint triggerSpellId = GetSpellEffectInfo().TriggerSpell;
if (triggerSpellId == 0)
@@ -5993,7 +6001,7 @@ namespace Game.Spells
playerTarget.ReplaceAllRequiredMountCapabilityFlags((byte)mountCapabilityFlags);
}
}
[AuraEffectHandler(AuraType.SuppressItemPassiveEffectBySpellLabel)]
void HandleSuppressItemPassiveEffectBySpellLabel(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{