Core/Players: Improve reset spell cooldowns when entering arenas

Port From (https://github.com/TrinityCore/TrinityCore/commit/752ea0f8e9a04abd53a3b811de2fbb91b689e69f)
This commit is contained in:
Hondacrx
2025-02-24 11:25:52 -05:00
parent 0e050f6c54
commit ca7820eccb
+7 -1
View File
@@ -3380,7 +3380,13 @@ namespace Game.Entities
GetSpellHistory().ResetCooldowns(p =>
{
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(p.Key, Difficulty.None);
return spellInfo.RecoveryTime < 10 * Time.Minute * Time.InMilliseconds && spellInfo.CategoryRecoveryTime < 10 * Time.Minute * Time.InMilliseconds && !spellInfo.HasAttribute(SpellAttr6.DoNotResetCooldownInArena);
TimeSpan cooldown = TimeSpan.Zero;
TimeSpan categoryCooldown = TimeSpan.Zero;
uint categoryId = 0;
SpellHistory.GetCooldownDurations(spellInfo, p.Value.ItemId, ref cooldown, ref categoryId, ref categoryCooldown);
return cooldown < TimeSpan.FromMinutes(10)
&& categoryCooldown < TimeSpan.FromMinutes(10)
&& !spellInfo.HasAttribute(SpellAttr6.DoNotResetCooldownInArena);
}, true);
// pet cooldowns