*Apply frozen state for both stun and root auras. Original patch by VladimirMangos and Tassader2.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-21 17:34:03 -06:00
parent 76abeb5710
commit eba481d86a
2 changed files with 57 additions and 21 deletions

View File

@@ -3248,14 +3248,6 @@ void Aura::HandleAuraModDisarm(bool apply, bool Real)
m_target->UpdateDamagePhysical(attType);
}
void Aura::HandleAuraModStun(bool apply, bool Real)
{
if(!Real)
return;
m_target->SetControlled(apply, UNIT_STAT_STUNNED);
}
void Aura::HandleModStealth(bool apply, bool Real)
{
if(apply)
@@ -3410,19 +3402,6 @@ void Aura::HandleInvisibilityDetect(bool apply, bool Real)
m_target->SetToNotify();
}
void Aura::HandleAuraModRoot(bool apply, bool Real)
{
// only at real add/remove aura
if(!Real)
return;
// Frost root aura -> freeze/unfreeze target
if (GetSpellSchoolMask(m_spellProto) & SPELL_SCHOOL_MASK_FROST)
m_target->ModifyAuraState(AURA_STATE_FROZEN, apply);
m_target->SetControlled(apply, UNIT_STAT_ROOT);
}
void Aura::HandleAuraModSilence(bool apply, bool Real)
{
// only at real add/remove aura
@@ -6454,6 +6433,61 @@ void Aura::HandleAuraConvertRune(bool apply, bool Real)
}
}
// Control Auras
void Aura::HandleAuraModStun(bool apply, bool Real)
{
if(!Real)
return;
m_target->SetControlled(apply, UNIT_STAT_STUNNED);
if(GetSpellSchoolMask(m_spellProto) & SPELL_SCHOOL_MASK_FROST)
HandleAuraStateFrozen(apply);
}
void Aura::HandleAuraModRoot(bool apply, bool Real)
{
if(!Real)
return;
m_target->SetControlled(apply, UNIT_STAT_ROOT);
if(GetSpellSchoolMask(m_spellProto) & SPELL_SCHOOL_MASK_FROST)
HandleAuraStateFrozen(apply);
}
static AuraType const frozenAuraTypes[] = { SPELL_AURA_MOD_ROOT, SPELL_AURA_MOD_STUN, SPELL_AURA_NONE };
void Aura::HandleAuraStateFrozen(bool apply)
{
if(apply)
{
m_target->ModifyAuraState(AURA_STATE_FROZEN, true);
}
else
{
bool found_another = false;
for(AuraType const* itr = &frozenAuraTypes[0]; *itr != SPELL_AURA_NONE; ++itr)
{
Unit::AuraList const& auras = m_target->GetAurasByType(*itr);
for(Unit::AuraList::const_iterator i = auras.begin(); i != auras.end(); ++i)
{
if( GetSpellSchoolMask((*i)->GetSpellProto()) & SPELL_SCHOOL_MASK_FROST)
{
found_another = true;
break;
}
}
if(found_another)
break;
}
if(!found_another)
m_target->ModifyAuraState(AURA_STATE_FROZEN, false);
}
}
// Charm Auras
void Aura::HandleModPossess(bool apply, bool Real)
{
if(!Real)

View File

@@ -212,6 +212,8 @@ class TRINITY_DLL_SPEC Aura
void HandleNoReagentUseAura(bool Apply, bool Real);
void HandlePhase(bool Apply, bool Real);
void HandleAuraStateFrozen(bool apply);
virtual ~Aura();
void SetModifier(AuraType t, int32 a, uint32 pt, int32 miscValue);