mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
[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:
parent
369e50e068
commit
a4d61a6988
11 changed files with 158 additions and 119 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue