aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2022-03-07 01:45:32 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-26 15:49:11 +0100
commit04c7e91097fbd0ba94cb60fee86958fdf29db8e9 (patch)
tree85bf54fd11a73c9518bf134ea7b0441e7569a054 /src
parentb105dc4c8fcbcd381d8c0ad24636d1e948743504 (diff)
Scripts/Quest: Update 'What Do You Feed a Yeti, Anyway?' (#27851)
(cherry picked from commit fbfb8da7fc89d8a595ec70969a54732372dc39d0)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/zone_icecrown.cpp43
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp31
2 files changed, 43 insertions, 31 deletions
diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp
index abb581be651..d3d79eb18c7 100644
--- a/src/server/scripts/Northrend/zone_icecrown.cpp
+++ b/src/server/scripts/Northrend/zone_icecrown.cpp
@@ -858,6 +858,48 @@ class spell_q14076_14092_pound_drum : public SpellScript
}
};
+/*######
+## Quest 14112 & 14145: What Do You Feed a Yeti, Anyway?
+######*/
+
+enum ChumTheWaterSummons
+{
+ SPELL_SUMMON_ANGRY_KVALDIR = 66737,
+ SPELL_SUMMON_NORTH_SEA_MAKO = 66738,
+ SPELL_SUMMON_NORTH_SEA_THRESHER = 66739,
+ SPELL_SUMMON_NORTH_SEA_BLUE_SHARK = 66740
+};
+
+std::array<uint32, 4> const ChumTheWaterSummonSpells =
+{
+ SPELL_SUMMON_ANGRY_KVALDIR,
+ SPELL_SUMMON_NORTH_SEA_MAKO,
+ SPELL_SUMMON_NORTH_SEA_THRESHER,
+ SPELL_SUMMON_NORTH_SEA_BLUE_SHARK
+};
+
+// 66741 - Chum the Water
+class spell_q14112_14145_chum_the_water : public SpellScript
+{
+ PrepareSpellScript(spell_q14112_14145_chum_the_water);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo(ChumTheWaterSummonSpells);
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, Trinity::Containers::SelectRandomContainerElement(ChumTheWaterSummonSpells));
+ }
+
+ void Register() override
+ {
+ OnEffectHit += SpellEffectFn(spell_q14112_14145_chum_the_water::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
void AddSC_icecrown()
{
new npc_argent_valiant;
@@ -868,4 +910,5 @@ void AddSC_icecrown()
RegisterSpellScript(spell_the_ocular_on_death);
RegisterSpellScript(spell_summon_tualiq_proxy);
RegisterSpellScript(spell_q14076_14092_pound_drum);
+ RegisterSpellScript(spell_q14112_14145_chum_the_water);
}
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 3b868bcdfee..56fc5c793c1 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -779,36 +779,6 @@ class spell_q13280_13283_jump_jets : public SpellScript
}
};
-enum ChumTheWaterSummons
-{
- SUMMON_ANGRY_KVALDIR = 66737,
- SUMMON_NORTH_SEA_MAKO = 66738,
- SUMMON_NORTH_SEA_THRESHER = 66739,
- SUMMON_NORTH_SEA_BLUE_SHARK = 66740
-};
-
-// 66741 - Chum the Water
-class spell_q14112_14145_chum_the_water : public SpellScript
-{
- PrepareSpellScript(spell_q14112_14145_chum_the_water);
-
- bool Validate(SpellInfo const* /*spellEntry*/) override
- {
- return ValidateSpellInfo({ SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK });
- }
-
- void HandleScriptEffect(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
- caster->CastSpell(caster, RAND(SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK));
- }
-
- void Register() override
- {
- OnEffectHitTarget += SpellEffectFn(spell_q14112_14145_chum_the_water::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
- }
-};
-
enum RedSnapperVeryTasty
{
SPELL_FISHED_UP_RED_SNAPPER = 29867,
@@ -2223,7 +2193,6 @@ void AddSC_quest_spell_scripts()
RegisterSpellScript(spell_q12805_lifeblood_dummy);
RegisterSpellScript(spell_q13280_13283_plant_battle_standard);
RegisterSpellScript(spell_q13280_13283_jump_jets);
- RegisterSpellScript(spell_q14112_14145_chum_the_water);
RegisterSpellScript(spell_q9452_cast_net);
RegisterSpellScript(spell_q12066_bunny_kill_credit);
RegisterSpellScript(spell_q12372_cast_from_gossip_trigger);