Core/Spells: Revert previous commit. add exception for deep wounds in pct done aura modifiers. clean up heal bonus code to use the correct numerical types.

This commit is contained in:
Kandera
2012-05-17 10:29:36 -04:00
parent 619fdd185b
commit c6aa41cc10
2 changed files with 21 additions and 16 deletions

View File

@@ -177,22 +177,27 @@ class spell_warr_deep_wounds : public SpellScriptLoader
void HandleDummy(SpellEffIndex /* effIndex */)
{
int32 damage = GetEffectValue();
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
if (Unit* caster = GetCaster())
{
ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
{
// apply percent damage mods
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC);
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
// Add remaining ticks to damage done
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID()))
damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber());
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC);
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
damage = damage / ticks;
// Add remaining ticks to damage done
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID()))
damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber());
caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true);
}
damage = damage / ticks;
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true);
}
}
void Register()