diff options
author | offl <11556157+offl@users.noreply.github.com> | 2022-03-07 01:45:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-07 01:45:32 +0200 |
commit | fbfb8da7fc89d8a595ec70969a54732372dc39d0 (patch) | |
tree | ac35469658583b9fd4f7c5fb0149d5e8172d99d2 | |
parent | 65a7a342d088f6e9c2eea6074881a8e4ad9320d7 (diff) |
Scripts/Quest: Update 'What Do You Feed a Yeti, Anyway?' (#27851)
-rw-r--r-- | sql/updates/world/3.3.5/2022_03_07_00_world.sql | 10 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_icecrown.cpp | 43 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 31 |
3 files changed, 53 insertions, 31 deletions
diff --git a/sql/updates/world/3.3.5/2022_03_07_00_world.sql b/sql/updates/world/3.3.5/2022_03_07_00_world.sql new file mode 100644 index 00000000000..87abc287d54 --- /dev/null +++ b/sql/updates/world/3.3.5/2022_03_07_00_world.sql @@ -0,0 +1,10 @@ +-- +UPDATE `creature_template` SET `unit_flags` = 32768, `AIName` = 'SmartAI' WHERE `entry` IN (35060,35061,35071,35072); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (35060,35061,35071,35072) AND `source_type` = 0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(35060,0,0,0,11,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"North Sea Thresher - On Spawn - Start Attack Summoner"), +(35061,0,0,0,11,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"North Sea Blue Shark - On Spawn - Start Attack Summoner"), +(35071,0,0,0,11,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"North Sea Mako - On Spawn - Start Attack Summoner"), + +(35072,0,0,0,11,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Angry Kvaldir - On Spawn - Start Attack Summoner"), +(35072,0,1,0,0,0,100,0,0,0,15000,15000,0,11,49922,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Angry Kvaldir - In Combat - Cast 'Wave Crash'"); diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 9ee82d36ae5..adb5a4cedef 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -860,6 +860,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; @@ -870,4 +912,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 0385e8ef4df..3f34a008845 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -780,36 +780,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, @@ -2117,7 +2087,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); |