*Fix a bug of spells that use combo points.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-21 23:52:30 -06:00
parent f3d8806ec3
commit 0dfa86cefd

View File

@@ -2269,7 +2269,8 @@ void Spell::cast(bool skipCheck)
((Player*)m_caster)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, m_spellInfo->Id);
}
//are there any spells need to be triggered after hit?
// this is related to combo points so must be done before takepower
// 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)
@@ -2286,6 +2287,10 @@ void Spell::cast(bool skipCheck)
}
}
// this is related to combo points so must be done before takepower
if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE)
CalculateDamageDoneForAllTargets();
if(!m_IsTriggeredSpell)
{
TakePower();
@@ -2297,9 +2302,6 @@ void Spell::cast(bool skipCheck)
//SendCastResult(castResult);
SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()...
if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE)
CalculateDamageDoneForAllTargets();
if(m_customAttr & SPELL_ATTR_CU_CHARGE)
EffectCharge(0);