diff options
author | offl <11556157+offl@users.noreply.github.com> | 2022-06-12 23:27:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-12 23:27:05 +0300 |
commit | b5194a15276f5ffc88ebaf38971dce0c2057f10f (patch) | |
tree | 0f679fa25e4cf1c9b73d3cc569e0a81fe821884e /src | |
parent | b52e0ccbad718eb0b2d84f4a247c60f7934e8eb6 (diff) |
Scripts/Spells: Rework Fire Bomb (Halaa) (#28025)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Outland/zone_nagrand.cpp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 7b02b3547e1..01da7da6b73 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -34,6 +34,7 @@ EndContentData */ #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" #include "SpellInfo.h" +#include "SpellScript.h" #include "TemporarySummon.h" /*###### @@ -703,10 +704,88 @@ public: } }; +enum FireBomb +{ + SPELL_FIRE_BOMB_TARGET_SUMMON_EFFECT = 31960, + SPELL_FIRE_BOMB_DAMAGE_MISSILE = 31961, + SPELL_FIRE_BOMB_SUMMON_CATAPULT_BLAZE = 31963, + SPELL_FIRE_BOMB_FLAMES = 34658 +}; + +// 31959 - Fire Bomb Target Summon Trigger +class spell_nagrand_fire_bomb_target_summon_trigger : public SpellScript +{ + PrepareSpellScript(spell_nagrand_fire_bomb_target_summon_trigger); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_FIRE_BOMB_TARGET_SUMMON_EFFECT }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (TempSummon* casterSummon = GetCaster()->ToTempSummon()) + if (Unit* summoner = casterSummon->GetSummonerUnit()) + casterSummon->CastSpell(summoner, SPELL_FIRE_BOMB_TARGET_SUMMON_EFFECT); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_nagrand_fire_bomb_target_summon_trigger::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 31960 - Fire Bomb Target Summon Effect +class spell_nagrand_fire_bomb_target_summon_effect : public SpellScript +{ + PrepareSpellScript(spell_nagrand_fire_bomb_target_summon_effect); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_FIRE_BOMB_DAMAGE_MISSILE }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetCaster(), SPELL_FIRE_BOMB_DAMAGE_MISSILE); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_nagrand_fire_bomb_target_summon_effect::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 31961 - Fire Bomb +class spell_nagrand_fire_bomb_damage_missile : public SpellScript +{ + PrepareSpellScript(spell_nagrand_fire_bomb_damage_missile); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_FIRE_BOMB_SUMMON_CATAPULT_BLAZE, SPELL_FIRE_BOMB_FLAMES }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* target = GetHitUnit(); + target->CastSpell(target, SPELL_FIRE_BOMB_SUMMON_CATAPULT_BLAZE); + target->CastSpell(target, SPELL_FIRE_BOMB_FLAMES); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_nagrand_fire_bomb_damage_missile::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_nagrand() { new npc_maghar_captive(); new npc_kurenai_captive(); new npc_nagrand_banner(); new condition_nagrand_banner(); + RegisterSpellScript(spell_nagrand_fire_bomb_target_summon_trigger); + RegisterSpellScript(spell_nagrand_fire_bomb_target_summon_effect); + RegisterSpellScript(spell_nagrand_fire_bomb_damage_missile); } |