From a4c27e574ac75ef40d0447faca65e7ab7c905d93 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 25 May 2022 14:04:26 -0400 Subject: [PATCH] Core/Spells: Apply UNIT_FLAG_IMMUNE after applying SPELL_AURA_DAMAGE_IMMUNITY Port From (https://github.com/TrinityCore/TrinityCore/commit/18beee8ba19c8848c868fdb9b9a7bad296e74d53) --- Source/Game/Spells/Auras/AuraEffect.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index d83fd13c4..2f9ef1916 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -2834,7 +2834,7 @@ namespace Game.Spells 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(AuraType.DamageImmunity)) return; target.RemoveUnitFlag(UnitFlags.Immune); @@ -2851,7 +2851,17 @@ namespace Game.Spells m_spellInfo.ApplyAllSpellImmunitiesTo(target, GetSpellEffectInfo(), apply); if (apply) + { + target.AddUnitFlag(UnitFlags.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(AuraType.SchoolImmunity)) + return; + target.RemoveUnitFlag(UnitFlags.Immune); + } } [AuraEffectHandler(AuraType.DispelImmunity)]