aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-02 17:01:41 -0600
committermegamage <none@none>2009-03-02 17:01:41 -0600
commitc064c2e2e1eebd43b273365583dd181293bafa22 (patch)
tree8db7a9eaa19c5485b392881bc78e52ea3697bdc4 /src/game/Spell.cpp
parentd7d7c3562a9e33f0d655b86572e7a73e0ee384a6 (diff)
[7365] Implement potion in combat delay proper work. Author: VladimirMangos
Original patch provided by miranda.conrado. --HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 1e36ee5e231..0a88010a6c8 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -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())