662 {
664
665
666
668
670
671 std::set<std::pair<uint32, bool>> spellsToRemove;
672 std::set<uint32> categoriesToRemove;
673
674 for (auto const& [spellId, cooldown] : cooldowns)
675 {
677 if (spellInfo
682 {
684 spellsToRemove.insert(std::make_pair(spellInfo->
Id, cooldown.needSendToClient));
685
687 categoriesToRemove.insert(spellInfo->
GetCategory());
688 }
689 }
690
691
692 for (auto const& [spellId, sendToClient] : spellsToRemove)
693 caster->RemoveSpellCooldown(spellId, sendToClient);
694 for (auto const& category : categoriesToRemove)
695 caster->RemoveCategoryCooldown(category);
696 }
std::map< uint32, SpellCooldown > SpellCooldowns
Definition Player.h:208
@ SPELLFAMILY_HUNTER
Definition SharedDefines.h:3537
#define sSpellMgr
Definition SpellMgr.h:825
Player * ToPlayer()
Definition Object.h:201
SpellCooldowns const & GetSpellCooldownMap() const
Definition Player.h:1783
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition Player.cpp:3543
Definition SpellInfo.h:316
uint32 GetCategory() const
Definition SpellInfo.cpp:871
uint32 RecoveryTime
Definition SpellInfo.h:348
uint32 Id
Definition SpellInfo.h:320
uint32 CategoryRecoveryTime
Definition SpellInfo.h:349
uint32 SpellFamilyName
Definition SpellInfo.h:387
Unit * GetCaster()
Definition SpellScript.cpp:401
@ SPELL_HUNTER_CHIMERA_SHOT_SCORPID
Definition spell_hunter.cpp:53
@ SPELL_HUNTER_READINESS
Definition spell_hunter.cpp:64
@ SPELL_DRAENEI_GIFT_OF_THE_NAARU
Definition spell_hunter.cpp:69
@ SPELL_HUNTER_BESTIAL_WRATH
Definition spell_hunter.cpp:50