mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
91e4d7324a
commit
2273f7abe0
3 changed files with 18 additions and 1 deletions
|
|
@ -3352,6 +3352,22 @@ void Player::RemoveSpellCooldown( uint32 spell_id, bool update /* = false */ )
|
||||||
SendClearCooldown(spell_id, this);
|
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()
|
void Player::RemoveArenaSpellCooldowns()
|
||||||
{
|
{
|
||||||
// remove cooldowns on spells that has < 15 min CD
|
// remove cooldowns on spells that has < 15 min CD
|
||||||
|
|
|
||||||
|
|
@ -1517,6 +1517,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0, Spell* spell = NULL);
|
void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0, Spell* spell = NULL);
|
||||||
void ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs );
|
void ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs );
|
||||||
void RemoveSpellCooldown(uint32 spell_id, bool update = false);
|
void RemoveSpellCooldown(uint32 spell_id, bool update = false);
|
||||||
|
void RemoveSpellCategoryCooldown(uint32 cat, bool update = false);
|
||||||
void SendClearCooldown( uint32 spell_id, Unit* target );
|
void SendClearCooldown( uint32 spell_id, Unit* target );
|
||||||
|
|
||||||
void RemoveArenaSpellCooldowns();
|
void RemoveArenaSpellCooldowns();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8122"
|
#define REVISION_NR "8123"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue