fix(Scripts/Hyjal): Cannibalize should heal more than 1 (#18766)

* init

* include SpellScript.h
This commit is contained in:
Jelle Meeus
2024-04-20 03:20:24 +02:00
committed by GitHub
parent 1c1c1f44c8
commit c738f0d67c
2 changed files with 26 additions and 0 deletions

View File

@@ -19,6 +19,8 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "hyjal.h"
enum Spells
@@ -327,6 +329,26 @@ public:
};
// 31538 - Cannibalize (Heal)
class spell_cannibalize_heal : public SpellScript
{
PrepareSpellScript(spell_cannibalize_heal);
void HandleHeal(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
{
uint32 heal = caster->CountPctFromMaxHealth(7);
SetHitHeal(heal);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_cannibalize_heal::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL);
}
};
struct npc_hyjal_ground_trash : public ScriptedAI
{
npc_hyjal_ground_trash(Creature* creature) : ScriptedAI(creature)
@@ -704,4 +726,5 @@ void AddSC_hyjal()
RegisterHyjalAI(npc_hyjal_ground_trash);
RegisterHyjalAI(npc_hyjal_gargoyle);
RegisterHyjalAI(npc_hyjal_frost_wyrm);
RegisterSpellScript(spell_cannibalize_heal);
}