Skip to content

Commit

Permalink
fix(Scripts/Hyjal): Azgalor mark of doom spawn demons on target death (
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah authored May 27, 2024
1 parent 3985db3 commit 73e4485
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/sql/updates/pending_db_world/rev_1716833230281927300.sql
Original file line number Diff line number Diff line change
@@ -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');
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "hyjal.h"

enum Spells
Expand Down Expand Up @@ -117,7 +119,27 @@ struct boss_azgalor : public BossAI

};

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);
}

0 comments on commit 73e4485

Please sign in to comment.