aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-15 17:24:01 -0500
committermegamage <none@none>2009-04-15 17:24:01 -0500
commitbf7b203e861f4c68d3d6a844d168552973ee7d5c (patch)
tree40840d45ee441c2c67e7532616dfbaa7e64c922b /src
parent02003cc338bb9ea5a8428ee068d618af5940b145 (diff)
[7670] Revert "Not apply/remove passive auras on aura state change (not need)" Author: Lightguard
This reverts commit d5f6eefd1bb3c64797e54d19cc58ccc8c4cf8a4f. Some 3.0.x talents not work without this like 44441 --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 1e403577dbd..c7c50d6548e 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7913,7 +7913,51 @@ void Unit::RemoveAllAttackers()
void Unit::ModifyAuraState(AuraState flag, bool apply)
{
- ApplyModFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1), apply);
+ if (apply)
+ {
+ if (!HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1)))
+ {
+ SetFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1));
+ if(GetTypeId() == TYPEID_PLAYER)
+ {
+ const PlayerSpellMap& sp_list = ((Player*)this)->GetSpellMap();
+ for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
+ {
+ if(itr->second->state == PLAYERSPELL_REMOVED) continue;
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
+ if (!spellInfo || !IsPassiveSpell(itr->first)) continue;
+ if (spellInfo->CasterAuraState == flag)
+ CastSpell(this, itr->first, true, NULL);
+ }
+ }
+ }
+ }
+ else
+ {
+ if (HasFlag(UNIT_FIELD_AURASTATE,1<<(flag-1)))
+ {
+ RemoveFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1));
+ Unit::AuraMap& tAuras = GetAuras();
+ for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
+ {
+ SpellEntry const* spellProto = (*itr).second->GetSpellProto();
+ if (spellProto->CasterAuraState == flag)
+ {
+ // exceptions (applied at state but not removed at state change)
+ // Rampage
+ if(spellProto->SpellIconID==2006 && spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && spellProto->SpellFamilyFlags==0x100000)
+ {
+ ++itr;
+ continue;
+ }
+
+ RemoveAura(itr);
+ }
+ else
+ ++itr;
+ }
+ }
+ }
}
bool Unit::HasAuraState(AuraState flag, SpellEntry const *spellProto, Unit * Caster) const