From 536ee1625b598ed85c98ed24361f42ae61097571 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 5 Sep 2022 22:27:09 -0400 Subject: [PATCH] Core/Auras: Do not remove auras unaffected by invincibility Port From (https://github.com/TrinityCore/TrinityCore/commit/eb9976cd08c1d6d56dfaa5247acc78f5b3b72381) --- Source/Game/Spells/SpellInfo.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 0d7a2978a..0cbf56243 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -2480,7 +2480,13 @@ namespace Game.Spells { target.ApplySpellImmune(Id, SpellImmunity.State, auraType, apply); if (apply && HasAttribute(SpellAttr1.ImmunityPurgesEffect)) - target.RemoveAurasByType(auraType); + { + target.RemoveAurasByType(auraType, aurApp => + { + // if the aura has SPELL_ATTR0_NO_IMMUNITIES, then it cannot be removed by immunity + return !aurApp.GetBase().GetSpellInfo().HasAttribute(SpellAttr0.NoImmunities); + }); + } } foreach (SpellEffectName effectType in immuneInfo.SpellEffectImmune)