diff options
author | krz <none@none> | 2009-05-17 12:03:54 +0200 |
---|---|---|
committer | krz <none@none> | 2009-05-17 12:03:54 +0200 |
commit | cc85d9e1c45e4346ba2a28639da708093db27b81 (patch) | |
tree | d84d5bc03204500ff4b107677e2d91fe9e1f7c9d /src/game/Unit.cpp | |
parent | 10ee81ef1320112090fa4e0b96da22f708cab22e (diff) |
Properly check if triggering spell can stack with player's aura.
That should fix e.g. water shield.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 7d8ae44e7ce..ceade1af235 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6894,19 +6894,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL; - // check if triggering spell can stack with current target's auras (if not - don't proc) - AuraMap::iterator i,next; - for (i = m_Auras.begin(); i != m_Auras.end(); i = next) - { - next = i; - ++next; - if (!(*i).second) continue; - if ( (*i).second->GetSpellProto()->Id == trigger_spell_id) continue; - if (spellmgr.IsNoStackSpellDueToSpell(trigger_spell_id, (*i).second->GetSpellProto()->Id, (pVictim == this))) - return false; - } - - // Try handle uncnown trigger spells + // Try handle unknown trigger spells if (sSpellStore.LookupEntry(trigger_spell_id)==NULL) switch (auraSpellInfo->SpellFamilyName) { @@ -7404,6 +7392,24 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB return false; } + // check if triggering spell can stack with current target's auras (if not - don't proc) + // don't check if + // aura is passive (talent's aura) + // trigger_spell_id's aura is already active (allow to refresh triggered auras) + // trigger_spell_id's triggeredByAura is already active (for example shaman's shields) + AuraMap::iterator i,next; + uint32 aura_id = 0; + for (i = m_Auras.begin(); i != m_Auras.end(); i = next) + { + next = i; + ++next; + if (!(*i).second) continue; + aura_id = (*i).second->GetSpellProto()->Id; + if ( IsPassiveSpell(aura_id) || aura_id == trigger_spell_id || aura_id == triggeredByAura->GetSpellProto()->Id ) continue; + if (spellmgr.IsNoStackSpellDueToSpell(trigger_spell_id, (*i).second->GetSpellProto()->Id, ((*i).second->GetCasterGUID() == GetGUID()))) + return false; + } + // not allow proc extra attack spell at extra attack if( m_extraAttacks && IsSpellHaveEffect(triggerEntry, SPELL_EFFECT_ADD_EXTRA_ATTACKS) ) return false; |