[7365] Implement potion in combat delay proper work.

Original patch provided by miranda.conrado.
This commit is contained in:
VladimirMangos 2009-03-01 10:30:24 +03:00
parent 2b10d8fd71
commit de51363151
5 changed files with 45 additions and 1 deletions

View file

@ -2521,6 +2521,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;
@ -2716,6 +2725,10 @@ void Spell::finish(bool ok)
((Player*)m_caster)->ClearComboPoints();
}
// 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)
if(!m_TriggerSpells.empty())
TriggerSpell();