mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[11435] Fixed IsPositiveEffect triggered spell case and some cleanups
Mostly found in time 400 update.
This commit is contained in:
parent
3f531024f7
commit
06ba42ccba
14 changed files with 15 additions and 27 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue