Core/Spell: partial revert of SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE immunity handling

This commit is contained in:
hondacrx
2018-03-12 14:37:52 -04:00
parent 205887145e
commit 05ecb41a10
5 changed files with 23 additions and 15 deletions
+8 -11
View File
@@ -1557,7 +1557,7 @@ namespace Game.Entities
{
// State/effect immunities applied by aura expect full spell immunity
// Ignore effects with mechanic, they are supposed to be checked separately
if (effect == null)
if (effect == null || !effect.IsEffect())
continue;
if (!IsImmunedToSpellEffect(spellInfo, effect.EffectIndex, caster))
@@ -1570,17 +1570,14 @@ namespace Game.Entities
if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects.
return true;
if (!spellInfo.HasAttribute(SpellAttr1.UnaffectedBySchoolImmune) && !spellInfo.HasAttribute(SpellAttr2.UnaffectedByAuraSchoolImmune))
var schoolList = m_spellImmune[(int)SpellImmunity.School];
foreach (var pair in schoolList)
{
var schoolList = m_spellImmune[(int)SpellImmunity.School];
foreach (var pair in schoolList)
{
SpellInfo immuneSpellInfo = Global.SpellMgr.GetSpellInfo(pair.Value);
if (Convert.ToBoolean(pair.Key & (uint)spellInfo.GetSchoolMask())
&& !(immuneSpellInfo != null && immuneSpellInfo.IsPositive() && spellInfo.IsPositive() && IsFriendlyTo(caster))
&& !spellInfo.CanPierceImmuneAura(immuneSpellInfo))
return true;
}
SpellInfo immuneSpellInfo = Global.SpellMgr.GetSpellInfo(pair.Value);
if (Convert.ToBoolean(pair.Key & (uint)spellInfo.GetSchoolMask())
&& !(immuneSpellInfo != null && immuneSpellInfo.IsPositive() && spellInfo.IsPositive() && IsFriendlyTo(caster))
&& !spellInfo.CanPierceImmuneAura(immuneSpellInfo))
return true;
}
return false;