aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Spells/Spell.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 11bf2163aaa..00a28f22db4 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4443,8 +4443,11 @@ void Spell::TakeRunePower(bool didHit)
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, runeCost[i], this);
}
+ // Let's say we use a skill that requires a Frost rune. This is the order:
+ // - Frost rune
+ // - Death rune, originally a Frost rune
+ // - Death rune, any kind
runeCost[RUNE_DEATH] = 0; // calculated later
-
for (uint32 i = 0; i < MAX_RUNES; ++i)
{
RuneType rune = player->GetCurrentRune(i);
@@ -4456,8 +4459,32 @@ void Spell::TakeRunePower(bool didHit)
}
}
+ // Find a Death rune where the base rune matches the one we need
runeCost[RUNE_DEATH] = runeCost[RUNE_BLOOD] + runeCost[RUNE_UNHOLY] + runeCost[RUNE_FROST];
+ if (runeCost[RUNE_DEATH] > 0)
+ {
+ for (uint32 i = 0; i < MAX_RUNES; ++i)
+ {
+ RuneType rune = player->GetCurrentRune(i);
+ RuneType baseRune = player->GetBaseRune(i);
+ if (!player->GetRuneCooldown(i) && rune == RUNE_DEATH && runeCost[baseRune] > 0)
+ {
+ player->SetRuneCooldown(i, didHit ? player->GetRuneBaseCooldown(i) : uint32(RUNE_MISS_COOLDOWN), true);
+ player->SetLastUsedRune(rune);
+ runeCost[baseRune]--;
+ runeCost[rune]--;
+
+ // keep Death Rune type if missed
+ if (didHit)
+ player->RestoreBaseRune(i);
+
+ if (runeCost[RUNE_DEATH] == 0)
+ break;
+ }
+ }
+ }
+ // Grab any Death rune
if (runeCost[RUNE_DEATH] > 0)
{
for (uint32 i = 0; i < MAX_RUNES; ++i)