Core/Spells: fix scourge strike extra damage. thanks to tibbi

This commit is contained in:
Kandera
2012-06-08 10:08:02 -04:00
parent 643b68926e
commit 6107e48f8b
+10 -1
View File
@@ -381,6 +381,7 @@ class spell_dk_scourge_strike : public SpellScriptLoader
class spell_dk_scourge_strike_SpellScript : public SpellScript class spell_dk_scourge_strike_SpellScript : public SpellScript
{ {
PrepareSpellScript(spell_dk_scourge_strike_SpellScript); PrepareSpellScript(spell_dk_scourge_strike_SpellScript);
float multiplier;
bool Validate(SpellInfo const* /*spellEntry*/) bool Validate(SpellInfo const* /*spellEntry*/)
{ {
@@ -390,11 +391,18 @@ class spell_dk_scourge_strike : public SpellScriptLoader
} }
void HandleDummy(SpellEffIndex /*effIndex*/) void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
multiplier = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()) / 100.f);
}
void HandleAfterHit()
{ {
Unit* caster = GetCaster(); Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit()) if (Unit* unitTarget = GetHitUnit())
{ {
int32 bp = CalculatePctN(GetHitDamage(), GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID())); int32 bp = GetHitDamage() * multiplier;
caster->CastCustomSpell(unitTarget, DK_SPELL_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true); caster->CastCustomSpell(unitTarget, DK_SPELL_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true);
} }
} }
@@ -402,6 +410,7 @@ class spell_dk_scourge_strike : public SpellScriptLoader
void Register() void Register()
{ {
OnEffectHitTarget += SpellEffectFn(spell_dk_scourge_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY); OnEffectHitTarget += SpellEffectFn(spell_dk_scourge_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY);
AfterHit += SpellHitFn(spell_dk_scourge_strike_SpellScript::HandleAfterHit);
} }
}; };