From 37be2f36846df38099764c41d4ca17edd2b48fe9 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 10 Feb 2009 09:35:26 -0600 Subject: *Fix some broken talent triggered spells. --HG-- branch : trunk --- src/game/Spell.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index d7d9446ab50..8b0a7a7a01f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2236,6 +2236,24 @@ void Spell::cast(bool skipCheck) if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE) CalculateDamageDoneForAllTargets(); + //handle SPELL_AURA_ADD_TARGET_TRIGGER auras + //are there any spells need to be triggered after hit? + Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER); + for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i) + { + SpellEntry const *auraSpellInfo = (*i)->GetSpellProto(); + uint32 auraSpellIdx = (*i)->GetEffIndex(); + if (IsAffectedBy(auraSpellInfo, auraSpellIdx)) + { + if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(auraSpellInfo->EffectTriggerSpell[auraSpellIdx])) + { + // Calculate chance at that moment (can be depend for example from combo points) + int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(), NULL); + m_ChanceTriggerSpells.push_back(std::make_pair(spellInfo, chance * (*i)->GetStackAmount())); + } + } + } + if(m_customAttr & SPELL_ATTR_CU_CHARGE) EffectCharge(0); @@ -2257,24 +2275,6 @@ void Spell::cast(bool skipCheck) handle_immediate(); } - //handle SPELL_AURA_ADD_TARGET_TRIGGER auras - //are there any spells need to be triggered after hit? - Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER); - for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i) - { - SpellEntry const *auraSpellInfo = (*i)->GetSpellProto(); - uint32 auraSpellIdx = (*i)->GetEffIndex(); - if (IsAffectedBy(auraSpellInfo, auraSpellIdx)) - { - if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(auraSpellInfo->EffectTriggerSpell[auraSpellIdx])) - { - // Calculate chance at that moment (can be depend for example from combo points) - int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(), NULL); - m_ChanceTriggerSpells.push_back(std::make_pair(spellInfo, chance * (*i)->GetStackAmount())); - } - } - } - // combo points should not be taken before SPELL_AURA_ADD_TARGET_TRIGGER auras are handled if(!m_IsTriggeredSpell) { -- cgit v1.2.3