Core/Spell: partial revert of SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE immunity handling

- Bonus: without breaking Banish... yay!

Closes #18370
This commit is contained in:
ariel- authored and roc13x committed 2017-05-04 03:35:47 +01:00
1 parent aee4958ed8
commit 4f3f455de4
2 files changed
+21 -10

No files matched your search

+10 -10
View File
@@ -7667,6 +7667,9 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const
{
// State/effect immunities applied by aura expect full spell immunity
// Ignore effects with mechanic, they are supposed to be checked separately
if (!spellInfo->Effects[i].IsEffect())
continue;
if (!IsImmunedToSpellEffect(spellInfo, i, caster))
{
immuneToAllEffects = false;
@@ -7677,17 +7680,14 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const
if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects.
return true;
if (!spellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) && !spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
{
SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
{
SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second);
if ((itr->first & spellInfo->GetSchoolMask())
&& !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive() && IsFriendlyTo(caster))
&& !spellInfo->CanPierceImmuneAura(immuneSpellInfo))
return true;
}
SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second);
if ((itr->first & spellInfo->GetSchoolMask())
&& !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive() && IsFriendlyTo(caster))
&& !spellInfo->CanPierceImmuneAura(immuneSpellInfo))
return true;
}
return false;