Scripts/Spells: fixed Howling Blast damage calculation

This commit is contained in:
Ovahlord
2025-01-11 20:36:09 +01:00
parent 7f29956937
commit c1d8e30015
2 changed files with 21 additions and 0 deletions

View File

@@ -281,6 +281,23 @@ class spell_dk_blood_plague: public AuraScript
DoEffectCalcDamageAndHealing += AuraEffectCalcDamageFn(spell_dk_blood_plague::CalculateDamage, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
// 49184 - Howling Blast
class spell_dk_howling_blast : public SpellScript
{
// According to tooltip: (($m2+$M2)/2)+($AP*0.44) and (0.5*((($m2+$M2)/2)+($AP*0.44))) for non-primary targets
void CalculateDamage(SpellEffectInfo const& /*effectInfo*/, Unit* victim, int32& damage, int32& /*flatMod*/, float& /*pctMod*/)
{
damage += GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.4f;
if (victim != GetExplTargetUnit())
damage *= 0.5f;
}
void Register() override
{
CalcDamage += SpellCalcDamageFn(spell_dk_howling_blast::CalculateDamage);
}
};
}
void AddSC_deathknight_spell_scripts()
@@ -291,6 +308,7 @@ void AddSC_deathknight_spell_scripts()
RegisterSpellScript(spell_dk_dark_simulacrum_buff);
RegisterSpellScript(spell_dk_death_coil);
RegisterSpellScript(spell_dk_frost_fever);
RegisterSpellScript(spell_dk_howling_blast);
RegisterSpellScript(spell_dk_icy_touch);
RegisterSpellScript(spell_dk_runic_empowerment);
}