Core/Auras: Do not remove auras unaffected by invincibility
* Mark WSG's Focused Assault and Brutal Assault as unaffected by immunities
This commit is contained in:
1 parent
f35e49b515
commit
0f4442c630
2 files changed
+6
-1
No files matched your search
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user