aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellAuras.cpp76
-rw-r--r--src/game/SpellAuras.h2
2 files changed, 57 insertions, 21 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 68665237500..9a6b65b89b4 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -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)
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index e615aa70c20..826ca16b630 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -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);