diff options
author | offl <11556157+offl@users.noreply.github.com> | 2021-03-11 20:16:36 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-03-07 00:18:13 +0100 |
commit | 18beee8ba19c8848c868fdb9b9a7bad296e74d53 (patch) | |
tree | 676378c60512081005967c82e024e862ecc168e6 /src | |
parent | 9ac16dc2198467f2fd2370119eb9e2d922120787 (diff) |
Core/Spells: Apply UNIT_FLAG_IMMUNE after applying SPELL_AURA_DAMAGE_IMMUNITY (#26187)
(cherry picked from commit 10304a8875453f989a4f9a073cd4cda57d29c910)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index fdde3126ebb..96d2b491ec7 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3213,7 +3213,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint else { // do not remove unit flag if there are more than this auraEffect of that kind on unit - if (target->HasAuraType(GetAuraType())) + if (target->HasAuraType(GetAuraType()) || target->HasAuraType(SPELL_AURA_DAMAGE_IMMUNITY)) return; target->RemoveUnitFlag(UNIT_FLAG_IMMUNE); } @@ -3228,7 +3228,17 @@ void AuraEffect::HandleAuraModDmgImmunity(AuraApplication const* aurApp, uint8 m m_spellInfo->ApplyAllSpellImmunitiesTo(target, GetSpellEffectInfo(), apply); if (apply) + { + target->AddUnitFlag(UNIT_FLAG_IMMUNE); target->GetThreatManager().EvaluateSuppressed(); + } + else + { + // do not remove unit flag if there are more than this auraEffect of that kind on unit + if (target->HasAuraType(GetAuraType()) || target->HasAuraType(SPELL_AURA_SCHOOL_IMMUNITY)) + return; + target->RemoveUnitFlag(UNIT_FLAG_IMMUNE); + } } void AuraEffect::HandleAuraModDispelImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const |