[8257] Avoid remove daze and croud control spells except polymorph at druid form change.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Astellar 2009-07-27 16:37:31 +04:00 committed by VladimirMangos
parent c547a27dad
commit 793ce2259a
3 changed files with 28 additions and 2 deletions

View file

@ -2709,14 +2709,34 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
case FORM_FLIGHT_EPIC:
case FORM_FLIGHT:
case FORM_MOONKIN:
{
// remove movement affects
m_target->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
m_target->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED);
Unit::AuraList const& slowingAuras = m_target->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
for (Unit::AuraList::const_iterator iter = slowingAuras.begin(); iter != slowingAuras.end();)
{
SpellEntry const* aurSpellInfo = (*iter)->GetSpellProto();
// If spell that caused this aura has Croud Control or Daze effect
if((GetAllSpellMechanicMask(aurSpellInfo) & MECHANIC_NOT_REMOVED_BY_SHAPESHIFT) ||
// some Daze spells have these parameters instead of MECHANIC_DAZE
(aurSpellInfo->SpellIconID == 15 && aurSpellInfo->Dispel == 0))
{
++iter;
continue;
}
// All OK, remove aura now
m_target->RemoveAurasDueToSpellByCancel(aurSpellInfo->Id);
iter = slowingAuras.begin();
}
// and polymorphic affects
if(m_target->IsPolymorphed())
m_target->RemoveAurasDueToSpell(m_target->getTransForm());
break;
}
default:
break;
}