aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-05-13 21:46:06 +0200
committerShauren <shauren.trinity@gmail.com>2016-05-13 21:46:32 +0200
commit00640dee97affdb3dd911235b24b7bd3c397c71f (patch)
tree593b4fc9e0a59ee32d0125123b5e8128456eeedf /src/server/game/Spells/Spell.cpp
parentede8f0ca0a28d059c1356c6970ac87f53c72a424 (diff)
Core/Auras: Implemented aura 481 - SPELL_AURA_CONVERT_CONSUMED_RUNE
Used by: Blood Rites, Reaping and Glyph of the Ice Reaper
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 594221099d6..dac9b82549c 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4612,6 +4612,11 @@ void Spell::TakeRunePower(bool didHit)
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, runeCost[i], this);
}
+ bool convertUsedRunes = false;
+ for (AuraEffect const* convertConsumedRuneAuras : m_caster->GetAuraEffectsByType(SPELL_AURA_CONVERT_CONSUMED_RUNE))
+ if (convertConsumedRuneAuras->IsAffectingSpell(m_spellInfo))
+ convertUsedRunes = true;
+
// Let's say we use a skill that requires a Frost rune. This is the order:
// - Frost rune
// - Death rune, originally a Frost rune
@@ -4624,6 +4629,8 @@ void Spell::TakeRunePower(bool didHit)
player->SetRuneCooldown(i, didHit ? player->GetRuneBaseCooldown(i) : uint32(RUNE_MISS_COOLDOWN), true);
player->SetLastUsedRune(rune);
runeCost[rune]--;
+ if (convertUsedRunes)
+ player->ConvertRune(i, RUNE_DEATH);
}
}
@@ -4643,7 +4650,7 @@ void Spell::TakeRunePower(bool didHit)
runeCost[rune]--;
// keep Death Rune type if missed
- if (didHit)
+ if (didHit && !convertUsedRunes)
player->RestoreBaseRune(i);
if (runeCost[RUNE_DEATH] == 0)
@@ -4665,7 +4672,7 @@ void Spell::TakeRunePower(bool didHit)
runeCost[rune]--;
// keep Death Rune type if missed
- if (didHit)
+ if (didHit && !convertUsedRunes)
player->RestoreBaseRune(i);
if (runeCost[RUNE_DEATH] == 0)