Core/Spells: removed Death and Decay hack and updated spellscript for proper handling

This commit is contained in:
Ovahlord
2018-07-05 14:03:32 +02:00
parent ee9933a766
commit 35a57a3b3b
2 changed files with 4 additions and 14 deletions

View File

@@ -24,6 +24,7 @@
#include "ScriptMgr.h"
#include "Containers.h"
#include "Creature.h"
#include "GridNotifiers.h"
#include "Pet.h"
#include "Player.h"
#include "Spell.h"
@@ -398,13 +399,13 @@ class spell_dk_death_and_decay : public SpellScriptLoader
void HandleDummyTick(AuraEffect const* aurEff)
{
if (Unit* caster = GetCaster())
caster->CastCustomSpell(SPELL_DK_DEATH_AND_DECAY_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff);
if (DynamicObject* dyn = GetTarget()->GetDynObject(aurEff->GetId()))
GetTarget()->CastSpell(dyn->GetPositionX(), dyn->GetPositionY(), dyn->GetPositionZ(), SPELL_DK_DEATH_AND_DECAY_DAMAGE, true, nullptr, aurEff);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dk_death_and_decay_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dk_death_and_decay_AuraScript::HandleDummyTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};