679 {
681
682
683
685
687
688 std::set<std::pair<uint32, bool>> spellsToRemove;
689 std::set<uint32> categoriesToRemove;
690
691 for (auto const& [spellId, cooldown] : cooldowns)
692 {
694 if (spellInfo
699 {
701 spellsToRemove.insert(std::make_pair(spellInfo->
Id, cooldown.needSendToClient));
702
704 categoriesToRemove.insert(spellInfo->
GetCategory());
705 }
706 }
707
708
709 for (auto const& [spellId, sendToClient] : spellsToRemove)
710 caster->RemoveSpellCooldown(spellId, sendToClient);
711 for (auto const& category : categoriesToRemove)
712 caster->RemoveCategoryCooldown(category);
713 }
std::map< uint32, SpellCooldown > SpellCooldowns
Definition Player.h:209
@ SPELLFAMILY_HUNTER
Definition SharedDefines.h:3793
#define sSpellMgr
Definition SpellMgr.h:847
Player * ToPlayer()
Definition Object.h:202
SpellCooldowns const & GetSpellCooldownMap() const
Definition Player.h:1794
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition Player.cpp:3532
Definition SpellInfo.h:340
uint32 GetCategory() const
Definition SpellInfo.cpp:880
uint32 RecoveryTime
Definition SpellInfo.h:372
uint32 Id
Definition SpellInfo.h:344
uint32 CategoryRecoveryTime
Definition SpellInfo.h:373
uint32 SpellFamilyName
Definition SpellInfo.h:411
Unit * GetCaster()
Definition SpellScript.cpp:401
@ SPELL_HUNTER_CHIMERA_SHOT_SCORPID
Definition spell_hunter.cpp:49
@ SPELL_HUNTER_READINESS
Definition spell_hunter.cpp:61
@ SPELL_DRAENEI_GIFT_OF_THE_NAARU
Definition spell_hunter.cpp:66
@ SPELL_HUNTER_BESTIAL_WRATH
Definition spell_hunter.cpp:46