mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
*Apply frozen state for both stun and root auras. Original patch by VladimirMangos and Tassader2.
--HG-- branch : trunk
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user