Core/Spells: register and apply individual aura effects on hit handler

Port From (https://github.com/TrinityCore/TrinityCore/commit/c07b9188dfc6f76bd909eea7cb8f5a8263b0e83e)
This commit is contained in:
hondacrx
2021-09-08 22:55:23 -04:00
parent f9779537a8
commit 0b3177fc1f
+9 -19
View File
@@ -705,26 +705,16 @@ namespace Game.Spells
if (spellAura == null || unitTarget == null)
return;
spellAura._ApplyEffectForTargets(effectInfo.EffectIndex);
}
// register target/effect on aura
AuraApplication aurApp = spellAura.GetApplicationOfTarget(unitTarget.GetGUID());
if (aurApp == null)
aurApp = unitTarget._CreateAuraApplication(spellAura, 1u << (int)effectInfo.EffectIndex);
else
aurApp.UpdateApplyEffectMask(aurApp.GetEffectsToApply() | 1u << (int)effectInfo.EffectIndex);
[SpellEffectHandler(SpellEffectName.ApplyAreaAuraEnemy)]
[SpellEffectHandler(SpellEffectName.ApplyAreaAuraFriend)]
[SpellEffectHandler(SpellEffectName.ApplyAreaAuraOwner)]
[SpellEffectHandler(SpellEffectName.ApplyAreaAuraParty)]
[SpellEffectHandler(SpellEffectName.ApplyAreaAuraPet)]
[SpellEffectHandler(SpellEffectName.ApplyAreaAuraRaid)]
[SpellEffectHandler(SpellEffectName.ApplyAreaAuraPartyNonrandom)]
[SpellEffectHandler(SpellEffectName.ApplyAreaAuraSummons)]
void EffectApplyAreaAura()
{
if (effectHandleMode != SpellEffectHandleMode.HitTarget)
return;
if (spellAura == null || unitTarget == null)
return;
spellAura._ApplyEffectForTargets(effectInfo.EffectIndex);
// apply effect on target (skip for reapply)
if (!aurApp.HasEffect(effectInfo.EffectIndex))
unitTarget._ApplyAuraEffect(spellAura, effectInfo.EffectIndex);
}
[SpellEffectHandler(SpellEffectName.UnlearnSpecialization)]