diff options
author | Ovahlord <dreadkiller@gmx.de> | 2025-01-12 01:29:04 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2025-01-12 19:10:19 +0100 |
commit | 1dc2e8fdc565ea35a4f6b442261da8566e81ca86 (patch) | |
tree | 63cced13ea995e9c846fc7851af446bcc571d75b /src/server/game/Spells/Spell.cpp | |
parent | 76ab2007c0540542b892dd66e9287b394c54ee42 (diff) |
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
(cherry picked from commit dbe2f1ee7ef90db0bdd60b29126f8a689a9e3548)
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 300a3155fff..eb43009aa1f 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4909,8 +4909,11 @@ void Spell::SendSpellGo() && HasPowerTypeCost(POWER_RUNES) && !(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_COST)) { - castFlags |= CAST_FLAG_NO_GCD; // not needed, but Blizzard sends it - castFlags |= CAST_FLAG_RUNE_LIST; // rune cooldowns list + castFlags |= CAST_FLAG_NO_GCD; // 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 |= CAST_FLAG_RUNE_LIST; // rune cooldowns list } if (m_targets.HasTraj()) @@ -5677,6 +5680,9 @@ void Spell::TakeRunePower(bool didHit) Player* player = m_caster->ToPlayer(); m_runesState = player->GetRunesState(); // store previous state + if (!didHit) + return; + int32 runeCost = std::accumulate(m_powerCost.begin(), m_powerCost.end(), 0, [](int32 totalCost, SpellPowerCost const& cost) { return totalCost + (cost.Power == POWER_RUNES ? cost.Amount : 0); @@ -5686,7 +5692,7 @@ void Spell::TakeRunePower(bool didHit) { if (!player->GetRuneCooldown(i) && runeCost > 0) { - player->SetRuneCooldown(i, didHit ? player->GetRuneBaseCooldown() : uint32(RUNE_MISS_COOLDOWN)); + player->SetRuneCooldown(i, player->GetRuneBaseCooldown()); --runeCost; } } |