diff options
author | Nay <dnpd.dd@gmail.com> | 2011-10-22 13:18:17 +0100 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2011-10-22 13:18:17 +0100 |
commit | 362b528bbbec2a41604bc67af773d667a2c5044f (patch) | |
tree | f2137903f3890c66a291d4dc4f028647f0248a6e | |
parent | e5c0be0a29e13f9ee519c353a56ef8c785f063c5 (diff) |
Scripts/Quests: Fix quest What Do You Feed a Yeti, Anyway? (14112,14145)
Closes #2975
-rw-r--r-- | sql/updates/world/2011_10_22_05_world_misc.sql | 14 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 51 |
2 files changed, 64 insertions, 1 deletions
diff --git a/sql/updates/world/2011_10_22_05_world_misc.sql b/sql/updates/world/2011_10_22_05_world_misc.sql new file mode 100644 index 00000000000..57e4f740530 --- /dev/null +++ b/sql/updates/world/2011_10_22_05_world_misc.sql @@ -0,0 +1,14 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_q14112_14145_chum_the_water'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(66741,'spell_q14112_14145_chum_the_water'); + +-- Template updates for creature 35071 (North Sea Mako) +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`InhabitType`=`InhabitType`&~1 WHERE `entry` IN (35071,35060,35061); -- North Sea * (Last 2 entries guessed) +UPDATE `creature_template` SET `faction_A`=1885,`faction_H`=1885,`baseattacktime`=2000 WHERE `entry`=35072; -- Angry Kvaldir +-- Addon data for creature 35071 (North Sea Mako) +DELETE FROM `creature_template_addon` WHERE `entry` IN (35071,35072,35060,35061); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(35071,0,0,1,0, NULL), -- North Sea Mako +(35060,0,0,1,0, NULL), -- North Sea Thresher - guessed +(35061,0,0,1,0, NULL), -- North Sea Blue Shark - guessed +(35072,0,0,1,0, NULL); -- Angry Kvaldir diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 6ae9577070e..3b2cc5f5e00 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -899,7 +899,6 @@ class spell_q9874_liquid_fire : public SpellScriptLoader }; }; - enum SalvagingLifesStength { NPC_SHARD_KILL_CREDIT = 29303, @@ -950,6 +949,7 @@ enum eBattleStandard { NPC_KING_OF_THE_MOUNTAINT_KC = 31766, }; + class spell_q13280_13283_plant_battle_standard: public SpellScriptLoader { public: @@ -978,6 +978,54 @@ public: } }; +enum ChumTheWaterSummons +{ + SUMMON_ANGRY_KVALDIR = 66737, + SUMMON_NORTH_SEA_MAKO = 66738, + SUMMON_NORTH_SEA_THRESHER = 66739, + SUMMON_NORTH_SEA_BLUE_SHARK = 66740 +}; + +class spell_q14112_14145_chum_the_water: public SpellScriptLoader +{ +public: + spell_q14112_14145_chum_the_water() : SpellScriptLoader("spell_q14112_14145_chum_the_water") { } + + class spell_q14112_14145_chum_the_water_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q14112_14145_chum_the_water_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SUMMON_ANGRY_KVALDIR)) + return false; + if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_MAKO)) + return false; + if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_THRESHER)) + return false; + if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_BLUE_SHARK)) + return false; + return true; + } + + 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() + { + OnEffectHitTarget += SpellEffectFn(spell_q14112_14145_chum_the_water_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q14112_14145_chum_the_water_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1001,4 +1049,5 @@ void AddSC_quest_spell_scripts() new spell_q9874_liquid_fire(); new spell_q12805_lifeblood_dummy(); new spell_q13280_13283_plant_battle_standard(); + new spell_q14112_14145_chum_the_water(); } |