mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Players: Improve reset spell cooldowns when entering arenas (#30032)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
(cherry picked from commit 97b19a5445)
This commit is contained in:
@@ -3493,8 +3493,11 @@ void Player::RemoveArenaSpellCooldowns(bool removeActivePetCooldowns)
|
||||
GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first, DIFFICULTY_NONE);
|
||||
return spellInfo->RecoveryTime < 10 * MINUTE * IN_MILLISECONDS
|
||||
&& spellInfo->CategoryRecoveryTime < 10 * MINUTE * IN_MILLISECONDS
|
||||
SpellHistory::Duration cooldown = 0s;
|
||||
SpellHistory::Duration categoryCooldown = 0s;
|
||||
SpellHistory::GetCooldownDurations(spellInfo, itr->second.ItemId, &cooldown, nullptr, &categoryCooldown);
|
||||
return cooldown < 10min
|
||||
&& categoryCooldown < 10min
|
||||
&& !spellInfo->HasAttribute(SPELL_ATTR6_DO_NOT_RESET_COOLDOWN_IN_ARENA);
|
||||
}, true);
|
||||
|
||||
|
||||
@@ -178,6 +178,8 @@ public:
|
||||
void PauseCooldowns();
|
||||
void ResumeCooldowns();
|
||||
|
||||
static void GetCooldownDurations(SpellInfo const* spellInfo, uint32 itemId, Duration* cooldown, uint32* categoryId, Duration* categoryCooldown);
|
||||
|
||||
void SaveCooldownStateBeforeDuel();
|
||||
void RestoreCooldownStateAfterDuel();
|
||||
|
||||
@@ -195,8 +197,6 @@ private:
|
||||
|
||||
void SendSetSpellCharges(uint32 chargeCategoryId, ChargeEntryCollection const& chargeCollection);
|
||||
|
||||
static void GetCooldownDurations(SpellInfo const* spellInfo, uint32 itemId, Duration* cooldown, uint32* categoryId, Duration* categoryCooldown);
|
||||
|
||||
Unit* _owner;
|
||||
CooldownStorageType _spellCooldowns;
|
||||
CooldownStorageType _spellCooldownsBeforeDuel;
|
||||
|
||||
Reference in New Issue
Block a user