[7365] Implement potion in combat delay proper work. Author: VladimirMangos

Original patch provided by miranda.conrado.

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-03-02 17:01:41 -06:00
1 parent d7d7c3562a
commit c064c2e2e1
5 files changed
+45 -1

No files matched your search

+13
View File
@@ -2433,6 +2433,15 @@ void Spell::SendSpellCooldown()
Player* _player = (Player*)m_caster;
// mana/health potions, disabled by client
if (m_spellInfo->Category==SPELLCATEGORY_HEALTH_MANA_POTIONS)
{
// need in some way provided data for Spell::finish SendCooldownEvent
if(m_CastItem)
_player->SetLastPotionId(m_CastItem->GetEntry());
return;
}
// have infinity cooldown but set at aura apply
if(m_spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
return;
@@ -2591,6 +2600,10 @@ void Spell::finish(bool ok)
m_caster->resetAttackTimer(RANGED_ATTACK);
}
// mana/health potions, disabled by client, send event "not in combat"
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->Category == SPELLCATEGORY_HEALTH_MANA_POTIONS)
((Player*)m_caster)->UpdatePotionCooldown(this);
// call triggered spell only at successful cast (after clear combo points -> for add some if need)
// I assume what he means is that some triggered spells may add combo points
if(!m_TriggerSpells.empty())