Scripts/Spells: modernize spell script for Howling Blast
This commit is contained in:
1 parent
4dd10462d0
commit
373dd1b6ac
1 file changed
+6
-5
@@ -1228,16 +1228,17 @@ private:
|
|||||||
// 49184 - Howling Blast
|
// 49184 - Howling Blast
|
||||||
class spell_dk_howling_blast : public SpellScript
|
class spell_dk_howling_blast : public SpellScript
|
||||||
{
|
{
|
||||||
void HandleDamage(SpellEffIndex /*effIndex*/)
|
// According to tooltip: (($m2+$M2)/2)+($AP*0.44) and (0.5*((($m2+$M2)/2)+($AP*0.44))) for non-primary targets
|
||||||
|
void CalculateDamage(Unit* victim, int32& damage, int32& /*flatMod*/, float& /*pctMod*/)
|
||||||
{
|
{
|
||||||
if (GetExplTargetUnit() && GetHitUnit())
|
damage += GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.44f;
|
||||||
if (GetExplTargetUnit() != GetHitUnit())
|
if (victim != GetExplTargetUnit())
|
||||||
SetHitDamage(CalculatePct(GetHitDamage(), GetSpellInfo()->Effects[EFFECT_2].BasePoints));
|
damage *= 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
OnEffectHitTarget.Register(&spell_dk_howling_blast::HandleDamage, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE);
|
CalcDamage.Register(&spell_dk_howling_blast::CalculateDamage);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user