diff options
55 files changed, 1997 insertions, 748 deletions
diff --git a/sql/updates/world/2011_10_21_00_world_creature_template_addon.sql b/sql/updates/world/2011_10_21_00_world_creature_template_addon.sql new file mode 100644 index 00000000000..fed232a29d2 --- /dev/null +++ b/sql/updates/world/2011_10_21_00_world_creature_template_addon.sql @@ -0,0 +1,3 @@ +-- Move Shadowfiend's Mana Leech Aura from spellscript to creature addon. +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_pri_shadowfiend'; +UPDATE `creature_template_addon` SET `auras`= '28305' WHERE `entry`=19668; diff --git a/sql/updates/world/2011_10_22_00_world_sai.sql b/sql/updates/world/2011_10_22_00_world_sai.sql new file mode 100644 index 00000000000..534e57297ef --- /dev/null +++ b/sql/updates/world/2011_10_22_00_world_sai.sql @@ -0,0 +1,44 @@ +-- [Q] A Taste of Flame + +-- Cyrus Therepentous SAI +SET @ENTRY := 9459; +SET @GOSSIP := 40060; +UPDATE `creature_template` SET `AIName`='SmartAI',`gossip_menu_id`=@GOSSIP WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,0,0,0,12,9461,1,360000,0,0,0,8,0,0,0,-7656.939941,-3009.474121,133.205612,4.830283,"Cyrus Therepentous - On Gossip Select - Summon Frenzied Black Drake"), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Cyrus Therepentous - On Gossip Select (Link) - Close Gossip"); + +-- Actual gossip option and text for Cyrus Therepentous +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=2494; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,2494); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(@GOSSIP,0,0,"I present you with proof...",1,1,0,0,0,0,NULL); + +-- Frenzied Black Drake SAI +SET @ENTRY := 9461; +SET @SPELL_FRENZY := 8269; +SET @SPELL_DECIMATE := 13459; +SET @SPELL_FLAME_BREATH := 9573; +SET @SPELL_FLAME_BUFFET := 9574; +UPDATE `creature_template` SET `AIName`='SmartAI',`mechanic_immune_mask`=1104 WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,0,0,100,0,2300,2900,19500,46300,11,@SPELL_FLAME_BREATH,0,0,0,0,0,2,0,0,0,0,0,0,0,"Frenzied Black Drake - In Combat - Cast Flame Breath"), +(@ENTRY,0,1,0,0,0,100,0,1100,3800,2300,6100,11,@SPELL_FLAME_BUFFET,0,0,0,0,0,2,0,0,0,0,0,0,0,"Frenzied Black Drake - In Combat - Cast Flame Buffet"), +(@ENTRY,0,2,0,0,0,100,0,28500,31600,70100,74400,11,@SPELL_DECIMATE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Frenzied Black Drake - In Combat - Cast Decimate"), +(@ENTRY,0,3,4,2,0,100,1,0,30,0,0,11,@SPELL_FRENZY,1,0,0,0,0,1,0,0,0,0,0,0,0,"Frenzied Black Drake - At 30% HP - Cast Frenzy"), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Frenzied Black Drake - At 30% HP - Emote Line 0"); +-- Text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"%s goes into a frenzy!",16,0,100,0,0,0,"Frenzied Black Drake"); + +-- Conditions for the gossip option +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`Comment`) VALUES +(15,@GOSSIP,0,0,9,4022, 'Show gossip if on quest A Taste of Flame (1) OR'), +(15,@GOSSIP,0,1,9,4023, 'Show gossip if on quest A Taste of Flame (2) OR'), +(15,@GOSSIP,0,2,9,4024, 'Show gossip if on quest A Taste of Flame (3) OR'); diff --git a/sql/updates/world/2011_10_22_01_world_quest_relation.sql b/sql/updates/world/2011_10_22_01_world_quest_relation.sql new file mode 100644 index 00000000000..f0d15832b98 --- /dev/null +++ b/sql/updates/world/2011_10_22_01_world_quest_relation.sql @@ -0,0 +1,36 @@ +-- corrected quests in creature_involvedrelation and creature_questrelation +-- Horde npcs 14726 Rashona Straglash +UPDATE `creature_involvedrelation` SET `quest` = 7824 WHERE `id` =14726 AND `quest` =7836; +UPDATE `creature_questrelation` SET `quest` = 7824 WHERE `id` =14726 AND `quest` =7836; +UPDATE `creature_involvedrelation` SET `quest` = 7832 WHERE `id` =14726 AND `quest` =7837; +UPDATE `creature_questrelation` SET `quest` = 7832 WHERE `id` =14726 AND `quest` =7837; + +-- NPC 14727 Vehena +UPDATE `creature_involvedrelation` SET `quest` = 7836 WHERE `id` =14727 AND `quest` =7832; +UPDATE `creature_questrelation` SET `quest` = 7836 WHERE `id` =14727 AND `quest` =7832; +UPDATE `creature_involvedrelation` SET `quest` = 7837 WHERE `id` =14727 AND `quest` =7824; +UPDATE `creature_questrelation` SET `quest` = 7837 WHERE `id` =14727 AND `quest` =7824; + +-- Alliance npcs 14725 Raedon Dustriker +UPDATE `creature_involvedrelation` SET `quest` = 10352 WHERE `id` =14725 AND `quest` =7792; +UPDATE `creature_questrelation` SET `quest` = 10352 WHERE `id` =14725 AND `quest` =7792; +UPDATE `creature_involvedrelation` SET `quest` = 10354 WHERE `id` =14725 AND `quest` =7798; +UPDATE `creature_questrelation` SET `quest` = 10354 WHERE `id` =14725 AND `quest` =7798; + +-- NPC 20604 Dugiru +UPDATE `creature_involvedrelation` SET `quest` = 7792 WHERE `id` =20604 AND `quest` =10352; +UPDATE `creature_questrelation` SET `quest` = 7792 WHERE `id` =20604 AND `quest` =10352; +UPDATE `creature_involvedrelation` SET `quest` = 7798 WHERE `id` =20604 AND `quest` =10354; +UPDATE `creature_questrelation` SET `quest` = 7798 WHERE `id` =20604 AND `quest` =10354; + +-- NPC 14723 Mistina Steelshield +UPDATE `creature_involvedrelation` SET `quest` = 7802 WHERE `id` =14723 AND `quest` =7807; +UPDATE `creature_questrelation` SET `quest` = 7802 WHERE `id` =14723 AND `quest` =7807; +UPDATE `creature_involvedrelation` SET `quest` = 7803 WHERE `id` =14723 AND `quest` =7808; +UPDATE `creature_questrelation` SET `quest` = 7803 WHERE `id` =14723 AND `quest` =7808; + +-- NPC 14724 Bublo Acerbus +UPDATE `creature_involvedrelation` SET `quest` = 7807 WHERE `id` =14724 AND `quest` =7802; +UPDATE `creature_questrelation` SET `quest` = 7807 WHERE `id` =14724 AND `quest` =7802; +UPDATE `creature_involvedrelation` SET `quest` = 7808 WHERE `id` =14724 AND `quest` =7803; +UPDATE `creature_questrelation` SET `quest` = 7808 WHERE `id` =14724 AND `quest` =7803; diff --git a/sql/updates/world/2011_10_22_02_world_gameobject_template.sql b/sql/updates/world/2011_10_22_02_world_gameobject_template.sql new file mode 100644 index 00000000000..8effad58ca6 --- /dev/null +++ b/sql/updates/world/2011_10_22_02_world_gameobject_template.sql @@ -0,0 +1,4 @@ +DELETE FROM `gameobject_template` WHERE `entry` IN (180211,180213); +INSERT INTO `gameobject_template`(`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `AIName`, `ScriptName`, `WDBVerified`) VALUES +(180211,5,6314,'Uther''s Gnome Tribute','','','',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'','',12340), +(180213,5,6315,'Uther''s Night Elf Tribute','','','',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'','',12340); diff --git a/sql/updates/world/2011_10_22_03_world_sai.sql b/sql/updates/world/2011_10_22_03_world_sai.sql new file mode 100644 index 00000000000..6003e1d365b --- /dev/null +++ b/sql/updates/world/2011_10_22_03_world_sai.sql @@ -0,0 +1,69 @@ +-- [Q] A Meeting With The Magister +-- [Q] An Audience With The Arcanist +SET @ENTRY_HATHOREL := 36670; +SET @ENTRY_TYBALIN := 36669; +SET @QUEST_A := 20439; +SET @QUEST_H := 24451; +SET @GOSSIP_A := 10857; +SET @GOSSIP_H := 10858; +SET @SPELL_SUNREAVER_DISGUISE := 70973; +SET @SPELL_COVENANT_DISGUISE := 70971; +SET @SPELL_CREATE_BLADES := 69722; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@ENTRY_HATHOREL,@ENTRY_TYBALIN); +UPDATE `quest_template` SET `OfferRewardText`="Excellent work. Now that this is in our hands, we must get it to Caladis Brightspear as soon as possible. We can't risk the book falling back into Sunreaver hands.$BI'll ensure that Shandy Glossgleam gets his tabard back without incident, along with a healthy reward for his help",`RequestItemsText`="Have you recovered that book?" WHERE `entry`=@QUEST_A; +UPDATE `quest_template` SET `OfferRewardText`="Excellent work. Now that this is in our hands, we must get it to Myralion Sunblaze as soon as possible. We can't risk the Silver Covenant taking the book from us again.$BI'll get that tabard back to Shandy and see that he's well compensated for his assistance. Once the book is in Myralion's hands, the Silver Covenant won't be a threat anymore.",`RequestItemsText`="Have you recovered that book?" WHERE `entry`=@QUEST_H; +DELETE FROM `creature` WHERE `guid`=150186 AND `id`=@ENTRY_HATHOREL; -- Double-spawned Hathorel +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY_HATHOREL,@ENTRY_HATHOREL*100,@ENTRY_TYBALIN,@ENTRY_TYBALIN*100); +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 +(@ENTRY_TYBALIN,0,0,0,19,0,100,0,@QUEST_A,0,0,0,11,@SPELL_SUNREAVER_DISGUISE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Arcanist Tybalin - On Quest Accept - Cast Sunreaver Disguise"), +(@ENTRY_TYBALIN,0,1,0,20,0,100,0,@QUEST_A,0,0,0,28,@SPELL_SUNREAVER_DISGUISE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Arcanist Tybalin - On Quest Reward - Remove Aura Sunreaver Disguise"), +(@ENTRY_TYBALIN,0,2,3,62,0,100,0,@GOSSIP_A,1,0,0,11,@SPELL_SUNREAVER_DISGUISE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Arcanist Tybalin - On Quest Accept - Cast Sunreaver Disguise"), +(@ENTRY_TYBALIN,0,3,0,61,0,100,0,@GOSSIP_A,1,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Arcanist Tybalin - On Gossip Select - Close Gossip"), +(@ENTRY_TYBALIN,0,4,0,62,0,100,0,@GOSSIP_H,0,0,0,80,@ENTRY_TYBALIN*100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Arcanist Tybalin - On Gossip Select - Run Script"), +(@ENTRY_TYBALIN*100,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Arcanist Tybalin - On Script - Close Gossip"), +(@ENTRY_TYBALIN*100,9,1,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Arcanist Tybalin - On Script - Say text 0"), +(@ENTRY_TYBALIN*100,9,2,0,0,0,100,0,6000,6000,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Arcanist Tybalin - On Script - Say text 1"), +(@ENTRY_TYBALIN*100,9,3,0,0,0,100,0,0,0,0,0,11,@SPELL_CREATE_BLADES,0,0,0,0,0,7,0,0,0,0,0,0,0,"Arcanist Tybalin - On Script - Cast Create Ancient Dragonforged Blades"), +(@ENTRY_TYBALIN*100,9,4,0,0,0,100,0,6000,6000,0,0,1,2,0,0,0,0,0,7,0,0,0,0,0,0,0,"Arcanist Tybalin - On Script - Say text 2"), + +(@ENTRY_HATHOREL,0,0,0,19,0,100,0,@QUEST_H,0,0,0,11,@SPELL_COVENANT_DISGUISE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Magister Hathorel - On Quest Accept - Cast Covenant Disguise"), +(@ENTRY_HATHOREL,0,1,0,20,0,100,0,@QUEST_H,0,0,0,28,@SPELL_COVENANT_DISGUISE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Magister Hathorel - On Quest Reward - Remove Aura Covenant Disguise"), +(@ENTRY_HATHOREL,0,2,3,62,0,100,0,@GOSSIP_H,1,0,0,11,@SPELL_COVENANT_DISGUISE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Magister Hathorel - On Quest Accept - Cast Covenant Disguise"), +(@ENTRY_HATHOREL,0,3,0,61,0,100,0,@GOSSIP_H,1,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Magister Hathorel - On Gossip Select - Close Gossip"), +(@ENTRY_HATHOREL,0,4,0,62,0,100,0,@GOSSIP_A,0,0,0,80,@ENTRY_HATHOREL*100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Magister Hathorel - On Gossip Select - Run Script"), +(@ENTRY_HATHOREL*100,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Magister Hathorel - On Script - Close Gossip"), +(@ENTRY_HATHOREL*100,9,1,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Magister Hathorel - On Script - Say text 0"), +(@ENTRY_HATHOREL*100,9,2,0,0,0,100,0,6000,6000,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Magister Hathorel - On Script - Say text 1"), +(@ENTRY_HATHOREL*100,9,3,0,0,0,100,0,0,0,0,0,11,@SPELL_CREATE_BLADES,0,0,0,0,0,7,0,0,0,0,0,0,0,"Magister Hathorel - On Script - Cast Create Ancient Dragonforged Blades"), +(@ENTRY_HATHOREL*100,9,4,0,0,0,100,0,6000,6000,0,0,1,2,0,0,0,0,0,7,0,0,0,0,0,0,0,"Magister Hathorel - On Script - Say text 2"); + +-- Actual gossip option +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (@GOSSIP_A,@GOSSIP_H); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +(@GOSSIP_A,0,0,"I'm ready to deliver the tome, Magister Hathorel.",1,1,0,0,0,0,NULL), +(@GOSSIP_A,1,0,"Would you renew my Sunreaver disguise?",1,1,0,0,0,0,NULL), +(@GOSSIP_H,0,0,"I'm ready to deliver the tome, Arcanist Tybalin.",1,1,0,0,0,0,NULL), +(@GOSSIP_H,1,0,"Would you renew my Covenant disguise?",1,1,0,0,0,0,NULL); + +-- Magister Hathorel +DELETE FROM `creature_text` WHERE `entry` IN (@ENTRY_HATHOREL,@ENTRY_TYBALIN); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY_HATHOREL,0,0,"You're late, courier. No, I don't want any excuses; this errand is far too important.",12,0,100,1,0,0,"Magister Hathorel"), +(@ENTRY_HATHOREL,1,0,"Here's the tome our representative brought from Wyrmrest. Get this to Myralion Sunblaze immediately.",12,0,100,1,0,0,"Magister Hathorel"), +(@ENTRY_HATHOREL,2,0,"Watch your back, courier. I needn't remind you of the value of the book, nor the fact that the Silver Covenant will stop at nothing to take it from us.",12,0,100,1,0,0,"Magister Hathorel"), +-- Arcanist Tybalin +(@ENTRY_TYBALIN,0,0,"It's good to finally see you, courier. Krasus has entrusted us with one of the few remaining copies of Ancient Dragonforged Blades.",12,0,100,1,0,0,"Arcanist Tybalin"), +(@ENTRY_TYBALIN,1,0,"Here is the book. You must ensure it gets to Caladis Brightspear in Icecrown before the Sunreavers realize what is happening.",12,0,100,1,0,0,"Arcanist Tybalin"), +(@ENTRY_TYBALIN,2,0,"Travel quickly! The Sunreavers will not waste any time once they realize that we have the information they seek.",12,0,100,1,0,0,"Arcanist Tybalin"); + +-- Conditions for the gossip options +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (@GOSSIP_A,@GOSSIP_H); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`) VALUES +(15,@GOSSIP_A,0,9,@QUEST_A), +(15,@GOSSIP_H,0,9,@QUEST_H), + +(15,@GOSSIP_A,1,11,@SPELL_COVENANT_DISGUISE), +(15,@GOSSIP_H,1,11,@SPELL_SUNREAVER_DISGUISE), + +(15,@GOSSIP_A,1,9,@QUEST_A), +(15,@GOSSIP_H,1,9,@QUEST_H); diff --git a/sql/updates/world/2011_10_22_04_world_sai.sql b/sql/updates/world/2011_10_22_04_world_sai.sql new file mode 100644 index 00000000000..71aac7a302b --- /dev/null +++ b/sql/updates/world/2011_10_22_04_world_sai.sql @@ -0,0 +1,145 @@ +-- [Q] Still At It +-- "Tipsy" McManus SAI +SET @ENTRY := 28566; +SET @GOSSIP := 9713; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100+0,@ENTRY*100+1,@ENTRY*100+2,@ENTRY*100+3,@ENTRY*100+4,@ENTRY*100+5,@ENTRY*100+6,@ENTRY*100+7,@ENTRY*100+8); +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 +(@ENTRY,0,0,0,62,0,100,0,@GOSSIP,0,0,0,80,@ENTRY*100+0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - On gossip option select - Run script"), +(@ENTRY,0,1,0,1,1,100,0,5000,5000,11000,11000,88,@ENTRY*100+1,@ENTRY*100+5,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - After 5 Sec - Run Random Script"), +(@ENTRY,0,2,0,38,1,100,0,1,1,0,0,80,@ENTRY*100+6,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - On Data Set 1 1 - Run Completion Script"), +(@ENTRY,0,3,0,1,1,100,1,103900,103900,0,0,80,@ENTRY*100+8,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Call Script Quest successful (phase 1) after some time (104s=9tasks)"), +(@ENTRY,0,4,0,1,2,100,1,0,0,0,0,80,@ENTRY*100+7,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Timed - Run Failure Script"), +(@ENTRY,0,5,0,1,4,100,1,8000,8000,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Timed - Set Back Gossip & Quest Flags"), +(@ENTRY,0,6,0,1,4,100,1,8010,8010,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Timed - Reset script"), +-- Start Script +(@ENTRY*100+0,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Tipsy McManus - Script 0 - Close Gossip"), +(@ENTRY*100+0,9,1,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 0 - Turn of Gossip & Questgiver flags"), +(@ENTRY*100+0,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 0 - Say Text 0"), +(@ENTRY*100+0,9,3,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 0 - Set Phase 1"), +-- Wants Orange +(@ENTRY*100+1,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 1 - Say Text 1"), +(@ENTRY*100+1,9,1,0,0,0,100,0,0,0,0,0,12,28535,1,10000,0,0,0,8,0,0,0,5549.62354,5769.51367,-73.42824,2.75762,"Tipsy McManus - Script 1 - Summon Wants Orange"), +(@ENTRY*100+1,9,2,0,0,0,100,0,10000,10000,10000,10000,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 1 - set phase 2"), +-- Wants Papaya +(@ENTRY*100+2,9,0,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 2 - Say Text 2"), +(@ENTRY*100+2,9,1,0,0,0,100,0,0,0,0,0,12,28536,1,10000,0,0,0,8,0,0,0,5549.62354,5769.51367,-73.42824,2.75762,"Tipsy McManus - Script 2 - Summon Wants Papaya"), +(@ENTRY*100+2,9,2,0,0,0,100,0,10000,10000,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 2 - set phase 2"), +-- Wants Bananas +(@ENTRY*100+3,9,0,0,0,0,100,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 3 - Say Text 3"), +(@ENTRY*100+3,9,1,0,0,0,100,0,0,0,0,0,12,28537,1,10000,0,0,0,8,0,0,0,5549.62354,5769.51367,-73.42824,2.75762,"Tipsy McManus - Script 3 - Summon Wants Bananas"), +(@ENTRY*100+3,9,2,0,0,0,100,0,10000,10000,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 3 - set phase 2"), +-- Steaming Valve +(@ENTRY*100+4,9,0,0,0,0,100,0,0,0,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 4 - Say Text 4"), +(@ENTRY*100+4,9,1,0,0,0,100,0,0,0,0,0,12,28539,1,10000,0,0,0,8,0,0,0,5548.1,5767.4,-76.2673,-2.1293,"Tipsy McManus - Script 4 - Summon Steaming Valve"), +(@ENTRY*100+4,9,2,0,0,0,100,0,10000,10000,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 4 - set phase 2"), +-- Wants Fire +(@ENTRY*100+5,9,0,0,0,0,100,0,0,0,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 5 - Say Text 5"), +(@ENTRY*100+5,9,1,0,0,0,100,0,0,0,0,0,12,28540,1,10000,0,0,0,8,0,0,0,5552.58,5765.66,-78.0212,-3.00195,"Tipsy McManus - Script 5 - Summon Wants Fire"), +(@ENTRY*100+5,9,2,0,0,0,100,0,10000,10000,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 5 - Set Phase 2"), +-- Task successful +(@ENTRY*100+6,9,0,0,0,0,100,0,0,0,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 6 - Say Text 6"), +-- End failure +(@ENTRY*100+7,9,0,0,0,0,100,0,0,0,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 7 - Say Text 7"), +(@ENTRY*100+7,9,1,0,0,0,100,0,0,0,0,0,22,4,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 7 - Set Phase 4"), +-- Completion script +(@ENTRY*100+8,9,0,0,0,0,100,0,0,0,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 8 - Say Text 8"), +(@ENTRY*100+8,9,1,0,0,0,100,0,0,0,0,0,50,190643,30000,0,0,0,0,8,0,0,0,5547.13525,5767.09961,-78.025856,2.25147343,"Tipsy McManus - Script 8 - Summon Thunderbrew's Jungle Punch"), +(@ENTRY*100+8,9,2,0,0,0,100,0,0,0,0,0,22,4,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tipsy McManus - Script 8 - Set Phase 4"); + + +-- NPC talk text for "Tipsy" McManus +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Beginning the distillation in 5 seconds.",12,0,100,0,0,0,"Tipsy McManus"), +(@ENTRY,1,0,"Add another orange, quickly!",12,0,100,25,0,0,"Tipsy McManus"), +(@ENTRY,2,0,"Put a papaya in the still!",12,0,100,25,0,0,"Tipsy McManus"), +(@ENTRY,3,0,"Add bananas!",12,0,100,25,0,0,"Tipsy McManus"), +(@ENTRY,4,0,"Pressure's too high! Open the pressure valve!",12,0,100,5,0,0,"Tipsy McManus"), +(@ENTRY,5,0,"The still needs heat! Light the brazier!",12,0,100,5,0,0,"Tipsy McManus"), +(@ENTRY,6,0,"Good job! Keep your eyes open, now.",12,0,100,4,0,0,"Tipsy McManus"), +(@ENTRY,6,1,"That'll do. Never know what it'll need next...",12,0,100,4,0,0,"Tipsy McManus"), +(@ENTRY,6,2,"Nicely handled! Stay on your toes!",12,0,100,4,0,0,"Tipsy McManus"), +(@ENTRY,6,3,"Well done! Be ready for anything!",12,0,100,4,0,0,"Tipsy McManus"), +(@ENTRY,7,0,"It's no good! I'm shutting it down...",12,0,100,0,0,0,"Tipsy McManus"), +(@ENTRY,8,0,"We've done it! Come get the cask.",12,0,100,0,0,0,"Tipsy McManus"); + +-- Add Gossip option +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`) VALUES +(@GOSSIP,0,0,"I'm ready to start the distillation, uh, Tipsy.",1,1); + +-- Add gossip_menu_option condition +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`) VALUES +(15,@GOSSIP,0,9,12644); -- Quest "Still At It" Has to be active and incomplete + +-- Update creature_template for Wants XX targets +UPDATE `creature_template` SET `minlevel`=70,`maxlevel`=70,`exp`=2,`unit_class`=2,`unit_flags`=`unit_flags`|33554432,`flags_extra`=`flags_extra`|128,`InhabitType`=4,`family`=23,`type`=3 WHERE `entry` IN (28535,28536,28537,28539,28540); + +-- Wants Orange SAI +SET @ENTRY := 28535; +SET @SPELL_ORANGE := 51931; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_ORANGE,0,0,0,45,1,1,0,0,0,0,19,28566,0,0,0,0,0,0,"Wants Orange - On Spellhit - Set Data McManus"); + +-- Wants Papaya SAI +SET @ENTRY := 28536; +SET @SPELL_PAPAYA := 51933; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_PAPAYA,0,0,0,45,1,1,0,0,0,0,19,28566,0,0,0,0,0,0,"Wants Papaya - On Spellhit - Set Data McManus"); + +-- Wants Bananas SAI +SET @ENTRY := 28537; +SET @SPELL_BANANAS := 51932; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_BANANAS,0,0,0,45,1,1,0,0,0,0,19,28566,0,0,0,0,0,0,"Wants Bananas - On Spellhit - Set Data McManus"); + +-- Steam Valve SAI +SET @ENTRY := 28539; +SET @SPELL_STEAM_BLAST := 51920; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,11,@SPELL_STEAM_BLAST,0,0,0,0,0,1,0,0,0,0,0,0,0,"Steam Valve - Out Of Combat - Cast Cosmetic Steam Blast"), +(@ENTRY,0,1,0,6,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,28566,0,0,0,0,0,0,"Steam Valve - On Death - Set Data McManus"); + +-- Pressure Valve SAI +SET @ENTRY := 190635; +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=@ENTRY; +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 +(@ENTRY,1,0,0,64,0,100,0,500,500,0,0,51,0,0,0,0,0,0,19,28539,0,0,0,0,0,0,"Pressure Valve - On Gossip Hello - Kill Steam Valve"); + +-- Wants Fire SAI +SET @ENTRY := 28540; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,6,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,28566,0,0,0,0,0,0,"Wants Fire - On Death - Set Data McManus"); + +-- Brazier SAI +SET @ENTRY := 190636; +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,1,0,0,64,0,100,0,500,500,0,0,51,0,0,0,0,0,0,19,28540,0,0,0,0,0,0,"Brazier - On Gossip Hello - Kill Wants Fire"); + +-- Add Spell Targets +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (51931,51932,51933); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`) VALUES +(13,51931,18,1,28535), -- Toss Orange requires target Wants Orange +(13,51931,18,1,28536), -- Toss Orange requires target Wants Papaya +(13,51931,18,1,28537), -- Toss Orange requires target Wants Bananas +(13,51933,18,1,28535), -- Toss Papaya requires target Wants Orange +(13,51933,18,1,28536), -- Toss Papaya requires target Wants Papaya +(13,51933,18,1,28537), -- Toss Papaya requires target Wants Bananas +(13,51932,18,1,28535), -- Toss Bananas requires target Wants Orange +(13,51932,18,1,28536), -- Toss Bananas requires target Wants Papaya +(13,51932,18,1,28537); -- Toss Bananas requires target Wants Bananas 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/sql/updates/world/2011_10_22_06_world_sai.sql b/sql/updates/world/2011_10_22_06_world_sai.sql new file mode 100644 index 00000000000..433252f4e2d --- /dev/null +++ b/sql/updates/world/2011_10_22_06_world_sai.sql @@ -0,0 +1,19 @@ +-- Snowblind Follower SAI +SET @ENTRY := 29618; +SET @SPELL_NET := 66474; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,1,8,0,100,0,@SPELL_NET,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Snowblind Follower - On Spellhit - Say Line 0 (random)"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,33,34899,0,0,0,0,0,7,0,0,0,0,0,0,0,"Snowblind Follower - On Spellhit (Link) - Quest Credit"), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Snowblind Follower - On Spellhit (Link) - Forced Despawn"); + +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Grrrrr!",12,0,100,0,0,0,"Snowblind Follower"), +(@ENTRY,0,1,"Me not afraid!",12,0,100,0,0,0,"Snowblind Follower"), +(@ENTRY,0,2,"Net not stop me! No... net stop me.",12,0,100,0,0,0,"Snowblind Follower"), +(@ENTRY,0,3,"No kill me!",12,0,100,0,0,0,"Snowblind Follower"), +(@ENTRY,0,4,"No!",12,0,100,0,0,0,"Snowblind Follower"), +(@ENTRY,0,5,"You no take... me!",12,0,100,0,0,0,"Snowblind Follower"); diff --git a/sql/updates/world/2011_10_22_07_world_sai.sql b/sql/updates/world/2011_10_22_07_world_sai.sql new file mode 100644 index 00000000000..8e85d719cf8 --- /dev/null +++ b/sql/updates/world/2011_10_22_07_world_sai.sql @@ -0,0 +1,51 @@ +-- Hooked Net SHOULD hit this hard, fyi! +-- Sunreaver Agent SAI +SET @ENTRY := 36776; +SET @SPELL_HOOKED_NET := 59260; +SET @SPELL_SINISTER_STRIKE := 60195; +SET @SPELL_VANISH := 71400; -- Why is this called Vanish?... It teleports caster behind target +SET @SPELL_EVISCERATE := 15691; +SET @SPELL_BACKSTAB := 71410; +UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=`flags_extra`|2,`unit_class`=4 WHERE `entry`=@ENTRY; -- Civilian according to video +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sunreaver Agent - On Aggro - Say Line 0 (random)"), +(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,11,@SPELL_HOOKED_NET,0,0,0,0,0,2,0,0,0,0,0,0,0,"Sunreaver Agent - On Aggro - Cast Hooked Net"), +(@ENTRY,0,2,0,67,0,100,0,1000,3000,0,0,11,@SPELL_BACKSTAB,0,0,0,0,0,2,0,0,0,0,0,0,0,"Sunreaver Agent - Behind Target - Cast Backstab"), +(@ENTRY,0,3,0,0,0,100,0,1000,1500,3000,3000,11,@SPELL_SINISTER_STRIKE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Sunreaver Agent - In Combat - Cast Sinister Strike"), +(@ENTRY,0,4,0,0,0,100,1,4000,6000,0,0,11,@SPELL_VANISH,1,0,0,0,0,2,0,0,0,0,0,0,0,"Sunreaver Agent - In Combat - Cast Vanish"), +(@ENTRY,0,5,0,0,0,100,0,9000,13000,20000,20000,11,@SPELL_EVISCERATE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Sunreaver Agent - In Combat - Cast Eviscerate"); + +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Did you think you would escape with your life?",12,0,100,1,0,0,"Sunreaver Agent"), +(@ENTRY,0,1,"You'll never run us out of the city, Silver Covenant thug!",12,0,100,1,0,0,"Sunreaver Agent"); + +-- Silver Covenant Agent SAI +SET @ENTRY := 36774; +SET @SPELL_HOOKED_NET := 59260; +SET @SPELL_SINISTER_STRIKE := 60195; +SET @SPELL_VANISH := 71400; -- Why is this called Vanish?... It teleports caster behind target +SET @SPELL_EVISCERATE := 15691; +SET @SPELL_BACKSTAB := 71410; +UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=`flags_extra`|2,`unit_class`=4 WHERE `entry`=@ENTRY; -- Civilian according to video +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Silver Covenant Agent - On Aggro - Say Line 0 (random)"), +(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,11,@SPELL_HOOKED_NET,0,0,0,0,0,2,0,0,0,0,0,0,0,"Silver Covenant Agent - On Aggro - Cast Hooked Net"), +(@ENTRY,0,2,0,67,0,100,0,1000,3000,0,0,11,@SPELL_BACKSTAB,0,0,0,0,0,2,0,0,0,0,0,0,0,"Silver Covenant Agent - Behind Target - Cast Backstab"), +(@ENTRY,0,3,0,0,0,100,0,1000,1500,3000,3000,11,@SPELL_SINISTER_STRIKE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Silver Covenant Agent - In Combat - Cast Sinister Strike"), +(@ENTRY,0,4,0,0,0,100,1,4000,6000,0,0,11,@SPELL_VANISH,1,0,0,0,0,2,0,0,0,0,0,0,0,"Silver Covenant Agent - In Combat - Cast Vanish"), +(@ENTRY,0,5,0,0,0,100,0,9000,13000,20000,20000,11,@SPELL_EVISCERATE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Silver Covenant Agent - In Combat - Cast Eviscerate"); + +-- Texts by +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"You Sunreaver lackeys are all the same.",12,0,100,1,0,0,"Silver Covenant Agent"), +(@ENTRY,0,1,"You won't escape from us so easily!",12,0,100,1,0,0,"Silver Covenant Agent"); + +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1.5,`gender`=1 WHERE `modelid`=30438; -- Sunreaver Agent +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=30310; -- Silver Covenant Agent diff --git a/sql/updates/world/2011_10_22_08_world_sai.sql b/sql/updates/world/2011_10_22_08_world_sai.sql new file mode 100644 index 00000000000..779f659f9af --- /dev/null +++ b/sql/updates/world/2011_10_22_08_world_sai.sql @@ -0,0 +1,108 @@ +-- [Q] Tails Up +-- Apparently it won't fall asleep due to evading. We are evading because the gossip won't show if we are in combat.. -_- + +-- Frost Leopard SAI +SET @ENTRY := 29327; +SET @QUEST := 13549; +SET @GOSSIP := 54000; +SET @SPELL_RAKE := 54668; +SET @SPELL_BLOWGUN := 62105; +SET @SPELL_SLEEP := 52742; +UPDATE `creature_template` SET `AIName`='SmartAI',`npcflag`=0,`gossip_menu_id`=@GOSSIP,`faction_A`=1990,`faction_H`=1990,`unit_flags`=`unit_flags`|0 WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100,@ENTRY*100+1,@ENTRY*100+2,@ENTRY*100+3); +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 +(@ENTRY,0,0,0,0,0,100,0,1000,1000,8000,11000,11,@SPELL_RAKE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Frost Leopard - In Combat - Cast Rake"), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,2,1990,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Reset - Set Faction Back"), +(@ENTRY,0,2,0,8,0,100,1,@SPELL_BLOWGUN,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Spellhit - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,11,@SPELL_SLEEP,2,0,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Script - Cast Sleep"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Script - Set Faction Friendly"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Script - Set npc_flag Gossip"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Script - Evade"), -- The gossip only shows out of combat.. +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Script - Stop Auto Attack"), + +(@ENTRY,0,3,0,62,0,100,0,@GOSSIP,0,0,0,88,@ENTRY*100+1,@ENTRY*100+3,0,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Gossip Select - Run Random Script"), +(@ENTRY*100+1,9,0,0,0,0,100,0,0,0,0,0,36,33007,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Script 1 - Update Template Male"), +(@ENTRY*100+1,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Frost Leopard - Script 1 - Say Line 0"), +(@ENTRY*100+2,9,0,0,0,0,100,0,0,0,0,0,36,33010,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Script 2 - Update Template Female"), +(@ENTRY*100+2,9,1,0,0,0,100,0,0,0,0,0,33,33005,0,0,0,0,0,7,0,0,0,0,0,0,0,"Frost Leopard - On Script 2 - Quest Credit"), +(@ENTRY*100+2,9,2,0,0,0,100,0,0,0,0,0,29,2,0,0,0,0,0,7,0,0,0,0,0,0,0,"Frost Leopard - On Script 2 - Follow Player"), -- Apparently crediting doesn't work through this action +(@ENTRY*100+3,9,0,0,0,0,100,0,0,0,0,0,36,33007,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frost Leopard - On Script 3 - Update Template Male"), +(@ENTRY*100+3,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Frost Leopard - Script 3 - Say Line 0"); + +-- Insert gossip and static text +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=14266; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,14266); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(@GOSSIP,0,0,"Lift the frost leopard's tail to check if it's a male or a female.",1,1,0); + +-- Text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"It's an angry male!",42,0,100,0,0,0,"Male Frost Leopard"); + +-- Male Frost Leopard SAI +SET @ENTRY := 33007; +SET @SPELL_RAKE := 54668; +UPDATE `creature_template` SET `AIName`='SmartAI',`faction_A`=1990,`faction_H`=1990,`unit_flags`=`unit_flags`|0 WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,0,0,100,0,3000,4000,9000,11000,11,@SPELL_RAKE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Male Frost Leopard - In Combat - Cast Rake"); + +-- Icepaw Bear SAI +SET @ENTRY := 29319; +SET @QUEST := 13549; +SET @GOSSIP := 55000; +SET @SPELL_CLAWS_OF_ICE := 54632; +SET @SPELL_BLOWGUN := 62105; +SET @SPELL_SLEEP := 52742; +UPDATE `creature_template` SET `AIName`='SmartAI',`npcflag`=0,`gossip_menu_id`=@GOSSIP,`faction_A`=1990,`faction_H`=1990,`unit_flags`=`unit_flags`|0 WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100,@ENTRY*100+1,@ENTRY*100+2,@ENTRY*100+3); +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 +(@ENTRY,0,0,0,0,0,100,0,1000,1000,8000,11000,11,@SPELL_CLAWS_OF_ICE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Icepaw Bear - In Combat - Cast Claws of Ice"), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,2,1990,0,0,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Reset - Set Faction Back"), +(@ENTRY,0,2,0,8,0,100,1,@SPELL_BLOWGUN,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Spellhit - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,11,@SPELL_SLEEP,2,0,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Script - Cast Sleep"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Script - Set Faction Friendly"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Script - Set npc_flag Gossip"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Script - Evade"), -- The gossip only shows out of combat.. +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Script - Stop Auto Attack"), + +(@ENTRY,0,3,0,62,0,100,0,@GOSSIP,0,0,0,88,@ENTRY*100+1,@ENTRY*100+3,0,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Gossip Select - Run Random Script"), +(@ENTRY*100+1,9,0,0,0,0,100,0,0,0,0,0,36,33008,0,0,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Script 1 - Update Template Male"), +(@ENTRY*100+1,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Icepaw Bear - Script 1 - Say Line 0"), +(@ENTRY*100+2,9,0,0,0,0,100,0,0,0,0,0,36,33011,0,0,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Script 2 - Update Template Female"), +(@ENTRY*100+2,9,1,0,0,0,100,0,0,0,0,0,33,33006,0,0,0,0,0,7,0,0,0,0,0,0,0,"Icepaw Bear - On Script 2 - Quest Credit"), +(@ENTRY*100+2,9,2,0,0,0,100,0,0,0,0,0,29,2,0,0,0,0,0,7,0,0,0,0,0,0,0,"Icepaw Bear - On Script 2 - Follow Player"), -- Apparently crediting doesn't work through this action +(@ENTRY*100+3,9,0,0,0,0,100,0,0,0,0,0,36,33008,0,0,0,0,0,1,0,0,0,0,0,0,0,"Icepaw Bear - On Script 3 - Update Template Male"), +(@ENTRY*100+3,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Icepaw Bear - Script 3 - Say Line 0"); + +-- Insert gossip and static text +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=14267; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,14267); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(@GOSSIP,0,0,"Lift the icepaw bear's tail to check if it's a male or a female.",1,1,0); + +-- Male Icepaw Bear SAI +SET @ENTRY := 33008; +SET @SPELL_CLAWS_OF_ICE := 54632; +UPDATE `creature_template` SET `AIName`='SmartAI',`faction_A`=1990,`faction_H`=1990,`unit_flags`=`unit_flags`|0 WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,0,0,100,0,3000,4000,9000,11000,11,@SPELL_CLAWS_OF_ICE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Male Icepaw Bear - In Combat - Cast Claws of Ice"); + +-- Text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"It's an angry male!",42,0,100,0,0,0,"Male Icepaw Bear"); + +-- Only show first gossip if player is on quest Tails Up +DELETE FROM `conditions` WHERE `SourceGroup`=@GOSSIP AND `ConditionValue1`=@QUEST; +DELETE FROM `conditions` WHERE `SourceEntry` IN (@SPELL_BLOWGUN) AND `ConditionValue1` IN (29327,29319); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP,0,0,9,@QUEST,0,0,0,'',"Only show gossip if player is on quest Tails Up"), +(17,0,@SPELL_BLOWGUN,0,19,29327,0,0,0,'',"Spell To'kini's Blowgun can only be cast at Frost Leopard"), +(17,0,@SPELL_BLOWGUN,1,19,29319,0,0,0,'',"Spell To'kini's Blowgun can only be cast at Icepaw Bear"); diff --git a/sql/updates/world/2011_10_22_09_world_sai.sql b/sql/updates/world/2011_10_22_09_world_sai.sql new file mode 100644 index 00000000000..2bf96f951c6 --- /dev/null +++ b/sql/updates/world/2011_10_22_09_world_sai.sql @@ -0,0 +1,47 @@ +-- Talbuk Doe SAI +SET @ENTRY := 20610; -- Talbuk Doe +SET @SPELL_GORE := 32019; -- Gore +SET @SPELL_TAG := 35771; -- Tag Subbued Talbuk +SET @SPELL_TAG_CREDIT := 40347; -- Talbuk Tagging Credit +SET @SPELL_SLEEPING := 42648; -- Sleeping Sleep +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - On Aggro - Say text 0"), +(@ENTRY,0,1,0,0,0,100,0,1000,1000,8000,11000,11,@SPELL_GORE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Talbuk Doe - In Combat - Cast Gore"), +(@ENTRY,0,2,0,2,0,100,1,0,20,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - At 20% HP - Say Text 1"), +(@ENTRY,0,3,0,8,0,100,0,@SPELL_TAG,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - On Spellhit - Run Script"), +(@ENTRY,0,4,0,11,0,100,0,0,0,0,0,19,386,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - On Respawn - Remove Unit Flag"), +(@ENTRY*100,9,0,0,0,0,100,1,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - Script - Evade"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,33,20982,0,0,0,0,0,7,0,0,0,0,0,0,0,"Talbuk Doe - Script - Give Quest Credit"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,18,386,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - Script - Set Unit Flag"),-- Make it un-attackable in any way +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,11,@SPELL_SLEEPING,1,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - Script - Cast Sleeping Sleep"); +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"%s calls for the aid of a nearby male!",16,0,100,0,0,0,"Talbuk Doe"), +(@ENTRY,1,0,"%s seems to have weakened.",16,0,100,0,0,0,"Talbuk Doe"); + +-- Talbuk Sire SAI +SET @ENTRY := 20777; -- Talbuk Sire +SET @SPELL_STOMP := 32023; -- Hoof Stomp +SET @SPELL_TAG := 35771; -- Tag Subbued Talbuk +SET @SPELL_SLEEPING := 42648; -- Sleeping Sleep +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,0,0,100,0,1000,1000,8000,11000,11,@SPELL_STOMP,0,0,0,0,0,2,0,0,0,0,0,0,0,"Talbuk Sire - In Combat - Cast Hoof Stomp"), +(@ENTRY,0,1,0,2,0,100,1,0,20,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - At 20% HP - Say Text 0"), +(@ENTRY,0,2,0,8,0,100,0,@SPELL_TAG,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - On Spellhit - Run Script"), +(@ENTRY,0,3,0,11,0,100,0,0,0,0,0,19,386,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - On Respawn - Remove Unit Flag"), +(@ENTRY*100,9,0,0,0,0,100,1,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Ancient Orc Ancestor - Script - Evade"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,11,@SPELL_TAG_CREDIT,2,0,0,0,0,7,0,0,0,0,0,0,0,"Talbuk Sire - Script - Give Killcredit"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,33,20982,0,0,0,0,0,7,0,0,0,0,0,0,0,"Talbuk Sire - Script - Give Quest Credit"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,18,386,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - Script - Set Unit Flag"),-- Make it un-attackable in any way +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,11,@SPELL_SLEEPING,1,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - Script - Cast Sleeping Sleep"); +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"%s seems to have weakened.",16,0,100,0,0,0,"Talbuk Sir"); diff --git a/sql/updates/world/2011_10_22_10_world_sai.sql b/sql/updates/world/2011_10_22_10_world_sai.sql new file mode 100644 index 00000000000..3e53d2a3757 --- /dev/null +++ b/sql/updates/world/2011_10_22_10_world_sai.sql @@ -0,0 +1,28 @@ +-- Farahlon Lasher SAI +SET @ENTRY := 20774; +SET @SPELL_ENTANGLING_ROOTS := 12747; +SET @SPELL_FRENZY := 3019; +SET @SPELL_FLANKING_GROWTH := 36604; +SET @SPELL_ENERGY_FIELD_MODULATOR := 35772; +UPDATE `creature_template` SET `AIName`='SmartAI',`dmgschool`=3 WHERE `entry`=@ENTRY; +DELETE FROM `creature` WHERE `id` IN (21331,20983); -- Those are supposed to be summoned +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,11,@SPELL_FLANKING_GROWTH,0,0,0,0,0,2,0,0,0,0,0,0,0,"Farahlon Lasher - On Aggro - Cast Flanking Growth"), +(@ENTRY,0,1,0,0,0,100,0,20000,20000,25000,25000,11,@SPELL_ENTANGLING_ROOTS,0,0,0,0,0,2,0,0,0,0,0,0,0,"Farahlon Lasher - In Combat - Cast Entanglin Roots"), +(@ENTRY,0,2,0,8,0,100,0,@SPELL_ENERGY_FIELD_MODULATOR,0,0,0,36,20983,0,0,0,0,0,1,0,0,0,0,0,0,0,"Farahlon Lasher - On Spellhit - Change Entry To Mutated"), +(@ENTRY,0,3,0,2,0,100,1,0,30,0,0,11,@SPELL_FRENZY,1,0,0,0,0,1,0,0,0,0,0,0,0,"Farahlon Lasher - At 30% HP - Cast Frenzy"), +(@ENTRY,0,4,0,2,0,100,1,0,30,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Farahlon Lasher - At 30% HP - Say Line 0"); +-- Text +DELETE FROM `creature_text` WHERE `entry` IN (@ENTRY,20983); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"%s goes into a frenzy!",16,0,100,0,0,0,"Farahlon Lasher"), +(20983,0,0,"%s goes into a frenzy!",16,0,100,0,0,0,"Mutated Farahlon Lasher"); + +-- To prevent being able to use the quest item more than once per creature +-- Removing previous entry which didn't work +DELETE FROM `conditions` WHERE `SourceEntry`=35772 AND `ConditionValue2`=20774; +DELETE FROM `conditions` WHERE `SourceEntry`=29818 AND `ConditionValue2`=20774; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(18,0,29818,0,24,1,20774,0,0,'',"Item Energy Field Modulator can only be used if target is Farahlon Lasher"); diff --git a/sql/updates/world/2011_10_22_11_world_sai.sql b/sql/updates/world/2011_10_22_11_world_sai.sql new file mode 100644 index 00000000000..dfae9ae383a --- /dev/null +++ b/sql/updates/world/2011_10_22_11_world_sai.sql @@ -0,0 +1,17 @@ +-- Withered Corpse SAI +SET @ENTRY := 20561; +SET @SPELL_PROTECTORATE_IGNITER := 35372; +UPDATE `creature_template` SET `AIName`='SmartAI',`unit_flags`=`unit_flags`|388 WHERE `entry`=@ENTRY; +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@ENTRY,0,0,1,0,"29266"); -- Emote death spell (Permanent Feign Death) +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,8,0,100,0,@SPELL_PROTECTORATE_IGNITER,0,0,0,33,20561,0,0,0,0,0,7,0,0,0,0,0,0,0,"Withered Corpse - On Spellhit - Give Quest Credit"), +(@ENTRY,0,1,0,8,0,100,0,@SPELL_PROTECTORATE_IGNITER,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Withered Corpse - On Spellhit - Die"); + +-- Protector Igniter can only be used inside Access Shaft Zeon +-- We are not removing the previous one, just adding an extra check +DELETE FROM `conditions` WHERE `SourceEntry`=35372 AND `ConditionValue1`=3880; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,35372,0,23,3880,0,0,0,'',"Protector Igniter can only be used inside Access Shaft Zeon"); diff --git a/sql/updates/world/2011_10_22_12_world_sai.sql b/sql/updates/world/2011_10_22_12_world_sai.sql new file mode 100644 index 00000000000..c405377f588 --- /dev/null +++ b/sql/updates/world/2011_10_22_12_world_sai.sql @@ -0,0 +1,21 @@ +-- Invis BE Ballista SAI +SET @ENTRY := 19723; +SET @SPELL_BURN_BLOOD_ELF := 34526; +UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=`flags_extra`|130 WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_BURN_BLOOD_ELF,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Invis BE Ballista - On Spellhit - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,50,181915,20000,0,0,0,0,1,0,0,0,0,0,0,0,"Invis BE Ballista - Script - Summon Blaze (fire)"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,8,0,0,0,0,0,0,0,"Invis BE Ballista - Script - Despawn"); + +-- Invis BE Tent SAI +SET @ENTRY := 19724; +SET @SPELL_BURN_BLOOD_ELF := 34526; +UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=`flags_extra`|130 WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_BURN_BLOOD_ELF,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Invis BE Tent - On Spellhit - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,50,181915,20000,0,0,0,0,1,0,0,0,0,0,0,0,"Invis BE Tent - Script - Summon Blaze (fire)"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,8,0,0,0,0,0,0,0,"Invis BE Tent - Script - Despawn"); diff --git a/sql/updates/world/2011_10_22_13_world_sai.sql b/sql/updates/world/2011_10_22_13_world_sai.sql new file mode 100644 index 00000000000..17f2efd7b5f --- /dev/null +++ b/sql/updates/world/2011_10_22_13_world_sai.sql @@ -0,0 +1,62 @@ +-- Windyreed Quest Credit (Hut 01) SAI +SET @ENTRY := 18142; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `gameobject` WHERE `id`=182146; -- Remove already spawned hut fires +SET @SPELL_LIVING_FIRE := 31927; -- Living Fire +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_LIVING_FIRE,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windyreed Quest Credit - On Spellhit - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1850.186401,6378.753906,49.132702,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1843.883911,6373.384277,46.005417,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1845.056030,6383.819336,56.662624,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1845.103638,6391.827148,53.700901,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1831.184937,6391.026855,45.671902,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,6,0,0,0,100,0,0,0,0,0,51,0,0,0,0,0,0,10,60165,17139,0,0,0,0,0,"Windyreed Quest Credit - Script - Kill Creature Inside Burning Hut"); + +-- Windyreed Quest Credit (Hut 02) SAI +SET @ENTRY := 18143; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +SET @SPELL_LIVING_FIRE := 31927; -- Living Fire +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_LIVING_FIRE,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windyreed Quest Credit - On Spellhit - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1915.344116,6350.488770,52.229897,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1907.135986,6353.901367,48.899532,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1911.698730,6354.161133,58.254566,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1926.308350,6360.901855,57.298611,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1921.458862,6367.373047,59.892593,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,6,0,0,0,100,0,0,0,0,0,51,0,0,0,0,0,0,10,60159,17139,0,0,0,0,0,"Windyreed Quest Credit - Script - Kill Creature Inside Burning Hut"); + +-- Windyreed Quest Credit (Hut 03) SAI +SET @ENTRY := 18144; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +SET @SPELL_LIVING_FIRE := 31927; -- Living Fire +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_LIVING_FIRE,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windyreed Quest Credit - On Spellhit - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1969.078369,6278.307129,56.866646,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1977.147461,6277.312988,59.912029,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1974.763306,6269.175781,51.401920,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1970.424805,6273.501953,61.741539,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,51,0,0,0,0,0,0,10,60157,17139,0,0,0,0,0,"Windyreed Quest Credit - Script - Kill Creature Inside Burning Hut"); + +-- Windyreed Quest Credit (Big Hut) SAI +SET @ENTRY := 18110; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +SET @SPELL_LIVING_FIRE := 31927; -- Living Fire +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_LIVING_FIRE,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windyreed Quest Credit - On Spellhit - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1816.939941,6283.669922,61.357101,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1816.94,6283.67,61.3571,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1819.71,6305.89,63.4012,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1819.55,6298.08,73.4331,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1801.45,6308.03,59.2728,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1808.88,6307.05,72.4877,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,6,0,0,0,100,0,0,0,0,0,50,182146,20000,0,0,0,0,8,0,0,0,-1794.54,6300.6,71.2263,0,"Windyreed Quest Credit - Script - Summon Hut Fire (Large)"), +(@ENTRY*100,9,7,0,0,0,100,0,0,0,0,0,51,0,0,0,0,0,0,10,60166,17139,0,0,0,0,0,"Windyreed Quest Credit - Script - Kill Creatures Inside Burning Hut"), +(@ENTRY*100,9,8,0,0,0,100,0,0,0,0,0,51,0,0,0,0,0,0,10,60167,17139,0,0,0,0,0,"Windyreed Quest Credit - Script - Kill Creatures Inside Burning Hut"); diff --git a/sql/updates/world/2011_10_22_14_world_sai.sql b/sql/updates/world/2011_10_22_14_world_sai.sql new file mode 100644 index 00000000000..e64b76711b8 --- /dev/null +++ b/sql/updates/world/2011_10_22_14_world_sai.sql @@ -0,0 +1,56 @@ +-- Wazat SAI +SET @ENTRY := 19035; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,1,0,100,0,20000,40000,60000,80000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wazat - OOC - Say Text 0"), +(@ENTRY,0,1,0,1,0,100,0,60000,80000,80000,110000,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wazat - OOC - Say Text 1"), +(@ENTRY,0,2,0,1,0,100,0,110000,130000,150000,170000,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wazat - OOC - Say Text 2"); +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Oh sweet, delicious, spotted eggs - you will be mine...",12,0,100,0,0,0,"Wazat"), +(@ENTRY,1,1,"If only I could get this blasted machine working!",12,0,100,0,0,0,"Wazat"), +(@ENTRY,2,2,"They look so delicious...",12,0,100,0,0,0,"Wazat"); + +-- Wazat pathing: 11365 +SET @GUID := 68343; +SET @PATH := @GUID * 10; +UPDATE `creature` SET `MovementType`=2,`position_x`=-2428.169922,`position_y`=6885.750000,`position_z`=4.196100 WHERE `guid`=@GUID; +DELETE FROM `creature_addon` WHERE `guid`=@GUID; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@GUID,@PATH,1,0,''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-2428.704590,6890.355469,4.297834,20000,0,0,100,0), +(@PATH,2,-2434.878418,6889.507813,4.266439,20000,0,0,100,0), +(@PATH,3,-2428.169922,6885.750000,4.196100,20000,0,0,100,0); + +-- Windroc Matriarch SAI +SET @ENTRY := 19055; +SET @SPELL_EAGLE_CLAW := 30285; -- Eagle Claw +SET @SPELL_WING_BUFFET := 32914; -- Wing Buffet +UPDATE `creature_template` SET `AIName`='SmartAI',`InhabitType`=4,`spell1`=0 WHERE `entry`=@ENTRY; -- Always in air, of course - really? Albino Snake as mind control ability? +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0, 'Windroc Matriarch - Start WP movement'), +(@ENTRY,0,1,0,1,0,100,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Windroc Matriarch - On Spawn - Emote Text 0"), +(@ENTRY,0,2,0,40,0,100,0,3,@ENTRY,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Windroc Matriarch - Load script 1 at WP 3"), +(@ENTRY,0,3,0,0,0,100,0,4000,4000,6000,6000,11,@SPELL_EAGLE_CLAW,0,0,0,0,0,2,0,0,0,0,0,0,0,"Windroc Matriarch - In Combat - Cast Eagle Claw"), +(@ENTRY,0,4,0,0,0,100,0,7000,8000,11000,14000,11,@SPELL_WING_BUFFET,0,0,0,0,0,2,0,0,0,0,0,0,0,"Windroc Matriarch - In Combat - Cast Wing Buffet"), +-- Script 1 +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,54,1000000000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Windroc Matriarch - Script - Pause Path'), +(@ENTRY*100,9,1,0,0,0,100,1,0,0,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,"Windroc Matriarch - On Script - Set Faction Aggressive"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'Windroc Matriarch - Script - Remove unit_flag OOC_NOT_ATTACKABLE'), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,20,1,0,0,0,0,0,21,0,0,0,0,0,0,0,'Windroc Matriarch - Script - Attack Nearest Player'); +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Emote blabla",16,0,100,0,0,0,"Windroc Matriarch"); +-- Waypoints +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,-2422.512695,6910.643555,20.124718,'Windroc Matriarch WP 1'), +(@ENTRY,2,-2420.722168,6901.208008,15.225160,'Windroc Matriarch WP 2'), +(@ENTRY,3,-2400.643066,6887.521973,-1.384245,'Windroc Matriarch WP 3'); diff --git a/sql/updates/world/2011_10_22_15_world_core_script_support.sql b/sql/updates/world/2011_10_22_15_world_core_script_support.sql new file mode 100644 index 00000000000..1d1c59c69d0 --- /dev/null +++ b/sql/updates/world/2011_10_22_15_world_core_script_support.sql @@ -0,0 +1,36 @@ +-- Kurenai Captive +UPDATE `creature_template` SET `ScriptName`='npc_kurenai_captive' WHERE `entry`=18209; +DELETE FROM `creature_template_addon` WHERE `entry`=18209; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (18209,0,0,8,0,0,''); -- Kneel +DELETE FROM `script_waypoint` WHERE `entry`=18209; +INSERT INTO `script_waypoint` (`entry`,`pointid`,`location_x`,`location_y`,`location_z`,`waittime`,`point_comment`) VALUES +(18209,1,-1518.593872,8469.956055,-4.101756,0,''), +(18209,2,-1511.784546,8480.531250,-4.033919,0,''), +(18209,3,-1513.447754,8509.764698,-0.109888,0,''), +(18209,4,-1498.857788,8508.805664,0.844676,0,''), +(18209,5,-1454.215088,8495.808594,4.912439,0,''), +(18209,6,-1437.483521,8504.165039,6.879123,0,''), +(18209,7,-1382.29,8539.87,11.139,7500,''), +(18209,8,-1361.22,8521.44,11.144,0,''), +(18209,9,-1324.8,8510.69,13.05,0,''), +(18209,10,-1312.08,8492.71,14.235,0,''); + +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000482 AND -1000488; +DELETE FROM `creature_text` WHERE `entry` IN (18209,18210); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +-- Maghar Captive +(18210,0,0,"Look out!",12,0,100,0,0,0,"Maghar Captive"), +(18210,1,0,"Don't let them escape! Kill the strong one first!",12,0,100,0,0,0,"Maghar Captive"), +(18210,2,0,"More of them are coming! Watch out!",12,0,100,0,0,0,"Maghar Captive"), +(18210,3,0,"Where do you think you're going? Kill them all!",12,0,100,0,0,0,"Maghar Captive"), +(18210,4,0,"Ride the lightning, filth!",12,0,100,0,0,0,"Maghar Captive"), +(18210,5,0,"FROST SHOCK!",14,0,100,0,0,0,"Maghar Captive"), +(18210,6,0,"It is best that we split up now, in case they send more after us. Hopefully one of us will make it back to Garrosh. Farewell, stranger.",12,0,100,0,0,0,"Maghar Captive"), +-- Kurenai Captive +(18209,0,0,"Look out!",12,0,100,0,0,0,"Kurenai Captive"), +(18209,1,0,"Don't let them escape! Kill the strong one first!",12,0,100,0,0,0,"Kurenai Captive"), +(18209,2,0,"More of them are coming! Watch out!",12,0,100,0,0,0,"Kurenai Captive"), +(18209,3,0,"Where do you think you're going? Kill them all!",12,0,100,0,0,0,"Kurenai Captive"), +(18209,4,0,"Ride the lightning, filth!",12,0,100,0,0,0,"Kurenai Captive"), +(18209,5,0,"FROST SHOCK!",14,0,100,0,0,0,"Kurenai Captive"), +(18209,6,0,"Up ahead is the road to Telaar. We will split up when we reach the fork as they will surely send more Murkblood after us. Hopefully one of us makes it back to Telaar alive.",14,0,100,0,0,0,"Kurenai Captive"); diff --git a/sql/updates/world/2011_10_22_16_world_core_script_support.sql b/sql/updates/world/2011_10_22_16_world_core_script_support.sql new file mode 100644 index 00000000000..c6049d49e19 --- /dev/null +++ b/sql/updates/world/2011_10_22_16_world_core_script_support.sql @@ -0,0 +1,10 @@ +SET @ENTRY := 18428; +UPDATE `gameobject_template` SET `ScriptName`='go_warmaul_prison' WHERE `entry` IN (182484,182486,182487,182488,182489,182490,182491,182492,182493,182494,182495,182496,182497,182498,182499,182501,182502,182503,182504); +UPDATE `quest_template` SET `ReqSpellCast1`=0 WHERE `entry`=9948; +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Death to the ogres!",12,0,100,0,0,0,"Mag'har Prisoner"), +(@ENTRY,1,1,"Many thanks, hero!",12,0,100,0,0,0,"Mag'har Prisoner"), +(@ENTRY,2,2,"One day, a hero will rise and lift the orcs up to their former glory.",12,0,100,0,0,0,"Mag'har Prisoner"), +(@ENTRY,3,3,"Spirits watch over you, $R!",12,0,100,0,0,0,"Mag'har Prisoner"), +(@ENTRY,4,4,"Thank you, $R! Your service to the Mag'har will not be forgotten.",12,0,100,0,0,0,"Mag'har Prisoner"); diff --git a/sql/updates/world/2011_10_22_17_world_conditions.sql b/sql/updates/world/2011_10_22_17_world_conditions.sql new file mode 100644 index 00000000000..db824c4ec3f --- /dev/null +++ b/sql/updates/world/2011_10_22_17_world_conditions.sql @@ -0,0 +1,5 @@ +-- Spell Place Kil'sorrow Banner can not only be cast on Warmaul Ogres +DELETE FROM `conditions` WHERE `SourceEntry` IN (32314) AND `ConditionValue2` IN (17138,18064); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,32314,0,18,1,17138,0,0,'',"Spell Place Kil'sorrow Banner can not only be cast on Warmaul Ogres"), -- Warmaul Reaver +(13,0,32314,1,18,1,18064,0,0,'',"Spell Place Kil'sorrow Banner can not only be cast on Warmaul Ogres"); -- Warmaul Shaman diff --git a/sql/updates/world/2011_10_22_18_world_misc.sql b/sql/updates/world/2011_10_22_18_world_misc.sql new file mode 100644 index 00000000000..c0c118eeb78 --- /dev/null +++ b/sql/updates/world/2011_10_22_18_world_misc.sql @@ -0,0 +1,104 @@ +-- Ancient Orc Ancestor SAI +SET @ENTRY := 18688; +SET @SPELL_SOUL_MIRROR := 34063; -- Soul Mirror +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,8,0,100,0,@SPELL_SOUL_MIRROR,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Ancient Orc Ancestor - On Spellhit - Run Script"), +(@ENTRY,0,1,0,0,0,100,0,20000,40000,60000,180000,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Ancient Orc Ancestor - Timed - Say Line (random)"), +(@ENTRY,0,2,0,6,0,100,0,0,0,0,0,12,19480,3,120000,0,0,0,1,0,0,0,0,0,0,0,"Ancient Orc Ancestor - On Death - Summon Darkened Spirit"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,"Ancient Orc Ancestor - Script - Say Line (random)"), +(@ENTRY*100,9,1,0,0,0,100,1,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Ancient Orc Ancestor - Script - Evade"), +(@ENTRY*100,9,2,0,0,0,100,1,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Ancient Orc Ancestor - Script - Prevent Combat Movement"), +(@ENTRY*100,9,3,0,0,0,100,0,2000,2000,0,0,37,19480,0,0,0,0,0,1,0,0,0,0,0,0,0,"Ancient Orc Ancestor - Script - Die"); +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Ancestors watch over you, kind one...",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,0,1,"Cease your crying! STOP!",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,0,2,"I remember everything...",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,0,3,"It cannot be...",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,0,4,"It comes for you...",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,1,0,"The spirits call... I am consumed.",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,1,1,"Cannot control... It draws me in... The void grows...",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,1,2,"It is dying. It is dying. It is dying.",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,1,3,"The cold embrace awaits...",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,1,4,"The pain is unbearable.",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,1,5,"What is happening to me?",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,1,6,"What is this trickery? I... ARGH...",12,0,100,21,0,0,"Ancient Orc Ancestor"), +(@ENTRY,1,7,"What will become of us when it falls?",12,0,100,21,0,0,"Ancient Orc Ancestor"); + +-- Voidwraith SAI +-- These are somehow summoned but can't find any info on sniffs or google.. +SET @ENTRY := 18659; +UPDATE `creature_template` SET `AIName`='SmartAI',`faction_A`=91,`faction_H`=91,`dmgschool`=5 WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +UPDATE `creature` SET `MovementType`=0,`spawndist`=0 WHERE `id`=18662; -- Ancestors +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,6,0,100,0,0,0,0,0,12,19480,3,120000,0,0,0,1,0,0,0,0,0,0,0,"Voidwraith - On Death - Summon Darkened Spirit"); + +-- Darkened Spirit SAI +SET @ENTRY := 19480; +SET @SPELL_CONSUMING_SHADOWS := 31293; -- Consuming Shadows +UPDATE `creature_template` SET `AIName`='SmartAI',`faction_A`=91,`faction_H`=91,`dmgschool`=5 WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,0,0,100,0,5000,7000,11000,15000,11,@SPELL_CONSUMING_SHADOWS,0,0,0,0,0,2,0,0,0,0,0,0,0,"Darkened Spirit - In Combat - Cast Consuming Shadows"), +(@ENTRY,0,1,0,6,0,100,0,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkened Spirit - Force Despawn 5 Seconds After Death"), +(@ENTRY,0,2,0,1,0,100,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Darkened Spirit - Timed - Say Line"); +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"What... What have I become? Arrrgghhh...",12,0,100,21,0,0,"Darkened Spirit"); + +-- Spell Soul Mirror can only be cast at Ancient Orc Spectator +DELETE FROM `conditions` WHERE `SourceEntry`=34063 AND `ConditionValue2`=18688; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,34063,0,18,1,18688,0,0,'',"Spell Soul Mirror can only be cast at Ancient Orc Spectator"); + +-- these still need waypoints and proper aura +DELETE FROM `creature` WHERE `id`=18688; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(66946,18688,530,1,1,0,0,-2225.73,8586.74,-10.361,0.261799,300,0,0,6542,0,0,0,0,0), +(66947,18688,530,1,1,0,0,-1452.95,8533.52,12.8692,3.33358,300,0,0,6542,0,0,0,0,0), +(14337,18688,530,1,1,0,0,-1637.01,8569.54,-12.3352,5.65003,300,0,0,6326,0,0,0,0,0), +(14338,18688,530,1,1,0,0,-2300.29,8571.08,-22.0957,5.65003,300,0,0,6326,0,0,0,0,0), +(14339,18688,530,1,1,0,0,-2407.95,8655.04,-19.7505,5.65003,300,0,0,6542,0,0,0,0,0), +(14340,18688,530,1,1,0,0,-2530.94,8629.31,-25.5884,5.65003,300,0,0,6326,0,0,0,0,0), +(14341,18688,530,1,1,0,0,-2571.84,8558.23,-33.6043,5.65003,300,0,0,6542,0,0,0,0,0), +(14342,18688,530,1,1,0,0,-2218.21,8513.48,-17.1368,5.65003,300,0,0,6542,0,0,0,0,0), +(14343,18688,530,1,1,0,0,-2114.42,8743.48,11.699,5.65003,300,0,0,6326,0,0,0,0,0), +(14977,18688,530,1,1,0,0,-2017.31,8743.44,19.5169,5.65003,300,0,0,6542,0,0,0,0,0), +(14978,18688,530,1,1,0,0,-1812.61,8813.18,30.2393,6.13478,300,0,0,6326,0,0,0,0,0), +(14979,18688,530,1,1,0,0,-1750.87,8877.25,31.67,6.13478,300,0,0,6326,0,0,0,0,0), +(14980,18688,530,1,1,0,0,-1539.61,8686.33,24.643,6.13478,300,0,0,6326,0,0,0,0,0), +(14981,18688,530,1,1,0,0,-1653.31,8494.49,-12.8156,6.13478,300,0,0,6542,0,0,0,0,0), +(14982,18688,530,1,1,0,0,-1579.32,8426.67,-9.33804,6.13478,300,0,0,6326,0,0,0,0,0), +(14983,18688,530,1,1,0,0,-1040.87,7895.8,22.8202,6.13478,300,0,0,6326,0,0,0,0,0), +(14984,18688,530,1,1,0,0,-1059.54,7750.35,25.8758,6.13478,300,0,0,6326,0,0,0,0,0), +(14985,18688,530,1,1,0,0,-908.965,7783.44,40.1036,6.13478,300,0,0,6326,0,0,0,0,0), +(20556,18688,530,1,1,0,0,-886.413,7824.75,40.0754,6.13478,300,0,0,6542,0,0,0,0,0), +(21776,18688,530,1,1,0,0,-878.863,7881.25,38.6467,6.13478,300,0,0,6326,0,0,0,0,0), +(23111,18688,530,1,1,0,0,-1866.27,8098.74,-20.3459,6.13478,300,0,0,6542,0,0,0,0,0), +(24670,18688,530,1,1,0,0,-2106.82,8191.13,-15.5604,6.13478,300,0,0,6542,0,0,0,0,0), +(24761,18688,530,1,1,0,0,-2084.75,8286.22,-11.4935,6.13478,300,0,0,6542,0,0,0,0,0), +(24794,18688,530,1,1,0,0,-2206.14,8306.9,-26.191,6.13478,300,0,0,6542,0,0,0,0,0), +(25100,18688,530,1,1,0,0,-2256,8478.68,-24.6155,6.13478,300,0,0,6542,0,0,0,0,0), +(26559,18688,530,1,1,0,0,-2336.12,8477.34,-30.3842,6.13478,300,0,0,6326,0,0,0,0,0), +(26564,18688,530,1,1,0,0,-2350.53,8641.59,-15.5674,6.13478,300,0,0,6326,0,0,0,0,0), +(31807,18688,530,1,1,0,0,-2379.14,8531.65,-28.7321,6.13478,300,0,0,6326,0,0,0,0,0), +(31833,18688,530,1,1,0,0,-2411.61,8492.45,-33.4541,6.13478,300,0,0,6542,0,0,0,0,0), +(32072,18688,530,1,1,0,0,-2416.02,8330.76,-37.6002,6.13478,300,0,0,6542,0,0,0,0,0), +(40475,18688,530,1,1,0,0,-2336.04,8288.74,-36.3567,1.72398,300,0,0,6326,0,0,0,0,0), +(40476,18688,530,1,1,0,0,-2336.11,8225.27,-35.7699,1.72398,300,0,0,6326,0,0,0,0,0), +(40703,18688,530,1,1,0,0,-2258.45,8221.08,-31.2193,3.93488,300,0,0,6326,0,0,0,0,0), +(40716,18688,530,1,1,0,0,-2203.79,8149.55,-25.1002,3.93488,300,0,0,6326,0,0,0,0,0), +(40725,18688,530,1,1,0,0,-2184.8,8029.08,-17.6373,3.93488,300,0,0,6542,0,0,0,0,0), +(40727,18688,530,1,1,0,0,-2297.12,7848.94,-30.4255,3.93488,300,0,0,6326,0,0,0,0,0), +(42893,18688,530,1,1,0,0,-2544.55,7818.57,-45.0012,3.93488,300,0,0,6326,0,0,0,0,0), +(45204,18688,530,1,1,0,0,-2555.36,7930.22,-55.675,3.93488,300,0,0,6542,0,0,0,0,0), +(46570,18688,530,1,1,0,0,-2622.32,7987.03,-48.9066,3.93488,300,0,0,6542,0,0,0,0,0), +(46819,18688,530,1,1,0,0,-2126.06,8148.39,-15.8518,3.93488,300,0,0,6326,0,0,0,0,0); diff --git a/sql/updates/world/2011_10_22_19_world_sai.sql b/sql/updates/world/2011_10_22_19_world_sai.sql new file mode 100644 index 00000000000..bb873c461ea --- /dev/null +++ b/sql/updates/world/2011_10_22_19_world_sai.sql @@ -0,0 +1,20 @@ +-- Quest 12860, 12927 "Data Mining" +SET @CREDIT := 29752; +SET @SPELL_CREDIT := 59728; +SET @SPELL := 55161; +SET @NPC := 29746; + +UPDATE `creature_template` SET `AIName`='SmartAI', `InhabitType`=7 WHERE `entry`=@NPC; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC 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`,`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 +(@NPC,0,0,1,8,0,100,0,@SPELL_CREDIT,0,0,0,33,@CREDIT,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Databank Core - On spell Retrieve Data hit - Give kill credit for quest Data Mining'), +(@NPC,0,1,0,61,0,100,0,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Databank Core - On spell Retrieve Data hit - Despawn (Linked)'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=@SPELL; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@SPELL; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=@SPELL_CREDIT; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@SPELL_CREDIT; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,@SPELL,0,29,@NPC,20,0,0, '', 'Spell Retrieve Data will only be cast near Databank'), +(13,0,@SPELL,0,18,1,@NPC,0,0, '', 'Spell Retrieve Data does only target Databank'); diff --git a/sql/updates/world/2011_10_23_00_world_sai.sql b/sql/updates/world/2011_10_23_00_world_sai.sql new file mode 100644 index 00000000000..0d90c2ac9ce --- /dev/null +++ b/sql/updates/world/2011_10_23_00_world_sai.sql @@ -0,0 +1,57 @@ +-- Horde + +-- Fix quest 8359 "Flexing for Nougat" +DELETE FROM `smart_scripts` WHERE `entryorguid`=6929 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`,`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 +(6929,0,0,1,62,0,100,0,441,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Gryshka - On gossip option 0 select - Close gossip'), +(6929,0,1,0,61,0,100,0,0,0,0,0,85,24751,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Gryshka - On gossip option 0 select - Player cast Trick or Treat on self'), +(6929,0,2,0,22,0,100,0,41,0,0,0,33,6929,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Gryshka - On flex emote - Give kill credit'); + +-- Fix quest 8358 "Incoming Gundrop" +UPDATE creature_template SET `AIName`= 'SmartAI' WHERE `entry`=11814; +DELETE FROM `smart_scripts` WHERE `entryorguid`=11814 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`,`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 +(11814,0,1,0,22,0,100,0,264,0,0,0,33,11814,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Kali Remik - On train emote - Give kill credit'); + +-- Fix quest 8354 "Chicken Clucking for a Mint" +DELETE FROM `smart_scripts` WHERE `entryorguid`=6741 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`,`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 +(6741,0,0,1,62,0,100,0,348,2,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Norman - On gossip option 2 select - Close gossip'), +(6741,0,1,0,61,0,100,0,0,0,0,0,85,24751,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Norman - On gossip option 2 select - Player cast Trick or Treat on self'), +(6741,0,2,0,22,0,100,0,22,0,0,0,33,6741,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Norman - On chicken emote - Give kill credit'); + +-- Fix quest 8360 "Dancing for Marzipan" +UPDATE creature_template SET `AIName`= 'SmartAI' WHERE `entry`=6746; +DELETE FROM `smart_scripts` WHERE `entryorguid`=6746 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`,`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 +(6746,0,1,0,22,0,100,0,34,0,0,0,33,6746,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Pala - On dance emote - Give kill credit'); + +-- Alliance + +-- Fix quest 8356 "Flexing for Nougat" +DELETE FROM `smart_scripts` WHERE `entryorguid`=6740 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`,`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 +(6740,0,0,1,62,0,100,0,342,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Allison - On gossip option 0 select - Close gossip'), +(6740,0,1,0,61,0,100,0,0,0,0,0,85,24751,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Innkeeper Allison - On gossip option 0 select - Player cast Trick or Treat on self'), +(6740,0,2,0,22,0,100,0,41,0,0,0,33,6740,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Allison - On flex emote - Give kill credit'); + +-- Fix quest 8358 "Incoming Gundrop" +UPDATE creature_template SET `AIName`= 'SmartAI' WHERE `entry`=6826; +DELETE FROM `smart_scripts` WHERE `entryorguid`=6826 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`,`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 +(6826,0,1,0,22,0,100,0,264,0,0,0,33,6826,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Talvash del Kissel - On train emote - Give kill credit'); + +-- Fix quest 8360 "Dancing for Marzipan" +UPDATE creature_template SET `AIName`= 'SmartAI' WHERE `entry`=6735; +DELETE FROM `smart_scripts` WHERE `entryorguid`=6735 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`,`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 +(6735,0,0,1,62,0,100,0,1581,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Saelienne - On gossip option 0 select - Close gossip'), +(6735,0,1,0,61,0,100,0,0,0,0,0,85,24751,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Saelienne - On gossip option 0 select - Player cast Trick or Treat on self'), +(6735,0,2,0,22,0,100,0,34,0,0,0,33,6735,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Saelienne - On dance emote - Give kill credit'); + +-- Fix quest 8353 "Chicken Clucking for a Mint" +DELETE FROM `smart_scripts` WHERE `entryorguid`=5111 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`,`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 +(5111,0,0,1,62,0,100,0,345,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Firebrew - On gossip option 0 select - Close gossip'), +(5111,0,1,0,61,0,100,0,0,0,0,0,85,24751,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Firebrew - On gossip option 0 select - Player cast Trick or Treat on self'), +(5111,0,2,0,22,0,100,0,22,0,0,0,33,5111,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Innkeeper Firebrew - On chicken emote - Give kill credit'); diff --git a/sql/updates/world/2011_10_23_01_world_sai.sql b/sql/updates/world/2011_10_23_01_world_sai.sql new file mode 100644 index 00000000000..89eba23683a --- /dev/null +++ b/sql/updates/world/2011_10_23_01_world_sai.sql @@ -0,0 +1,8 @@ +-- Quest 'Ruthless Cunning' exploit fix +-- Spell Place Kil'sorrow Banner can not only be cast on Warmaul Ogres +DELETE FROM `conditions` WHERE `SourceEntry` IN (32307) AND `ConditionValue2` IN (17148,17147,17146,18391); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,32307,0,18,1,17148,0,0,'',"Spell Place Kil'sorrow Banner can not only be cast on Kil'sorrow mobs"), -- Kil'sorrow Deathsworn +(13,0,32307,1,18,1,17147,0,0,'',"Spell Place Kil'sorrow Banner can not only be cast on Kil'sorrow mobs"), -- Kil'sorrow Cultist +(13,0,32307,2,18,1,17146,0,0,'',"Spell Place Kil'sorrow Banner can not only be cast on Kil'sorrow mobs"), -- Kil'sorrow Spellbinder +(13,0,32307,3,18,1,18391,0,0,'',"Spell Place Kil'sorrow Banner can not only be cast on Kil'sorrow mobs"); -- Giselda the Crone diff --git a/sql/updates/world/2011_10_23_02_world_sai.sql b/sql/updates/world/2011_10_23_02_world_sai.sql new file mode 100644 index 00000000000..a6a5da03bbb --- /dev/null +++ b/sql/updates/world/2011_10_23_02_world_sai.sql @@ -0,0 +1,9 @@ +-- Scarlet Onslaught Prisoner SAI +SET @ENTRY := 27349; +SET @SPELL_FLASK_OF_BLIGHT := 48188; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,1,8,0,100,0,@SPELL_FLASK_OF_BLIGHT,0,0,0,33,27253,0,0,0,0,0,7,0,0,0,0,0,0,0,"Scarlet Onslaught Prisoner - On Spellhit - Quest Credit"), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Scarlet Onslaught Prisoner - In Combat - Forced Despawn"); diff --git a/sql/updates/world/2011_10_23_03_world_sai.sql b/sql/updates/world/2011_10_23_03_world_sai.sql new file mode 100644 index 00000000000..d38e0a0b4fd --- /dev/null +++ b/sql/updates/world/2011_10_23_03_world_sai.sql @@ -0,0 +1,159 @@ +-- Shattered Rumbler SAI +SET @ENTRY := 17157; +SET @ENTRY_MINION := 18181; -- Minion of Gurok +SET @SPELL_EARTH_RUMBLE := 33840; -- Earth Rumble +SET @SPELL_THROW_GORDAWGS_BULDER := 32001; -- Throw Gordawgs Boulder +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`=''WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +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 +(@ENTRY,0,0,0,0,0,100,0,1000,1000,8000,9000,11,@SPELL_EARTH_RUMBLE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Shattered Rumbler - In Combat - Cast Earth Rumble"), +(@ENTRY,0,1,0,8,0,100,1,@SPELL_THROW_GORDAWGS_BULDER,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Shattered Rumbler - On Spellhit - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,12,@ENTRY_MINION,4,20000,0,0,0,1,0,0,0,0,0,0,0,"Shattered Rumbler - Script - Summon Minion of Gurok"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,12,@ENTRY_MINION,4,20000,0,0,0,1,0,0,0,0,0,0,0,"Shattered Rumbler - Script - Summon Minion of Gurok"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,12,@ENTRY_MINION,4,20000,0,0,0,1,0,0,0,0,0,0,0,"Shattered Rumbler - Script - Summon Minion of Gurok"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Shattered Rumbler - Script - Die"); + +-- Minion of Gurok SAI +SET @ENTRY := 18181; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,89,10,0,0,0,0,0,1,0,0,0,0,0,0,0,"Minion of Gurok - Out of Combat - Set Random Movement"); + +-- Spell Throw Gordawgs Boulder can only be cast at Shattered Rumbler +DELETE FROM `conditions` WHERE `SourceEntry`=24501 AND `ConditionValue2`=17157; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(18,0,24501,0,24,1,17157,0,0,'',"Item Gordawgs Boulder can only be used if target is Shattered Rumbler"); + + +-- Lump SAI +SET @ENTRY := 18351; +SET @QUEST := 9918; +SET @GOSSIP := 21289; +SET @SPELL_SLEEPING_SLEEP := 42648; -- Sleeping Sleep +SET @SPELL_SHOULDER_CHARGE := 31994; -- Shoulder Charge +SET @SPELL_SPEAR_THROW := 32248; -- Spear Throw +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='',`gossip_menu_id`=@GOSSIP+1,`faction_A`=1711,`faction_H`=1711,`unit_flags`=`unit_flags`|528 WHERE `entry`=@ENTRY; +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,11,@SPELL_SLEEPING_SLEEP,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - Out Of Combat - Cast Sleeping Sleep"), +(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Lump - On Aggro - Say Line (random)"), +(@ENTRY,0,2,0,62,0,100,0,@GOSSIP+4,0,0,0,33,18354,0,0,0,0,0,7,0,0,0,0,0,0,0,"Lump - On Gossip Select - Give Quest Credit"), +(@ENTRY,0,3,0,2,0,100,1,0,30,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Lump - On 30% HP - Run Script"), +(@ENTRY*100,9,0,0,2,0,100,1,0,0,0,0,2,1080,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Set Faction Friendly"), +(@ENTRY*100,9,1,0,2,0,100,1,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Say Line 1"), +(@ENTRY*100,9,2,0,2,0,100,1,1000,1000,0,0,5,447,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Emote ONESHOT_FLY_SIT_GROUND_DOWN"), -- He wont sit down, no matter which emote I use - probably due evading +(@ENTRY*100,9,3,0,2,0,100,1,0,0,0,0,20,9,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Stop auto-attack"), +(@ENTRY*100,9,4,0,2,0,100,1,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Evade"), +(@ENTRY*100,9,5,0,2,0,100,1,0,0,0,0,28,@SPELL_SLEEPING_SLEEP,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Remove Aura Sleeping Sleep"), -- Prevent gaining it - were leaving combat! +(@ENTRY,0,4,0,9,0,100,0,8,25,1500,2000,11,@SPELL_SHOULDER_CHARGE,1,0,0,0,0,2,0,0,0,0,0,0,0,"Lump - On Player Range - Cast Shoulder Charge"), +(@ENTRY,0,5,0,9,0,100,0,5,40,1500,2000,11,@SPELL_SPEAR_THROW,1,0,0,0,0,2,0,0,0,0,0,0,0,"Lump - On Player Range - Cast Spear Throw"); +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"In Nagrand, food hunt ogre!",12,0,100,0,0,0,"Lump"), +(@ENTRY,0,1,"You taste good with maybe a little salt and pepper.",12,0,100,0,0,0,"Lump"), +(@ENTRY,1,2,"OK, OK! Lump give up!",12,0,100,0,0,0,"Lump"); + +-- Actual story menu +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+1 AND `text_id`=9352; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+1,9352); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+2 AND `text_id`=9353; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+2,9353); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+3 AND `text_id`=9354; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+3,9354); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+4 AND `text_id`=9355; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+4,9355); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+5 AND `text_id`=9356; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+5,9356); + +-- Insert option menu +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN @GOSSIP+1 AND @GOSSIP+4; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(@GOSSIP+1,0,0,"I need answers, ogre!",1,1,@GOSSIP+2), +(@GOSSIP+2,1,0,"Why are the Boulderfist out this far? You know that this is Kurenai territory.",1,1,@GOSSIP+3), +(@GOSSIP+3,2,0,"And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar.",1,1,@GOSSIP+4), +(@GOSSIP+4,3,0,"This means war, Lump! War I say!",1,1,@GOSSIP+5); + +-- Only show first gossip if player is on quest Not On My Watch! +DELETE FROM `conditions` WHERE `SourceGroup`=@GOSSIP+1 AND `ConditionValue1`=@QUEST AND `SourceTypeOrReferenceId`=15; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP+1,0,0,9,@QUEST,0,0,0,'',"Only show first gossip if player is on quest Not On My Watch!"); + + +-- Wild Sparrowhawk SAI +SET @ENTRY := 22979; +SET @SPELL_SPARROWHAWK_NET := 39810; -- Sparrowhawk Net +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='',`InhabitType`=4 WHERE `entry`=@ENTRY; -- Always in air +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_SPARROWHAWK_NET,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Spellhit - Run Script"), +(@ENTRY,0,1,0,6,0,100,0,0,0,0,0,28,@SPELL_SPARROWHAWK_NET,2,0,0,0,0,1,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Death - Remove Aura Sparrowhawk Net"), +(@ENTRY,0,2,0,6,0,100,0,0,0,0,0,41,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Wild Sparrowhawk - Force Despawn 8 Seconds After Death'), +(@ENTRY*100,9,0,0,0,0,100,0,1000,1000,0,0,25,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Script - Flee For Assist"), -- This is how it should work - there is no flee function in event_scripts, so can't do it blizzlike (event_scripts 39812) +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,28,@SPELL_SPARROWHAWK_NET,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Script - Remove Aura Sparrowhawk Net"), -- Remove it and add it back later +(@ENTRY*100,9,2,0,0,0,100,0,11000,11000,0,0,56,32320,1,0,0,0,0,7,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Script - Add Item Captured Sparrowhawk"), +(@ENTRY*100,9,3,0,0,0,100,0,11000,11000,0,0,37,0,1,0,0,0,0,1,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Script - Die"); + +-- Spell Sparrowhawk Net can only be cast at Wild Sparrowhawk +DELETE FROM `conditions` WHERE `SourceEntry`=32321 AND `ConditionValue2`=22979 AND `SourceTypeOrReferenceId`=18; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(18,0,32321,0,24,1,22979,0,0,'',"Item Sparrowhawk Net can only be used if target is Wild Sparrowhawk"); + + +-- [Q] Diplomatic Measures +SET @GOSSIP := 21295; +SET @QUEST_HORDE := 10107; +SET @QUEST_ALLIANCE := 10108; + +-- Lantresor of the Blade SAI +SET @ENTRY := 18261; +SET @SPELL_BUNING_BLADE_BLADEMASTER := 32281; -- Burning Blade Blademaster +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP+0,`AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,1,0,100,1,0,0,0,0,11,@SPELL_BUNING_BLADE_BLADEMASTER,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lantrestor of the Blade - Out of Combat - Cast Burning Blade Blademaster"), +(@ENTRY,0,1,0,62,0,100,0,@GOSSIP+7,0,0,0,26,@QUEST_ALLIANCE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Lantrestor of the Blade - On Gossip Select - Give Quest Credit"), +(@ENTRY,0,2,0,62,0,100,0,@GOSSIP+7,0,0,0,26,@QUEST_HORDE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Lantrestor of the Blade - On Gossip Select - Give Quest Credit"); + +-- Make the npc_text entries work properly +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+1 AND `text_id`=9362; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+1,9362); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+2 AND `text_id`=9363; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+2,9363); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+3 AND `text_id`=9364; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+3,9364); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+4 AND `text_id`=9365; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+4,9365); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+5 AND `text_id`=9366; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+5,9366); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+6 AND `text_id`=9367; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+6,9367); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+7 AND `text_id`=9368; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+7,9368); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+8 AND `text_id`=9369; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+8,9369); + +-- Insert menu options +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN @GOSSIP+0 AND @GOSSIP+7; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(@GOSSIP+0,0,0,"I have killed many of your ogres, Lantresor. I have no fear.",1,1,@GOSSIP+1), +(@GOSSIP+1,1,0,"Should I know? You look like an orc to me.",1,1,@GOSSIP+2), +(@GOSSIP+2,2,0,"And the other half?",1,1,@GOSSIP+3), +(@GOSSIP+3,3,0,"I have heard of your kind, but I never thought to see the day when I would meet a half-breed.",1,1,@GOSSIP+4), +(@GOSSIP+4,4,0,"My apologies. I did not mean to offend. I am here on behalf of my people.",1,1,@GOSSIP+5), +(@GOSSIP+5,5,0,"My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces.",1,1,@GOSSIP+6), +(@GOSSIP+6,6,0,"We will fight you until the end,then, Lantresor. We will not stand idly by as you pillage our towns and kill our people.",1,1,@GOSSIP+7), +(@GOSSIP+7,7,0,"What do I need to do?",1,1,@GOSSIP+8); + +-- Conditions for gossip menu of quest Diplomatic Measures, they are grouped and thus ONE of them must be met in order for the gossip to become visible +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP+0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP+0,0,0,9,@QUEST_ALLIANCE,0,0,0,'',"Only show first gossip if player is on quest Diplomatic Measures (alliance)"), +(15,@GOSSIP+0,0,1,9,@QUEST_HORDE,0,0,0,'',"Only show first gossip if player is on quest Diplomatic Measures (horde)"); diff --git a/sql/updates/world/2011_10_23_04_world_sai.sql b/sql/updates/world/2011_10_23_04_world_sai.sql new file mode 100644 index 00000000000..27adf09d51a --- /dev/null +++ b/sql/updates/world/2011_10_23_04_world_sai.sql @@ -0,0 +1,50 @@ +-- Altruis the Sufferer SAI +-- [Q] Survey the Land +-- [Q] Illidan's Pupil +SET @ENTRY := 18417; +SET @GOSSIP := 21304; +SET @QUEST_SURVEY := 9991; +SET @QUEST_PUPIL := 10646; +UPDATE `quest_template` SET `SpecialFlags`=`SpecialFlags`|2 WHERE `entry` IN (@QUEST_SURVEY,@QUEST_PUPIL); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP+0,`AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +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 +-- Survey the Land +(@ENTRY,0,0,0,62,0,100,0,@GOSSIP+1,0,0,0,52,532,0,0,0,0,0,7,0,0,0,0,0,0,0,"Altruis the Sufferer - On Gossip Select - Activate Taxi Path"), +(@ENTRY,0,1,0,62,0,100,0,@GOSSIP+1,0,0,0,26,@QUEST_SURVEY,0,0,0,0,0,7,0,0,0,0,0,0,0,"Altruis the Sufferer - On Gossip Select - Quest Credit"), +-- Illidan's Pupil +(@ENTRY,0,2,0,62,0,100,0,@GOSSIP+6,0,0,0,26,@QUEST_PUPIL,0,0,0,0,0,7,0,0,0,0,0,0,0,"Altruis the Sufferer - On Gossip Select - Give Quest Credit"); + +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+0 AND `text_id`=9427; +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+1 AND `text_id`=10492; +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+2 AND `text_id`=10493; +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+3 AND `text_id`=10494; +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+4 AND `text_id`=10495; +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+5 AND `text_id`=10497; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(@GOSSIP+0,9427), -- Survey the Land +(@GOSSIP+1,10492), -- Illidan's Pupil +(@GOSSIP+2,10493), -- Illidan's Pupil +(@GOSSIP+3,10494), -- Illidan's Pupil +(@GOSSIP+4,10495), -- Illidan's Pupil +(@GOSSIP+5,10497); -- Illidan's Pupil + +-- Insert menu options +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN @GOSSIP+0 AND @GOSSIP+6; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +-- Survey the Land +(@GOSSIP+0,0,0,"Well?",1,3,@GOSSIP+1), +(@GOSSIP+1,0,0,"Ok.",1,3,0), +-- Illidan's Pupil +(@GOSSIP+0,1,0,"Tell me about the demon hunter training grounds at the Ruins of Karabor.",1,3,@GOSSIP+2), +(@GOSSIP+2,0,0,"I'm listening.",1,3,@GOSSIP+3), +(@GOSSIP+3,0,0,"Go on, please.",1,3,@GOSSIP+4), +(@GOSSIP+4,0,0,"Interesting.",1,3,@GOSSIP+5), +(@GOSSIP+5,0,0,"That's quite a story.",1,3,@GOSSIP+6), +(@GOSSIP+6,0,0,"There was something else I wanted to ask you, Altruis.",1,3,@GOSSIP+0); -- Back to first page + +-- Conditions for gossip menu of quest Survey the Land +DELETE FROM `conditions` WHERE `SourceGroup` IN (@GOSSIP+0,@GOSSIP+10) AND `ConditionValue1` IN (@QUEST_SURVEY,@QUEST_PUPIL); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP+0,0,0,9,@QUEST_SURVEY,0,0,0,'',"Only show first gossip if player is on quest Survey the Land"), +(15,@GOSSIP+0,1,0,9,@QUEST_PUPIL,0,0,0,'',"Only show first gossip if player is on quest Illidans Pupil"); diff --git a/sql/updates/world/2011_10_23_05_world_misc.sql b/sql/updates/world/2011_10_23_05_world_misc.sql new file mode 100644 index 00000000000..5c730c8cd18 --- /dev/null +++ b/sql/updates/world/2011_10_23_05_world_misc.sql @@ -0,0 +1,16 @@ +-- Ethereum Relay SAI +SET @ENTRY := 20619; +SET @SPELL_SHADOWFORM := 16592; +SET @SPELL_ETHEREUM_RELAY := 39596; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,1,0,100,1,0,0,0,0,11,@SPELL_SHADOWFORM,1,0,0,0,0,1,0,0,0,0,0,0,0,"Ethereum Relay - Out of Combat - Cast Shadowform"), +(@ENTRY,0,1,0,1,0,100,1,0,0,0,0,11,@SPELL_ETHEREUM_RELAY,1,0,0,0,0,1,0,0,0,0,0,0,0,"Ethereum Relay - Out of Combat - Cast Ethereum Relay"); + +-- Re-add what shouldn't be deleted +SET @Gossip = 21289; +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@Gossip AND `id`=0; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`) VALUES +(@Gossip, 0, 0, 'I believe in you.', 1, 1); diff --git a/sql/updates/world/2011_10_23_06_world_sai.sql b/sql/updates/world/2011_10_23_06_world_sai.sql new file mode 100644 index 00000000000..7e0eb7e7e96 --- /dev/null +++ b/sql/updates/world/2011_10_23_06_world_sai.sql @@ -0,0 +1,44 @@ +-- Sundered Rumbler SAI +SET @ENTRY := 18881; +SET @SPELL_SUMMON_SUNDERED_SHARD := 35310; +SET @SPELL_CREATE_ELEMENTAL_POWER := 34525; +SET @SPELL_ELEMENTAL_POWERDER_EXTRACTOR := 34520; +UPDATE `creature_template` SET `AIName`='SmartAI',`dmgschool`=3 WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,8,0,100,1,@SPELL_ELEMENTAL_POWERDER_EXTRACTOR,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sundered Rumbler - On Spellhit - Set Phase 1"), +(@ENTRY,0,1,0,6,1,100,0,0,0,0,0,11,@SPELL_CREATE_ELEMENTAL_POWER,2,0,0,0,0,1,0,0,0,0,0,0,0,"Sundered Rumbler - On Death - Cast Create Elemental Power"), +(@ENTRY,0,2,0,2,0,100,1,0,10,0,0,11,@SPELL_SUMMON_SUNDERED_SHARD,1,0,0,0,0,1,0,0,0,0,0,0,0,"Sundered Rumbler - At 10% HP - Cast Summon Sundered Shard"); + +-- Warp Aberration SAI +SET @ENTRY := 18865; +SET @SPELL_WARP_STORM := 36577; +SET @SPELL_ARCANE_SHIELD := 36640; +SET @SPELL_CREATE_ELEMENTAL_POWER := 34525; +SET @SPELL_ELEMENTAL_POWERDER_EXTRACTOR := 34520; +UPDATE `creature_template` SET `AIName`='SmartAI',`dmgschool`=6 WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,11,@SPELL_ARCANE_SHIELD,0,0,0,0,0,1,0,0,0,0,0,0,0,"Warp Aberration - On Aggro - Cast Arcane Shield"), +(@ENTRY,0,1,0,8,0,100,1,@SPELL_ELEMENTAL_POWERDER_EXTRACTOR,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Warp Aberration - On Spellhit - Set Phase 1"), +(@ENTRY,0,2,0,6,1,100,0,0,0,0,0,11,@SPELL_CREATE_ELEMENTAL_POWER,2,0,0,0,0,1,0,0,0,0,0,0,0,"Warp Aberration - On Death - Cast Create Elemental Power"), +(@ENTRY,0,3,0,0,0,100,0,2500,5000,30000,35000,11,@SPELL_WARP_STORM,0,0,0,0,0,2,0,0,0,0,0,0,0,"Warp Aberration - In Combat - Cast Warp Storm"); + +-- Warp Storm SAI +SET @ENTRY := 21322; +SET @SPELL_WARP_STORM := 36580; +UPDATE `creature_template` SET `AIName`='SmartAI',`modelid1`=18402,`unit_flags`=33554822 WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,0,54,0,100,1,1000,1000,1000,1000,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Warp Storm - On Just Summoned - Prevent Combat Movement"), +(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Warp Storm - On Aggro - Stop Auto Attack"), +(@ENTRY,0,2,0,0,0,100,0,1000,2000,3000,5000,11,@SPELL_WARP_STORM,0,0,0,0,0,1,0,0,0,0,0,0,0,"Warp Storm - In Combat - Cast Warp Storm"); + +-- Conditions for quest item +DELETE FROM `conditions` WHERE `SourceEntry` IN (28547) AND `ConditionValue2` IN (18881,18865); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(18,0,28547,0,24,1,18881,0,0,"","Item Elemental Power Extractor can only be used if target is Sundered Rumbler"), +(18,0,28547,0,24,1,18865,0,0,"","Item Elemental Power Extractor can only be used if target is Warp Aberration"); diff --git a/sql/updates/world/2011_10_23_07_world_creature_templates.sql b/sql/updates/world/2011_10_23_07_world_creature_templates.sql new file mode 100644 index 00000000000..08d1d0a0ec1 --- /dev/null +++ b/sql/updates/world/2011_10_23_07_world_creature_templates.sql @@ -0,0 +1,98 @@ +-- Random Stormwind NPC's +-- Template updates +UPDATE `creature_template` SET `minlevel`=60,`maxlevel`=60,`unit_flags`=`unit_flags`|33555200,`speed_walk`=1,`speed_run`=1.14286 WHERE `entry`=37574; -- [DND] Shaker - Small +UPDATE `creature_template` SET `minlevel`=60,`maxlevel`=60,`unit_flags`=`unit_flags`|33555200,`speed_walk`=1,`speed_run`=1.14286 WHERE `entry`=37543; -- [DND] Shaker +UPDATE `creature_template` SET `speed_run`=1.14286 WHERE `entry`=68; -- Stormwind City Guard +UPDATE `creature_template` SET `speed_run`=1.14286 WHERE `entry`=4075; -- Rat +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|32768 WHERE `entry`=29093; -- Ian Drake +UPDATE `creature_template` SET `npcflag`=`npcflag`|17 WHERE `entry`=11867; -- Woo Ping + +-- Model data 1436 (creature 2456 (Newton Burnside)) +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=0,`gender`=0 WHERE `modelid` IN (1436 -- Newton Burnside +,1437 -- John Burnside +,1434 -- Thurman Mullby +,1431 -- Keldric Boucher +,5082 -- Morgan Pestle +,2974 -- Aldwin Laughlin +,5547 -- Ben Trias +,3246 -- Elling Trias +,3167 -- Stormwind City Guard +,25901 -- Ian Drake +,5074 -- Renato Gallina +,7991 -- Auctioneer Chilton +,7992 -- Auctioneer Fitch +,5567 -- Melris Malagan +,1525 -- Crier Goodman +,1541 -- Thomas Miller +,5551 -- Harlan Bagley +,1429 -- Gunther Weller +,11804 -- Woo Ping +,1433 -- Roberto Pupellyverbos +,1427 -- Frederick Stover +,1438); -- Topper McNabb +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=0,`gender`=1 WHERE `modelid` IN (5545 -- Suzetta Gallina +,5444 -- Innkeeper Allison +,1446 -- Lina Stover +,1448 -- Marda Weller +,1443 -- Julia Gallina +,1440 -- Edna Mullby +,1445 -- Lara Moore +,1439 -- Carla Granger +,5446 -- Justine Demalier +,5446 -- Stormwind City Guard +,15594 -- Auctioneer Jaxon +,4888 -- Stephanie Turner +,1450 -- Olivia Burnside +,5546 -- Elaine Trias +,3133 -- Rebecca Laughlin +,1444); -- Kyra Boucher +UPDATE `creature_model_info` SET `bounding_radius`=0.25,`combat_reach`=0,`gender`=2 WHERE `modelid`=5585; -- Fuzz +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=0,`gender`=2 WHERE `modelid` IN (1141,1418); -- Rat +UPDATE `creature_model_info` SET `bounding_radius`=0.075,`combat_reach`=0,`gender`=2 WHERE `modelid`=24719; -- [DND] Shaker - Small +-- Addon data +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=257,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry` IN +(2456 -- Newton Burnside +,2457 -- John Burnside +,1285 -- Thurman Mullby +,1286 -- Edna Mullby +,1257 -- Keldric Boucher +,1275 -- Kyra Boucher +,279 -- Morgan Pestle +,5193 -- Rebecca Laughlin +,4974 -- Aldwin Laughlin +,4981 -- Ben Trias +,2455 -- Olivia Burnside +,483 -- Elaine Trias +,482 -- Elling Trias +,68 -- Stormwind City Guard +,1432 -- Renato Gallina +,6174 -- Stephanie Turner +,8670 -- Auctioneer Chilton +,15659 -- Auctioneer Jaxon +,8719 -- Auctioneer Fitch +,12480 -- Melris Malagan +,12481 -- Justine Demalier +,2198 -- Crier Goodman +,3518 -- Thomas Miller +,1976 -- Stormwind City Patroller +,1291 -- Carla Granger +,1427 -- Harlan Bagley +,1295 -- Lara Moore +,1289 -- Gunther Weller +,11867 -- Woo Ping +,6740 -- Innkeeper Allison +,1402 -- Topper McNabb +,1287 -- Marda Weller +,1301 -- Julia Gallina +,277 -- Roberto Pupellyverbos +,1431); -- Suzetta Gallina + +-- Frederick Stover +-- Lina Stover +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=258,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry` IN (1297,1298); +DELETE FROM `creature_template_addon` WHERE `entry` IN (37574,37543,29093,25058); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(37574,0,0,1,0, NULL), -- [DND] Shaker - Small +(37543,0,0,1,0, NULL), -- [DND] Shaker +(29093,0,0,257,0, NULL), -- Ian Drake +(25058,0,3,1,0, NULL); -- Fuzz diff --git a/sql/updates/world/2011_10_23_07_world_sai.sql b/sql/updates/world/2011_10_23_07_world_sai.sql new file mode 100644 index 00000000000..7853b6eb411 --- /dev/null +++ b/sql/updates/world/2011_10_23_07_world_sai.sql @@ -0,0 +1,53 @@ +-- [Q] The Dwarven Spy +SET @ENTRY := 15420; +SET @GOSSIP := 21310; + +-- Waypoints +DELETE FROM `script_waypoint` WHERE `entry`=@ENTRY; +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,9294.78,-6682.51,22.42,'Prospector Anvilward'), +(@ENTRY,2,9298.27,-6667.99,22.42,'Prospector Anvilward'), +(@ENTRY,3,9309.63,-6658.84,22.42,'Prospector Anvilward'), +(@ENTRY,4,9304.43,-6649.31,26.46,'Prospector Anvilward'), +(@ENTRY,5,9298.83,-6648,28.61,'Prospector Anvilward'), +(@ENTRY,6,9291.06,-6653.46,31.83,'Prospector Anvilward'), +(@ENTRY,7,9289.08,-6660.17,31.83,'Prospector Anvilward'); + +-- Prospector Anvilward SAI +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='',`gossip_menu_id`=@GOSSIP WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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 +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP+1,0,0,0,53,0,@ENTRY,0,0,0,2,1,0,0,0,0,0,0,0,'Prospector Anvilward - On Gossip Select - Start WP'), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Prospector Anvilward - On Gossip Select - Start WP'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,83,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Prospector Anvilward - On Gossip Select - Remove npcflag'), +(@ENTRY,0,3,0,40,0,100,0,1,@ENTRY,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Prospector Anvilward - On WP 1 - Say Line 0'), +(@ENTRY,0,4,5,40,0,100,0,6,@ENTRY,0,0,54,2500,0,0,0,0,0,1,0,0,0,0,0,0,0,'Prospector Anvilward - On WP 6 - Pause Path'), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,'Prospector Anvilward - On WP 6 - Say Line 1'), +(@ENTRY,0,6,7,40,0,100,0,7,@ENTRY,0,0,54,15000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Prospector Anvilward - On WP 7 - Pause Path'), +(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,2,24,0,0,0,0,0,1,0,0,0,0,0,0,0,'Prospector Anvilward - On WP 7 - Set Faction'), +(@ENTRY,0,8,0,1,0,100,1,10000,10000,24000,29000,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,"Prospector Anvilward - Out of Combat - Say Line 2"); + +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Very well. Let's see what you have to show me, $N.",12,1,100,0,0,0,'Prospector Anvilward'), +(@ENTRY,1,0,"What manner of trick is this, $r? If you seek to ambush me, I warn you I will not go down quietly!",12,1,100,0,0,0,'Prospector Anvilward'), +(@ENTRY,2,0,"These arcane sanctums of yours are quite... interesting, Mr. Caidanis. I appreciate the information you have given me today.",12,0,100,1,0,0,'Prospector Anvilward'); + +-- This one was missing.. +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=8239; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,8239); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+1 AND `text_id`=8240; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+1,8240); + +-- Insert menu options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (@GOSSIP+0,@GOSSIP+1); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(@GOSSIP+0,0,0,"I need a moment of your time, sir.",1,1,@GOSSIP+1), +(@GOSSIP+1,0,0,"Why... yes, of course. I've something to show you right inside this building, Mr. Anvilward.",1,1,0); + +-- Conditions for gossip menu of quest The Dwarven Spy +DELETE FROM `conditions` WHERE `SourceGroup`=@GOSSIP+0 AND `ConditionValue1`=8483; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP+0,0,0,9,8483,0,0,0,'',"Only show first gossip if player is on quest The Dwarven Spy"); diff --git a/sql/updates/world/2011_10_23_08_world_sai.sql b/sql/updates/world/2011_10_23_08_world_sai.sql new file mode 100644 index 00000000000..911168102ba --- /dev/null +++ b/sql/updates/world/2011_10_23_08_world_sai.sql @@ -0,0 +1,175 @@ +SET @ENTRY := 14354; -- the little bugger Pusillin + +SET @SPELL_1 := 14145; -- Fire Blast +SET @SPELL_2 := 15228; -- Fireball +SET @SPELL_3 := 22424; -- Blast Wave +SET @SPELL_4 := 22735; -- Spirit of Runn Tum (reflect magic) +SET @NPC_WILDSPAWN_IMP := 13276; -- 5 of them summoned by Pusillin during fight + +-- Gossip menu's from npc_text +SET @GOSSIP_1 := 6877; +SET @GOSSIP_2 := 6878; +SET @GOSSIP_3 := 6879; +SET @GOSSIP_4 := 6880; +SET @GOSSIP_5 := 6881; + +-- Gossip menu options +SET @GOSSIP_OPTION_1 := 6877; +SET @GOSSIP_OPTION_2 := 6878; +SET @GOSSIP_OPTION_3 := 6879; +SET @GOSSIP_OPTION_4 := 6880; +SET @GOSSIP_OPTION_5 := 6881; + +SET @SCRIPT_1 := 1435400; -- gossip +SET @SCRIPT_2 := 1435401; -- gossip +SET @SCRIPT_3 := 1435402; -- gossip +SET @SCRIPT_4 := 1435403; -- gossip +SET @SCRIPT_5 := 1435404; -- fight + +SET @SA_SEND_GOSSIP := 98; -- SMART ACTION_SEND_GOSSIP + +-- SmartAI for Pusillin +UPDATE `creature_template` SET `lootid`=@ENTRY,`gossip_menu_id`=0,`speed_run`=2.14286,`AIName`='SmartAI',`npcflag`=1 WHERE `entry`=@ENTRY; +UPDATE `creature` SET `MovementType`=1,`spawndist`=3,`spawntimesecs`=300 WHERE `id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@SCRIPT_1,@SCRIPT_2,@SCRIPT_3,@SCRIPT_4,@SCRIPT_5) AND `source_type`=9; +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 +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,22,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'Pusillin - On Spawn - Set Phase 1'), + + -- send gossip depending on phase + (@ENTRY,0,1,0,64,0,100,0,0,0,0,0,@SA_SEND_GOSSIP,@GOSSIP_1,@GOSSIP_OPTION_1,0,0,0,0,7,0,0,0,0,0,0,0,'Pusillin - On Gossip Hello & Phase 1 - Send Gossip'), + (@ENTRY,0,2,0,64,1,100,0,0,0,0,0,@SA_SEND_GOSSIP,@GOSSIP_2,@GOSSIP_OPTION_2,0,0,0,0,7,0,0,0,0,0,0,0,'Pusillin - On Gossip Hello & Phase 2 - Send Gossip'), + (@ENTRY,0,3,0,64,2,100,0,0,0,0,0,@SA_SEND_GOSSIP,@GOSSIP_3,@GOSSIP_OPTION_3,0,0,0,0,7,0,0,0,0,0,0,0,'Pusillin - On Gossip Hello & Phase 3 - Send Gossip'), + (@ENTRY,0,4,0,64,4,100,0,0,0,0,0,@SA_SEND_GOSSIP,@GOSSIP_4,@GOSSIP_OPTION_4,0,0,0,0,7,0,0,0,0,0,0,0,'Pusillin - On Gossip Hello & Phase 4 - Send Gossip'), + (@ENTRY,0,5,0,64,8,100,0,0,0,0,0,@SA_SEND_GOSSIP,@GOSSIP_5,@GOSSIP_OPTION_5,0,0,0,0,7,0,0,0,0,0,0,0,'Pusillin - On Gossip Hello & Phase 5 - Send Gossip'), + +-- run script depending on phase +(@ENTRY,0,6,0,62,0,100,0,@GOSSIP_OPTION_1,0,0,0,80,@SCRIPT_1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Gossip Select - Run Script 1'), +(@ENTRY,0,7,0,62,1,100,0,@GOSSIP_OPTION_2,0,0,0,80,@SCRIPT_2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Gossip Select - Run Script 2'), +(@ENTRY,0,8,0,62,2,100,0,@GOSSIP_OPTION_3,0,0,0,80,@SCRIPT_3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Gossip Select - Run Script 3'), +(@ENTRY,0,9,0,62,4,100,0,@GOSSIP_OPTION_4,0,0,0,80,@SCRIPT_4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Gossip Select - Run Script 4'), +(@ENTRY,0,10,0,62,8,100,0,@GOSSIP_OPTION_5,0,0,0,80,@SCRIPT_5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Gossip Select - Run Script 5'), + + -- Waypoint 3 (chit-chat 1) +(@ENTRY,0,11,12,40,0,100,0,3,@ENTRY,0,0,55,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - At WP3 - stop'), +(@ENTRY,0,12,0,61,0,100,0,0,0,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - At WP3 - Turn on Gossip flag'), + +-- Waypoint 14 (chit-chat 2) +(@ENTRY,0,13,14,40,0,100,0,14,@ENTRY*10,0,0,55,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - At WP14 - stop'), +(@ENTRY,0,14,0,61,0,100,0,0,0,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - At WP14 - Turn on Gossip flag'), + +-- Waypoint 12 (chit-chat 3) +(@ENTRY,0,15,16,40,0,100,0,12,@ENTRY*20,0,0,55,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - At WP12 - stop'), +(@ENTRY,0,16,0,61,0,100,0,0,0,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - At WP12 - Turn on Gossip flag'), + +-- Waypoint 7 (chit-chat 4) +(@ENTRY,0,17,18,40,0,100,0,7,@ENTRY*30,0,0,55,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - At WP7 - stop'), +(@ENTRY,0,18,0,61,0,100,0,0,0,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - At WP7 - Turn on Gossip flag'), + +-- casts during fight +(@ENTRY,0,19,0,0,0,100,0,1000,4250,8000,8000,11,@SPELL_1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Pusillin - In Combat - Cast Fire Blast'), +(@ENTRY,0,20,0,0,0,100,0,1000,1000,4000,4000,11,@SPELL_2,0,0,0,0,0,2,0,0,0,0,0,0,0,'Pusillin - In Combat - Cast Fireball'), +(@ENTRY,0,21,0,0,0,100,0,2000,10000,10000,17500,11,@SPELL_3,0,0,0,0,0,2,0,0,0,0,0,0,0,'Pusillin - In Combat - Cast Blast Wave'), + +-- Script 1 +(@SCRIPT_1,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Pusillin - On Script 1 - Close Gossip'), +(@SCRIPT_1,9,1,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 1 - Turn Off Gossip Flags'), +(@SCRIPT_1,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 1 - Say Text 0'), +(@SCRIPT_1,9,3,0,0,0,100,0,0,0,0,0,23,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'Pusillin - On Script 1 - Set Phase to 2'), +(@SCRIPT_1,9,4,0,0,0,100,0,0,0,0,0,53,1,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 1 - Start Waypoint Movement'), + +-- Script 2 +(@SCRIPT_2,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Pusillin - On Script 2 - Close Gossip'), +(@SCRIPT_2,9,1,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 2 - Turn Off Gossip Flags'), +(@SCRIPT_2,9,2,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 2 - Say Text 1'), +(@SCRIPT_2,9,3,0,0,0,100,0,0,0,0,0,23,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'Pusillin - On Script 2 - Set Phase to 3'), +(@SCRIPT_2,9,4,0,0,0,100,0,0,0,0,0,53,1,@ENTRY*10,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 2 - Start Waypoint Movement'), + +-- Script 3 +(@SCRIPT_3,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Pusillin - On Script 3 - Close Gossip'), +(@SCRIPT_3,9,1,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 3 - Turn Off Gossip Flags'), +(@SCRIPT_3,9,2,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 3 - Say Text 2'), +(@SCRIPT_3,9,3,0,0,0,100,0,0,0,0,0,23,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'Pusillin - On Script 3 - Set Phase to 4'), +(@SCRIPT_3,9,4,0,0,0,100,0,0,0,0,0,53,1,@ENTRY*20,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 3 - Start Waypoint Movement'), + +-- Script 4 +(@SCRIPT_4,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Pusillin - On Script 4 - Close Gossip'), +(@SCRIPT_4,9,1,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 4 - Turn Off Gossip Flags'), +(@SCRIPT_4,9,2,0,0,0,100,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 4 - Say Text 3'), +(@SCRIPT_4,9,3,0,0,0,100,0,0,0,0,0,23,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'Pusillin - On Script 4 - Set Phase to 5'), +(@SCRIPT_4,9,4,0,0,0,100,0,0,0,0,0,53,1,@ENTRY*30,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 4 - Start Waypoint Movement'), + +-- Script 5 +(@SCRIPT_5,9,0,0,0,0,100,0,0,0,0,0,55,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 5 - Stop Waypoint Movement'), +(@SCRIPT_5,9,1,0,0,0,100,0,0,0,0,0,1,4,0,0,0,0,0,9,0,0,0,0,0,0,0,'Pusillin - On script 5 - Say Text 4'), +(@SCRIPT_5,9,2,0,0,0,100,0,0,0,0,0,2,168,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 5 - Set Faction Enemy'), +(@SCRIPT_5,9,3,0,0,0,100,0,100,100,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On script 5 - Set React State Hostile'), +(@SCRIPT_5,9,4,0,0,0,100,0,100,100,0,0,11,@SPELL_4,1,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Script 5 - Aura Self'), +(@SCRIPT_5,9,5,0,0,0,100,0,0,0,0,0,12,@NPC_WILDSPAWN_IMP,7,0,0,0,0,8,0,0,0,25.1447,-703.067,-12.6426,0,'Pusillin - On Script 5 - Summon Wildspawn Imp'), +(@SCRIPT_5,9,6,0,0,0,100,0,0,0,0,0,12,@NPC_WILDSPAWN_IMP,7,0,0,0,0,8,0,0,0,13.1924,-709.858,-12.6426,0,'Pusillin - On Script 5 - Summon Wildspawn Imp'), +(@SCRIPT_5,9,7,0,0,0,100,0,0,0,0,0,12,@NPC_WILDSPAWN_IMP,7,0,0,0,0,8,0,0,0,24.2691,-694.881,-12.6426,0,'Pusillin - On Script 5 - Summon Wildspawn Imp'), +(@SCRIPT_5,9,8,0,0,0,100,0,0,0,0,0,12,@NPC_WILDSPAWN_IMP,7,0,0,0,0,8,0,0,0,15.6403,-690.705,-12.6426,0,'Pusillin - On Script 5 - Summon Wildspawn Imp'), +(@SCRIPT_5,9,9,0,0,0,100,0,0,0,0,0,12,@NPC_WILDSPAWN_IMP,7,0,0,0,0,8,0,0,0,19.6062,-677.524,-12.6426,0,'Pusillin - On Script 5 - Summon Wildspawn Imp'), +(@SCRIPT_5,9,10,0,4,0,100,0,0,0,0,0,20,1,0,0,0,0,0,21,0,0,0,0,0,0,0,'Pusillin - On Aggro - Attack Nearest Player'), +(@SCRIPT_5,9,11,0,4,0,100,0,0,0,0,0,39,125,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pusillin - On Aggro - Call for help (within 125 yards)'); + +-- waypoints for Pusillin from sniff +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY,@ENTRY*10,@ENTRY*20,@ENTRY*30); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,82.88,-198.508,-4.1331,'Pusillin path'), +(@ENTRY,2,-159.153,-201.138,-4.15275,'Pusillin path'), +(@ENTRY,3,-154.512,-276.2,-4.14787,'Pusillin path'), +(@ENTRY*10,1,-159.64,-320.208,-4.14787,'Pusillin path'), +(@ENTRY*10,2,-142.923,-344.111,-4.11348,'Pusillin path'), +(@ENTRY*10,3,-84.2623,-363.37,-4.14729,'Pusillin path'), +(@ENTRY*10,4,-71.9857,-364.048,-4.14729,'Pusillin path'), +(@ENTRY*10,5,-53.8684,-348.615,-4.06211,'Pusillin path'), +(@ENTRY*10,6,-31.2778,-353.235,-4.09911,'Pusillin path'), +(@ENTRY*10,7,40.8255,-356.709,-4.12891,'Pusillin path'), +(@ENTRY*10,8,44.4199,-357.733,-4.13713,'Pusillin path'), +(@ENTRY*10,9,43.8367,-362.318,-4.14879,'Pusillin path'), +(@ENTRY*10,10,36.4393,-359.959,-4.14924,'Pusillin path'), +(@ENTRY*10,11,38.3357,-357.051,-4.13201,'Pusillin path'), +(@ENTRY*10,12,55.7067,-349.754,-4.07173,'Pusillin path'), +(@ENTRY*10,13,88.4046,-354.125,-4.10444,'Pusillin path'), +(@ENTRY*10,14,113.54,-372.365,-4.08966,'Pusillin path'), +(@ENTRY*20,1,111.71,-468.929,-2.71837,'Pusillin path'), +(@ENTRY*20,2,111.557,-485.672,-6.88627,'Pusillin path'), +(@ENTRY*20,3,111.29,-514.931,-6.91324,'Pusillin path'), +(@ENTRY*20,4,111.144,-530.976,-11.0799,'Pusillin path'), +(@ENTRY*20,5,106.029,-539.906,-11.0803,'Pusillin path'), +(@ENTRY*20,6,92.632,-544.772,-11.1469,'Pusillin path'), +(@ENTRY*20,7,78.5392,-545.053,-15.2469,'Pusillin path'), +(@ENTRY*20,8,67.4856,-547.887,-15.2466,'Pusillin path'), +(@ENTRY*20,9,54.6709,-557.626,-19.4133,'Pusillin path'), +(@ENTRY*20,10,50.4845,-565.069,-19.4122,'Pusillin path'), +(@ENTRY*20,11,49.8745,-586.269,-23.5734,'Pusillin path'), +(@ENTRY*20,12,49.3262,-636.426,-25.1286,'Pusillin path'), +(@ENTRY*30,1,39.8513,-677.459,-25.1611,'Pusillin path'), +(@ENTRY*30,2,11.7509,-698.469,-25.1611,'Pusillin path'), +(@ENTRY*30,3,4.38368,-694.666,-25.1611,'Pusillin path'), +(@ENTRY*30,4,4.88613,-671.499,-12.6426,'Pusillin path'), +(@ENTRY*30,5,8.9517,-667.447,-12.6426,'Pusillin path'), +(@ENTRY*30,6,13.0878,-672.124,-12.6426,'Pusillin path'), +(@ENTRY*30,7,16.2925,-701.417,-12.6426,'Pusillin path'); + +-- add gossip menu option id's +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN(@GOSSIP_OPTION_1,@GOSSIP_OPTION_2,@GOSSIP_OPTION_3,@GOSSIP_OPTION_4,@GOSSIP_OPTION_5) AND `id`=0; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`) VALUES +(@GOSSIP_OPTION_1,0,0,'Game? Are you crazy?',1,1), +(@GOSSIP_OPTION_2,0,0,'Why you little...',1,1), +(@GOSSIP_OPTION_3,0,0,'Mark my words, I will catch you, imp. And when I do!',1,1), +(@GOSSIP_OPTION_4,0,0,'DIE!',1,1), +(@GOSSIP_OPTION_5,0,0,'Prepare to meet your maker.',1,1); + +-- Pusillin texts +DELETE FROM `creature_text` WHERE `entry`= @ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,'If you want the key, you''ll have to catch me!',12,0,0,0,0,0,'Pusillin text #1'), +(@ENTRY,1,0,'Chase me if you dare! I run without a care!',12,0,0,0,0,0,'Pusillin text #2'), +(@ENTRY,2,0,'Why would you ever want to harm me!? Come. Friends we can be!',12,0,0,0,0,0,'Pusillin text #3'), +(@ENTRY,3,0,'DIE?! You make Pusillin cry!',12,0,0,0,0,0,'Pusillin text #4'), +(@ENTRY,4,0,'Say hello to my little friends!',12,0,0,0,0,0,'Pusillin text #5'); + +-- remove already spawned Wildspawn Imp +DELETE FROM `creature` WHERE `guid`=56995; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 143cb1f0ec1..de263fafdea 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -32,6 +32,7 @@ #include "SmartAI.h" #include "Group.h" #include "Vehicle.h" +#include "ScriptedGossip.h" SmartScript::SmartScript() { @@ -1323,7 +1324,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsCreature(*itr)) (*itr)->ToCreature()->Respawn(); else if (IsGameObject(*itr)) - (*itr)->ToGameObject()->SetRespawnTime(e.action.RespawnTarget.GoRespawnTime); + (*itr)->ToGameObject()->SetRespawnTime(e.action.RespawnTarget.goRespawnTime); } delete targets; @@ -1784,6 +1785,29 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->GetMotionMaster()->MoveJump(e.target.x, e.target.y, e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz); break; } + case SMART_ACTION_SEND_GOSSIP_MENU: + { + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossip_option_id %d", + e.action.sendGossipMenu.gossipMenuId, e.action.sendGossipMenu.gossipOptionId); + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if(Player* player = (*itr)->ToPlayer()) + { + if (e.action.sendGossipMenu.gossipMenuId) + player->PrepareGossipMenu(GetBaseObject(), e.action.sendGossipMenu.gossipMenuId, true); + else + player->PlayerTalkClass->ClearMenus(); + + player->SEND_GOSSIP_MENU(e.action.sendGossipMenu.gossipOptionId, GetBaseObject()->GetGUID()); + } + + delete targets; + break; + } default: sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType()); break; @@ -2608,6 +2632,19 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) if (e.timer < diff) { + // delay spell cast event if another spell is being casted + if (e.GetActionType() == SMART_ACTION_CAST) + { + if (!(e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS)) + { + if (me && me->HasUnitState(UNIT_STAT_CASTING)) + { + e.timer = 1; + return; + } + } + } + e.active = true;//activate events with cooldown switch (e.GetEventType())//process ONLY timed events { diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index 03d04f4b3df..7ebe8ca500f 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -222,7 +222,7 @@ class SmartScript } void DecPhase(int32 p = 1) { mEventPhase -= (mEventPhase < (uint32)p ? (uint32)p - mEventPhase : (uint32)p); } - bool IsInPhase(uint32 p) const { return mEventPhase & p; } + bool IsInPhase(uint32 p) const { return (1 << (mEventPhase - 1)) & p; } void SetPhase(uint32 p = 0) { mEventPhase = p; } SmartAIEventList mEvents; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index fab2a6b7722..b1516916760 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -775,6 +775,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_ADD_DYNAMIC_FLAG: case SMART_ACTION_REMOVE_DYNAMIC_FLAG: case SMART_ACTION_JUMP_TO_POS: + case SMART_ACTION_SEND_GOSSIP_MENU: break; default: sLog->outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 327d03d31ff..a37b95fd035 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -450,20 +450,17 @@ enum SMART_ACTION SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST = 87, // script9 ids 1-9 SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST = 88, // script9 id min, max SMART_ACTION_RANDOM_MOVE = 89, // maxDist - SMART_ACTION_SET_UNIT_FIELD_BYTES_1 = 90, // bytes, target SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1 = 91, // bytes, target - SMART_ACTION_INTERRUPT_SPELL = 92, - SMART_ACTION_SEND_GO_CUSTOM_ANIM = 93, // anim id - SMART_ACTION_SET_DYNAMIC_FLAG = 94, // Flags SMART_ACTION_ADD_DYNAMIC_FLAG = 95, // Flags SMART_ACTION_REMOVE_DYNAMIC_FLAG = 96, // Flags SMART_ACTION_JUMP_TO_POS = 97, // speedXY, speedZ, targetX, targetY, targetZ + SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId - SMART_ACTION_END = 98, + SMART_ACTION_END = 99, }; struct SmartAction @@ -859,8 +856,14 @@ struct SmartAction struct { - uint32 GoRespawnTime; + uint32 goRespawnTime; } RespawnTarget; + + struct + { + uint32 gossipMenuId; + uint32 gossipOptionId; + } sendGossipMenu; struct { diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 8dd5e17f550..9dda89a6972 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -1859,6 +1859,12 @@ bool ChatHandler::HandleDamageCommand(const char * args) return false; } + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (HasLowerSecurity((Player*)target, 0, false)) + return false; + } + if (!target->isAlive()) return true; @@ -2671,7 +2677,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args) CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'", atLogin, atLogin); - ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, *HashMapHolder<Player>::GetLock(), true); + ACE_READ_GUARD_RETURN(HashMapHolder<Player>::LockType, guard, *HashMapHolder<Player>::GetLock(), true); HashMapHolder<Player>::MapType const& plist = sObjectAccessor->GetPlayers(); for (HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr) itr->second->SetAtLoginFlag(atLogin); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e7d4e69a247..dc70781a0f3 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1595,7 +1595,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe static uint32 const BOSS_LEVEL = 83; static float const BOSS_RESISTANCE_CONSTANT = 510.0f; - uint32 level = getLevel(); + uint32 level = victim->getLevel(); float resistanceConstant = 0.0f; if (level == BOSS_LEVEL) diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index 306d19d2001..84d27efc8d9 100755 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -165,9 +165,9 @@ Unit* ObjectAccessor::FindUnit(uint64 guid) Player* ObjectAccessor::FindPlayerByName(const char* name) { - ACE_GUARD_RETURN(LockType, g, *HashMapHolder<Player>::GetLock(), NULL); - HashMapHolder<Player>::MapType& m = HashMapHolder<Player>::GetContainer(); - for (HashMapHolder<Player>::MapType::iterator iter = m.begin(); iter != m.end(); ++iter) + ACE_READ_GUARD_RETURN(HashMapHolder<Player>::LockType, g, *HashMapHolder<Player>::GetLock(), NULL); + HashMapHolder<Player>::MapType const& m = GetPlayers(); + for (HashMapHolder<Player>::MapType::const_iterator iter = m.begin(); iter != m.end(); ++iter) if (iter->second->IsInWorld() && strcmp(name, iter->second->GetName()) == 0) return iter->second; @@ -176,9 +176,9 @@ Player* ObjectAccessor::FindPlayerByName(const char* name) void ObjectAccessor::SaveAllPlayers() { - ACE_GUARD(LockType, g, *HashMapHolder<Player>::GetLock()); - HashMapHolder<Player>::MapType& m = HashMapHolder<Player>::GetContainer(); - for (HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr) + ACE_READ_GUARD(HashMapHolder<Player>::LockType, g, *HashMapHolder<Player>::GetLock()); + HashMapHolder<Player>::MapType const& m = GetPlayers(); + for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) itr->second->SaveToDB(); } @@ -380,7 +380,7 @@ void ObjectAccessor::UnloadAll() /// Define the static members of HashMapHolder template <class T> UNORDERED_MAP< uint64, T* > HashMapHolder<T>::m_objectMap; -template <class T> ACE_Thread_Mutex HashMapHolder<T>::i_lock; +template <class T> typename HashMapHolder<T>::LockType HashMapHolder<T>::i_lock; /// Global definitions for the hashmap storage diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h index 4ffe27b19d8..ae88ae3673f 100755 --- a/src/server/game/Globals/ObjectAccessor.h +++ b/src/server/game/Globals/ObjectAccessor.h @@ -48,23 +48,23 @@ class HashMapHolder public: typedef UNORDERED_MAP<uint64, T*> MapType; - typedef ACE_Thread_Mutex LockType; + typedef ACE_RW_Thread_Mutex LockType; static void Insert(T* o) { - ACE_GUARD(LockType, Guard, i_lock); + ACE_WRITE_GUARD(LockType, Guard, i_lock); m_objectMap[o->GetGUID()] = o; } static void Remove(T* o) { - ACE_GUARD(LockType, Guard, i_lock); + ACE_WRITE_GUARD(LockType, Guard, i_lock); m_objectMap.erase(o->GetGUID()); } static T* Find(uint64 guid) { - ACE_GUARD_RETURN(LockType, Guard, i_lock, NULL); + ACE_READ_GUARD_RETURN(LockType, Guard, i_lock, NULL); typename MapType::iterator itr = m_objectMap.find(guid); return (itr != m_objectMap.end()) ? itr->second : NULL; } @@ -198,22 +198,22 @@ class ObjectAccessor Player* FindPlayerByName(const char* name); // when using this, you must use the hashmapholder's lock - HashMapHolder<Player>::MapType& GetPlayers() + HashMapHolder<Player>::MapType const& GetPlayers() const { return HashMapHolder<Player>::GetContainer(); } // when using this, you must use the hashmapholder's lock - HashMapHolder<Creature>::MapType& GetCreatures() - { - return HashMapHolder<Creature>::GetContainer(); - } - - // when using this, you must use the hashmapholder's lock - HashMapHolder<GameObject>::MapType& GetGameObjects() - { - return HashMapHolder<GameObject>::GetContainer(); - } + //HashMapHolder<Creature>::MapType& GetCreatures() + //{ + // return HashMapHolder<Creature>::GetContainer(); + //} + + //// when using this, you must use the hashmapholder's lock + //HashMapHolder<GameObject>::MapType& GetGameObjects() + //{ + // return HashMapHolder<GameObject>::GetContainer(); + //} template<class T> void AddObject(T* object) { diff --git a/src/server/game/Grids/GridStates.cpp b/src/server/game/Grids/GridStates.cpp index dcf7c3bf1ad..fd5e3c68a51 100755 --- a/src/server/game/Grids/GridStates.cpp +++ b/src/server/game/Grids/GridStates.cpp @@ -22,24 +22,24 @@ #include "Log.h" void -InvalidState::Update(Map &, NGridType &, GridInfo &, const uint32 /*x*/, const uint32 /*y*/, const uint32) const +InvalidState::Update(Map &, NGridType &, GridInfo &, const uint32) const { } void -ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 x, const uint32 y, const uint32 t_diff) const +ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 t_diff) const { // Only check grid activity every (grid_expiry/10) ms, because it's really useless to do it every cycle info.UpdateTimeTracker(t_diff); if (info.getTimeTracker().Passed()) { - if (grid.ActiveObjectsInGrid() == 0 && !m.ActiveObjectsNearGrid(x, y)) + if (grid.ActiveObjectsInGrid() == 0 && !m.ActiveObjectsNearGrid(grid)) { ObjectGridStoper worker; TypeContainerVisitor<ObjectGridStoper, GridTypeMapContainer> visitor(worker); grid.VisitAllGrids(visitor); grid.SetGridState(GRID_STATE_IDLE); - sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to IDLE state", x, y, m.GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to IDLE state", grid.getX(), grid.getY(), m.GetId()); } else { @@ -49,24 +49,24 @@ ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 x, co } void -IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32 x, const uint32 y, const uint32) const +IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32) const { m.ResetGridExpiry(grid); grid.SetGridState(GRID_STATE_REMOVAL); - sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to REMOVAL state", x, y, m.GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to REMOVAL state", grid.getX(), grid.getY(), m.GetId()); } void -RemovalState::Update(Map &m, NGridType &grid, GridInfo &info, const uint32 x, const uint32 y, const uint32 t_diff) const +RemovalState::Update(Map &m, NGridType &grid, GridInfo &info, const uint32 t_diff) const { if (!info.getUnloadLock()) { info.UpdateTimeTracker(t_diff); if (info.getTimeTracker().Passed()) { - if (!m.UnloadGrid(x, y, false)) + if (!m.UnloadGrid(grid, false)) { - sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] for map %u differed unloading due to players or active objects nearby", x, y, m.GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] for map %u differed unloading due to players or active objects nearby", grid.getX(), grid.getY(), m.GetId()); m.ResetGridExpiry(grid); } } diff --git a/src/server/game/Grids/GridStates.h b/src/server/game/Grids/GridStates.h index 81bf749b63f..78f70356608 100755 --- a/src/server/game/Grids/GridStates.h +++ b/src/server/game/Grids/GridStates.h @@ -40,35 +40,31 @@ class GridState void setMagic() { i_Magic = MAGIC_TESTVAL; } unsigned int i_Magic; #endif - virtual void Update(Map &, NGridType&, GridInfo &, const uint32 x, const uint32 y, const uint32 t_diff) const = 0; + virtual void Update(Map &, NGridType&, GridInfo &, const uint32 t_diff) const = 0; }; class InvalidState : public GridState { public: - - void Update(Map &, NGridType &, GridInfo &, const uint32 x, const uint32 y, const uint32 t_diff) const; + void Update(Map &, NGridType &, GridInfo &, const uint32 t_diff) const; }; class ActiveState : public GridState { public: - - void Update(Map &, NGridType &, GridInfo &, const uint32 x, const uint32 y, const uint32 t_diff) const; + void Update(Map &, NGridType &, GridInfo &, const uint32 t_diff) const; }; class IdleState : public GridState { public: - - void Update(Map &, NGridType &, GridInfo &, const uint32 x, const uint32 y, const uint32 t_diff) const; + void Update(Map &, NGridType &, GridInfo &, const uint32 t_diff) const; }; class RemovalState : public GridState { public: - - void Update(Map &, NGridType &, GridInfo &, const uint32 x, const uint32 y, const uint32 t_diff) const; + void Update(Map &, NGridType &, GridInfo &, const uint32 t_diff) const; }; #endif diff --git a/src/server/game/Grids/NGrid.h b/src/server/game/Grids/NGrid.h index bcd03edb2b8..b814fd386a5 100755 --- a/src/server/game/Grids/NGrid.h +++ b/src/server/game/Grids/NGrid.h @@ -77,7 +77,6 @@ class GRID_OBJECT_TYPES class NGrid { public: - typedef Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> GridType; NGrid(uint32 id, int32 x, int32 y, time_t expiry, bool unload = true) : i_gridId(id), i_x(x), i_y(y), i_cellstate(GRID_STATE_INVALID), i_GridObjectDataLoaded(false) @@ -85,13 +84,13 @@ class NGrid i_GridInfo = GridInfo(expiry, unload); } - const GridType& operator()(unsigned short x, unsigned short y) const + GridType& GetGridType(const uint32 x, const uint32 y) { ASSERT(x < N && y < N); return i_cells[x][y]; } - GridType& operator()(unsigned short x, unsigned short y) + GridType const& GetGridType(const uint32 x, const uint32 y) const { ASSERT(x < N && y < N); return i_cells[x][y]; @@ -123,12 +122,22 @@ class NGrid template<class SPECIFIC_OBJECT> void AddWorldObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj) { - getGridType(x, y).AddWorldObject(obj); + GetGridType(x, y).AddWorldObject(obj); } template<class SPECIFIC_OBJECT> void RemoveWorldObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj) { - getGridType(x, y).RemoveWorldObject(obj); + GetGridType(x, y).RemoveWorldObject(obj); + } + + template<class SPECIFIC_OBJECT> void AddGridObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj) + { + GetGridType(x, y).AddGridObject(obj); + } + + template<class SPECIFIC_OBJECT> void RemoveGridObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj) + { + GetGridType(x, y).RemoveGridObject(obj); } // Visit all Grids (cells) in NGrid (grid) @@ -137,14 +146,14 @@ class NGrid { for (uint32 x = 0; x < N; ++x) for (uint32 y = 0; y < N; ++y) - getGridType(x, y).Visit(visitor); + GetGridType(x, y).Visit(visitor); } // Visit a single Grid (cell) in NGrid (grid) template<class T, class TT> void VisitGrid(const uint32 x, const uint32 y, TypeContainerVisitor<T, TypeMapContainer<TT> > &visitor) { - getGridType(x, y).Visit(visitor); + GetGridType(x, y).Visit(visitor); } unsigned int ActiveObjectsInGrid(void) const @@ -156,24 +165,7 @@ class NGrid return count; } - template<class SPECIFIC_OBJECT> bool AddGridObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj) - { - return getGridType(x, y).AddGridObject(obj); - } - - template<class SPECIFIC_OBJECT> bool RemoveGridObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj) - { - return getGridType(x, y).RemoveGridObject(obj); - } - private: - - GridType& getGridType(const uint32 x, const uint32 y) - { - ASSERT(x < N && y < N); - return i_cells[x][y]; - } - uint32 i_gridId; GridInfo i_GridInfo; GridReference<NGrid<N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> > i_Reference; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 425a31fc38a..ebeac025f1d 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -238,9 +238,9 @@ void Map::AddToGrid(T* obj, Cell const& cell) { NGridType* grid = getNGrid(cell.GridX(), cell.GridY()); if (obj->m_isWorldObject) - (*grid)(cell.CellX(), cell.CellY()).template AddWorldObject<T>(obj); + grid->GetGridType(cell.CellX(), cell.CellY()).template AddWorldObject<T>(obj); else - (*grid)(cell.CellX(), cell.CellY()).template AddGridObject<T>(obj); + grid->GetGridType(cell.CellX(), cell.CellY()).template AddGridObject<T>(obj); } template<> @@ -248,9 +248,9 @@ void Map::AddToGrid(Creature* obj, Cell const& cell) { NGridType* grid = getNGrid(cell.GridX(), cell.GridY()); if (obj->m_isWorldObject) - (*grid)(cell.CellX(), cell.CellY()).AddWorldObject(obj); + grid->GetGridType(cell.CellX(), cell.CellY()).AddWorldObject(obj); else - (*grid)(cell.CellX(), cell.CellY()).AddGridObject(obj); + grid->GetGridType(cell.CellX(), cell.CellY()).AddGridObject(obj); obj->SetCurrentCell(cell); } @@ -260,9 +260,9 @@ void Map::RemoveFromGrid(T* obj, Cell const& cell) { NGridType* grid = getNGrid(cell.GridX(), cell.GridY()); if (obj->m_isWorldObject) - (*grid)(cell.CellX(), cell.CellY()).template RemoveWorldObject<T>(obj); + grid->GetGridType(cell.CellX(), cell.CellY()).template RemoveWorldObject<T>(obj); else - (*grid)(cell.CellX(), cell.CellY()).template RemoveGridObject<T>(obj); + grid->GetGridType(cell.CellX(), cell.CellY()).template RemoveGridObject<T>(obj); } template<class T> @@ -283,27 +283,17 @@ void Map::SwitchGridContainers(T* obj, bool on) NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY()); ASSERT(ngrid != NULL); - GridType &grid = (*ngrid)(cell.CellX(), cell.CellY()); + GridType &grid = ngrid->GetGridType(cell.CellX(), cell.CellY()); if (on) { grid.RemoveGridObject<T>(obj); grid.AddWorldObject<T>(obj); - /*if (!grid.RemoveGridObject<T>(obj, obj->GetGUID()) - || !grid.AddWorldObject<T>(obj, obj->GetGUID())) - { - ASSERT(false); - }*/ } else { grid.RemoveWorldObject<T>(obj); grid.AddGridObject<T>(obj); - /*if (!grid.RemoveWorldObject<T>(obj, obj->GetGUID()) - || !grid.AddGridObject<T>(obj, obj->GetGUID())) - { - ASSERT(false); - }*/ } obj->m_isWorldObject = on; } @@ -387,7 +377,7 @@ bool Map::EnsureGridLoaded(const Cell &cell) loader.LoadN(); // Add resurrectable corpses to world object list in grid - sObjectAccessor->AddCorpsesToGrid(GridCoord(cell.GridX(), cell.GridY()), (*grid)(cell.CellX(), cell.CellY()), this); + sObjectAccessor->AddCorpsesToGrid(GridCoord(cell.GridX(), cell.GridY()), grid->GetGridType(cell.CellX(), cell.CellY()), this); return true; } @@ -944,13 +934,13 @@ bool Map::CreatureRespawnRelocation(Creature* c, bool diffGridOnly) return false; } -bool Map::UnloadGrid(const uint32 x, const uint32 y, bool unloadAll) +bool Map::UnloadGrid(NGridType& ngrid, bool unloadAll) { - NGridType *grid = getNGrid(x, y); - ASSERT(grid != NULL); + const uint32 x = ngrid.getX(); + const uint32 y = ngrid.getY(); { - if (!unloadAll && ActiveObjectsNearGrid(x, y)) + if (!unloadAll && ActiveObjectsNearGrid(ngrid)) return false; sLog->outDebug(LOG_FILTER_MAPS, "Unloading grid[%u, %u] for map %u", x, y, GetId()); @@ -964,7 +954,7 @@ bool Map::UnloadGrid(const uint32 x, const uint32 y, bool unloadAll) // move creatures to respawn grids if this is diff.grid or to remove list ObjectGridEvacuator worker; TypeContainerVisitor<ObjectGridEvacuator, GridTypeMapContainer> visitor(worker); - grid->VisitAllGrids(visitor); + ngrid.VisitAllGrids(visitor); // Finish creature moves, remove and delete all creatures with delayed remove before unload MoveAllCreaturesInMoveList(); @@ -973,7 +963,7 @@ bool Map::UnloadGrid(const uint32 x, const uint32 y, bool unloadAll) { ObjectGridCleaner worker; TypeContainerVisitor<ObjectGridCleaner, GridTypeMapContainer> visitor(worker); - grid->VisitAllGrids(visitor); + ngrid.VisitAllGrids(visitor); } RemoveAllObjectsInRemoveList(); @@ -981,12 +971,12 @@ bool Map::UnloadGrid(const uint32 x, const uint32 y, bool unloadAll) { ObjectGridUnloader worker; TypeContainerVisitor<ObjectGridUnloader, GridTypeMapContainer> visitor(worker); - grid->VisitAllGrids(visitor); + ngrid.VisitAllGrids(visitor); } ASSERT(i_objectsToRemove.empty()); - delete grid; + delete &ngrid; setNGrid(NULL, x, y); } int gx = (MAX_NUMBER_OF_GRIDS - 1) - x; @@ -1040,7 +1030,7 @@ void Map::UnloadAll() { NGridType &grid(*i->getSource()); ++i; - UnloadGrid(grid.getX(), grid.getY(), true); // deletes the grid and removes it from the GridRefManager + UnloadGrid(grid, true); // deletes the grid and removes it from the GridRefManager } } @@ -1999,7 +1989,7 @@ void Map::DelayedUpdate(const uint32 t_diff) GridInfo* info = i->getSource()->getGridInfoRef(); ++i; // The update might delete the map and we need the next map before the iterator gets invalid ASSERT(grid->GetGridState() >= 0 && grid->GetGridState() < MAX_GRID_STATE); - si_GridStates[grid->GetGridState()]->Update(*this, *grid, *info, grid->getX(), grid->getY(), t_diff); + si_GridStates[grid->GetGridState()]->Update(*this, *grid, *info, t_diff); } } } @@ -2102,11 +2092,9 @@ void Map::SendToPlayers(WorldPacket const* data) const itr->getSource()->GetSession()->SendPacket(data); } -bool Map::ActiveObjectsNearGrid(uint32 x, uint32 y) const +bool Map::ActiveObjectsNearGrid(NGridType const& ngrid) const { - ASSERT(x < MAX_NUMBER_OF_GRIDS && y < MAX_NUMBER_OF_GRIDS); - - CellCoord cell_min(x*MAX_NUMBER_OF_CELLS, y*MAX_NUMBER_OF_CELLS); + CellCoord cell_min(ngrid.getX() * MAX_NUMBER_OF_CELLS, ngrid.getY() * MAX_NUMBER_OF_CELLS); CellCoord cell_max(cell_min.x_coord + MAX_NUMBER_OF_CELLS, cell_min.y_coord+MAX_NUMBER_OF_CELLS); //we must find visible range in cells so we unload only non-visible cells... diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index a8386360ae2..053759a3ab3 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -275,7 +275,7 @@ class Map : public GridRefManager<NGridType> bool GetUnloadLock(const GridCoord &p) const { return getNGrid(p.x_coord, p.y_coord)->getUnloadLock(); } void SetUnloadLock(const GridCoord &p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadExplicitLock(on); } void LoadGrid(float x, float y); - bool UnloadGrid(const uint32 x, const uint32 y, bool pForce); + bool UnloadGrid(NGridType& ngrid, bool pForce); virtual void UnloadAll(); void ResetGridExpiry(NGridType &grid, float factor = 1) const @@ -379,7 +379,7 @@ class Map : public GridRefManager<NGridType> bool HavePlayers() const { return !m_mapRefManager.isEmpty(); } uint32 GetPlayersCountExceptGMs() const; - bool ActiveObjectsNearGrid(uint32 x, uint32 y) const; + bool ActiveObjectsNearGrid(NGridType const& ngrid) const; void AddWorldObject(WorldObject* obj) { i_worldObjects.insert(obj); } void RemoveWorldObject(WorldObject* obj) { i_worldObjects.erase(obj); } diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 293933c8bb9..bbef60aa5e7 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -260,7 +260,7 @@ void PoolGroup<Quest>::Despawn1Object(uint32 quest_id) QuestRelations::iterator lastElement = questMap->upper_bound(itr->second); for (; qitr != lastElement; ++qitr) { - if (qitr->first == itr->second) + if (qitr->first == itr->second && qitr->second == itr->first) { questMap->erase(qitr); // iterator is now no more valid break; // but we can exit loop since the element is found @@ -279,7 +279,7 @@ void PoolGroup<Quest>::Despawn1Object(uint32 quest_id) QuestRelations::iterator lastElement = questMap->upper_bound(itr->second); for (; qitr != lastElement; ++qitr) { - if (qitr->first == itr->second) + if (qitr->first == itr->second && qitr->second == itr->first) { questMap->erase(qitr); // iterator is now no more valid break; // but we can exit loop since the element is found diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index a1a1f5d5cac..9650afb60e2 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -205,6 +205,11 @@ int32 Quest::GetRewOrReqMoney() const return int32(RewOrReqMoney * sWorld->getRate(RATE_DROP_MONEY)); } +bool Quest::IsAutoComplete() const +{ + return QuestMethod == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE); +} + bool Quest::IsAllowedInRaid() const { if (IsRaidQuest()) diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 61d492ce88c..90e52660160 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -246,7 +246,7 @@ class Quest uint32 GetQuestStartScript() const { return QuestStartScript; } uint32 GetQuestCompleteScript() const { return QuestCompleteScript; } bool IsRepeatable() const { return QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE; } - bool IsAutoComplete() const { return QuestMethod ? false : true; } + bool IsAutoComplete() const; uint32 GetFlags() const { return QuestFlags; } bool IsDaily() const { return QuestFlags & QUEST_FLAGS_DAILY; } bool IsWeekly() const { return QuestFlags & QUEST_FLAGS_WEEKLY; } diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 1b0cef69c04..971e0b89c0f 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -239,8 +239,8 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) data << uint32(matchcount); // placeholder, count of players matching criteria data << uint32(displaycount); // placeholder, count of players displayed - ACE_GUARD(ACE_Thread_Mutex, g, *HashMapHolder<Player>::GetLock()); - HashMapHolder<Player>::MapType& m = sObjectAccessor->GetPlayers(); + ACE_READ_GUARD(HashMapHolder<Player>::LockType, g, *HashMapHolder<Player>::GetLock()); + HashMapHolder<Player>::MapType const& m = sObjectAccessor->GetPlayers(); for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) { if (AccountMgr::IsPlayerAccount(security)) diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index 2a352e92d01..68ccf96bb87 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -117,8 +117,8 @@ public: bool first = true; bool footer = false; - ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, *HashMapHolder<Player>::GetLock(), true); - HashMapHolder<Player>::MapType& m = sObjectAccessor->GetPlayers(); + ACE_READ_GUARD_RETURN(HashMapHolder<Player>::LockType, guard, *HashMapHolder<Player>::GetLock(), true); + HashMapHolder<Player>::MapType const& m = sObjectAccessor->GetPlayers(); for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) { AccountTypes itrSec = itr->second->GetSession()->GetSecurity(); diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index 10b7066068b..d02cce3f17c 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -35,91 +35,6 @@ EndContentData */ #include "ScriptedEscortAI.h" /*###### -## npc_prospector_anvilward -######*/ - -#define GOSSIP_HELLO "I need a moment of your time, sir." -#define GOSSIP_SELECT "Why... yes, of course. I've something to show you right inside this building, Mr. Anvilward." - -enum eProspectorAnvilward -{ - SAY_ANVIL1 = -1000209, - SAY_ANVIL2 = -1000210, - QUEST_THE_DWARVEN_SPY = 8483, -}; - -class npc_prospector_anvilward : public CreatureScript -{ -public: - npc_prospector_anvilward() : CreatureScript("npc_prospector_anvilward") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(8240, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->CLOSE_GOSSIP_MENU(); - if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_anvilward::npc_prospector_anvilwardAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_THE_DWARVEN_SPY) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(8239, creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_prospector_anvilwardAI(creature); - } - - struct npc_prospector_anvilwardAI : public npc_escortAI - { - // CreatureAI functions - npc_prospector_anvilwardAI(Creature* c) : npc_escortAI(c) {} - - // Pure Virtual Functions - void WaypointReached(uint32 i) - { - Player* player = GetPlayerForEscort(); - - if (!player) - return; - - switch (i) - { - case 0: DoScriptText(SAY_ANVIL1, me, player); break; - case 5: DoScriptText(SAY_ANVIL2, me, player); break; - case 6: me->setFaction(24); break; - } - } - - void Reset() - { - me->RestoreFaction(); - } - - void JustDied(Unit* /*killer*/) - { - me->RestoreFaction(); - } - }; - -}; - -/*###### ## Quest 9686 Second Trial ######*/ @@ -711,7 +626,6 @@ public: void AddSC_eversong_woods() { - new npc_prospector_anvilward(); new npc_second_trial_controller(); new npc_second_trial_paladin(); new go_second_trial(); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index e4749fd2ffe..be83c4d326a 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -284,7 +284,7 @@ public: if (m_uiPenetratingColdTimer <= uiDiff) { - me->CastCustomSpell(SPELL_PENETRATING_COLD, SPELLVALUE_MAX_TARGETS, RAID_MODE(2, 5)); + me->CastCustomSpell(SPELL_PENETRATING_COLD, SPELLVALUE_MAX_TARGETS, RAID_MODE(2, 5, 2, 5)); m_uiPenetratingColdTimer = 20*IN_MILLISECONDS; } else m_uiPenetratingColdTimer -= uiDiff; diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/dalaran.cpp index be9e9308f4f..8ff5a314dcc 100644 --- a/src/server/scripts/Northrend/dalaran.cpp +++ b/src/server/scripts/Northrend/dalaran.cpp @@ -70,8 +70,9 @@ public: return; Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself(); - - if (!player || player->isGameMaster() || player->IsBeingTeleported()) + + // If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass + if (!player || player->isGameMaster() || player->IsBeingTeleported() || player->HasAura(70973) || player->HasAura(70971)) return; switch (me->GetEntry()) diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index b639050320c..726edb5efb2 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -19,330 +19,20 @@ /* ScriptData SDName: Nagrand SD%Complete: 90 -SDComment: Quest support: 9849, 9868, 9918, 9874, 9991, 10107, 10108, 10044, 10172, 10646, 10085, 10987. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text) +SDComment: Quest support: 9868, 9874, 10044, 10172, 10085. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text) SDCategory: Nagrand EndScriptData */ /* ContentData -mob_shattered_rumbler -mob_lump -npc_altruis_the_sufferer npc_greatmother_geyah -npc_lantresor_of_the_blade npc_maghar_captive npc_creditmarker_visit_with_ancestors -mob_sparrowhawk EndContentData */ #include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### -## mob_shattered_rumbler - this should be done with ACID -######*/ - -class mob_shattered_rumbler : public CreatureScript -{ -public: - mob_shattered_rumbler() : CreatureScript("mob_shattered_rumbler") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_shattered_rumblerAI (creature); - } - - struct mob_shattered_rumblerAI : public ScriptedAI - { - bool Spawn; - - mob_shattered_rumblerAI(Creature* c) : ScriptedAI(c) {} - - void Reset() - { - Spawn = false; - } - - void EnterCombat(Unit* /*who*/) {} - - void SpellHit(Unit* Hitter, const SpellInfo* Spellkind) - { - if (Spellkind->Id == 32001 && !Spawn) - { - float x = me->GetPositionX(); - float y = me->GetPositionY(); - float z = me->GetPositionZ(); - - Hitter->SummonCreature(18181, x+(0.7f * (rand()%30)), y+(rand()%5), z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); - Hitter->SummonCreature(18181, x+(rand()%5), y-(rand()%5), z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); - Hitter->SummonCreature(18181, x-(rand()%5), y+(0.5f *(rand()%60)), z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); - me->setDeathState(CORPSE); - Spawn = true; - } - return; - } - }; - -}; - -/*###### -## mob_lump -######*/ - -#define SPELL_VISUAL_SLEEP 16093 -#define SPELL_SPEAR_THROW 32248 - -#define LUMP_SAY0 -1000190 -#define LUMP_SAY1 -1000191 - -#define LUMP_DEFEAT -1000192 - -#define GOSSIP_HL "I need answers, ogre!" -#define GOSSIP_SL1 "Why are Boulderfist out this far? You know that this is Kurenai territory." -#define GOSSIP_SL2 "And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar." -#define GOSSIP_SL3 "This means war, Lump! War I say!" - -class mob_lump : public CreatureScript -{ -public: - mob_lump() : CreatureScript("mob_lump") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(9353, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(9354, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(9355, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->SEND_GOSSIP_MENU(9356, creature->GetGUID()); - player->TalkedToCreature(18354, creature->GetGUID()); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(9352, creature->GetGUID()); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_lumpAI(creature); - } - - struct mob_lumpAI : public ScriptedAI - { - mob_lumpAI(Creature* c) : ScriptedAI(c) - { - bReset = false; - } - - uint32 Reset_Timer; - uint32 Spear_Throw_Timer; - bool bReset; - - void Reset() - { - Reset_Timer = 60000; - Spear_Throw_Timer = 2000; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim()) - return; - - if (me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* done_by, uint32 & damage) - { - if (done_by->GetTypeId() == TYPEID_PLAYER && me->HealthBelowPctDamaged(30, damage)) - { - if (!bReset && CAST_PLR(done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE) - { - //Take 0 damage - damage = 0; - - CAST_PLR(done_by)->AttackStop(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(true); - me->setFaction(1080); //friendly - me->SetStandState(UNIT_STAND_STATE_SIT); - DoScriptText(LUMP_DEFEAT, me); - - bReset = true; - } - } - } - - void EnterCombat(Unit* /*who*/) - { - if (me->HasAura(SPELL_VISUAL_SLEEP)) - me->RemoveAura(SPELL_VISUAL_SLEEP); - - if (!me->IsStandState()) - me->SetStandState(UNIT_STAND_STATE_STAND); - - DoScriptText(RAND(LUMP_SAY0, LUMP_SAY1), me); - } - - void UpdateAI(const uint32 diff) - { - //check if we waiting for a reset - if (bReset) - { - if (Reset_Timer <= diff) - { - EnterEvadeMode(); - bReset = false; - me->setFaction(1711); //hostile - return; - } - else Reset_Timer -= diff; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Spear_Throw_Timer - if (Spear_Throw_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SPEAR_THROW); - Spear_Throw_Timer = 20000; - } else Spear_Throw_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### -## npc_altruis_the_sufferer -######*/ - -#define GOSSIP_HATS1 "I see twisted steel and smell sundered earth." -#define GOSSIP_HATS2 "Well...?" -#define GOSSIP_HATS3 "[PH] Story about Illidan's Pupil" - -#define GOSSIP_SATS1 "Legion?" -#define GOSSIP_SATS2 "And now?" -#define GOSSIP_SATS3 "How do you see them now?" -#define GOSSIP_SATS4 "Forge camps?" -#define GOSSIP_SATS5 "Ok." -#define GOSSIP_SATS6 "[PH] Story done" - -class npc_altruis_the_sufferer : public CreatureScript -{ -public: - npc_altruis_the_sufferer() : CreatureScript("npc_altruis_the_sufferer") { } - - bool OnQuestAccept(Player* player, Creature* /*creature*/, Quest const* /*quest*/) - { - if (!player->GetQuestRewardStatus(9991)) //Survey the Land, q-id 9991 - { - player->CLOSE_GOSSIP_MENU(); - player->ActivateTaxiPathTo(532); //TaxiPath 532 - } - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+10: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - player->SEND_GOSSIP_MENU(9420, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); - player->SEND_GOSSIP_MENU(9421, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+12: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); - player->SEND_GOSSIP_MENU(9422, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+13: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); - player->SEND_GOSSIP_MENU(9423, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+14: - player->SEND_GOSSIP_MENU(9424, creature->GetGUID()); - break; - - case GOSSIP_ACTION_INFO_DEF+20: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); - player->SEND_GOSSIP_MENU(9427, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+21: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(9991); - break; - - case GOSSIP_ACTION_INFO_DEF+30: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31); - player->SEND_GOSSIP_MENU(384, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+31: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(10646); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - //gossip before obtaining Survey the Land - if (player->GetQuestStatus(9991) == QUEST_STATUS_NONE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10); - - //gossip when Survey the Land is incomplete (technically, after the flight) - if (player->GetQuestStatus(9991) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20); - - //wowwiki.com/Varedis - if (player->GetQuestStatus(10646) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+30); - - player->SEND_GOSSIP_MENU(9419, creature->GetGUID()); - - return true; - } - -}; - -/*###### ## npc_greatmother_geyah ######*/ @@ -453,83 +143,6 @@ public: }; -/*###### -## npc_lantresor_of_the_blade -######*/ - -#define GOSSIP_HLB "I have killed many of your ogres, Lantresor. I have no fear." -#define GOSSIP_SLB1 "Should I know? You look like an orc to me." -#define GOSSIP_SLB2 "And the other half?" -#define GOSSIP_SLB3 "I have heard of your kind, but I never thought to see the day when I would meet a half-breed." -#define GOSSIP_SLB4 "My apologies. I did not mean to offend. I am here on behalf of my people." -#define GOSSIP_SLB5 "My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces." -#define GOSSIP_SLB6 "We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people." -#define GOSSIP_SLB7 "What do I need to do?" - -class npc_lantresor_of_the_blade : public CreatureScript -{ -public: - npc_lantresor_of_the_blade() : CreatureScript("npc_lantresor_of_the_blade") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(9362, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(9363, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(9364, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(9365, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->SEND_GOSSIP_MENU(9366, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - player->SEND_GOSSIP_MENU(9367, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - player->SEND_GOSSIP_MENU(9368, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->SEND_GOSSIP_MENU(9369, creature->GetGUID()); - if (player->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(10107); - if (player->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(10108); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HLB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(9361, creature->GetGUID()); - - return true; - } - -}; - /*##### ## npc_maghar_captive #####*/ @@ -747,113 +360,9 @@ public: }; /*###### -## mob_sparrowhawk +## go_corkis_prison and npc_corki ######*/ -#define SPELL_SPARROWHAWK_NET 39810 -#define SPELL_ITEM_CAPTIVE_SPARROWHAWK 39812 - -class mob_sparrowhawk : public CreatureScript -{ -public: - mob_sparrowhawk() : CreatureScript("mob_sparrowhawk") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_sparrowhawkAI (creature); - } - - struct mob_sparrowhawkAI : public ScriptedAI - { - - mob_sparrowhawkAI(Creature* c) : ScriptedAI(c) {} - - uint32 Check_Timer; - uint64 PlayerGUID; - bool fleeing; - - void Reset() - { - me->RemoveAurasDueToSpell(SPELL_SPARROWHAWK_NET); - Check_Timer = 1000; - PlayerGUID = 0; - fleeing = false; - } - void AttackStart(Unit* who) - { - if (PlayerGUID) - return; - - ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit* /*who*/) {} - - void MoveInLineOfSight(Unit* who) - { - if (!who || PlayerGUID) - return; - - if (!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE) - { - PlayerGUID = who->GetGUID(); - return; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void UpdateAI(const uint32 diff) - { - if (Check_Timer <= diff) - { - if (PlayerGUID) - { - if (fleeing && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE) - fleeing = false; - - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && me->IsWithinDistInMap(player, 30)) - { - if (!fleeing) - { - me->DeleteThreatList(); - me->GetMotionMaster()->MoveFleeing(player); - fleeing = true; - } - } - else if (fleeing) - { - me->GetMotionMaster()->MovementExpired(false); - PlayerGUID = 0; - fleeing = false; - } - } - Check_Timer = 1000; - } else Check_Timer -= diff; - - if (PlayerGUID) - return; - - ScriptedAI::UpdateAI(diff); - } - - void SpellHit(Unit* caster, const SpellInfo* spell) - { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - if (spell->Id == SPELL_SPARROWHAWK_NET && CAST_PLR(caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE) - { - DoCast(caster, SPELL_ITEM_CAPTIVE_SPARROWHAWK, true); - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - } - return; - } - }; -}; - enum CorkiData { // first quest @@ -916,10 +425,6 @@ public: } }; -/*###### -## npc_corki -######*/ - class npc_corki : public CreatureScript { public: @@ -970,16 +475,241 @@ public: }; }; +/*##### +## npc_kurenai_captive +#####*/ + +enum KurenaiCaptive +{ + SAY_KUR_START = 0, + SAY_KUR_NO_ESCAPE = 1, + SAY_KUR_MORE = 2, + SAY_KUR_MORE_TWO = 3, + SAY_KUR_LIGHTNING = 4, + SAY_KUR_SHOCK = 5, + SAY_KUR_COMPLETE = 6, + + SPELL_KUR_CHAIN_LIGHTNING = 16006, + SPELL_KUR_EARTHBIND_TOTEM = 15786, + SPELL_KUR_FROST_SHOCK = 12548, + SPELL_KUR_HEALING_WAVE = 12491, + + QUEST_TOTEM_KARDASH_A = 9879, + + NPC_KUR_MURK_RAIDER = 18203, + NPC_KUR_MURK_BRUTE = 18211, + NPC_KUR_MURK_SCAVENGER = 18207, + NPC_KUR_MURK_PUTRIFIER = 18202, +}; + +static float kurenaiAmbushA[]= {-1568.805786f, 8533.873047f, 1.958f}; +static float kurenaiAmbushB[]= {-1491.554321f, 8506.483398f, 1.248f}; + +class npc_kurenai_captive : public CreatureScript +{ +public: + npc_kurenai_captive() : CreatureScript("npc_kurenai_captive") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_TOTEM_KARDASH_A) + { + if (npc_kurenai_captiveAI* EscortAI = dynamic_cast<npc_kurenai_captiveAI*>(creature->AI())) + { + creature->SetStandState(UNIT_STAND_STATE_STAND); + EscortAI->Start(true, false, player->GetGUID(), quest); + DoScriptText(SAY_KUR_START, creature); + + creature->SummonCreature(NPC_KUR_MURK_RAIDER, kurenaiAmbushA[0]+2.5f, kurenaiAmbushA[1]-2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + creature->SummonCreature(NPC_KUR_MURK_BRUTE, kurenaiAmbushA[0]-2.5f, kurenaiAmbushA[1]+2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + creature->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushA[0], kurenaiAmbushA[1], kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + } + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_kurenai_captiveAI(creature); + } + + struct npc_kurenai_captiveAI : public npc_escortAI + { + npc_kurenai_captiveAI(Creature* creature) : npc_escortAI(creature) { } + + uint32 ChainLightningTimer; + uint32 HealTimer; + uint32 FrostShockTimer; + + void Reset() + { + ChainLightningTimer = 1000; + HealTimer = 0; + FrostShockTimer = 6000; + } + + void EnterCombat(Unit* /*who*/) + { + DoCast(me, SPELL_KUR_EARTHBIND_TOTEM, false); + } + + void JustDied(Unit* /*killer*/) + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + if (Player* player = GetPlayerForEscort()) + { + if (player->GetQuestStatus(QUEST_TOTEM_KARDASH_A) != QUEST_STATUS_COMPLETE) + player->FailQuest(QUEST_TOTEM_KARDASH_A); + } + } + + void WaypointReached(uint32 PointId) + { + switch(PointId) + { + case 3: + { + Talk(SAY_KUR_MORE); + + if (Creature* temp = me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0], kurenaiAmbushB[1], kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000)) + Talk(SAY_KUR_MORE_TWO); + + me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0]-2.5f, kurenaiAmbushB[1]-2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushB[0]+2.5f, kurenaiAmbushB[1]+2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushB[0]+2.5f, kurenaiAmbushB[1]-2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + } + case 7: + { + Talk(SAY_KUR_COMPLETE); + + if (Player* player = GetPlayerForEscort()) + player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me); + + SetRun(); + break; + } + } + } + + void JustSummoned(Creature* summoned) + { + if (summoned->GetEntry() == NPC_KUR_MURK_BRUTE) + Talk(SAY_KUR_NO_ESCAPE); + + // This function is for when we summoned enemies to fight - so that does NOT mean we should make our totem count in this! + if (summoned->isTotem()) + return; + + summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); + summoned->AI()->AttackStart(me); + } + + void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) + { + if (spell->Id == SPELL_KUR_CHAIN_LIGHTNING) + { + if (rand()%30) + return; + + Talk(SAY_KUR_LIGHTNING); + } + + if (spell->Id == SPELL_KUR_FROST_SHOCK) + { + if (rand()%30) + return; + + Talk(SAY_KUR_SHOCK); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; + + if (ChainLightningTimer <= diff) + { + DoCast(me->getVictim(), SPELL_KUR_CHAIN_LIGHTNING); + ChainLightningTimer = urand(7000,14000); + } else ChainLightningTimer -= diff; + + if (HealthBelowPct(30)) + { + if (HealTimer <= diff) + { + DoCast(me, SPELL_KUR_HEALING_WAVE); + HealTimer = 5000; + } else HealTimer -= diff; + } + + if (FrostShockTimer <= diff) + { + DoCast(me->getVictim(), SPELL_KUR_FROST_SHOCK); + FrostShockTimer = urand(7500,15000); + } else FrostShockTimer -= diff; + + DoMeleeAttackIfReady(); + } + }; +}; + +/*###### +## go_warmaul_prison +######*/ + +enum FindingTheSurvivorsData +{ + QUEST_FINDING_THE_SURVIVORS = 9948, + NPC_MAGHAR_PRISONER = 18428, + + SAY_FREE_0 = 0, + SAY_FREE_1 = 1, + SAY_FREE_2 = 2, + SAY_FREE_3 = 3, + SAY_FREE_4 = 4, +}; + +class go_warmaul_prison : public GameObjectScript +{ +public: + go_warmaul_prison() : GameObjectScript("go_warmaul_prison") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + if (player->GetQuestStatus(QUEST_FINDING_THE_SURVIVORS) != QUEST_STATUS_INCOMPLETE) + return false; + + if (Creature* prisoner = go->FindNearestCreature(NPC_MAGHAR_PRISONER, 1.0f)) + { + if (prisoner) + { + go->UseDoorOrButton(); + if (player) + player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0); + + prisoner->AI()->Talk(RAND(SAY_FREE_0, SAY_FREE_1, SAY_FREE_2, SAY_FREE_3, SAY_FREE_4), player->GetGUID()); + prisoner->ForcedDespawn(6000); + } + } + return true; + } +}; + void AddSC_nagrand() { - new mob_shattered_rumbler(); - new mob_lump(); - new npc_altruis_the_sufferer(); new npc_greatmother_geyah(); - new npc_lantresor_of_the_blade(); new npc_maghar_captive(); new npc_creditmarker_visit_with_ancestors(); - new mob_sparrowhawk(); new npc_corki(); new go_corkis_prison(); + new npc_kurenai_captive(); + new go_warmaul_prison(); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index ef2e4c92190..07b8a79691a 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -33,8 +33,6 @@ enum PriestSpells PRIEST_SPELL_PENANCE_R1_HEAL = 47757, PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED = 33619, PRIEST_SPELL_REFLECTIVE_SHIELD_R1 = 33201, - PRIEST_SPELL_SHADOWFIEND = 34433, - PRIEST_SPELL_SHADOWFIEND_TRIGGERED = 28305, }; // Guardian Spirit @@ -275,44 +273,6 @@ class spell_pri_reflective_shield_trigger : public SpellScriptLoader } }; -class spell_pri_shadowfiend : public SpellScriptLoader -{ - public: - spell_pri_shadowfiend() : SpellScriptLoader("spell_pri_shadowfiend") { } - - class spell_pri_shadowfiend_SpellScript : public SpellScript - { - PrepareSpellScript(spell_pri_shadowfiend_SpellScript); - - bool Validate(SpellInfo const* spellEntry) - { - return sSpellMgr->GetSpellInfo(PRIEST_SPELL_SHADOWFIEND) && sSpellMgr->GetSpellInfo(PRIEST_SPELL_SHADOWFIEND_TRIGGERED); - } - - void HandleTriggerSpell(SpellEffIndex /*effIndex*/) - { - Unit* unitTarget = GetHitUnit(); - if (!unitTarget) - return; - - if (Unit* pet = unitTarget->GetGuardianPet()) - { - pet->CastSpell(pet, PRIEST_SPELL_SHADOWFIEND_TRIGGERED, true); - } - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_pri_shadowfiend_SpellScript::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_pri_shadowfiend_SpellScript; - } -}; - void AddSC_priest_spell_scripts() { new spell_pri_guardian_spirit(); @@ -321,5 +281,4 @@ void AddSC_priest_spell_scripts() new spell_pri_penance; new spell_pri_reflective_shield_trigger(); new spell_pri_mind_sear(); - new spell_pri_shadowfiend(); } 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(); } |