fix(Scripts/Hyjal): Azgalor mark of doom spawn demons on target death (#18959)

This commit is contained in:
Andrew
2024-05-27 15:48:29 -03:00
committed by GitHub
parent 3985db3006
commit 73e44859f0
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
--
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_azgalor_doom' AND `spell_id` = 31347;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(31347, 'spell_azgalor_doom');

View File

@@ -17,6 +17,8 @@
#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "hyjal.h"
enum Spells
@@ -117,7 +119,27 @@ private:
};
class spell_azgalor_doom : public AuraScript
{
PrepareAuraScript(spell_azgalor_doom);
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
{
target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, true);
}
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_azgalor_doom::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
void AddSC_boss_azgalor()
{
RegisterHyjalAI(boss_azgalor);
RegisterSpellScript(spell_azgalor_doom);
}