659 {
661
662
663
665
667
668 std::set<std::pair<uint32, bool>> spellsToRemove;
669 std::set<uint32> categoriesToRemove;
670
671 for (auto const& [spellId, cooldown] : cooldowns)
672 {
674 if (spellInfo
679 {
681 spellsToRemove.insert(std::make_pair(spellInfo->
Id, cooldown.needSendToClient));
682
684 categoriesToRemove.insert(spellInfo->
GetCategory());
685 }
686 }
687
688
689 for (auto const& [spellId, sendToClient] : spellsToRemove)
690 caster->RemoveSpellCooldown(spellId, sendToClient);
691 for (auto const& category : categoriesToRemove)
692 caster->RemoveCategoryCooldown(category);
693 }
std::map< uint32, SpellCooldown > SpellCooldowns
Definition Player.h:209
@ SPELLFAMILY_HUNTER
Definition SharedDefines.h:3553
#define sSpellMgr
Definition SpellMgr.h:825
Player * ToPlayer()
Definition Object.h:202
SpellCooldowns const & GetSpellCooldownMap() const
Definition Player.h:1784
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition Player.cpp:3522
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:50
@ 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:47