aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormik1893 <michele.roscelli@gmail.com>2015-07-02 14:23:33 +0200
committerDDuarte <dnpd.dd@gmail.com>2015-07-03 01:16:12 +0100
commitee168cae9b22fb418839af07d7b1e84e78350307 (patch)
treee3384decd8a40686f8546ea96174879135894eb4 /src
parent2dba70c65593534a9a9da6fe16735728002502d7 (diff)
Merge pull request #14797 from czw/3.3.5
Core/Spells: Fix DK Death rune selection (cherry picked from commit 94bb71e5a1f2b341e94aa6adc661f1200b2b10aa) Conflicts: src/server/game/Spells/Spell.cpp
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 05e2f5d33ff..6109ca0a5e1 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4508,6 +4508,10 @@ 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
for (uint32 i = 0; i < MAX_RUNES; ++i)
{
RuneType rune = player->GetCurrentRune(i);
@@ -4519,8 +4523,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)