From 36f7dd04b360a5bbd678a8352fbd73b60c6915b2 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 3 Feb 2009 18:22:28 -0600 Subject: *Apply proc effects such as frostbite after the spell hits the target. --HG-- branch : trunk --- src/game/Spell.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/game') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 648d73a8f6f..55b6f93f8da 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2206,25 +2206,24 @@ void Spell::cast(bool skipCheck) FillTargetMap(); + if(m_spellState == SPELL_STATE_FINISHED) // stop cast if spell marked as finish somewhere in Take*/FillTargetMap + { + SetExecutedCurrently(false); + return; + } + // traded items have trade slot instead of guid in m_itemTargetGUID // set to real guid to be sent later to the client m_targets.updateTradeSlotItem(); - // CAST SPELL - SendSpellCooldown(); - if(!m_IsTriggeredSpell) { //TakePower(); TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot } - if(m_spellState == SPELL_STATE_FINISHED) // stop cast if spell marked as finish somewhere in Take*/FillTargetMap - { - SetExecutedCurrently(false); - return; - } - + // CAST SPELL + SendSpellCooldown(); SendCastResult(castResult); SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()... @@ -2270,10 +2269,13 @@ void Spell::cast(bool skipCheck) { // Calculate chance at that moment (can be depend for example from combo points) int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(),unit); + chance *= (*i)->GetStackAmount(); if(roll_chance_i(chance)) - for (int j=0; j != (*i)->GetStackAmount(); ++j) - m_caster->CastSpell(unit, auraSpellInfo->EffectTriggerSpell[auraSpellIdx], true, NULL, (*i)); + { + if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(auraSpellInfo->EffectTriggerSpell[auraSpellIdx])) + m_TriggerSpells.push_back(spellInfo); + } } } } -- cgit v1.2.3