From ac79cbbad309a0905ffab4e15c77fcb0ae662963 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 20 May 2025 13:11:53 +0200 Subject: Scripts/Spells: Fixed Improved Death Strike value calculation for blood specialization --- src/server/scripts/Spells/spell_dk.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/server') diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 44382fae93a..7defc5a9398 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -923,6 +923,35 @@ class spell_dk_icy_talons_buff : public SpellScript } }; +// 374277 - Improved Death Strike +class spell_dk_improved_death_strike : public AuraScript +{ + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ SPELL_DK_BLOOD }) + && ValidateSpellEffect({ { spellInfo->Id, EFFECT_4 } }); + } + + void CalcHealIncrease(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) const + { + if (GetUnitOwner()->HasAura(SPELL_DK_BLOOD)) + amount = GetEffectInfo(EFFECT_3).CalcValue(GetCaster()); + } + + void CalcPowerCostReduction(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) const + { + if (GetUnitOwner()->HasAura(SPELL_DK_BLOOD)) + amount = GetEffectInfo(EFFECT_4).CalcValue(GetCaster()); + } + + void Register() override + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_improved_death_strike::CalcHealIncrease, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_improved_death_strike::CalcHealIncrease, EFFECT_1, SPELL_AURA_ADD_PCT_MODIFIER); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_improved_death_strike::CalcPowerCostReduction, EFFECT_2, SPELL_AURA_ADD_FLAT_MODIFIER); + } +}; + // 206940 - Mark of Blood class spell_dk_mark_of_blood : public AuraScript { @@ -1411,6 +1440,7 @@ void AddSC_deathknight_spell_scripts() RegisterSpellScript(spell_dk_ice_prison); RegisterSpellScript(spell_dk_icy_talons); RegisterSpellScript(spell_dk_icy_talons_buff); + RegisterSpellScript(spell_dk_improved_death_strike); RegisterSpellScript(spell_dk_mark_of_blood); RegisterSpellScript(spell_dk_necrosis); RegisterSpellScript(spell_dk_obliteration); -- cgit v1.2.3