diff options
-rw-r--r-- | sql/updates/world/2012_12_17_00_world_song_of_wind_and_water.sql | 38 | ||||
-rw-r--r-- | src/server/scripts/Northrend/sholazar_basin.cpp | 57 |
2 files changed, 94 insertions, 1 deletions
diff --git a/sql/updates/world/2012_12_17_00_world_song_of_wind_and_water.sql b/sql/updates/world/2012_12_17_00_world_song_of_wind_and_water.sql new file mode 100644 index 00000000000..0cfc2677df1 --- /dev/null +++ b/sql/updates/world/2012_12_17_00_world_song_of_wind_and_water.sql @@ -0,0 +1,38 @@ +-- Add DB suport for quest ID: 12726 "Song of Wind and Water" +-- Indexes: +SET @HAIPHOON_W := 28999; -- WATER +SET @HAIPHOON_A := 28985; -- AIR +SET @STORM := 28858; -- Storm Revenant +SET @AQUEOUS := 28862; -- Aqueous Spirit +-- WATER VERSION SPELLS +SET @SPELL_W_1 := 61375; -- Water Bolt +SET @SPELL_W_2 := 61376; -- Frost Nova +SET @SPELL_W_3 := 52862; -- Devour Wind +-- Both version spell +SET @SPELL_AW := 52869; -- Evocation +-- AIR VERSION SPELLS +SET @SPELL_A_1 :=61374; -- Lightning Bolt +SET @SPELL_A_2 :=52870; -- Windshear +SET @SPELL_A_3 :=52864; -- Devour Water + +-- Update both quest vehicles templates +-- Water version +UPDATE `creature_template` SET `spell1`=@SPELL_W_1,`spell2`=@SPELL_W_2,`spell3`=@SPELL_W_3,`spell6`=@SPELL_AW,`unit_flags`=`unit_flags`|16777216,`VehicleId`=257,`AIName`='',`exp`=2,`minlevel`=80,`maxlevel`=80,`ScriptName`='npc_haiphoon' WHERE `entry`=@HAIPHOON_W; +-- Wind version +UPDATE `creature_template` SET `spell1`=@SPELL_A_1,`spell2`=@SPELL_A_2,`spell3`=@SPELL_A_3,`spell6`=@SPELL_AW,`unit_flags`=`unit_flags`|16777216,`VehicleId`=257,`unit_class`=2,`exp`=2,`minlevel`=80,`maxlevel`=80,`ScriptName`='npc_haiphoon' WHERE `entry`=@HAIPHOON_A; + +-- Insert conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (@SPELL_W_3,@SPELL_A_3); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17,0,@SPELL_W_3,0,0,31,1,3,@STORM,0,0,0,'', 'Spell Devour Wind can only target Storm Revenant'), +(17,0,@SPELL_A_3,0,0,31,1,3,@AQUEOUS,0,0,0,'', 'Spell Devour Water can only target Aqueous Spirit'); + +-- Add SAI and DB support for Storm Revenant and Aqueous Spirit +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@STORM,@AQUEOUS); +UPDATE `creature_template` SET `resistance3`=545 WHERE `entry`=@STORM; -- should've resistance according to video (tried to be precise as possible) +UPDATE `creature_template` SET `resistance4`=545 WHERE `entry`=@AQUEOUS; -- should've resistance according to video -//- +DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (@STORM,@AQUEOUS); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@STORM,@AQUEOUS); +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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@STORM,0,0,0,0,0,100,0,2000,4000,5000,7000,11,32018,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Revenant - IC - Cast Call Lightning'), +(@AQUEOUS,0,0,0,0,0,100,0,6000,9000,7000,10000,11,55087,0,0,0,0,0,2,0,0,0,0,0,0,0,'Aqueous Spirit - IC - Cast Typhoon'); diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index c0635f897d9..46ee4e04eed 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -18,7 +18,7 @@ /* ScriptData SDName: Sholazar_Basin SD%Complete: 100 -SDComment: Quest support: 12570, 12573, 12621. +SDComment: Quest support: 12570, 12573, 12621, 12726 SDCategory: Sholazar_Basin EndScriptData */ @@ -26,6 +26,7 @@ EndScriptData */ npc_injured_rainspeaker_oracle npc_vekjik avatar_of_freya +npc_haiphoon (Quest: "Song of Wind and Water") EndContentData */ #include "ScriptMgr.h" @@ -984,6 +985,59 @@ public: } }; +/*###### +## Quest: Song of Wind and Water ID: 12726 +######*/ +/*This quest precisly needs core script since battle vehicles are not well integrated with SAI, +may be easily converted to SAI when they get.*/ +enum SongOfWindAndWater +{ + // Spells + SPELL_DEVOUR_WIND = 52862, + SPELL_DEVOUR_WATER = 52864, + // NPCs + NPC_HAIPHOON_WATER = 28999, + NPC_HAIPHOON_AIR = 28985 +}; + +class npc_haiphoon : public CreatureScript +{ +public: + npc_haiphoon() : CreatureScript("npc_haiphoon") { } + + struct npc_haiphoonAI : public VehicleAI + { + npc_haiphoonAI(Creature* creature) : VehicleAI(creature) { } + + void SpellHitTarget(Unit* target, SpellInfo const* spell) + { + if (target == me) + return; + + if (spell->Id == SPELL_DEVOUR_WIND) + { + if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + me->UpdateEntry(NPC_HAIPHOON_AIR); + } + } + + if (spell->Id == SPELL_DEVOUR_WATER) + { + if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + me->UpdateEntry(NPC_HAIPHOON_WATER); + } + } + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_haiphoonAI(creature); + } +}; + void AddSC_sholazar_basin() { new npc_injured_rainspeaker_oracle(); @@ -995,4 +1049,5 @@ void AddSC_sholazar_basin() new npc_jungle_punch_target(); new spell_q12620_the_lifewarden_wrath(); new spell_q12589_shoot_rjr(); + new npc_haiphoon(); } |