From 00af1579bb5ae9e2e835b083ec9828190ea4e1d2 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Wed, 4 Jun 2025 09:14:40 -0400 Subject: [PATCH] Core/Spells: corrected refunding runes - they don't get put on a cooldown and don't send cooldowns for spells which had their runes refunded Port From (https://github.com/TrinityCore/TrinityCore/commit/1dc2e8fdc565ea35a4f6b442261da8566e81ca86) --- Source/Game/Spells/Spell.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index f36cca60e..51ef672ed 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -4050,8 +4050,11 @@ namespace Game.Spells if (m_caster.IsPlayer() && m_caster.ToPlayer().GetClass() == Class.Deathknight && HasPowerTypeCost(PowerType.Runes) && !_triggeredCastFlags.HasAnyFlag(TriggerCastFlags.IgnorePowerCost)) { - castFlags |= SpellCastFlags.NoGCD; // same as in SMSG_SPELL_START - castFlags |= SpellCastFlags.RuneList; // rune cooldowns list + castFlags |= SpellCastFlags.NoGCD; // not needed, but it's being sent according to sniffs + + // Only send rune cooldowns when there has been a change + if (m_runesState != m_caster.ToPlayer().GetRunesState()) + castFlags |= SpellCastFlags.RuneList; // rune cooldowns list } if (m_targets.HasTraj()) @@ -4843,12 +4846,15 @@ namespace Game.Spells Player player = m_caster.ToPlayer(); m_runesState = player.GetRunesState(); // store previous state + if (!didHit) + return; + int runeCost = m_powerCost.Sum(cost => cost.Power == PowerType.Runes ? cost.Amount : 0); for (byte i = 0; i < player.GetMaxPower(PowerType.Runes); ++i) { if (player.GetRuneCooldown(i) == 0 && runeCost > 0) { - player.SetRuneCooldown(i, didHit ? player.GetRuneBaseCooldown() : RuneCooldowns.Miss); + player.SetRuneCooldown(i, player.GetRuneBaseCooldown()); --runeCost; } }