[8649] Implement SPELL_AURA_MECHANIC_IMMUNITY_MASK (147) and related cleanups.

* Always use machanic masks in form (1 << (mech-1)), fix all cases.
* Imppement SPELL_AURA_MECHANIC_IMMUNITY_MASK (mostly boss/elite spells).

Note: db stored mechannic masks already stored in proper format so not affected.
This commit is contained in:
VladimirMangos 2009-10-15 20:44:30 +04:00
parent 369e50e068
commit a4d61a6988
11 changed files with 158 additions and 119 deletions

View file

@ -4989,26 +4989,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
if(!unitTarget)
return;
// Removes snares and roots.
uint32 mechanic_mask = (1<<MECHANIC_ROOT) | (1<<MECHANIC_SNARE);
Unit::AuraMap& Auras = unitTarget->GetAuras();
for(Unit::AuraMap::iterator iter = Auras.begin(), next; iter != Auras.end(); iter = next)
{
next = iter;
++next;
Aura *aur = iter->second;
if (!aur->IsPositive()) //only remove negative spells
{
// check for mechanic mask
if(GetSpellMechanicMask(aur->GetSpellProto(), aur->GetEffIndex()) & mechanic_mask)
{
unitTarget->RemoveAurasDueToSpell(aur->GetId());
if(Auras.empty())
break;
else
next = Auras.begin();
}
}
}
unitTarget->RemoveAurasAtMechanicImmunity(IMMUNE_TO_ROOT_AND_SNARE_MASK,30918,true);
break;
}
// Flame Crash