aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2022-06-12 23:27:05 +0300
committerShauren <shauren.trinity@gmail.com>2022-09-05 18:34:31 +0200
commitab7010dae103ea316015b1b01f67cfecd5cdfe21 (patch)
tree3602f2bd34d2848aa9c560a00a3f6e6dbb919973 /src
parenteafc5214b25494fcf75793e5c6ffcd36e2aaf271 (diff)
Scripts/Spells: Rework Fire Bomb (Halaa) (#28025)
(cherry picked from commit b5194a15276f5ffc88ebaf38971dce0c2057f10f)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Outland/zone_nagrand.cpp79
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 4d29f5e639b..a1517edd60f 100644
--- a/src/server/scripts/Outland/zone_nagrand.cpp
+++ b/src/server/scripts/Outland/zone_nagrand.cpp
@@ -33,6 +33,7 @@ EndContentData */
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "SpellInfo.h"
+#include "SpellScript.h"
#include "TemporarySummon.h"
/*######
@@ -702,10 +703,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);
}