Skip to content

Commit

Permalink
Core/Spells: fix scourge strike extra damage. thanks to tibbi
Browse files Browse the repository at this point in the history
  • Loading branch information
Star-lion committed Jun 8, 2012
1 parent 643b689 commit 6107e48
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/server/scripts/Spells/spell_dk.cpp
Expand Up @@ -381,6 +381,7 @@ class spell_dk_scourge_strike : public SpellScriptLoader
class spell_dk_scourge_strike_SpellScript : public SpellScript
{
PrepareSpellScript(spell_dk_scourge_strike_SpellScript);
float multiplier;

bool Validate(SpellInfo const* /*spellEntry*/)
{
Expand All @@ -390,18 +391,26 @@ class spell_dk_scourge_strike : public SpellScriptLoader
}

void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
multiplier = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()) / 100.f);
}

void HandleAfterHit()
{
Unit* caster = GetCaster();
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);
}
}

void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_dk_scourge_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY);
AfterHit += SpellHitFn(spell_dk_scourge_strike_SpellScript::HandleAfterHit);
}
};

Expand Down

4 comments on commit 6107e48

@Warpten
Copy link
Member

@Warpten Warpten commented on 6107e48 Jun 8, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiplier should default to 1 !

@Star-lion
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah indeed

@Xanvial
Copy link
Contributor

@Xanvial Xanvial commented on 6107e48 Jun 8, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use int32 for multiplier, then use calculatepctN (although maybe not much difference)

Xanvial@3355dbb (forgot to change multiplier initialization to 0 not 1 because if there's any disease it shouldn't deal shadow damage)

@tibbi
Copy link

@tibbi tibbi commented on 6107e48 Jun 10, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess it closes #636

Please sign in to comment.