diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-22 23:43:35 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-22 23:43:35 +0200 |
| commit | a94bbf34808c3a05cb6c4c889e3f890e4bec74a1 (patch) | |
| tree | 99455531d09be8d5048dd3daea745cd20eef15cd /src/server/scripts | |
| parent | c38dcab7d84453aa83a147ee19180485b327e350 (diff) | |
Core/Spells: Fix warlock "Health Funnel" self damage with hacky way
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index b2344a33313..b4eed9c527a 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -752,10 +752,28 @@ class spell_warl_health_funnel : public SpellScriptLoader target->RemoveAurasDueToSpell(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2); } + void OnPeriodic(AuraEffect const* aurEff) + { + Unit* caster = GetCaster(); + if (!caster) + return; + //! HACK for self damage, is not blizz :/ + uint32 damage = caster->CountPctFromMaxHealth(aurEff->GetBaseAmount()); + + if (Player* modOwner = caster->GetSpellModOwner()) + modOwner->ApplySpellMod(GetId(), SPELLMOD_COST, damage); + + SpellNonMeleeDamage damageInfo(caster, caster, GetSpellInfo()->Id, GetSpellInfo()->SchoolMask); + damageInfo.damage = damage; + caster->SendSpellNonMeleeDamageLog(&damageInfo); + caster->DealSpellDamage(&damageInfo, false); + } + void Register() OVERRIDE { OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_OBS_MOD_HEALTH, AURA_EFFECT_HANDLE_REAL); OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_OBS_MOD_HEALTH, AURA_EFFECT_HANDLE_REAL); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_health_funnel_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_OBS_MOD_HEALTH); } }; |
