diff options
author | megamage <none@none> | 2009-02-11 11:56:53 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-11 11:56:53 -0600 |
commit | 651e7c29eb6b73489dd27d4f67c89bf539c8d68a (patch) | |
tree | e2fce2c55e341e69161d4137bab7886f69cc5a12 /src/game/Spell.cpp | |
parent | 757037ce543b5185946b6b3d89219156c78927f1 (diff) | |
parent | 1ff96e6ac2f2b0a7c1e5a05f6f6143cf2ab25a06 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r-- | src/game/Spell.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 1f829f763f6..cbde7b7023c 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2219,6 +2219,23 @@ void Spell::cast(bool skipCheck) if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE) CalculateDamageDoneForAllTargets(); + //are there any spells need to be triggered after hit? + // handle SPELL_AURA_ADD_TARGET_TRIGGER auras + Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER); + for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i) + { + if (!(*i)->isAffectedOnSpell(m_spellInfo)) + continue; + SpellEntry const *auraSpellInfo = (*i)->GetSpellProto(); + uint32 auraSpellIdx = (*i)->GetEffIndex(); + 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); @@ -2240,23 +2257,6 @@ void Spell::cast(bool skipCheck) handle_immediate(); } - //are there any spells need to be triggered after hit? - // handle SPELL_AURA_ADD_TARGET_TRIGGER auras - Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER); - for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i) - { - if (!(*i)->isAffectedOnSpell(m_spellInfo)) - continue; - SpellEntry const *auraSpellInfo = (*i)->GetSpellProto(); - uint32 auraSpellIdx = (*i)->GetEffIndex(); - 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) { |