diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d807221fa7..0dea0cc2d1 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7371,6 +7371,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, WorldObject const* caste continue; SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second); + // Consider the school immune if any of these conditions are not satisfied. // In case of no immuneSpellInfo, ignore that condition and check only the other conditions if ((immuneSpellInfo && !immuneSpellInfo->IsPositive()) || !spellInfo->IsPositive() || !caster || !IsFriendlyTo(caster)) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index ecb2838870..2b3fd1a7d6 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -3150,7 +3150,11 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool app { target->ApplySpellImmune(Id, IMMUNITY_STATE, auraType, apply); if (apply && HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT)) - target->RemoveAurasByType(auraType); + target->RemoveAurasByType(auraType, [](AuraApplication const* aurApp) -> bool + { + // if the aura has SPELL_ATTR0_NO_IMMUNITIES, then it cannot be removed by immunity + return !aurApp->GetBase()->GetSpellInfo()->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES); + }); } for (SpellEffects effectType : immuneInfo->SpellEffectImmune)