mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Auras: Implemented aura 481 - SPELL_AURA_CONVERT_CONSUMED_RUNE
Used by: Blood Rites, Reaping and Glyph of the Ice Reaper
This commit is contained in:
@@ -537,10 +537,17 @@ enum AuraType
|
||||
SPELL_AURA_478 = 478,
|
||||
SPELL_AURA_479 = 479,
|
||||
SPELL_AURA_480 = 480,
|
||||
SPELL_AURA_481 = 481,
|
||||
SPELL_AURA_CONVERT_CONSUMED_RUNE = 481,
|
||||
SPELL_AURA_482 = 482,
|
||||
SPELL_AURA_483 = 483,
|
||||
TOTAL_AURAS = 484
|
||||
SPELL_AURA_484 = 484,
|
||||
SPELL_AURA_485 = 485,
|
||||
SPELL_AURA_486 = 486,
|
||||
SPELL_AURA_487 = 487,
|
||||
SPELL_AURA_488 = 488,
|
||||
SPELL_AURA_489 = 489,
|
||||
SPELL_AURA_490 = 490,
|
||||
TOTAL_AURAS = 491
|
||||
};
|
||||
|
||||
enum AuraObjectType
|
||||
|
||||
@@ -540,9 +540,16 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
|
||||
&AuraEffect::HandleNULL, //478
|
||||
&AuraEffect::HandleNULL, //479
|
||||
&AuraEffect::HandleNULL, //480
|
||||
&AuraEffect::HandleNULL, //481
|
||||
&AuraEffect::HandleNoImmediateEffect, //481 SPELL_AURA_CONVERT_CONSUMED_RUNE implemented in Spell::TakeRunePower
|
||||
&AuraEffect::HandleNULL, //482
|
||||
&AuraEffect::HandleNULL, //483
|
||||
&AuraEffect::HandleNULL, //484
|
||||
&AuraEffect::HandleNULL, //485
|
||||
&AuraEffect::HandleNULL, //486
|
||||
&AuraEffect::HandleNULL, //487
|
||||
&AuraEffect::HandleNULL, //488
|
||||
&AuraEffect::HandleNULL, //489
|
||||
&AuraEffect::HandleNULL, //490
|
||||
};
|
||||
|
||||
AuraEffect::AuraEffect(Aura* base, uint32 effIndex, int32 *baseAmount, Unit* caster) :
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user