[11435] Fixed IsPositiveEffect triggered spell case and some cleanups

Mostly found in time 400 update.
This commit is contained in:
VladimirMangos 2011-05-08 01:38:28 +04:00
parent 3f531024f7
commit 06ba42ccba
14 changed files with 15 additions and 27 deletions

View file

@ -7174,11 +7174,16 @@ bool Unit::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex i
// Check for immune to application of harmful magical effects
AuraList const& immuneAuraApply = GetAurasByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL);
for(AuraList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
if (spellInfo->Dispel == DISPEL_MAGIC && // Magic debuff
((*iter)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellInfo)) && // Check school
!IsPositiveEffect(spellInfo, index)) // Harmful
return true;
if (!immuneAuraApply.empty() &&
spellInfo->Dispel == DISPEL_MAGIC && // Magic debuff)
!IsPositiveEffect(spellInfo, index)) // Harmful
{
// Check school
SpellSchoolMask schoolMask = GetSpellSchoolMask(spellInfo);
for(AuraList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
if ((*iter)->GetModifier()->m_miscvalue & schoolMask)
return true;
}
}
return false;