[8123] Introduced new method Player::RemoveSpellCategoryCooldown(uint32,bool)

This method removes cooldown from all spells from given category
and optionaly sends update to player. By default update is not send.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-07-05 14:28:03 +02:00
parent 91e4d7324a
commit 2273f7abe0
3 changed files with 18 additions and 1 deletions

View file

@ -3352,6 +3352,22 @@ void Player::RemoveSpellCooldown( uint32 spell_id, bool update /* = false */ )
SendClearCooldown(spell_id, this);
}
void Player::RemoveSpellCategoryCooldown(uint32 cat, bool update /* = false */)
{
SpellCategoryStore::const_iterator ct = sSpellCategoryStore.find(cat);
if (ct == sSpellCategoryStore.end())
return;
const SpellCategorySet& ct_set = ct->second;
for (SpellCooldowns::const_iterator i = m_spellCooldowns.begin(); i != m_spellCooldowns.end();)
{
if (ct_set.find(i->first) != ct_set.end())
RemoveSpellCooldown((i++)->first, update);
else
++i;
}
}
void Player::RemoveArenaSpellCooldowns()
{
// remove cooldowns on spells that has < 15 min CD

View file

@ -1517,6 +1517,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0, Spell* spell = NULL);
void ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs );
void RemoveSpellCooldown(uint32 spell_id, bool update = false);
void RemoveSpellCategoryCooldown(uint32 cat, bool update = false);
void SendClearCooldown( uint32 spell_id, Unit* target );
void RemoveArenaSpellCooldowns();

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8122"
#define REVISION_NR "8123"
#endif // __REVISION_NR_H__