diff options
author | megamage <none@none> | 2009-05-01 15:36:32 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-01 15:36:32 -0500 |
commit | 5a667740082b8afa6af30d0f1e7082e8a3321fd3 (patch) | |
tree | ae98a2abb25b95a45cae47c98dfcd8c83782fd0b | |
parent | 4fb815a9b85087e6dbc1983780b33e9611ea14dd (diff) |
*Fix the bug that shapeshift can remove blind.
--HG--
branch : trunk
-rw-r--r-- | src/game/SpellAuras.cpp | 3 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 24 | ||||
-rw-r--r-- | src/game/SpellMgr.h | 1 | ||||
-rw-r--r-- | src/game/Unit.cpp | 11 | ||||
-rw-r--r-- | src/game/Unit.h | 1 |
5 files changed, 33 insertions, 7 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 0296f12a34b..63952c723b0 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2434,8 +2434,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real) case FORM_FLIGHT: case FORM_MOONKIN: // remove movement affects - m_target->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT); - m_target->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED); + m_target->RemoveMovementImpairingAuras(); // and polymorphic affects if(m_target->IsPolymorphed()) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index a66ea70755f..25c68da03d6 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2145,13 +2145,12 @@ void SpellMgr::LoadSpellCustomAttr() case SPELL_AURA_OBS_MOD_HEALTH: mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_HOT; break; - case SPELL_AURA_MOD_POSSESS: - case SPELL_AURA_MOD_CONFUSE: - case SPELL_AURA_MOD_CHARM: - case SPELL_AURA_MOD_FEAR: - case SPELL_AURA_MOD_STUN: case SPELL_AURA_MOD_ROOT: mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_CC; + mSpellCustomAttr[i] |= SPELL_ATTR_CU_MOVEMENT_IMPAIR; + break; + case SPELL_AURA_MOD_DECREASE_SPEED: + mSpellCustomAttr[i] |= SPELL_ATTR_CU_MOVEMENT_IMPAIR; break; default: break; @@ -2178,6 +2177,21 @@ void SpellMgr::LoadSpellCustomAttr() } } + for(uint32 j = 0; j < 3; ++j) + { + switch(spellInfo->EffectApplyAuraName[j]) + { + case SPELL_AURA_MOD_POSSESS: + case SPELL_AURA_MOD_CONFUSE: + case SPELL_AURA_MOD_CHARM: + case SPELL_AURA_MOD_FEAR: + case SPELL_AURA_MOD_STUN: + mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_CC; + mSpellCustomAttr[i] &= ~SPELL_ATTR_CU_MOVEMENT_IMPAIR; + break; + } + } + if(spellInfo->SpellVisual == 3879) mSpellCustomAttr[i] |= SPELL_ATTR_CU_CONE_BACK; diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 35d867dce2b..f9d5cdd09f4 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -719,6 +719,7 @@ inline bool IsProfessionSkill(uint32 skill) #define SPELL_ATTR_CU_LINK_HIT 0x00000800 #define SPELL_ATTR_CU_LINK_AURA 0x00001000 #define SPELL_ATTR_CU_LINK_REMOVE 0x00002000 +#define SPELL_ATTR_CU_MOVEMENT_IMPAIR 0x00004000 typedef std::vector<uint32> SpellCustomAttribute; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 756a1ac7d43..d4503c0f55c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -503,6 +503,17 @@ void Unit::GetRandomContactPoint( const Unit* obj, float &x, float &y, float &z, , GetAngle(obj) + (attacker_number ? (M_PI/2 - M_PI * rand_norm()) * (float)attacker_number / combat_reach / 3 : 0)); } +void Unit::RemoveMovementImpairingAuras() +{ + for(AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end();) + { + if(spellmgr.GetSpellCustomAttr(iter->second->GetId()) & SPELL_ATTR_CU_MOVEMENT_IMPAIR) + RemoveAura(iter); + else + ++iter; + } +} + void Unit::RemoveSpellsCausingAura(AuraType auraType) { if (auraType >= TOTAL_AURAS) return; diff --git a/src/game/Unit.h b/src/game/Unit.h index 79fff7a7351..4281ac55038 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1161,6 +1161,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject bool RemoveNoStackAurasDueToAura(Aura *Aur); void RemoveAurasWithInterruptFlags(uint32 flags, uint32 except = 0); void RemoveAurasWithDispelType( DispelType type ); + void RemoveMovementImpairingAuras(); void RemoveAllAuras(); void RemoveArenaAuras(bool onleave = false); |