mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 11:52:32 +01:00
Core/Scripts: Move some spells to scripts (#22332)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user