Scripts/Quest: Rework 'Fel Spirits' (10909) (#28134)

This commit is contained in:
offl
2022-07-18 23:38:37 +03:00
committed by GitHub
parent d06842d42a
commit aef55d5dfa
2 changed files with 93 additions and 0 deletions

View File

@@ -24,6 +24,7 @@
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "WorldSession.h"
@@ -794,6 +795,60 @@ struct npc_fear_controller : public ScriptedAI
EventMap _events;
};
/*######
## Quest 10909: Fel Spirits
######*/
enum FelSpirits
{
SPELL_SEND_VENGEANCE_TO_PLAYER = 39202,
SPELL_SUMMON_FEL_SPIRIT = 39206
};
// 39190 - Send Vengeance
class spell_hellfire_peninsula_send_vengeance : public SpellScript
{
PrepareSpellScript(spell_hellfire_peninsula_send_vengeance);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SEND_VENGEANCE_TO_PLAYER });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (TempSummon* target = GetHitUnit()->ToTempSummon())
if (Unit* summoner = target->GetSummonerUnit())
target->CastSpell(summoner, SPELL_SEND_VENGEANCE_TO_PLAYER, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_hellfire_peninsula_send_vengeance::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
// 39202 - Send Vengeance to Player
class spell_hellfire_peninsula_send_vengeance_to_player : public SpellScript
{
PrepareSpellScript(spell_hellfire_peninsula_send_vengeance_to_player);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SUMMON_FEL_SPIRIT });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_SUMMON_FEL_SPIRIT, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_hellfire_peninsula_send_vengeance_to_player::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_hellfire_peninsula()
{
new npc_colonel_jules();
@@ -802,4 +857,6 @@ void AddSC_hellfire_peninsula()
RegisterCreatureAI(npc_watch_commander_leonus);
RegisterCreatureAI(npc_infernal_rain_hellfire);
RegisterCreatureAI(npc_fear_controller);
RegisterSpellScript(spell_hellfire_peninsula_send_vengeance);
RegisterSpellScript(spell_hellfire_peninsula_send_vengeance_to_player);
}