mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Players: Improve reset spell cooldowns when entering arenas (#30032)
Co-authored-by: Shauren <shauren.trinity@gmail.com> (cherry picked from commit97b19a5445) (cherry picked from commit752ea0f8e9)
This commit is contained in:
@@ -3127,8 +3127,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