aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-03 18:22:28 -0600
committermegamage <none@none>2009-02-03 18:22:28 -0600
commit36f7dd04b360a5bbd678a8352fbd73b60c6915b2 (patch)
tree482364b9fd6f25f812b6da53192e8db488338fe0 /src
parent8dfe8cd64a29dfb57e392733929e86abaa749e6b (diff)
*Apply proc effects such as frostbite after the spell hits the target.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp24
1 files changed, 13 insertions, 11 deletions
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);
+ }
}
}
}