mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 19:35:42 +00:00
refactor(Core/Scripts): Spell To Scripts (#9718)
This commit is contained in:
committed by
GitHub
parent
838c88f45a
commit
11a734bf2b
@@ -28,6 +28,7 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
// TODO: this import is not necessary for compilation and marked as unused by the IDE
|
||||
// however, for some reasons removing it would cause a damn linking issue
|
||||
@@ -306,10 +307,35 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
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_ghoul();
|
||||
new npc_pet_dk_army_of_the_dead();
|
||||
new npc_pet_dk_dancing_rune_weapon();
|
||||
RegisterSpellScript(spell_pet_dk_gargoyle_strike);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user