aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-12 22:14:43 -0600
committermegamage <none@none>2008-12-12 22:14:43 -0600
commit032f5bc87de643b9946bebab1afeef27c23840cf (patch)
treec157f4a562f0e662be2504afb680a8a96b000e5f /src
parentf088698922e1bc34ef0332dae5a4768f45115d3d (diff)
*Remove combo points when spell casted. This fixes the bug that rogue can cast multiple deadly throw before dagger hits target. But this also makes deadly throw do not receive combo bonus. This bug can only be trully fixed by calculating spell damage when spell is casted but not when spell hits target.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index c253c6a30b3..6a3b33a8bdc 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2538,6 +2538,22 @@ void Spell::cast(bool skipCheck)
handle_immediate();
}
+ // Clear combo at finish state
+ if(m_caster->GetTypeId() == TYPEID_PLAYER && NeedsComboPoints(m_spellInfo))
+ {
+ // Not drop combopoints if negative spell and if any miss on enemy exist
+ bool needDrop = true;
+ //if (!IsPositiveSpell(m_spellInfo->Id))
+ for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
+ if (ihit->missCondition != SPELL_MISS_NONE && ihit->missCondition != SPELL_MISS_MISS/* && ihit->targetGUID!=m_caster->GetGUID()*/)
+ {
+ needDrop = false;
+ break;
+ }
+ if (needDrop)
+ ((Player*)m_caster)->ClearComboPoints();
+ }
+
SetExecutedCurrently(false);
}
@@ -2951,25 +2967,6 @@ void Spell::finish(bool ok)
m_caster->resetAttackTimer(RANGED_ATTACK);
}
- //if (IsRangedAttackResetSpell())
- // m_caster->resetAttackTimer(RANGED_ATTACK);
-
- // Clear combo at finish state
- if(m_caster->GetTypeId() == TYPEID_PLAYER && NeedsComboPoints(m_spellInfo))
- {
- // Not drop combopoints if negative spell and if any miss on enemy exist
- bool needDrop = true;
- if (!IsPositiveSpell(m_spellInfo->Id))
- for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
- if (ihit->missCondition != SPELL_MISS_NONE && ihit->targetGUID!=m_caster->GetGUID())
- {
- needDrop = false;
- break;
- }
- if (needDrop)
- ((Player*)m_caster)->ClearComboPoints();
- }
-
// call triggered spell only at successful cast (after clear combo points -> for add some if need)
if(!m_TriggerSpells.empty())
TriggerSpell();