Core/Scripts: Move some spells to scripts (#22332)

This commit is contained in:
DanVS
2019-01-05 00:54:33 +00:00
committed by Aokromes
parent 030f5d54d0
commit 8051ff13df
6 changed files with 141 additions and 90 deletions

View File

@@ -26,6 +26,7 @@
#include "GridNotifiersImpl.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
enum DeathKnightSpells
{
@@ -136,8 +137,31 @@ class npc_pet_dk_guardian : public CreatureScript
}
};
class spell_pet_dk_gargoyle_strike : public SpellScript
{
PrepareSpellScript(spell_pet_dk_gargoyle_strike);
void HandleDamageCalc(SpellEffIndex /*effIndex*/)
{
int32 damage = 60;
if (Unit* caster = GetCaster())
{
if (caster->getLevel() >= 60)
damage += (caster->getLevel() - 60) * 4;
}
SetHitDamage(damage);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_pet_dk_gargoyle_strike::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
void AddSC_deathknight_pet_scripts()
{
new npc_pet_dk_ebon_gargoyle();
new npc_pet_dk_guardian();
RegisterSpellScript(spell_pet_dk_gargoyle_strike);
}