diff options
85 files changed, 2168 insertions, 729 deletions
diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 69c6c990e1e..c57e54918e6 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -783,6 +783,7 @@ CREATE TABLE `character_instance` ( `guid` int(10) unsigned NOT NULL DEFAULT '0', `instance` int(10) unsigned NOT NULL DEFAULT '0', `permanent` tinyint(3) unsigned NOT NULL DEFAULT '0', + `extendState` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1', PRIMARY KEY (`guid`,`instance`), KEY `instance` (`instance`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -2539,7 +2540,7 @@ CREATE TABLE `updates` ( LOCK TABLES `updates` WRITE; /*!40000 ALTER TABLE `updates` DISABLE KEYS */; -INSERT INTO `updates` VALUES ('2015_03_20_00_characters.sql','B761760804EA73BD297F296C5C1919687DF7191C','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_01_characters.sql','894F08B70449A5481FFAF394EE5571D7FC4D8A3A','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_02_characters.sql','97D7BE0CAADC79F3F11B9FD296B8C6CD40FE593B','ARCHIVED','2015-03-21 21:44:51',0),('2015_06_26_00_characters_335.sql','C2CC6E50AFA1ACCBEBF77CC519AAEB09F3BBAEBC','ARCHIVED','2015-07-13 23:49:22',0),('2015_09_28_00_characters_335.sql','F8682A431D50E54BDC4AC0E7DBED21AE8AAB6AD4','ARCHIVED','2015-09-28 21:00:00',0),('2015_08_26_00_characters_335.sql','C7D6A3A00FECA3EBFF1E71744CA40D3076582374','ARCHIVED','2015-08-26 21:00:00',0),('2015_10_06_00_characters.sql','16842FDD7E8547F2260D3312F53EFF8761EFAB35','ARCHIVED','2015-10-06 16:06:38',0),('2015_10_07_00_characters.sql','E15AB463CEBE321001D7BFDEA4B662FF618728FD','ARCHIVED','2015-10-07 23:32:00',0),('2015_10_12_00_characters.sql','D6F9927BDED72AD0A81D6EC2C6500CBC34A39FA2','ARCHIVED','2015-10-12 15:35:47',0),('2015_10_28_00_characters.sql','622A9CA8FCE690429EBE23BA071A37C7A007BF8B','ARCHIVED','2015-10-19 14:32:22',0),('2015_10_29_00_characters_335.sql','4555A7F35C107E54C13D74D20F141039ED42943E','ARCHIVED','2015-10-29 17:05:43',0),('2015_11_03_00_characters.sql','CC045717B8FDD9733351E52A5302560CD08AAD57','ARCHIVED','2015-10-12 15:23:33',0),('2015_11_07_00_characters.sql','BAF9F6B8F97A30D04BDBBA8127A62A1720F9B904','RELEASED','2015-11-07 15:40:47',0); +INSERT INTO `updates` VALUES ('2015_03_20_00_characters.sql','B761760804EA73BD297F296C5C1919687DF7191C','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_01_characters.sql','894F08B70449A5481FFAF394EE5571D7FC4D8A3A','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_02_characters.sql','97D7BE0CAADC79F3F11B9FD296B8C6CD40FE593B','ARCHIVED','2015-03-21 21:44:51',0),('2015_06_26_00_characters_335.sql','C2CC6E50AFA1ACCBEBF77CC519AAEB09F3BBAEBC','ARCHIVED','2015-07-13 23:49:22',0),('2015_09_28_00_characters_335.sql','F8682A431D50E54BDC4AC0E7DBED21AE8AAB6AD4','ARCHIVED','2015-09-28 21:00:00',0),('2015_08_26_00_characters_335.sql','C7D6A3A00FECA3EBFF1E71744CA40D3076582374','ARCHIVED','2015-08-26 21:00:00',0),('2015_10_06_00_characters.sql','16842FDD7E8547F2260D3312F53EFF8761EFAB35','ARCHIVED','2015-10-06 16:06:38',0),('2015_10_07_00_characters.sql','E15AB463CEBE321001D7BFDEA4B662FF618728FD','ARCHIVED','2015-10-07 23:32:00',0),('2015_10_12_00_characters.sql','D6F9927BDED72AD0A81D6EC2C6500CBC34A39FA2','ARCHIVED','2015-10-12 15:35:47',0),('2015_10_28_00_characters.sql','622A9CA8FCE690429EBE23BA071A37C7A007BF8B','ARCHIVED','2015-10-19 14:32:22',0),('2015_10_29_00_characters_335.sql','4555A7F35C107E54C13D74D20F141039ED42943E','ARCHIVED','2015-10-29 17:05:43',0),('2015_11_03_00_characters.sql','CC045717B8FDD9733351E52A5302560CD08AAD57','ARCHIVED','2015-10-12 15:23:33',0),('2015_11_07_00_characters.sql','BAF9F6B8F97A30D04BDBBA8127A62A1720F9B904','RELEASED','2015-11-07 15:40:47',0),('2016_02_10_00_characters.sql','418F9639F558346E0F7A33512059906E94E30E49','RELEASED','2016-02-10 00:00:00',0); /*!40000 ALTER TABLE `updates` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/characters/2016_02_10_00_characters.sql b/sql/updates/characters/2016_02_10_00_characters.sql new file mode 100644 index 00000000000..d49ed155bc8 --- /dev/null +++ b/sql/updates/characters/2016_02_10_00_characters.sql @@ -0,0 +1,2 @@ +-- extend=0 is expired, extend=1 is normal, extend=2 is extended +ALTER TABLE `character_instance` ADD COLUMN `extendState` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1'; diff --git a/sql/updates/world/2016_02_09_02_world_335.sql b/sql/updates/world/2016_02_09_02_world_335.sql new file mode 100644 index 00000000000..a8612c5d88d --- /dev/null +++ b/sql/updates/world/2016_02_09_02_world_335.sql @@ -0,0 +1,29 @@ +-- move script 'npc_myranda_the_hag' to SAI (PR #16438) +UPDATE `gossip_menu_option` SET `option_id`=1 WHERE `menu_id`=3801; +DELETE FROM `gossip_menu` WHERE `entry`=3801 AND `text_id`=4773; +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(3801, 4773); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=11872; +DELETE FROM `smart_scripts` WHERE `entryorguid`=11872 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 +(11872, 0, 0, 1, 62, 0, 100, 0, 3801, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Myranda the Hag - On Gossip Option 0 Selected - Close Gossip'), +(11872, 0, 1, 0, 61, 0, 100, 0, 3801, 0, 0, 0, 85, 17961, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Myranda the Hag - On Gossip Option 0 Selected - Invoker Cast \'Scarlet Illusion\''); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=3801; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=3801; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 3801, 0, 0, 0, 28, 0, 5862, 0, 0, 0, 0, 0, '', 'Only show gossip menu option if quest \'Scarlet Subterfuge\' is complete'), +(15, 3801, 0, 0, 0, 28, 0, 5944, 0, 0, 1, 0, 0, '', 'Only show gossip menu option if quest \'In Dreams\' is not complete'), +(15, 3801, 0, 0, 0, 8, 0, 5944, 0, 0, 1, 0, 0, '', 'Only show gossip menu option if quest \'In Dreams\' is not rewarded'), +(15, 3801, 0, 0, 0, 1, 0, 17961, 0, 0, 1, 0, 0, '', 'Only show gossip menu option if no \'Scarlet Illusion\' Aura'), +(15, 3801, 0, 0, 1, 8, 0, 5862, 0, 0, 0, 0, 0, '', 'Only show gossip menu option if quest \'Scarlet Subterfuge\' is rewarded'), +(15, 3801, 0, 0, 1, 28, 0, 5944, 0, 0, 1, 0, 0, '', 'Only show gossip menu option if quest \'In Dreams\' is not complete'), +(15, 3801, 0, 0, 1, 8, 0, 5944, 0, 0, 1, 0, 0, '', 'Only show gossip menu option if quest \'In Dreams\' is not rewarded'), +(15, 3801, 0, 0, 1, 1, 0, 17961, 0, 0, 1, 0, 0, '', 'Only show gossip menu option if no \'Scarlet Illusion\' Aura'), +(14, 3801, 4773, 0, 0, 28, 0, 5862, 0, 0, 0, 0, 0, '', 'Only show text if quest \'Scarlet Subterfuge\' is complete'), +(14, 3801, 4773, 0, 0, 28, 0, 5944, 0, 0, 1, 0, 0, '', 'Only show text if quest \'In Dreams\' is not complete'), +(14, 3801, 4773, 0, 0, 8, 0, 5944, 0, 0, 1, 0, 0, '', 'Only show text if quest \'In Dreams\' is not rewarded'), +(14, 3801, 4773, 0, 1, 8, 0, 5862, 0, 0, 0, 0, 0, '', 'Only show text if quest \'Scarlet Subterfuge\' is rewarded'), +(14, 3801, 4773, 0, 1, 28, 0, 5944, 0, 0, 1, 0, 0, '', 'Only show text if quest \'In Dreams\' is not complete'), +(14, 3801, 4773, 0, 1, 8, 0, 5944, 0, 0, 1, 0, 0, '', 'Only show text if quest \'In Dreams\' is not rewarded'); diff --git a/sql/updates/world/2016_02_09_08_world.sql b/sql/updates/world/2016_02_09_08_world.sql new file mode 100644 index 00000000000..307a9f9a0b3 --- /dev/null +++ b/sql/updates/world/2016_02_09_08_world.sql @@ -0,0 +1 @@ +UPDATE `gameobject` SET `state`=1 WHERE `guid`=61216; diff --git a/sql/updates/world/2016_02_10_00_world.sql b/sql/updates/world/2016_02_10_00_world.sql new file mode 100644 index 00000000000..872861b08dc --- /dev/null +++ b/sql/updates/world/2016_02_10_00_world.sql @@ -0,0 +1,18 @@ +-- Pathing for Kalecgos Entry: 24844 'TDB FORMAT' +SET @NPC := 24844; +SET @PATH := @NPC * 10; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,163.9735,-398.0906,2.083333,0,0,0,0,100,0), -- 16:16:43 +(@PATH,2,164.3802,-397.1771,2.083333,0,0,0,0,100,0), -- 16:16:43 +(@PATH,3,162.7923,-386.1964,15.67094,0,0,0,0,100,0), -- 16:16:43 +(@PATH,4,151.5555,-345.349,5.92646,0,0,0,0,100,0), -- 16:16:43 +(@PATH,5,162.2416,-299.8032,-5.436685,0,0,0,0,100,0), -- 16:16:43 +(@PATH,6,199.7482,-272.3315,-7.186677,0,0,0,0,100,0), -- 16:16:43 +(@PATH,7,199.7482,-272.3315,-7.186677,0,0,0,0,100,0), -- 16:16:43 +(@PATH,8,199.7482,-272.3315,-7.186677,0.06981317,0,0,0,100,0); -- 16:16:54 +-- 0x1C2F2C4920184300001F1D000038BF6E .go 163.9735 -398.0906 2.083333 + +DELETE FROM `creature_text` WHERE `entry` = 24844 AND `groupid` = 0; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(24844, 0, 0, 'Be still, mortals, and hearken to my words.', 14, 0, 100, 0, 0, 0, 23936, 3, 'Kalecgos - SAY_KALECGOS_SPAWN'); diff --git a/sql/updates/world/2016_02_10_01_world.sql b/sql/updates/world/2016_02_10_01_world.sql new file mode 100644 index 00000000000..9ffe2e81c1c --- /dev/null +++ b/sql/updates/world/2016_02_10_01_world.sql @@ -0,0 +1,21 @@ +-- Nethurbian Crater KC Bunny SAI +SET @ENTRY := 28352; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,1,8,0,100,0,51381,0,180000,180000,33,28352,0,0,0,0,0,7,0,0,0,0,0,0,0,"Nethurbian Crater KC Bunny - On Spellhit 'Toss Grenade' - Quest Credit ''"), +(@ENTRY,0,1,0,61,0,100,0,51381,0,180000,180000,45,1,1,0,0,0,0,20,190555,2,0,0,0,0,0,"Nethurbian Crater KC Bunny - On Spellhit 'Toss Grenade' - Set Data 1 1"); + +-- Nerubian Crater SAI +SET @ENTRY := 190555; +UPDATE `gameobject_template` SET `AIName`="SmartGameObjectAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=1; +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,38,0,100,0,1,1,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Nerubian Crater - On Data Set 1 1 - Run Script"); + +-- Actionlist SAI +SET @ENTRY := 19055500; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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,9,0,0,0,0,100,0,0,0,0,0,44,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Set Phase 2"), +(@ENTRY,9,1,0,0,0,100,0,180000,180000,0,0,44,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Set Phase 1"); diff --git a/sql/updates/world/2016_02_10_02_world.sql b/sql/updates/world/2016_02_10_02_world.sql new file mode 100644 index 00000000000..92ee165dd83 --- /dev/null +++ b/sql/updates/world/2016_02_10_02_world.sql @@ -0,0 +1,19 @@ +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9546; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(9546, 0, 2, 'Where would you like to fly to?', 10753, 4, 8192, 0, 0, 0, 0, '', 0), +(9546, 1, 0, 'I need to get to Wintergarde Keep fast!', 26697, 1, 1, 0, 0, 0, 0, '', 0), +(9546, 2, 0, 'Greer, I need a gryphon to ride and some bombs to drop on New Agamand!', 23112, 1, 1, 0, 0, 0, 0, '', 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9546; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 9546, 1, 0, 0, 28, 0, 12298, 0, 0, 0, 0, 0, '', 'Greer Orehammer - Show gossip option only if player has taken quest 12298'), +(15, 9546, 2, 0, 0, 9, 0, 11332, 0, 0, 0, 0, 0, '', 'Greer Orehammer - Show gossip option only if player has taken quest 11332'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=23859 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 +(23859, 0, 0, 0, 4, 0, 100, 0, 0, 0, 0, 0, 80, 2385900, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Greer Orehammer - On Aggro - Run Script'), +(23859, 0, 1, 2, 62, 0, 100, 0, 9546, 2, 0, 0, 56, 33634, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Greer Orehammer - On Gossip Option 1 Selected - Add Item \'Orehammer\'s Precision Bombs\' 10 Times'), +(23859, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 52, 745, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Greer Orehammer - On Gossip Option 1 Selected - Cast \'High Commander Halford Wyrmbane: Westguard Keep to Wintergarde Keep Taxi\''), +(23859, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Greer Orehammer - On Gossip Option 1 Selected - Close Gossip'), +(23859, 0, 4, 5, 62, 0, 100, 0, 9546, 1, 0, 0, 11, 48862, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Greer Orehammer - On gossip select - Invoker spellcast'), +(23859, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Greer Orehammer - On gossip select - Close gossip'); diff --git a/sql/updates/world/2016_02_10_03_world.sql b/sql/updates/world/2016_02_10_03_world.sql new file mode 100644 index 00000000000..f52872c3431 --- /dev/null +++ b/sql/updates/world/2016_02_10_03_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `gameobject` SET `spawnmask`=1 WHERE `map`=229; diff --git a/sql/updates/world/2016_02_10_04_world.sql b/sql/updates/world/2016_02_10_04_world.sql new file mode 100644 index 00000000000..1349b83f442 --- /dev/null +++ b/sql/updates/world/2016_02_10_04_world.sql @@ -0,0 +1,6 @@ +-- Honor among thieves +DELETE FROM `spell_script_names` WHERE `scriptname` = 'spell_rog_honor_among_thieves'; +DELETE FROM `spell_script_names` WHERE `scriptname` = 'spell_rog_honor_among_thieves_proc'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-51698, 'spell_rog_honor_among_thieves'), +(52916, 'spell_rog_honor_among_thieves_proc'); diff --git a/sql/updates/world/2016_02_10_05_world.sql b/sql/updates/world/2016_02_10_05_world.sql new file mode 100644 index 00000000000..c19dd8feb06 --- /dev/null +++ b/sql/updates/world/2016_02_10_05_world.sql @@ -0,0 +1,7 @@ +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=47482; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 47482, 0, 0, 21, 0, 1024, 0, 0, 1, 103, 0, '', 'Ghoul Leap - not using Ghoul Leap while rooted'); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=49376; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 49376, 0, 0, 21, 0, 1024, 0, 0, 1, 103, 0, '', 'Cat charge - not using Cat charge while rooted'); diff --git a/sql/updates/world/2016_02_10_06_world.sql b/sql/updates/world/2016_02_10_06_world.sql new file mode 100644 index 00000000000..9e24ab31ce1 --- /dev/null +++ b/sql/updates/world/2016_02_10_06_world.sql @@ -0,0 +1,26 @@ +UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry` IN(24283); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(24283) AND `source_type`=0; + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(2428300) 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 +(24283,0,0,0,20,1,100,0,11328,0,0,0,80,2428300,2,0,0,0,0,1,0,0,0,0,0,0,0,'Peppy Wrongnozzle - On Quest Reward (Mission: Forsaken Intel) - Run Script'), +(24283,0,1,0,25,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Peppy Wrongnozzle - On Spawn - Set Phase 1'), +(24283,0,2,0,1,1,100,0,8000,10000,8000,10000,5,92,0,0,0,0,0,1,0,0,0,0,0,0,0,'Peppy Wrongnozzle - OOC (Phase 1) - Play emote OneShotEatNoSheathe'), +(2428300,9,0,0,0,0,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Peppy Wrongnozzle - Script - Set Phase 2'), +(2428300,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Peppy Wrongnozzle - Script - Face Player '), -- 19:35:27.323 +(2428300,9,2,0,0,0,100,0,0,0,0,0,71,0,0,2200,3698,0,0,1,0,0,0,0,0,0,0,'Peppy Wrongnozzle - Script - Equip item 2200 to Slot 1 & 3698 to slot 2'), -- 19:35:27.573 +(2428300,9,3,0,0,0,100,0,700,700,0,0,17,133,0,0,0,0,0,1,0,0,0,0,0,0,0,'Peppy Wrongnozzle - Script - Set Emote state 133'), -- 19:35:29.226 +(2428300,9,4,0,0,0,100,0,5000,5000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Peppy Wrongnozzle - Script - Set Emote state 0'), -- 19:35:34.405 +(2428300,9,5,0,0,0,100,0,1300,1300,0,0,71,0,0,2705,0,0,0,1,0,0,0,0,0,0,0,'Peppy Wrongnozzle - Script - Equip item 2705 to Slot 1 & Unequip slot 2'), -- 19:35:35.638 +(2428300,9,6,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Peppy Wrongnozzle - Script - Say Line 0'), -- 19:35:35.638 +(2428300,9,7,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Peppy Wrongnozzle - Script - Set Phase 1'), +(2428300,9,8,0,0,0,100,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Peppy Wrongnozzle - Script - Evade'); + +DELETE FROM `creature_template_addon` WHERE `entry`=24283; +INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES +(24283, 0, 0x0, 0x101, '35777'); -- 24283 - 35777 + +DELETE FROM `creature_text` WHERE `entry`IN(24283); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `comment`) VALUES +(24283, 0, 0, 'Right, that should do it. I think ...hic.', 12, 7, 100, 396, 0, 0, 23086, 'Peppy Wrongnozzle to Player'); diff --git a/sql/updates/world/2016_02_10_07_world.sql b/sql/updates/world/2016_02_10_07_world.sql new file mode 100644 index 00000000000..5feb4f44163 --- /dev/null +++ b/sql/updates/world/2016_02_10_07_world.sql @@ -0,0 +1,6 @@ +-- +DELETE FROM `command` WHERE `name`="debug raidreset"; +INSERT INTO `command` (`name`,`permission`,`help`) VALUES ("debug raidreset",414,"Syntax: .debug raidreset mapid [difficulty] +Forces a global reset of the specified map on all difficulties (or only the specific difficulty if specified). Effectively the same as setting the specified map's reset timer to now."); + +UPDATE `trinity_string` SET `content_default`="Map: %d | ID: %d | perm: %s | extended: %s | diff: %d | canReset: %s | TTR: %s" WHERE `entry`=5045; diff --git a/sql/updates/world/2016_02_11_00_world.sql b/sql/updates/world/2016_02_11_00_world.sql new file mode 100644 index 00000000000..b130133a2ca --- /dev/null +++ b/sql/updates/world/2016_02_11_00_world.sql @@ -0,0 +1,6 @@ +-- Scarlet Insignia Ring - Questloot +DELETE FROM `creature_loot_template` WHERE `Entry` IN (1538,1539,1540) AND `Item`= 2875; +INSERT INTO `creature_loot_template` (`Entry`,`Item`,`Reference`,`Chance`,`QuestRequired`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`,`Comment`) VALUES +(1538, 2875, 0, 40, 1, 1, 0, 1, 1, 'Scarlet Friar - Scarlet Insignia Ring'), +(1539, 2875, 0, 40, 1, 1, 0, 1, 1, 'Scarlet Neophyte - Scarlet Insignia Ring'), +(1540, 2875, 0, 40, 1, 1, 0, 1, 1, 'Scarlet Vanguard - Scarlet Insignia Ring'); diff --git a/sql/updates/world/2016_02_11_01_world.sql b/sql/updates/world/2016_02_11_01_world.sql new file mode 100644 index 00000000000..ec1c98659e1 --- /dev/null +++ b/sql/updates/world/2016_02_11_01_world.sql @@ -0,0 +1,5 @@ +-- Imperial Eagle SAI +SET @ENTRY := 26369; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0 AND `id`=1; +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,1,0,8,0,100,0,49546,0,0,0,41,4000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Imperial Eagle - On Spellhit 'Eagle Eyes' - Despawn In 4000 ms"); diff --git a/sql/updates/world/2016_02_11_02_world.sql b/sql/updates/world/2016_02_11_02_world.sql new file mode 100644 index 00000000000..9228e2d99d7 --- /dev/null +++ b/sql/updates/world/2016_02_11_02_world.sql @@ -0,0 +1,18 @@ +-- DB/Item: Sealed Tome +DELETE FROM `gameobject_loot_template` WHERE `Entry`=18509; +INSERT INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(18509,1054,1054,100,0,1,1,1,1,NULL); + +DELETE FROM `reference_loot_template` WHERE `Entry`=1054; +INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(1054,23864,0,0,0,1,1,1,1,NULL), -- Torment of the Worgen +(1054,23857,0,0,0,1,1,1,1,NULL), -- Legacy of the Mountain King +(1054,23862,0,0,0,1,1,1,1,NULL), -- Redemption of the Fallen +(1054,23865,0,0,0,1,1,1,1, NULL); -- Wrath of the Titans + +DELETE FROM `conditions` WHERE `SourceEntry` IN (30562, 30557, 30550, 30567) AND `SourceTypeOrReferenceId`=17; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `Comment`) VALUES +(17,0,30562,0,0,23,0,3457,0,0,0,0,0,'Legacy of the Mountain King needs area 3457'), +(17,0,30557,0,0,23,0,3457,0,0,0,0,0,'Wrath of the Titans needs area 3457'), +(17,0,30550,0,0,23,0,3457,0,0,0,0,0,'Redemption of the Fallen needs area 3457'), +(17,0,30567,0,0,23,0,3457,0,0,0,0,0,'Torment of the Worgen needs area 3457'); diff --git a/sql/updates/world/2016_02_11_03_world.sql b/sql/updates/world/2016_02_11_03_world.sql new file mode 100644 index 00000000000..4dfefb12281 --- /dev/null +++ b/sql/updates/world/2016_02_11_03_world.sql @@ -0,0 +1,11 @@ +-- DB/Quest: Souls at Unrest +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceGroup`=0 AND `SourceEntry`=48974; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 48974, 0, 0, 31, 1, 3, 26891, 0, 0, 0, 0, '', 'Burn Corpse - only targets Undead Miner'), +(17, 0, 48974, 0, 0, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Burn Corpse - only targets dead Undead Miner'); + +-- Undead Miner SAI +SET @ENTRY := 26891; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0 AND `id`=2; +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,2,0,8,0,100,0,48974,0,0,0,41,2000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Undead Miner - On Spellhit 'Burn Corpse' - Despawn In 2000 ms"); diff --git a/sql/updates/world/2016_02_11_04_world.sql b/sql/updates/world/2016_02_11_04_world.sql new file mode 100644 index 00000000000..41f648b5f6e --- /dev/null +++ b/sql/updates/world/2016_02_11_04_world.sql @@ -0,0 +1,4 @@ +-- DB/Quest: The Exorcism ( Mage Quest 1955) +DELETE FROM `smart_scripts` WHERE `entryorguid`=6546 AND `id`=5; +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 +(6546, 0, 5, 0, 19, 0, 100, 0, 1955, 0, 0, 0, 80, 654600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tabetha - On Quest \'The Exorcism\' Taken - Run Script (No Repeat)'); diff --git a/sql/updates/world/2016_02_11_05_world.sql b/sql/updates/world/2016_02_11_05_world.sql new file mode 100644 index 00000000000..76b59765d08 --- /dev/null +++ b/sql/updates/world/2016_02_11_05_world.sql @@ -0,0 +1,2 @@ +-- Iron Rune Avenger +UPDATE `creature_template` SET `flags_extra`=(`flags_extra`|2097152) WHERE `entry` IN (26786); diff --git a/sql/updates/world/2016_02_11_06_world.sql b/sql/updates/world/2016_02_11_06_world.sql new file mode 100644 index 00000000000..bbf9880dca9 --- /dev/null +++ b/sql/updates/world/2016_02_11_06_world.sql @@ -0,0 +1,206 @@ +SET @OGUID:=79584; +SET @CGUID:=61988; +SET @Event:=7; + +-- Add missing lunar objects +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+182; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@OGUID+0 , 180766, 571, 1, 1, 5827.364, 638.9564, 647.2116, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613) +(@OGUID+1 , 180766, 571, 1, 1, 5827.502, 645.6351, 647.1417, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613) +(@OGUID+2 , 180766, 571, 1, 1, 5821.811, 633.4114, 647.1953, 0, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613) +(@OGUID+3 , 180766, 571, 1, 1, 5822.486, 652.9247, 647.212, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613) +(@OGUID+4 , 180766, 571, 1, 1, 5815.521, 643.1665, 647.1968, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613) +(@OGUID+5 , 180766, 571, 1, 1, 5818.29, 648.6586, 647.173, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613) +(@OGUID+6 , 180766, 571, 1, 1, 5818.406, 635.2549, 647.1855, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613) +(@OGUID+7 , 180766, 571, 1, 1, 5816.469, 638.8152, 647.1979, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613) +(@OGUID+8 , 180765, 571, 1, 1, 5862.578, 608.9785, 622.725, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4613) +(@OGUID+9 , 180765, 571, 1, 1, 5818.557, 689.6754, 617.5377, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4613) +(@OGUID+10 , 180765, 571, 1, 1, 5759.772, 714.2535, 653.2266, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4620) +(@OGUID+11 , 180765, 571, 1, 1, 5760.561, 701.3275, 623.345, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 0) +(@OGUID+12 , 180765, 571, 1, 1, 5731.914, 677.9752, 653.3376, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 0) +(@OGUID+13 , 180765, 571, 1, 1, 5670.342, 779.5948, 669.5635, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4569) +(@OGUID+14 , 180765, 571, 1, 1, 5753.294, 594.6252, 618.5057, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4560) +(@OGUID+15 , 180765, 571, 1, 1, 5819.917, 557.6574, 655.4913, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4570) +(@OGUID+16 , 180878, 571, 1, 1, 5831.143, 655.095, 647.124, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613) +(@OGUID+17 , 180878, 571, 1, 1, 5830.427, 655.5619, 647.1938, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613) +(@OGUID+18 , 180878, 571, 1, 1, 5829.478, 652.8141, 647.3889, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613) +(@OGUID+19 , 180878, 571, 1, 1, 5829.293, 656.304, 647.3473, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613) +(@OGUID+20 , 180878, 571, 1, 1, 5830.003, 656.1676, 647.2794, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613) +(@OGUID+21 , 180878, 571, 1, 1, 5829.671, 655.4982, 647.2844, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613) +(@OGUID+22 , 180878, 571, 1, 1, 5828.868, 653.2474, 647.4297, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613) +(@OGUID+23 , 180770, 571, 1, 1, 5948.266, 620.9393, 660.9077, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4613) +(@OGUID+24 , 180770, 571, 1, 1, 5885.173, 625.6719, 667.6763, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4613) +(@OGUID+25 , 180770, 571, 1, 1, 5834.693, 718.492, 659.2477, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4613) +(@OGUID+26 , 180770, 571, 1, 1, 5728.38, 609.739, 668.472, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4560) +(@OGUID+27 , 180770, 571, 1, 1, 5671.689, 646.728, 664.1037, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4560) +(@OGUID+28 , 180770, 571, 1, 1, 5783.651, 561.3226, 663.734, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4560) +(@OGUID+29 , 180770, 571, 1, 1, 5659.569, 679.338, 662.2587, 5.864307, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4560) +(@OGUID+30 , 180769, 571, 1, 1, 5909.365, 661.7691, 649.1791, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+31 , 180769, 571, 1, 1, 5886.387, 624.8147, 653.553, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+32 , 180769, 571, 1, 1, 5931.343, 575.7878, 615.0651, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+33 , 180769, 571, 1, 1, 5881.342, 611.066, 654.6136, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+34 , 180769, 571, 1, 1, 5901.177, 684.3577, 647.6432, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+35 , 180769, 571, 1, 1, 5929.563, 561.2188, 615.4888, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+36 , 180769, 571, 1, 1, 5913.596, 558.0538, 615.162, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+37 , 180769, 571, 1, 1, 5859.038, 634.4976, 653.8649, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+38 , 180769, 571, 1, 1, 5915.081, 710.2066, 646.7171, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+39 , 180769, 571, 1, 1, 5855.796, 664.7435, 653.7689, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+40 , 180769, 571, 1, 1, 5858.535, 699.8768, 647.4109, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+41 , 180769, 571, 1, 1, 5852.463, 690.137, 614.8257, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+42 , 180769, 571, 1, 1, 5873.14, 725.0781, 647.2786, 1.780234, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+43 , 180769, 571, 1, 1, 5883.378, 741.8604, 644.6421, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+44 , 180769, 571, 1, 1, 5817.372, 694.9447, 653.3386, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+45 , 180769, 571, 1, 1, 5901.752, 746.1671, 645.9257, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+46 , 180769, 571, 1, 1, 5864.876, 738.8313, 644.7396, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+47 , 180769, 571, 1, 1, 5835.081, 719.8969, 646.1445, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613) +(@OGUID+48 , 180769, 571, 1, 1, 5786.942, 691.6105, 653.3179, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4620) +(@OGUID+49 , 180769, 571, 1, 1, 5768.04, 709.3449, 623.6602, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4620) +(@OGUID+50 , 180769, 571, 1, 1, 5768.866, 732.3944, 645.68, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4620) +(@OGUID+51 , 180769, 571, 1, 1, 5769.894, 668.6614, 650.4285, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 0) +(@OGUID+52 , 180769, 571, 1, 1, 5788.438, 653.5104, 654.6097, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 0) +(@OGUID+53 , 180769, 571, 1, 1, 5750.353, 646.9713, 656.329, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560) +(@OGUID+54 , 180769, 571, 1, 1, 5753.372, 616.3696, 656.3885, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560) +(@OGUID+55 , 180769, 571, 1, 1, 5730.582, 607.2877, 652.4621, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560) +(@OGUID+56 , 180769, 571, 1, 1, 5687.786, 619.9709, 652.2067, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560) +(@OGUID+57 , 180769, 571, 1, 1, 5675.173, 631.3223, 652.21, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560) +(@OGUID+58 , 180769, 571, 1, 1, 5671.983, 646.4656, 652.1304, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560) +(@OGUID+59 , 180769, 571, 1, 1, 5783.131, 561.6129, 655.8354, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560) +(@OGUID+60 , 180769, 571, 1, 1, 5809.257, 575.9974, 656.7222, 4.834563, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560) +(@OGUID+61 , 180769, 571, 1, 1, 5844.062, 569.6259, 656.8289, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4570) +(@OGUID+62 , 180763, 571, 1, 1, 5944.821, 630.5286, 652.4573, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613) +(@OGUID+63 , 180763, 571, 1, 1, 5890.119, 630.0712, 650.7103, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613) +(@OGUID+64 , 180763, 571, 1, 1, 5883.333, 613.3351, 651.5501, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613) +(@OGUID+65 , 180763, 571, 1, 1, 5983.581, 603.4676, 653.0666, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613) +(@OGUID+66 , 180763, 571, 1, 1, 5986.168, 610.6107, 653.0659, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0) +(@OGUID+67 , 180763, 571, 1, 1, 5913.733, 726.7258, 645.9022, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613) +(@OGUID+68 , 180763, 571, 1, 1, 5820.595, 692.2194, 647.6371, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613) +(@OGUID+69 , 180763, 571, 1, 1, 5867.973, 739.8099, 641.4172, 5.410522, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613) +(@OGUID+70 , 180763, 571, 1, 1, 5903.759, 687.3698, 644.8055, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4620) +(@OGUID+71 , 180763, 571, 1, 1, 5871.152, 724.772, 643.811, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4620) +(@OGUID+72 , 180763, 571, 1, 1, 5752.106, 717.1315, 641.7864, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0) +(@OGUID+73 , 180763, 571, 1, 1, 5746.831, 728.174, 641.7136, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0) +(@OGUID+74 , 180763, 571, 1, 1, 5733.553, 726.9333, 642.7537, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0) +(@OGUID+75 , 180763, 571, 1, 1, 5735.731, 678.2547, 647.2717, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0) +(@OGUID+76 , 180763, 571, 1, 1, 5732.593, 674.2257, 647.2732, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+77 , 180763, 571, 1, 1, 5716.352, 722.8108, 643.5378, 0.9599299, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+78 , 180763, 571, 1, 1, 5709.845, 727.9358, 643.5585, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+79 , 180763, 571, 1, 1, 5703.215, 733.3229, 643.576, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+80 , 180763, 571, 1, 1, 5833.685, 645.7676, 610.1852, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+81 , 180763, 571, 1, 1, 5669.793, 808.6216, 655.2228, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569) +(@OGUID+82 , 180763, 571, 1, 1, 5746.831, 728.174, 641.7136, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569) +(@OGUID+83 , 180763, 571, 1, 1, 5657.733, 814.1997, 654.9894, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569) +(@OGUID+84 , 180763, 571, 1, 1, 5640.182, 793.6152, 654.9894, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569) +(@OGUID+85 , 180763, 571, 1, 1, 5648.342, 782.4639, 654.989, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569) +(@OGUID+86 , 180763, 571, 1, 1, 5646.54, 805.8158, 654.9894, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569) +(@OGUID+87 , 180763, 571, 1, 1, 5752.106, 717.1315, 641.7864, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569) +(@OGUID+88 , 180763, 571, 1, 1, 5733.553, 726.9333, 642.7537, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+89 , 180763, 571, 1, 1, 5820.595, 692.2194, 647.6371, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+90 , 180763, 571, 1, 1, 5703.215, 733.3229, 643.576, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+91 , 180763, 571, 1, 1, 5689.638, 617.3722, 649.33, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+92 , 180763, 571, 1, 1, 5668.561, 683.9375, 653.5638, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+93 , 180763, 571, 1, 1, 5821.209, 557.6127, 652.8544, 1.815142, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570) +(@OGUID+94 , 180763, 571, 1, 1, 5845.696, 572.116, 653.2255, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570) +(@OGUID+95 , 180763, 571, 1, 1, 5828.66, 517.7811, 659.3014, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570) +(@OGUID+96 , 180763, 571, 1, 1, 5735.731, 678.2547, 647.2717, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570) +(@OGUID+97 , 180763, 571, 1, 1, 5732.593, 674.2257, 647.2732, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570) +(@OGUID+98 , 180763, 571, 1, 1, 5883.333, 613.3351, 651.5501, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570) +(@OGUID+99 , 180763, 571, 1, 1, 5890.119, 630.0712, 650.7103, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570) +(@OGUID+100, 180763, 571, 1, 1, 5903.759, 687.3698, 644.8055, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0) +(@OGUID+101, 180763, 571, 1, 1, 5944.821, 630.5286, 652.4573, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0) +(@OGUID+102, 180763, 571, 1, 1, 5939.341, 616.0452, 652.3865, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0) +(@OGUID+103, 180763, 571, 1, 1, 5871.152, 724.772, 643.811, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0) +(@OGUID+104, 180763, 571, 1, 1, 5983.581, 603.4676, 653.0666, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+105, 180763, 571, 1, 1, 5828.66, 517.7811, 659.3014, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560) +(@OGUID+106, 180763, 571, 1, 1, 5872.536, 687.5123, 647.7181, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613) +(@OGUID+107, 180763, 571, 1, 1, 5812.34, 554.8807, 652.9316, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4616) +(@OGUID+108, 180763, 571, 1, 1, 5820.595, 692.2194, 647.6371, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4739) +(@OGUID+109, 180763, 571, 1, 1, 5735.731, 678.2547, 647.2717, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4739) +(@OGUID+110, 180763, 571, 1, 1, 5733.001, 605.4604, 649.6217, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4739) +(@OGUID+111, 180764, 571, 1, 1, 5939.341, 616.0452, 652.3865, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+112, 180764, 571, 1, 1, 5930.153, 592.1089, 640.6768, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+113, 180764, 571, 1, 1, 5920.96, 592.6715, 640.6837, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+114, 180764, 571, 1, 1, 5938.111, 587.7853, 640.6421, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+115, 180764, 571, 1, 1, 5912.436, 589.316, 640.6563, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+116, 180764, 571, 1, 1, 5943.503, 581.1985, 640.6602, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+117, 180764, 571, 1, 1, 5946.514, 572.8181, 640.6762, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+118, 180764, 571, 1, 1, 5986.168, 610.6107, 653.0659, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+119, 180764, 571, 1, 1, 5945.639, 564.164, 640.7072, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+120, 180764, 571, 1, 1, 5941.456, 556.3479, 640.7192, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+121, 180764, 571, 1, 1, 5934.847, 550.7705, 640.6883, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+122, 180764, 571, 1, 1, 5864.014, 600.7278, 652.6012, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+123, 180764, 571, 1, 1, 5903.759, 687.3698, 644.8055, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+124, 180764, 571, 1, 1, 5853.561, 587.517, 652.7214, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+125, 180764, 571, 1, 1, 5872.536, 687.5123, 647.7181, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+126, 180764, 571, 1, 1, 5914.998, 716.574, 643.6473, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+127, 180764, 571, 1, 1, 5893.063, 706.0598, 648.3202, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+128, 180764, 571, 1, 1, 5890.119, 630.0712, 650.7103, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0) +(@OGUID+129, 180764, 571, 1, 1, 5938.111, 587.7853, 640.6421, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0) +(@OGUID+130, 180764, 571, 1, 1, 5983.581, 603.4676, 653.0666, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0) +(@OGUID+131, 180764, 571, 1, 1, 5912.436, 589.316, 640.6563, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0) +(@OGUID+132, 180764, 571, 1, 1, 5934.847, 550.7705, 640.6883, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0) +(@OGUID+133, 180764, 571, 1, 1, 5872.536, 687.5123, 647.7181, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+134, 180764, 571, 1, 1, 5945.639, 564.164, 640.7072, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+135, 180764, 571, 1, 1, 5833.685, 645.7676, 610.1852, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+136, 180764, 571, 1, 1, 5827.226, 645.5917, 648.326, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+137, 180764, 571, 1, 1, 5845.696, 572.116, 653.2255, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+138, 180764, 571, 1, 1, 5871.152, 724.772, 643.811, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+139, 180764, 571, 1, 1, 5816.614, 639.0052, 648.413, 2.164206, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+140, 180764, 571, 1, 1, 5883.333, 613.3351, 651.5501, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+141, 180764, 571, 1, 1, 5898.784, 746.4573, 642.1553, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613) +(@OGUID+142, 180764, 571, 1, 1, 5893.063, 706.0598, 648.3202, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4620) +(@OGUID+143, 180764, 571, 1, 1, 5763.81, 725.4814, 620.0308, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4620) +(@OGUID+144, 180764, 571, 1, 1, 5763.81, 725.4814, 620.0308, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560) +(@OGUID+145, 180764, 571, 1, 1, 5867.973, 739.8099, 641.4172, 5.410522, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560) +(@OGUID+146, 180764, 571, 1, 1, 5872.536, 687.5123, 647.7181, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560) +(@OGUID+147, 180764, 571, 1, 1, 5733.001, 605.4604, 649.6217, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560) +(@OGUID+148, 180764, 571, 1, 1, 5674.231, 639.6476, 649.1661, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560) +(@OGUID+149, 180764, 571, 1, 1, 5785.611, 560.2617, 652.6686, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560) +(@OGUID+150, 180764, 571, 1, 1, 5812.34, 554.8807, 652.9316, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560) +(@OGUID+151, 180764, 571, 1, 1, 5662.389, 669.6667, 653.5421, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560) +(@OGUID+152, 180764, 571, 1, 1, 5853.561, 587.517, 652.7214, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4570) +(@OGUID+153, 180764, 571, 1, 1, 5864.014, 600.7278, 652.6012, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4570) +(@OGUID+154, 180764, 571, 1, 1, 5920.96, 592.6715, 640.6837, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0) +(@OGUID+155, 180764, 571, 1, 1, 5912.436, 589.316, 640.6563, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0) +(@OGUID+156, 180764, 571, 1, 1, 5930.153, 592.1089, 640.6768, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0) +(@OGUID+157, 180764, 571, 1, 1, 5938.111, 587.7853, 640.6421, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0) +(@OGUID+158, 180764, 571, 1, 1, 5943.503, 581.1985, 640.6602, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560) +(@OGUID+159, 180764, 571, 1, 1, 5945.639, 564.164, 640.7072, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560) +(@OGUID+160, 180879, 571, 1, 1, 5829.639, 654.4427, 647.3204, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 4613) +(@OGUID+161, 180767, 571, 1, 1, 5867.941, 616.2357, 622.7247, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4613) +(@OGUID+162, 180767, 571, 1, 1, 5897.854, 555.5522, 648.3434, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4613) +(@OGUID+163, 180767, 571, 1, 1, 5892.568, 549.7327, 648.2482, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4613) +(@OGUID+164, 180767, 571, 1, 1, 5814.174, 684.2547, 617.5809, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4613) +(@OGUID+165, 180767, 571, 1, 1, 5774.229, 717.9037, 623.3556, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4620) +(@OGUID+166, 180767, 571, 1, 1, 5770.015, 581.1361, 618.5083, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4560) +(@OGUID+167, 180767, 571, 1, 1, 5813.308, 555.64, 655.5086, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4560) +(@OGUID+168, 188215, 571, 1, 1, 5927.629, 731.5903, 643.1697, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 188215 (Area: 4613) +(@OGUID+169, 180880, 571, 1, 1, 5828.156, 651.3569, 647.5219, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 4613) +(@OGUID+170, 180881, 571, 1, 1, 5829.097, 651.775, 647.4488, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 4613) +(@OGUID+171, 180882, 571, 1, 1, 5829.017, 651.1241, 647.4738, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 4613) +(@OGUID+172, 180883, 571, 1, 1, 5828.462, 652.3148, 647.4636, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 4613) +(@OGUID+173, 180883, 571, 1, 1, 5828.013, 651.9222, 647.5066, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 4613) +(@OGUID+174, 180868, 571, 1, 1, 5820.396, 633.1682, 647.392, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613) +(@OGUID+175, 180868, 571, 1, 1, 5818.986, 634.1285, 647.392, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613) +(@OGUID+176, 180868, 571, 1, 1, 5815.437, 644.6893, 647.392, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613) +(@OGUID+177, 180868, 571, 1, 1, 5818.691, 650.1199, 647.3958, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613) +(@OGUID+178, 180868, 571, 1, 1, 5817.034, 647.832, 647.392, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613) +(@OGUID+179, 180868, 571, 1, 1, 5819.984, 651.618, 647.4, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613) +(@OGUID+180, 180868, 571, 1, 1, 5816.064, 637.7977, 647.3924, 3.665196, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613) +(@OGUID+181, 180869, 571, 1, 1, 5816.274, 646.3437, 647.392, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 4613) +(@OGUID+182, 180869, 571, 1, 1, 5817.032, 636.2288, 647.392, 3.735006, 0, 0, 0, 1, 120, 255, 1); -- 180869 (Area: 4613) + +DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+182 AND `eventEntry`=@Event; +INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+182; + +-- Add missing lunar spawns +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+5; +INSERT INTO `creature` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `curhealth`) VALUES +(@CGUID+0, 15892, 571, 5825.602, 642.9196, 647.8765, 3.106686, 120, 0), -- 15892 (Area: 4613) +(@CGUID+1, 15892, 571, 5820.262, 646.1699, 647.8525, 5.235988, 120, 0), -- 15892 (Area: 4613) +(@CGUID+2, 15892, 571, 5819.783, 639.3316, 647.9127, 1.029744, 120, 0), -- 15892 (Area: 4613) +(@CGUID+3, 15898, 571, 5827.147, 654.6258, 647.5777, 3.159046, 120, 0), -- 15898 (Area: 4613) (Auras: ) +(@CGUID+4, 15895, 571, 5824.651, 657.0713, 647.6139, 3.246312, 120, 0), -- 15895 (Area: 4613) (Auras: ) +(@CGUID+5, 15897, 571, 5821.922, 642.784, 648.11, 5.166174, 120, 0); -- 15897 (Area: 4613) (Auras: 25824 - 25824) + +DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+5 AND `eventEntry`=@Event; +INSERT INTO `game_event_creature` SELECT @Event, creature.guid FROM `creature` WHERE creature.guid BETWEEN @CGUID+0 AND @CGUID+5; diff --git a/sql/updates/world/2016_02_11_07_world.sql b/sql/updates/world/2016_02_11_07_world.sql new file mode 100644 index 00000000000..e34106cb44c --- /dev/null +++ b/sql/updates/world/2016_02_11_07_world.sql @@ -0,0 +1,145 @@ +SET @OGUID:=79767; +SET @CGUID:=97677; +SET @Event:=7; + +-- Add missing lunar objects +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+109; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@OGUID+0 , 180768, 530, 1, 1, -1813.065, 5493.691, -12.42814, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703) +(@OGUID+1 , 180768, 530, 1, 1, -1810.529, 5502.124, -12.42814, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703) +(@OGUID+2 , 180768, 530, 1, 1, -1797.383, 5484.879, -12.42814, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703) +(@OGUID+3 , 180768, 530, 1, 1, -1802.372, 5503.944, -12.42814, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703) +(@OGUID+4 , 180768, 530, 1, 1, -1804.87, 5483.975, -12.42814, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703) +(@OGUID+5 , 180768, 530, 1, 1, -1796.439, 5505.653, -12.42814, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703) +(@OGUID+6 , 180768, 530, 1, 1, -1791.092, 5498.224, -12.42814, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703) +(@OGUID+7 , 180768, 530, 1, 1, -1793.718, 5492.52, -12.42814, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703) +(@OGUID+8 , 180768, 530, 1, 1, 9487.017, -7295.95, 14.34292, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487) +(@OGUID+9 , 180768, 530, 1, 1, 9484.238, -7301.355, 14.38242, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487) +(@OGUID+10 , 180768, 530, 1, 1, 9489.608, -7291.334, 14.31547, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487) +(@OGUID+11 , 180768, 530, 1, 1, 9477.151, -7304.068, 14.36639, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487) +(@OGUID+12 , 180768, 530, 1, 1, 9486.314, -7286.41, 14.28697, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487) +(@OGUID+13 , 180768, 530, 1, 1, 9475.41, -7288.148, 14.25113, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487) +(@OGUID+14 , 180768, 530, 1, 1, 9481.289, -7287.188, 14.267, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487) +(@OGUID+15 , 180768, 530, 1, 1, 9470.736, -7293.924, 14.30253, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487) +(@OGUID+16 , 180766, 530, 1, 1, -1784.918, 5443.967, -12.42814, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703) +(@OGUID+17 , 180766, 530, 1, 1, -1782.34, 5432.168, -12.42814, 5.864307, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703) +(@OGUID+18 , 180766, 530, 1, 1, -1779.882, 5450.221, -12.42814, 3.438303, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703) +(@OGUID+19 , 180766, 530, 1, 1, -1771.785, 5447.635, -12.42814, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703) +(@OGUID+20 , 180766, 530, 1, 1, -1768.499, 5435.3, -12.42814, 0.7853968, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703) +(@OGUID+21 , 180766, 530, 1, 1, -1774.774, 5428.898, -12.42814, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703) +(@OGUID+22 , 180766, 530, 1, 1, -1764.911, 5447.474, -12.42814, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703) +(@OGUID+23 , 180766, 530, 1, 1, -1762.984, 5438.721, -12.42814, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703) +(@OGUID+24 , 180778, 530, 1, 1, -1807.913, 5485.737, -12.42814, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180778 (Area: 3703) +(@OGUID+25 , 180778, 530, 1, 1, -1812.186, 5490.322, -12.42814, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 180778 (Area: 3703) +(@OGUID+26 , 180778, 530, 1, 1, 9471.936, -7298.056, 14.34922, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 180778 (Area: 3487) +(@OGUID+27 , 180778, 530, 1, 1, 9474.56, -7301.353, 14.37097, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180778 (Area: 3487) +(@OGUID+28 , 180878, 530, 1, 1, -1790.338, 5498.744, -12.42814, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+29 , 180878, 530, 1, 1, -1790.234, 5496.288, -12.42814, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+30 , 180878, 530, 1, 1, -1790.902, 5497.011, -12.42814, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+31 , 180878, 530, 1, 1, -1789.234, 5496.14, -12.42814, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+32 , 180878, 530, 1, 1, -1789.172, 5498.917, -12.42814, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+33 , 180878, 530, 1, 1, -1788.415, 5496.598, -12.42814, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+34 , 180878, 530, 1, 1, -1788.392, 5498.381, -12.42814, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+35 , 180878, 530, 1, 1, -1788.111, 5497.561, -12.42814, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+36 , 180878, 530, 1, 1, -1765.722, 5449.934, -12.42814, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+37 , 180878, 530, 1, 1, -1764.807, 5450.181, -12.42814, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+38 , 180878, 530, 1, 1, -1766.226, 5448.125, -12.42814, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+39 , 180878, 530, 1, 1, -1766.088, 5449.026, -12.42814, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+40 , 180878, 530, 1, 1, -1765.541, 5447.308, -12.42814, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+41 , 180878, 530, 1, 1, -1763.994, 5449.78, -12.42814, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+42 , 180878, 530, 1, 1, -1763.402, 5449.152, -12.42814, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703) +(@OGUID+43 , 180878, 530, 1, 1, 9491.685, -7292.46, 14.32974, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487) +(@OGUID+44 , 180878, 530, 1, 1, 9490.622, -7293.794, 14.33648, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487) +(@OGUID+45 , 180878, 530, 1, 1, 9491.373, -7293.285, 14.3349, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487) +(@OGUID+46 , 180878, 530, 1, 1, 9489.716, -7293.833, 14.33415, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487) +(@OGUID+47 , 180878, 530, 1, 1, 9488.958, -7293.352, 14.32843, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487) +(@OGUID+48 , 180878, 530, 1, 1, 9491.266, -7291.555, 14.32187, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487) +(@OGUID+49 , 180878, 530, 1, 1, 9488.673, -7292.52, 14.32149, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487) +(@OGUID+50 , 180878, 530, 1, 1, 9488.967, -7291.694, 14.31627, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487) +(@OGUID+51 , 180763, 530, 1, 1, -1804.848, 5484.874, -11.5462, 0.6981314, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703) +(@OGUID+52 , 180763, 530, 1, 1, -1795.721, 5504.963, -11.49064, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703) +(@OGUID+53 , 180763, 530, 1, 1, -1779.698, 5450.049, -11.14342, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703) +(@OGUID+54 , 180763, 530, 1, 1, -1784.666, 5443.933, -11.10175, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703) +(@OGUID+55 , 180763, 530, 1, 1, -1774.672, 5429.127, -11.12259, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703) +(@OGUID+56 , 180763, 530, 1, 1, -1762.88, 5438.89, -11.18509, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703) +(@OGUID+57 , 180764, 530, 1, 1, 9489.186, -7290.492, 15.29506, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 3487) +(@OGUID+58 , 180764, 530, 1, 1, 9471.669, -7294.084, 15.2562, 0.6981314, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 3487) +(@OGUID+59 , 180879, 530, 1, 1, -1764.911, 5448.846, -12.42814, 1.204277, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 3703) +(@OGUID+60 , 180777, 530, 1, 1, -1784.936, 5439.937, -12.42814, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 3703) +(@OGUID+61 , 180777, 530, 1, 1, -1784.008, 5435.997, -12.42814, 0.2094394, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 3703) +(@OGUID+62 , 180880, 530, 1, 1, -1789.301, 5498.034, -11.72675, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 3703) +(@OGUID+63 , 180880, 530, 1, 1, -1789.678, 5498.17, -11.71286, 1.989672, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 3703) +(@OGUID+64 , 180880, 530, 1, 1, -1764.493, 5448.475, -10.58786, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 3703) +(@OGUID+65 , 180880, 530, 1, 1, 9490.517, -7292.749, 15.03819, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 3487) +(@OGUID+66 , 180880, 530, 1, 1, 9490.091, -7292.49, 15.04175, 1.989672, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 3487) +(@OGUID+67 , 180881, 530, 1, 1, -1789.489, 5497.099, -11.74759, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 3703) +(@OGUID+68 , 180881, 530, 1, 1, -1790.061, 5497.251, -11.74064, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 3703) +(@OGUID+69 , 180881, 530, 1, 1, -1764.79, 5449.202, -10.61564, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 3703) +(@OGUID+70 , 180881, 530, 1, 1, 9489.579, -7292.59, 15.02525, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 3487) +(@OGUID+71 , 180881, 530, 1, 1, 9489.869, -7292.061, 15.01508, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 3487) +(@OGUID+72 , 180882, 530, 1, 1, -1789.633, 5497.666, -11.7337, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 3703) +(@OGUID+73 , 180882, 530, 1, 1, -1790.078, 5497.862, -11.7337, 4.956738, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 3703) +(@OGUID+74 , 180882, 530, 1, 1, -1764.311, 5449.006, -10.6087, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 3703) +(@OGUID+75 , 180882, 530, 1, 1, 9490.705, -7292.344, 15.01931, 4.956738, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 3487) +(@OGUID+76 , 180882, 530, 1, 1, 9490.47, -7292.036, 15.02789, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 3487) +(@OGUID+77 , 180883, 530, 1, 1, -1789.06, 5497.521, -11.7337, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 3703) +(@OGUID+78 , 180883, 530, 1, 1, -1764.884, 5448.252, -10.58786, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 3703) +(@OGUID+79 , 180883, 530, 1, 1, -1765.275, 5448.697, -10.6087, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 3703) +(@OGUID+80 , 180883, 530, 1, 1, 9490.114, -7293.036, 15.03141, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 3487) +(@OGUID+81 , 180888, 530, 1, 1, -1789.768, 5497.439, -12.42814, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180888 (Area: 3703) +(@OGUID+82 , 180888, 530, 1, 1, 9489.949, -7292.669, 14.32627, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180888 (Area: 3487) +(@OGUID+83 , 180868, 530, 1, 1, -1809.283, 5488.518, -12.42814, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+84 , 180868, 530, 1, 1, -1798.701, 5502.052, -12.42814, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+85 , 180868, 530, 1, 1, -1801.822, 5499.706, -12.42814, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+86 , 180868, 530, 1, 1, -1804.326, 5487.32, -12.42814, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+87 , 180868, 530, 1, 1, -1796.721, 5493.617, -12.42814, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+88 , 180868, 530, 1, 1, -1809.226, 5493.723, -12.42814, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+89 , 180868, 530, 1, 1, -1794.08, 5495.903, -12.42814, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+90 , 180868, 530, 1, 1, -1780.21, 5435.097, -12.42814, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+91 , 180868, 530, 1, 1, -1781.543, 5442.225, -12.42814, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+92 , 180868, 530, 1, 1, -1784.189, 5438.144, -12.42814, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+93 , 180868, 530, 1, 1, -1770.829, 5437.18, -12.42814, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+94 , 180868, 530, 1, 1, -1768.798, 5445.465, -12.42814, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+95 , 180868, 530, 1, 1, -1772.664, 5444.496, -12.42814, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+96 , 180868, 530, 1, 1, -1766.992, 5438.217, -12.42814, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703) +(@OGUID+97 , 180868, 530, 1, 1, 9487.395, -7292.862, 14.32032, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487) +(@OGUID+98 , 180868, 530, 1, 1, 9485.133, -7294.792, 14.32811, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487) +(@OGUID+99 , 180868, 530, 1, 1, 9483.845, -7288.145, 14.27744, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487) +(@OGUID+100, 180868, 530, 1, 1, 9478.389, -7299.729, 14.37478, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487) +(@OGUID+101, 180868, 530, 1, 1, 9474.005, -7299.41, 14.36638, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487) +(@OGUID+102, 180868, 530, 1, 1, 9481.45, -7289.982, 14.28201, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487) +(@OGUID+103, 180868, 530, 1, 1, 9474.831, -7294.813, 14.31686, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487) +(@OGUID+104, 180869, 530, 1, 1, -1808.304, 5498.599, -12.42814, 5.148723, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 3703) +(@OGUID+105, 180869, 530, 1, 1, -1799.88, 5487.621, -12.42814, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 3703) +(@OGUID+106, 180869, 530, 1, 1, -1778.706, 5445.924, -12.42814, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 3703) +(@OGUID+107, 180869, 530, 1, 1, -1775.92, 5433.098, -12.42814, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 3703) +(@OGUID+108, 180869, 530, 1, 1, 9482.434, -7299.702, 14.37898, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 3487) +(@OGUID+109, 180869, 530, 1, 1, 9476.028, -7289.976, 14.26634, 5.148723, 0, 0, 0, 1, 120, 255, 1); -- 180869 (Area: 3487) + +DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+109 AND `eventEntry`=@Event; +INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+109; + +-- Add missing lunar spawns +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+17; +INSERT INTO `creature` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `curhealth`) VALUES +(@CGUID+0 , 15892, 530, -1781.75, 5438.715, -12.34481, 0.2617994, 120, 0), -- 15892 (Area: 3703) +(@CGUID+1 , 15892, 530, -1775.563, 5444.455, -12.34481, 4.223697, 120, 0), -- 15892 (Area: 3703) +(@CGUID+2 , 15892, 530, -1773.548, 5436.28, -12.3448, 2.495821, 120, 0), -- 15892 (Area: 3703) +(@CGUID+3 , 15898, 530, -1790.075, 5499.826, -12.34481, 0.6981317, 120, 0), -- 15898 (Area: 3703) +(@CGUID+4 , 15898, 530, -1763.572, 5447.717, -12.34481, 0.2268928, 120, 0), -- 15898 (Area: 3703) (Auras: ) +(@CGUID+5 , 15898, 530, 9490.617, -7290.235, 14.39641, 0.6981317, 120, 0), -- 15898 (Area: 3487) +(@CGUID+6 , 15895, 530, -1794.924, 5506.388, -12.34481, 0.6806784, 120, 0), -- 15895 (Area: 3703) +(@CGUID+7 , 15895, 530, -1762.115, 5439.025, -12.34481, 0.3316126, 120, 0), -- 15895 (Area: 3703) (Auras: ) +(@CGUID+8 , 15895, 530, 9487.328, -7285.737, 14.37371, 0.6806784, 120, 0), -- 15895 (Area: 3487) +(@CGUID+9 , 15891, 530, -1799.079, 5491.603, -12.34481, 2.879793, 120, 0), -- 15891 (Area: 3703) +(@CGUID+10, 15891, 530, -1804.241, 5498.248, -12.34481, 4.694936, 120, 0), -- 15891 (Area: 3703) +(@CGUID+11, 15891, 530, -1807.636, 5489.974, -12.34481, 0.7504916, 120, 0), -- 15891 (Area: 3703) +(@CGUID+12, 15891, 530, 9483.579, -7296.714, 14.43082, 2.879793, 120, 0), -- 15891 (Area: 3487) +(@CGUID+13, 15891, 530, 9479.115, -7290.209, 14.36029, 4.694936, 120, 0), -- 15891 (Area: 3487) +(@CGUID+14, 15891, 530, 9475.681, -7297.988, 14.43598, 0.7504916, 120, 0), -- 15891 (Area: 3487) +(@CGUID+15, 15897, 530, -1804.344, 5492.794, -12.34481, 5.375614, 120, 0), -- 15897 (Area: 3703) (Auras: 25824 - 25824) +(@CGUID+16, 15897, 530, -1778.063, 5439.687, -12.34481, 4.415683, 120, 0), -- 15897 (Area: 3703) (Auras: 25824 - 25824) +(@CGUID+17, 15897, 530, 9479.258, -7295.212, 14.4095, 4.39823, 120, 0); -- 15897 (Area: 3487) (Auras: 25824 - 25824) + +DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+17 AND `eventEntry`=@Event; +INSERT INTO `game_event_creature` SELECT @Event, creature.guid FROM `creature` WHERE creature.guid BETWEEN @CGUID+0 AND @CGUID+17; diff --git a/sql/updates/world/2016_02_12_00_world.sql b/sql/updates/world/2016_02_12_00_world.sql new file mode 100644 index 00000000000..af599148e04 --- /dev/null +++ b/sql/updates/world/2016_02_12_00_world.sql @@ -0,0 +1,7 @@ +-- +-- Spawn creature ID 16399 Bloodsail Traitor: +SET @CGUID := 1528; -- selected by TC team + +DELETE FROM `creature` WHERE `id` = 16399; +INSERT INTO `creature` (`guid`,`id`,`map`,`zoneId`,`areaId`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`,`VerifiedBuild`) VALUES +(@CGUID, 16399, 0, 0, 0, 1, 1, 2557, 1, -14184.4, 192.764, 20.6905, 3.735, 300, 0, 0, 2059, 0, 0, 0, 0, 0, 0); diff --git a/sql/updates/world/2016_02_13_00_world.sql b/sql/updates/world/2016_02_13_00_world.sql new file mode 100644 index 00000000000..2341e33a8b5 --- /dev/null +++ b/sql/updates/world/2016_02_13_00_world.sql @@ -0,0 +1,4 @@ +SET @ENTRY:=23258; +SET @AURA:=40670; +DELETE FROM `creature_template_addon` WHERE `entry` = @ENTRY; +INSERT INTO `creature_template_addon` (`entry`, `auras`) VALUES (@ENTRY, @AURA); diff --git a/sql/updates/world/2016_02_13_01_world.sql b/sql/updates/world/2016_02_13_01_world.sql new file mode 100644 index 00000000000..29f94a9f41d --- /dev/null +++ b/sql/updates/world/2016_02_13_01_world.sql @@ -0,0 +1,206 @@ +SET @OGUID:=79877; +SET @Event:=7; + +-- Add missing lunar objects +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+152; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@OGUID+0 , 180879, 1, 1, 1, 7593.807, -2222.592, 469.1576, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 493) +(@OGUID+1 , 180879, 1, 1, 1, 7595.46, -2226.798, 468.3849, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 493) +(@OGUID+2 , 180879, 1, 1, 1, 7592.46, -2218.003, 469.6433, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 493) +(@OGUID+3 , 180880, 1, 1, 1, 7593.197, -2221.986, 470.9921, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 493) +(@OGUID+4 , 180880, 1, 1, 1, 7596.01, -2226.955, 470.215, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 493) +(@OGUID+5 , 180880, 1, 1, 1, 7591.976, -2217.98, 471.4845, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 493) +(@OGUID+6 , 180880, 1, 1, 1, 7593.209, -2218.238, 471.4679, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 493) +(@OGUID+7 , 180881, 1, 1, 1, 7595.163, -2227.192, 470.1959, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 493) +(@OGUID+8 , 180881, 1, 1, 1, 7594.063, -2222.041, 470.9863, 3.595379, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 493) +(@OGUID+9 , 180881, 1, 1, 1, 7595.476, -2226.666, 470.2082, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 493) +(@OGUID+10 , 180881, 1, 1, 1, 7592.764, -2218.324, 471.472, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 493) +(@OGUID+11 , 180881, 1, 1, 1, 7592.445, -2217.559, 471.4581, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 493) +(@OGUID+12 , 180882, 1, 1, 1, 7593.618, -2221.826, 470.969, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 493) +(@OGUID+13 , 180882, 1, 1, 1, 7595.62, -2227.267, 470.2169, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 493) +(@OGUID+14 , 180882, 1, 1, 1, 7595.934, -2226.421, 470.1891, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 493) +(@OGUID+15 , 180882, 1, 1, 1, 7592.151, -2218.304, 471.4556, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 493) +(@OGUID+16 , 180882, 1, 1, 1, 7592.401, -2218.573, 471.4416, 2.91469, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 493) +(@OGUID+17 , 180883, 1, 1, 1, 7595.268, -2226.156, 470.2048, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 493) +(@OGUID+18 , 180883, 1, 1, 1, 7594.821, -2226.714, 470.1994, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 493) +(@OGUID+19 , 180883, 1, 1, 1, 7593.012, -2217.75, 471.4669, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 493) +(@OGUID+20 , 180851, 1, 1, 1, 7564.366, -2224.284, 475.4654, 5.148725, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+21 , 180851, 1, 1, 1, 7600.833, -2219.168, 473.4156, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+22 , 180851, 1, 1, 1, 7588.353, -2200.221, 479.1006, 4.20625, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+23 , 180851, 1, 1, 1, 7592.721, -2256.181, 467.8657, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+24 , 180851, 1, 1, 1, 7600.807, -2205.065, 476.8404, 5.061459, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+25 , 180851, 1, 1, 1, 7588.353, -2200.221, 479.1006, 4.20625, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+26 , 180851, 1, 1, 1, 7612.306, -2222.548, 473.3903, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+27 , 180851, 1, 1, 1, 7577.153, -2226.377, 475.8007, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+28 , 180851, 1, 1, 1, 7573.452, -2244.367, 470.6506, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+29 , 180851, 1, 1, 1, 7588.164, -2211.207, 476.1555, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+30 , 180851, 1, 1, 1, 7581.566, -2236.441, 474.0557, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+31 , 180851, 1, 1, 1, 7607.799, -2215.778, 473.6258, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+32 , 180851, 1, 1, 1, 7592.721, -2256.181, 467.8657, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+33 , 180851, 1, 1, 1, 7579.257, -2243.993, 471.6541, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+34 , 180851, 1, 1, 1, 7612.306, -2222.548, 473.3903, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+35 , 180851, 1, 1, 1, 7600.601, -2238.859, 470.7188, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+36 , 180851, 1, 1, 1, 7588.164, -2211.207, 476.1555, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+37 , 180851, 1, 1, 1, 7617.579, -2233.563, 470.0322, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493) +(@OGUID+38 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+39 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+40 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+41 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+42 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+43 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+44 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+45 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+46 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+47 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+48 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+49 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+50 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+51 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+52 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+53 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+54 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+55 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+56 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+57 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+58 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+59 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+60 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+61 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+62 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+63 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+64 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493) +(@OGUID+65 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+66 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+67 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+68 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+69 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+70 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+71 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+72 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+73 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+74 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+75 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+76 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+77 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+78 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+79 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+80 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+81 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+82 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493) +(@OGUID+83 , 180769, 1, 1, 1, 7879.087, -2219.161, 479.2853, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 2362) +(@OGUID+84 , 180769, 1, 1, 1, 7837.341, -2197, 478.0439, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 2362) +(@OGUID+85 , 180769, 1, 1, 1, 7868.952, -2191.253, 486.3665, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 2362) +(@OGUID+86 , 180879, 1, 1, 1, 7946.622, -2621.156, 492.3542, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 2361) +(@OGUID+87 , 180909, 1, 1, 1, 7946.665, -2621.123, 494.2065, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 180909 (Area: 2361) +(@OGUID+88 , 180909, 1, 1, 1, 7946.252, -2621.753, 494.1519, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 180909 (Area: 2361) +(@OGUID+89 , 180909, 1, 1, 1, 7946.777, -2621.559, 494.1994, 3.263772, 0, 0, 0, 1, 120, 255, 1), -- 180909 (Area: 2361) +(@OGUID+90 , 180909, 1, 1, 1, 7947.238, -2621.351, 494.1782, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 180909 (Area: 2361) +(@OGUID+91 , 180777, 1, 1, 1, 7951.528, -2615.867, 492.9226, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361) +(@OGUID+92 , 180777, 1, 1, 1, 7948.855, -2629.297, 493.1261, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361) +(@OGUID+93 , 180910, 1, 1, 1, 7946.681, -2621.326, 494.1927, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 180910 (Area: 2361) +(@OGUID+94 , 188215, 1, 1, 1, 7947.822, -2622.942, 492.8509, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 188215 (Area: 2361) - !!! might be temporary spawn !!! +(@OGUID+95 , 188215, 1, 1, 1, 7948.878, -2619.704, 492.7197, 2.303831, 0, 0, 0, 1, 120, 255, 1), -- 188215 (Area: 2361) - !!! might be temporary spawn !!! +(@OGUID+96 , 180764, 1, 1, 1, 7781.23, -2437.568, 494.049, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 2361) +(@OGUID+97 , 180769, 1, 1, 1, 7797.483, -2417.394, 497.058, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 2361) +(@OGUID+98 , 180769, 1, 1, 1, 7439.099, -2809.767, 473.9281, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 656) +(@OGUID+99 , 180777, 1, 1, 1, 7619.005, -2221.212, 469.807, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+100, 180777, 1, 1, 1, 7586.018, -2220.791, 471.5764, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+101, 180777, 1, 1, 1, 7591.077, -2214.273, 471.4059, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+102, 180777, 1, 1, 1, 7585.201, -2209.946, 473.8624, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+103, 180777, 1, 1, 1, 7580.083, -2215.166, 473.3982, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+104, 180777, 1, 1, 1, 7587.347, -2196.992, 476.204, 1.343901, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+105, 180777, 1, 1, 1, 7562.486, -2227.179, 471.6295, 3.595379, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+106, 180777, 1, 1, 1, 7571.573, -2207.698, 474.8347, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+107, 180777, 1, 1, 1, 7577.507, -2201.813, 475.4521, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+108, 180777, 1, 1, 1, 7497.841, -2203.225, 480.2202, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+109, 180777, 1, 1, 1, 7499.098, -2191.63, 480.452, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0) +(@OGUID+110, 180777, 1, 1, 1, 7937.66, -2362.064, 488.5504, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2362) +(@OGUID+111, 180777, 1, 1, 1, 7971.51, -2352.85, 488.2709, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2362) +(@OGUID+112, 180777, 1, 1, 1, 7993.134, -2468.059, 489.5084, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361) +(@OGUID+113, 180777, 1, 1, 1, 7960.454, -2515.816, 485.9554, 5.340709, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361) +(@OGUID+114, 180777, 1, 1, 1, 7925.333, -2550.147, 486.0686, 4.101525, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361) +(@OGUID+115, 180777, 1, 1, 1, 7951.528, -2615.867, 492.9226, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361) +(@OGUID+116, 180777, 1, 1, 1, 7948.855, -2629.297, 493.1261, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361) +(@OGUID+117, 180777, 1, 1, 1, 7530.31, -2850.198, 458.604, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 656) +(@OGUID+118, 180777, 1, 1, 1, 7532.818, -2852.513, 458.175, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 656) +(@OGUID+119, 180777, 1, 1, 1, 7562.452, -2873.018, 460.911, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 656) +(@OGUID+120, 180777, 1, 1, 1, 7559.907, -2871.458, 460.6194, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 656) +(@OGUID+121, 180875, 1, 1, 1, 7531.745, -2851.107, 457.8172, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 180875 (Area: 656) +(@OGUID+122, 180875, 1, 1, 1, 7561.202, -2872.201, 459.9906, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 180875 (Area: 656) +(@OGUID+123, 180773, 1, 1, 1, 7562.604, -2903.484, 462.9012, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 180773 (Area: 656) +(@OGUID+124, 180773, 1, 1, 1, 7570.199, -2903.755, 462.812, 1.640607, 0, 0, 0, 1, 120, 255, 1), -- 180773 (Area: 656) +(@OGUID+125, 180765, 1, 1, 1, 7478.559, -2652.309, 455.1449, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 656) +(@OGUID+126, 180765, 1, 1, 1, 7532.16, -2467.022, 455.5912, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 0) +(@OGUID+127, 180766, 1, 1, 1, 7572.346, -2366.04, 454.7335, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0) +(@OGUID+128, 180766, 1, 1, 1, 7535.119, -2436.779, 453.7722, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0) +(@OGUID+129, 180766, 1, 1, 1, 7528.662, -2481.222, 454.3387, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0) +(@OGUID+130, 180766, 1, 1, 1, 7499.897, -2487.684, 457.2921, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0) +(@OGUID+131, 180766, 1, 1, 1, 7520.417, -2504.377, 454.1295, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0) +(@OGUID+132, 180766, 1, 1, 1, 7479.219, -2479.521, 461.8409, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0) +(@OGUID+133, 180766, 1, 1, 1, 7497.929, -2564.247, 454.2826, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+134, 180766, 1, 1, 1, 7496.524, -2532.186, 452.8313, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+135, 180766, 1, 1, 1, 7464.938, -2691.611, 454.3436, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+136, 180766, 1, 1, 1, 7475.028, -2597.744, 452.8322, 1.239183, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+137, 180766, 1, 1, 1, 7483.91, -2632.364, 453.8647, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+138, 180766, 1, 1, 1, 7463.901, -2741.921, 459.2945, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+139, 180766, 1, 1, 1, 7494.413, -2822.02, 461.3461, 4.991644, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+140, 180766, 1, 1, 1, 7481.923, -2829.692, 461.2198, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+141, 180766, 1, 1, 1, 7461.356, -2813.827, 462.3748, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+142, 180766, 1, 1, 1, 7474.328, -2795.222, 462.4803, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+143, 180766, 1, 1, 1, 7461.583, -2802.854, 462.1353, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+144, 180766, 1, 1, 1, 7475.494, -2750.214, 460.2916, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+145, 180766, 1, 1, 1, 7533.194, -2849.556, 456.259, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+146, 180766, 1, 1, 1, 7560.079, -2900.277, 460.4167, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+147, 180766, 1, 1, 1, 7562.421, -2870.49, 458.3398, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+148, 180766, 1, 1, 1, 7572.878, -2900.665, 460.2018, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656) +(@OGUID+149, 180767, 1, 1, 1, 7472.893, -2651.321, 455.1381, 5.480334, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 656) +(@OGUID+150, 180767, 1, 1, 1, 7526.87, -2464.803, 455.183, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 0) +(@OGUID+151, 180767, 1, 1, 1, 7553.503, -2401.662, 456.9937, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 0) +(@OGUID+152, 180767, 1, 1, 1, 7547.994, -2399.728, 456.7213, 0.8203033, 0, 0, 0, 1, 120, 255, 1); -- 180767 (Area: 0) + +DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+152 AND `eventEntry`=@Event; +INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+152; + +UPDATE `creature_addon` SET `emote`=0 WHERE `guid` IN (91639, 91644, 91657, 91658, 91663, 91669, 91671, 91676); + +-- Darnassus Reveler SAI +SET @ENTRY := 15905; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Darnassus Reveler - Out of Combat - Play Random Emote (11, 94)"); + +-- Ironforge Reveler SAI +SET @ENTRY := 15906; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Ironforge Reveler - Out of Combat - Play Random Emote (11, 94)"); + +-- Stormwind Reveler SAI +SET @ENTRY := 15694; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Stormwind Reveler - Out of Combat - Play Random Emote (11, 94)"); + +-- Orgrimmar Reveler SAI +SET @ENTRY := 15908; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Orgrimmar Reveler - Out of Combat - Play Random Emote (11, 94)"); + +-- Thunder Bluff Reveler SAI +SET @ENTRY := 15719; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Thunder Bluff Reveler - Out of Combat - Play Random Emote (11, 94)"); + +-- Undercity Reveler SAI +SET @ENTRY := 15907; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Undercity Reveler - Out of Combat - Play Random Emote (11, 94)"); diff --git a/sql/updates/world/2016_02_13_02_world.sql b/sql/updates/world/2016_02_13_02_world.sql new file mode 100644 index 00000000000..5a4633fee41 --- /dev/null +++ b/sql/updates/world/2016_02_13_02_world.sql @@ -0,0 +1,74 @@ +-- Update aura for Manifest Nightmare +UPDATE `creature_template_addon` SET `auras`='39579 37509' WHERE `entry`=22889; +-- Update aura for Phantasmal Lash +UPDATE `creature_template_addon` SET `auras`='34427' WHERE `entry`=22902; + +-- Pathing for Moonglade Warden Entry: 11822 'TDB FORMAT' +SET @NPC := 42393; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7546.649,`position_y`=-2901.733,`position_z`=462.5362 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7546.649,-2901.733,462.5362,0,0,0,0,100,0), -- 13:28:53 +(@PATH,2,7528.728,-2908.457,461.338,0,0,0,0,100,0), -- 13:28:57 +(@PATH,3,7517.918,-2920.282,461.923,0,0,0,0,100,0), -- 13:29:03 +(@PATH,4,7512.568,-2933.285,464.4847,0,0,0,0,100,0), -- 13:29:09 +(@PATH,5,7509.731,-2947.129,463.4818,0,0,0,0,100,0), -- 13:29:15 +(@PATH,6,7510.136,-2952.441,461.5912,0,0,0,0,100,0), -- 13:29:20 +(@PATH,7,7511.554,-2961.568,462.0287,0,0,0,0,100,0), -- 13:29:26 +(@PATH,8,7529.275,-2970.313,461.0047,0,0,0,0,100,0), -- 13:29:30 +(@PATH,9,7534.475,-2972.501,460.6516,0,0,0,0,100,0), -- 13:29:36 +(@PATH,10,7542.61,-2984.713,461.6914,0,0,0,0,100,0), -- 13:29:41 +(@PATH,11,7541.939,-2996.007,464.5852,0,0,0,0,100,0), -- 13:29:44 +(@PATH,12,7537.476,-3005.4,466.0187,0,0,0,0,100,0), -- 13:29:47 +(@PATH,13,7535.565,-3017.812,466.2273,0,0,0,0,100,0), -- 13:29:52 +(@PATH,14,7550.125,-3028.802,462.2839,0,0,0,0,100,0), -- 13:29:57 +(@PATH,15,7566.678,-3023.841,461.0449,0,0,0,0,100,0), -- 13:30:05 +(@PATH,16,7574.592,-3019.921,460.4108,0,0,0,0,100,0), -- 13:30:16 +(@PATH,17,7580.481,-3005.122,461.308,0,0,0,0,100,0), -- 13:30:19 +(@PATH,18,7581.311,-2996.924,462.5332,0,0,0,0,100,0), -- 13:30:23 +(@PATH,19,7589.289,-2980.43,460.9365,0,0,0,0,100,0), -- 13:30:28 +(@PATH,20,7589.837,-2979.668,460.4661,0,0,0,0,100,0), -- 13:30:33 +(@PATH,21,7606.989,-2972.392,461.5837,0,0,0,0,100,0), -- 13:30:37 +(@PATH,22,7617.824,-2965.905,461.3898,0,0,0,0,100,0), -- 13:30:43 +(@PATH,23,7620.032,-2963.793,461.5444,0,0,0,0,100,0), -- 13:30:47 +(@PATH,24,7653.39,-2955.129,463.8018,0,0,0,0,100,0), -- 13:30:51 +(@PATH,25,7668.529,-2958.117,464.894,0,0,0,0,100,0), -- 13:31:05 +(@PATH,26,7652.024,-2942.818,463.3503,0,0,0,0,100,0), -- 13:31:13 +(@PATH,27,7648.988,-2940.365,462.6953,0,0,0,0,100,0), -- 13:31:24 +(@PATH,28,7623.73,-2923.926,462.5015,0,0,0,0,100,0), -- 13:31:36 +(@PATH,29,7596.945,-2907.005,462.287,0,0,0,0,100,0), -- 13:31:43 +(@PATH,30,7589.421,-2904.872,461.6304,0,0,0,0,100,0), -- 13:31:51 +(@PATH,31,7591.465,-2904.978,461.9995,0,0,0,0,100,0), -- 13:31:58 +(@PATH,32,7600.53,-2909.323,462.908,0,0,0,0,100,0), -- 13:32:02 +(@PATH,33,7610.539,-2915.46,462.7303,0,0,0,0,100,0), -- 13:32:10 +(@PATH,34,7623.934,-2924.251,462.4937,0,0,0,0,100,0), -- 13:32:16 +(@PATH,35,7670.327,-2956.833,465.3539,0,0,0,0,100,0), -- 13:32:28 +(@PATH,36,7656.929,-2955.638,464.1862,0,0,0,0,100,0), -- 13:32:40 +(@PATH,37,7622.145,-2953.092,462.1255,0,0,0,0,100,0), -- 13:32:49 +(@PATH,38,7621.655,-2953.013,461.7986,0,0,0,0,100,0), -- 13:33:01 +(@PATH,39,7615.943,-2966.924,461.1361,0,0,0,0,100,0), -- 13:33:06 +(@PATH,40,7603.335,-2972.608,460.9927,0,0,0,0,100,0), -- 13:33:12 +(@PATH,41,7598.073,-2973.764,460.5677,0,0,0,0,100,0), -- 13:33:16 +(@PATH,42,7584.056,-2987.697,461.8174,0,0,0,0,100,0), -- 13:33:20 +(@PATH,43,7581.24,-2999.696,462.0973,0,0,0,0,100,0), -- 13:33:25 +(@PATH,44,7580.043,-3009.624,460.9475,0,0,0,0,100,0), -- 13:33:29 +(@PATH,45,7579.715,-3010.909,460.7065,0,0,0,0,100,0), -- 13:33:34 +(@PATH,46,7556.479,-3028.306,461.8019,0,0,0,0,100,0), -- 13:33:38 +(@PATH,47,7535.963,-3018.814,465.7519,0,0,0,0,100,0), -- 13:33:48 +(@PATH,48,7541.39,-2997.226,464.9632,0,0,0,0,100,0), -- 13:34:01 +(@PATH,49,7544.303,-2989.159,462.7299,0,0,0,0,100,0), -- 13:34:06 +(@PATH,50,7542.205,-2983.293,461.2471,0,0,0,0,100,0), -- 13:34:09 +(@PATH,51,7540.801,-2981.162,461.0032,0,0,0,0,100,0), -- 13:34:13 +(@PATH,52,7521.677,-2967.251,461.8644,0,0,0,0,100,0), -- 13:34:17 +(@PATH,53,7519.106,-2965.93,461.9445,0,0,0,0,100,0), -- 13:34:24 +(@PATH,54,7509.905,-2950.868,462.2672,0,0,0,0,100,0), -- 13:34:28 +(@PATH,55,7510.615,-2942.81,464.3668,0,0,0,0,100,0), -- 13:34:33 +(@PATH,56,7515.797,-2924.253,463.1058,0,0,0,0,100,0), -- 13:34:37 +(@PATH,57,7521.769,-2915.139,460.8744,0,0,0,0,100,0), -- 13:34:45 +(@PATH,58,7537.507,-2902.868,462.3076,0,0,0,0,100,0), -- 13:34:50 +(@PATH,59,7538.777,-2902.161,462.3616,0,0,0,0,100,0), -- 13:34:56 +(@PATH,60,7546.649,-2901.733,462.5362,0,0,0,0,100,0); -- 13:35:03 +-- 0x1C392000200B8B8000003800003F2E06 .go 7546.649 -2901.733 462.5362 diff --git a/sql/updates/world/2016_02_13_03_world.sql b/sql/updates/world/2016_02_13_03_world.sql new file mode 100644 index 00000000000..136a068bd9e --- /dev/null +++ b/sql/updates/world/2016_02_13_03_world.sql @@ -0,0 +1,166 @@ + +SET @CGUID := 145042; +SET @OGUID := 82917; + + +DELETE FROM `spell_area` WHERE `spell`=58139 AND `area`IN(4530,4531); +INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES +(58139, 4531, 13144, 0, 0, 0, 2, 1, 64, 11), -- The Fleshweks after Killing two scourge with one skeleton +(58139, 4530, 13144, 0, 0, 0, 2, 1, 64, 11); -- Sanctumn on renaimation after Killing two scourge with one skeleton + +DELETE FROM `creature` WHERE `id` IN(30703,30704,31015,30697,30696,31432); +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@CGUID+0, 31015, 571, 1, 64, 6661.146, 3261.688, 668.9714, 4.115243, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+1, 31015, 571, 1, 64, 6627.71, 3189.896, 647.9885, 2.84596, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+2, 31015, 571, 1, 64, 6659.174, 3212.105, 667.0215, 0.1042775, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+3, 31015, 571, 1, 64, 6654.514, 3239.867, 670.2061, 5.907172, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+4, 31015, 571, 1, 64, 6610.869, 3232.499, 668.5587, 2.604744, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+5, 31015, 571, 1, 64, 6605.338, 3153.076, 665.3033, 5.409661, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+6, 31015, 571, 1, 64, 6702.106, 3154.25, 654.8233, 5.986479, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+7, 31015, 571, 1, 64, 6583.975, 3157.158, 665.6695, 2.269745, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+8, 31015, 571, 1, 64, 6565.48, 3315.214, 667.1922, 3.576956, 120, 0, 0), -- 31015 (Area: 4588) +(@CGUID+9, 31015, 571, 1, 64, 6498.057, 3314.354, 664.8021, 0.5061455, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+10, 31015, 571, 1, 64, 6518.352, 3309.556, 665.1537, 5.462881, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+11, 31015, 571, 1, 64, 6571.921, 3315.821, 668.0949, 2.940412, 120, 0, 0), -- 31015 (Area: 4588) +(@CGUID+12, 31015, 571, 1, 64, 6572.489, 3319.39, 667.0414, -1.827478, 120, 0, 0), -- 31015 (Area: 4588) +(@CGUID+13, 31015, 571, 1, 64, 6530.034, 3256.114, 666.3459, 4.205114, 120, 0, 0), -- 31015 (Area: 4588) +(@CGUID+14, 31015, 571, 1, 64, 6493.935, 3292.664, 664.7191, 5.110613, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement) +(@CGUID+15, 31015, 571, 1, 64, 6569.369, 3316.948, 667.7736, -0.4594761, 120, 0, 0), -- 31015 (Area: 4588) (Auras: ) +(@CGUID+16, 31015, 571, 1, 64, 6530.081, 3256.11, 666.2975, 4.193476, 120, 0, 0), -- 31015 (Area: 4588) +(@CGUID+17, 31015, 571, 1, 64, 6464.674, 3252.994, 641.5389, 5.995564, 120, 0, 0), -- 31015 (Area: 4531) +(@CGUID+18, 31015, 571, 1, 64, 6489.055, 3385.385, 598.3196, -1.682238, 120, 0, 0), -- 31015 (Area: 4531) +(@CGUID+19, 31015, 571, 1, 64, 6456.603, 3166.644, 657.527, 1.598204, 120, 0, 0), -- 31015 (Area: 4531) +(@CGUID+20, 31015, 571, 1, 64, 6461.294, 3153.185, 657.5644, 4.921828, 120, 5, 1), -- 31015 (Area: 4531) (possible waypoints or random movement) +(@CGUID+21, 31015, 571, 1, 64, 6453.171, 3166.278, 657.5888, 0.3810751, 120, 0, 0), -- 31015 (Area: 4531) +(@CGUID+22, 31015, 571, 1, 64, 6455.606, 3164.106, 657.6061, 1.870695, 120, 0, 0), -- 31015 (Area: 4531) +(@CGUID+23, 31015, 571, 1, 64, 6412.766, 3231.688, 639.8654, 4.939847, 120, 5, 1), -- 31015 (Area: 4531) (possible waypoints or random movement) +(@CGUID+24, 31015, 571, 1, 64, 6667.497, 3354.504, 704.6642, -2.447248, 120, 0, 0), -- 31015 (Area: 4531) +(@CGUID+25, 30696, 571, 1, 64, 6638.812, 3160.733, 660.6064, 1.080401, 120, 5, 1), -- 30696 (Area: 4588) (possible waypoints or random movement) +(@CGUID+26, 30696, 571, 1, 64, 6686.414, 3147.764, 656.3453, 6.07866, 120, 5, 1), -- 30696 (Area: 4588) (possible waypoints or random movement) +(@CGUID+27, 30696, 571, 1, 64, 6526.674, 3303.937, 665.1752, 4.911891, 120, 5, 1), -- 30696 (Area: 4588) (possible waypoints or random movement) +(@CGUID+28, 30696, 571, 1, 64, 6548.213, 3310.022, 665.8172, 2.349988, 120, 0, 0), -- 30696 (Area: 4588) +(@CGUID+29, 30696, 571, 1, 64, 6532.149, 3256.876, 666.6301, -2.182277, 120, 0, 0), -- 30696 (Area: 4588) +(@CGUID+30, 30696, 571, 1, 64, 6521.981, 3320.334, 664.9473, 4.594295, 120, 0, 0), -- 30696 (Area: 4588) +(@CGUID+31, 30696, 571, 1, 64, 6470.161, 3250.802, 643.5604, 3.930473, 120, 0, 0), -- 30696 (Area: 4531) +(@CGUID+32, 30696, 571, 1, 64, 6487.702, 3380.006, 599.0916, 6.272988, 120, 0, 0), -- 30696 (Area: 4531) +(@CGUID+33, 30696, 571, 1, 64, 6488.242, 3194.719, 652.9039, 1.48353, 120, 0, 0), -- 30696 (Area: 4531) +(@CGUID+34, 30696, 571, 1, 64, 6435.536, 3141.343, 657.5279, 0.1379021, 120, 5, 1), -- 30696 (Area: 4531) (possible waypoints or random movement) +(@CGUID+35, 30696, 571, 1, 64, 6564.194, 3135.601, 666.2081, 0.4537856, 120, 0, 0), -- 30696 (Area: 4531) +(@CGUID+36, 30696, 571, 1, 64, 6410.666, 3233.757, 640.489, 4.667454, 120, 5, 1), -- 30696 (Area: 4531) (possible waypoints or random movement) +(@CGUID+37, 30696, 571, 1, 64, 6413.427, 3218.029, 638.4678, 0.122173, 120, 0, 0), -- 30696 (Area: 4531) +(@CGUID+38, 30696, 571, 1, 64, 6452.031, 3161.715, 657.5867, 0.9863433, 120, 0, 0), -- 30696 (Area: 4531) +(@CGUID+39, 30696, 571, 1, 64, 6459.535, 3110.506, 657.6054, 1.157361, 120, 5, 1), -- 30696 (Area: 4531) (possible waypoints or random movement) +(@CGUID+40, 30696, 571, 1, 64, 6679.659, 3345.589, 704.6539, 3.205272, 120, 5, 1), -- 30696 (Area: 4531) (possible waypoints or random movement) +(@CGUID+41, 30703, 571, 1, 64, 6571.963, 3314.406, 668.2784, 2.36651, 120, 0, 0), -- 30703 (Area: 4588) +(@CGUID+42, 30703, 571, 1, 64, 6517.844, 3323.566, 664.8954, -0.663258, 120, 0, 0), -- 30703 (Area: 4588) +(@CGUID+43, 30703, 571, 1, 64, 6528.306, 3259.301, 665.793, -1.073858, 120, 0, 0), -- 30703 (Area: 4588) +(@CGUID+44, 30703, 571, 1, 64, 6454.563, 3168.846, 657.5237, 5.535412, 120, 0, 0), -- 30703 (Area: 4531) +(@CGUID+45, 30703, 571, 1, 64, 6421.846, 3257.234, 640.0424, 2.456618, 120, 0, 0), -- 30703 (Area: 4531) (Auras: ) +(@CGUID+46, 30703, 571, 1, 64, 6669.027, 3354.094, 704.2711, 2.458861, 120, 0, 0), -- 30703 (Area: 4531) +(@CGUID+47, 30704, 571, 1, 64, 6572.606, 3315.346, 668.405, -2.30596, 120, 0, 0), -- 30704 (Area: 4588) +(@CGUID+48, 30704, 571, 1, 64, 6568.352, 3316.549, 667.683, 2.906086, 120, 0, 0), -- 30704 (Area: 4588) +(@CGUID+49, 30704, 571, 1, 64, 6571.605, 3316.023, 668.1923, -2.073231, 120, 0, 0), -- 30704 (Area: 4588) +(@CGUID+50, 30704, 571, 1, 64, 6530.246, 3252.483, 666.8104, 1.616269, 120, 0, 0), -- 30704 (Area: 4588) +(@CGUID+51, 30704, 571, 1, 64, 6543.361, 3308.063, 665.3945, 0.383608, 120, 0, 0), -- 30704 (Area: 4588) +(@CGUID+52, 30704, 571, 1, 64, 6529.136, 3252.577, 666.5628, 1.30948, 120, 0, 0), -- 30704 (Area: 4588) (Auras: ) +(@CGUID+53, 30704, 571, 1, 64, 6489.347, 3384.931, 598.3163, -1.893157, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+54, 30704, 571, 1, 64, 6492.296, 3382.427, 598.8416, 5.579057, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+55, 30704, 571, 1, 64, 6488.653, 3381.798, 598.9666, 1.330476, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+56, 30704, 571, 1, 64, 6492.833, 3385.416, 598.5916, -3.133257, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+57, 30704, 571, 1, 64, 6492.375, 3197.953, 653.0616, -2.477693, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+58, 30704, 571, 1, 64, 6571.54, 3281.336, 670.894, 5.986175, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+59, 30704, 571, 1, 64, 6463.915, 3257.741, 640.313, 0.01159616, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+60, 30704, 571, 1, 64, 6462.88, 3253.862, 641.1767, 0.2747464, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+61, 30704, 571, 1, 64, 6468.83, 3249.454, 643.105, 0.7893116, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+62, 30704, 571, 1, 64, 6509.02, 3212.699, 658.4735, 2.319517, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+63, 30704, 571, 1, 64, 6507.89, 3210.89, 658.0303, 1.634014, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+64, 30704, 571, 1, 64, 6456.575, 3167.642, 657.5801, -1.838321, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+65, 30704, 571, 1, 64, 6452.937, 3166.663, 657.6061, -0.005128502, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+66, 30704, 571, 1, 64, 6454.717, 3168.428, 657.5237, 2.709053, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+67, 30704, 571, 1, 64, 6455.861, 3167.833, 657.575, -1.598367, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+68, 30704, 571, 1, 64, 6416.846, 3214.117, 639.7312, 2.10443, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+69, 30704, 571, 1, 64, 6590.434, 3331.823, 667.183, 4.037075, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+70, 30704, 571, 1, 64, 6668.725, 3357.257, 704.2558, -3.137703, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+71, 30704, 571, 1, 64, 6664.69, 3352.166, 704.3459, 1.520238, 120, 0, 0), -- 30704 (Area: 4531) +(@CGUID+72, 30697, 571, 1, 64, 6559.192, 3333.02, 664.9217, 4.991642, 120, 0, 0), -- 30697 (Area: 4588) +(@CGUID+73, 30697, 571, 1, 64, 6512.84, 3320.273, 665.2345, 0.5819893, 120, 0, 0), -- 30697 (Area: 4588) +(@CGUID+74, 30697, 571, 1, 64, 6515.811, 3280.09, 665.0708, 0.1396263, 120, 0, 0), -- 30697 (Area: 4531) +(@CGUID+75, 30697, 571, 1, 64, 6476.128, 3146.229, 657.5644, 4.380776, 120, 0, 0), -- 30697 (Area: 4531) +(@CGUID+76, 30697, 571, 1, 64, 6417.988, 3260.385, 640.6262, -0.6849744, 120, 0, 0), -- 30697 (Area: 4531) +(@CGUID+77, 31432, 571, 1, 64, 6588.427, 3278.203, 818.2033, 5.044002, 120, 5, 1); -- 31432 (Area: 4588) (possible waypoints or random movement) + + +UPDATE `creature` SET `phaseMask`=64 WHERE `id` IN(31314,30698,31306,31428); +UPDATE `creature` SET `phaseMask`=65 WHERE `id` IN(30597,32467); +UPDATE `creature_template` SET `unit_flags`=768 WHERE `entry`=31432; +UPDATE `creature` SET `equipment_id`=1 WHERE `id` IN(30703,30704); + +DELETE FROM `vehicle_template_accessory` WHERE `entry`=31432; +INSERT INTO `vehicle_template_accessory` (`entry`, `accessory_entry`, `seat_id`, `minion`, `description`, `summontype`, `summontimer`) VALUES +(31432, 31428, 0, 0, '31432 - 31428', 6, 30000); -- 31432 - 31428 + + +DELETE FROM `gameobject` WHERE `id` IN(193203,193204); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@OGUID+0, 193203, 571, 1, 64, 6531.642, 3336.632, 666.5159, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+1, 193203, 571, 1, 64, 6541.198, 3337.612, 674.4935, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+2, 193203, 571, 1, 64, 6561.242, 3342.843, 667.0536, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+3, 193203, 571, 1, 64, 6575.444, 3336.632, 667.6539, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+4, 193203, 571, 1, 64, 6517.65, 3262.135, 668.0207, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+5, 193204, 571, 1, 64, 6509.69, 3298.966, 670.1282, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531) +(@OGUID+6, 193203, 571, 1, 64, 6441.041, 3245.802, 643.5339, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+7, 193203, 571, 1, 64, 6523.465, 3403.516, 599.7352, 1.06465, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+8, 193204, 571, 1, 64, 6774.447, 3517.597, 670.3411, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531) +(@OGUID+9, 193204, 571, 1, 64, 6774.1, 3539.328, 670.2827, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531) +(@OGUID+10, 193203, 571, 1, 64, 6815.187, 3502.362, 691.7656, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+11, 193203, 571, 1, 64, 6836.54, 3514.926, 691.6472, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+12, 193204, 571, 1, 64, 6859.746, 3515.827, 696.0732, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531) +(@OGUID+13, 193203, 571, 1, 64, 6717.095, 3499.194, 656.2964, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+14, 193203, 571, 1, 64, 6716.513, 3544.395, 670.4061, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+15, 193203, 571, 1, 64, 6671.143, 3539.871, 670.931, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+16, 193203, 571, 1, 64, 6656.081, 3455.363, 632.7549, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+17, 193203, 571, 1, 64, 6678.709, 3572.928, 671.7523, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+18, 193203, 571, 1, 64, 6665.039, 3553.045, 670.4769, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+19, 193203, 571, 1, 64, 6466.252, 3423.323, 598.091, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+20, 193203, 571, 1, 64, 6522.733, 3429.231, 599.0632, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+21, 193203, 571, 1, 64, 6516.931, 3478.982, 597.8824, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+22, 193203, 571, 1, 64, 6498.917, 3480.367, 596.7786, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+23, 193203, 571, 1, 64, 6544.474, 3464.513, 597.8202, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+24, 193203, 571, 1, 64, 6671.423, 3264.837, 669.0335, 5.724681, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+25, 193203, 571, 1, 64, 6669.524, 3338.208, 703.5842, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+26, 193204, 571, 1, 64, 6926.368, 3514.581, 713.6303, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531) +(@OGUID+27, 193203, 571, 1, 64, 6901.291, 3446.396, 704.4607, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+28, 193204, 571, 1, 64, 6885.061, 3495.637, 707.6733, 6.056293, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531) +(@OGUID+29, 193203, 571, 1, 64, 6907.985, 3453.707, 705.4143, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531) +(@OGUID+30, 193203, 571, 1, 64, 6680.36, 3371.357, 701.1601, 0.3141584, 0, 0, 0, 1, 120, 255, 1); -- 193203 (Area: 4531) + +DELETE FROM `creature_template_addon` WHERE `entry` IN(30703,30704,31432); +INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES +(31432, 0, 0x3000000, 0x1, ''), -- 31432 +(30703, 25280, 0x0, 0x1, ''), -- 30703 +(30704, 28919, 0x0, 0x1, ''); -- 30704 + +DELETE FROM `creature_addon` WHERE `guid` IN(@CGUID+41,@CGUID+42,@CGUID+43,@CGUID+47,@CGUID+48,@CGUID+49,@CGUID+50,@CGUID+51,@CGUID+52); +INSERT INTO `creature_addon` (`guid`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES +(@CGUID+41, 0, 0x0, 0x1, ''), +(@CGUID+42, 0, 0x0, 0x1, ''), +(@CGUID+43, 0, 0x0, 0x1, ''), +(@CGUID+47, 0, 0x0, 0x1, ''), +(@CGUID+48, 0, 0x0, 0x1, ''), +(@CGUID+49, 0, 0x0, 0x1, ''), +(@CGUID+50, 0, 0x0, 0x1, ''), +(@CGUID+51, 0, 0x0, 0x1, ''), +(@CGUID+52, 0, 0x0, 0x1, ''); + +UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry` IN(30703,30704,31015); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(30703,30704,31015) 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 +(30703,0,0,0,4,0,100,0,0,0,0,0,43,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ebon Blade Champion - On Agro - Dismount'), +(30703,0,1,0,0,0,100,0,0,5000,25000,35000,11,58130,2,0,0,0,0,1,0,0,0,0,0,0,0,'Ebon Blade Champion - IC - Cast Icebound Fortitude'), +(30703,0,2,0,9,0,100,0,0,5,20000,30000,11,50688,2,0,0,0,0,2,0,0,0,0,0,0,0,'Ebon Blade Champion - On Range - Cast Plague Strike'), +(30704,0,0,0,4,0,100,0,0,0,0,0,43,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Argent Paladin - On Agro - Dismount'), +(30704,0,1,0,9,0,100,0,0,5,12000,15000,11,58127,2,0,0,0,0,2,0,0,0,0,0,0,0,'Argent Paladin - On Range - Cast Divine Storm'), +(31015,0,0,0,9,0,100,0,0,5,15000,25000,11,60873,2,0,0,0,0,2,0,0,0,0,0,0,0,'Intrepid Ghoul - On Range - Cast Festering Bite'), +(31015,0,1,0,9,0,100,0,0,5,9000,16000,11,60872,2,0,0,0,0,2,0,0,0,0,0,0,0,'Intrepid Ghoul - On Range - Cast Festering Bite'), +(31015,0,2,0,2,0,100,1,0,10,0,0,11,58137,2,0,0,0,0,2,0,0,0,0,0,0,0,'Intrepid Ghoul - On Less than 10% hp - Cast Ghoulplosion'); diff --git a/sql/updates/world/2016_02_13_04_world.sql b/sql/updates/world/2016_02_13_04_world.sql new file mode 100644 index 00000000000..83d95745052 --- /dev/null +++ b/sql/updates/world/2016_02_13_04_world.sql @@ -0,0 +1,51 @@ +-- +-- Arred +UPDATE `creature` SET `spawndist` = 0, `MovementType` = 0 WHERE `guid` = 63008; +UPDATE `creature_template` SET `MovementType` = 0 WHERE `Entry` = 17512; +-- Arred SAI +SET @ENTRY := 17512; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,0,25,0,100,0,0,0,0,0,53,0,17512,1,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Reset - Start Waypoint"), +(@ENTRY,0,1,0,64,0,100,0,0,0,0,0,54,20000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Gossip Hello - Pause Waypoint"), +(@ENTRY,0,2,0,40,0,100,0,1,17512,0,0,54,90000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Waypoint 1 Reached - Pause Waypoint"), +(@ENTRY,0,3,0,40,0,100,0,3,17512,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Waypoint 3 Reached - Run Script"), +(@ENTRY,0,4,0,40,0,100,0,7,17512,0,0,80,@ENTRY*100+01,2,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Waypoint 7 Reached - Run Script"), +(@ENTRY,0,5,0,40,0,100,0,8,17512,0,0,80,@ENTRY*100+02,2,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Waypoint 8 Reached - Run Script"), +(@ENTRY,0,6,0,40,0,100,0,9,17512,0,0,54,210000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Waypoint 9 Reached - Pause Waypoint"); + +-- Actionlist SAI +SET @ENTRY := 1751200; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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,9,0,0,0,0,100,0,0,0,0,0,54,90000,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Pause Waypoint"), +(@ENTRY,9,1,0,0,0,100,0,88000,88000,0,0,5,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Play Emote 3"); + +-- Actionlist SAI +SET @ENTRY := 1751201; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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,9,0,0,0,0,100,0,0,0,0,0,54,120000,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Pause Waypoint"), +(@ENTRY,9,1,0,0,0,100,0,3000,3000,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Set Flag Standstate Kneel"), +(@ENTRY,9,2,0,0,0,100,0,115000,115000,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Remove Flag Standstate Kneel"); + +-- Actionlist SAI +SET @ENTRY := 1751202; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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,9,0,0,0,0,100,0,0,0,0,0,54,30000,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Pause Waypoint"), +(@ENTRY,9,1,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Play Emote 25"), +(@ENTRY,9,2,0,0,0,100,0,12000,12000,0,0,5,273,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Play Emote 273"); + +DELETE FROM `waypoints` WHERE `entry`=17512; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(17512,1,-3788.04,-11547.3,-134.842, 'Arred'), +(17512,2,-3789.79,-11543.9,-134.849, 'Arred'), +(17512,3,-3793.72,-11542.8,-134.892, 'Arred'), +(17512,4,-3789.94,-11543.8,-134.851, 'Arred'), +(17512,5,-3787.24,-11546.9,-134.831, 'Arred'), +(17512,6,-3786.81,-11549.6,-134.836, 'Arred'), +(17512,7,-3787.67,-11551.3,-134.853, 'Arred'), +(17512,8,-3784.96,-11550.9,-134.819, 'Arred'), +(17512,9,-3788.04,-11547.3,-134.842, 'Arred'); diff --git a/sql/updates/world/2016_02_14_00_world.sql b/sql/updates/world/2016_02_14_00_world.sql new file mode 100644 index 00000000000..961ecd74d4d --- /dev/null +++ b/sql/updates/world/2016_02_14_00_world.sql @@ -0,0 +1,3 @@ +-- Disallow flight form while affected by no-mount shapeshift +DELETE FROM `spell_script_names` WHERE `spell_id` IN (-33943, 33943, 40120); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (-33943, "spell_dru_flight_form"); diff --git a/sql/updates/world/2016_02_14_01_world.sql b/sql/updates/world/2016_02_14_01_world.sql new file mode 100644 index 00000000000..2ce06020621 --- /dev/null +++ b/sql/updates/world/2016_02_14_01_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature` SET `modelid`=0 WHERE `id`=27452; diff --git a/sql/updates/world/2016_02_14_02_world.sql b/sql/updates/world/2016_02_14_02_world.sql new file mode 100644 index 00000000000..1459b702cf0 --- /dev/null +++ b/sql/updates/world/2016_02_14_02_world.sql @@ -0,0 +1,16 @@ +-- Free at Last + +UPDATE `smart_scripts` SET `action_type`=45, `action_param1`=1, `action_param2`=1, `target_type`=1, `comment`='Runed Giant - On Script - Set Data Self' WHERE `entryorguid`=2641700 AND `source_type`=9 AND `id`=2 AND `link`=0; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=26417 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 +(26417, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 11, 47329, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - On Spellhit \'Gavrock\'s Runebreaker\' - Run Script (No Repeat)'), +(26417, 0, 1, 0, 38, 0, 100, 0, 1, 1, 0, 0, 33, 26783, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Runed Giant - On Script - Quest Credit \'Free at Last\''), +(26417, 0, 2, 3, 8, 0, 25, 0, 47604, 0, 10000, 10000, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - On Spell Hit - Store Target List'), +(26417, 0, 3, 0, 61, 0, 0, 0, 0, 0, 10000, 10000, 80, 2641700, 2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - On Spell Hit - Start Script for Free At Last'); + +-- Put on Your Best Face for Loken +UPDATE `creature_template` SET `unit_flags`=33555200 WHERE `entry`=27212; + +-- Send them Packing +UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=23977 AND `source_type`=0 AND `id`=0 AND `link`=0; diff --git a/sql/updates/world/2016_02_09_99_world.sql b/sql/updates/world/2016_02_14_03_world.sql index d9ad3ed1cc1..9a0237725c0 100644 --- a/sql/updates/world/2016_02_09_99_world.sql +++ b/sql/updates/world/2016_02_14_03_world.sql @@ -1,2 +1,3 @@ +-- DELETE FROM `linked_respawn` WHERE `guid`=150211 AND `linkedGuid`=150211; DELETE FROM `creature` WHERE `guid`=150212 AND `id`=38995; diff --git a/src/server/authserver/Server/AuthSession.cpp b/src/server/authserver/Server/AuthSession.cpp index 60e9b734b13..acab29a5b86 100644 --- a/src/server/authserver/Server/AuthSession.cpp +++ b/src/server/authserver/Server/AuthSession.cpp @@ -43,12 +43,6 @@ enum eAuthCmd XFER_CANCEL = 0x34 }; -enum eStatus -{ - STATUS_CONNECTED = 0, - STATUS_AUTHED -}; - #pragma pack(push, 1) typedef struct AUTH_LOGON_CHALLENGE_C @@ -115,11 +109,10 @@ enum class BufferSizes : uint32 SRP_6_S = 0x20, }; +#define MAX_ACCEPTED_CHALLENGE_SIZE (sizeof(AUTH_LOGON_CHALLENGE_C) + 16) + #define AUTH_LOGON_CHALLENGE_INITIAL_SIZE 4 #define REALM_LIST_PACKET_SIZE 5 -#define XFER_ACCEPT_SIZE 1 -#define XFER_RESUME_SIZE 9 -#define XFER_CANCEL_SIZE 1 std::unordered_map<uint8, AuthHandler> AuthSession::InitHandlers() { @@ -130,15 +123,102 @@ std::unordered_map<uint8, AuthHandler> AuthSession::InitHandlers() handlers[AUTH_RECONNECT_CHALLENGE] = { STATUS_CONNECTED, AUTH_LOGON_CHALLENGE_INITIAL_SIZE, &AuthSession::HandleReconnectChallenge }; handlers[AUTH_RECONNECT_PROOF] = { STATUS_CONNECTED, sizeof(AUTH_RECONNECT_PROOF_C), &AuthSession::HandleReconnectProof }; handlers[REALM_LIST] = { STATUS_AUTHED, REALM_LIST_PACKET_SIZE, &AuthSession::HandleRealmList }; - handlers[XFER_ACCEPT] = { STATUS_AUTHED, XFER_ACCEPT_SIZE, &AuthSession::HandleXferAccept }; - handlers[XFER_RESUME] = { STATUS_AUTHED, XFER_RESUME_SIZE, &AuthSession::HandleXferResume }; - handlers[XFER_CANCEL] = { STATUS_AUTHED, XFER_CANCEL_SIZE, &AuthSession::HandleXferCancel }; return handlers; } std::unordered_map<uint8, AuthHandler> const Handlers = AuthSession::InitHandlers(); +void AccountInfo::LoadResult(Field* fields) +{ + // 0 1 2 3 4 5 6 + //SELECT a.id, a.username, a.locked, a.lock_country, a.last_ip, a.failed_logins, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, + // 7 8 9 10 11 12 + // ab.unbandate = ab.bandate, aa.gmlevel, a.token_key, a.sha_pass_hash, a.v, a.s + //FROM account a LEFT JOIN account_access aa ON a.id = aa.id LEFT JOIN account_banned ab ON ab.id = a.id AND ab.active = 1 WHERE a.username = ? + + Id = fields[0].GetUInt32(); + Login = fields[1].GetString(); + IsLockedToIP = fields[2].GetBool(); + LockCountry = fields[3].GetString(); + LastIP = fields[4].GetString(); + FailedLogins = fields[5].GetUInt32(); + IsBanned = fields[6].GetUInt64() != 0; + IsPermanenetlyBanned = fields[7].GetUInt64() != 0; + SecurityLevel = AccountTypes(fields[8].GetUInt8()); +} + +AuthSession::AuthSession(tcp::socket&& socket) : Socket(std::move(socket)), +_sentChallenge(false), _sentProof(false), +_status(STATUS_CONNECTED), _build(0), _expversion(0) +{ + N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"); + g.SetDword(7); +} + +void AuthSession::Start() +{ + std::string ip_address = GetRemoteIpAddress().to_string(); + TC_LOG_TRACE("session", "Accepted connection from %s", ip_address.c_str()); + + // Remove expired ip ban if needed - login might fail for the first time + // but its better than allowing ourselves to be flooded by connections triggering blocking queries + LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS)); + + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_INFO); + stmt->setString(0, ip_address); + stmt->setUInt32(1, inet_addr(ip_address.c_str())); + + _queryCallback = std::bind(&AuthSession::CheckIpCallback, this, std::placeholders::_1); + _queryFuture = LoginDatabase.AsyncQuery(stmt); +} + +bool AuthSession::Update() +{ + if (!AuthSocket::Update()) + return false; + + if (_queryFuture.valid() && _queryFuture.wait_for(std::chrono::seconds(0)) == std::future_status::ready) + { + auto callback = _queryCallback; + _queryCallback = nullptr; + callback(_queryFuture.get()); + } + + return true; +} + +void AuthSession::CheckIpCallback(PreparedQueryResult result) +{ + if (result) + { + bool banned = false; + do + { + Field* fields = result->Fetch(); + if (fields[0].GetUInt64() != 0) + banned = true; + + if (!fields[1].GetString().empty()) + _ipCountry = fields[1].GetString(); + + } while (result->NextRow()); + + if (banned) + { + ByteBuffer pkt; + pkt << uint8(AUTH_LOGON_CHALLENGE); + pkt << uint8(0x00); + pkt << uint8(WOW_FAIL_BANNED); + SendPacket(pkt); + TC_LOG_DEBUG("session", "[AuthSession::CheckIpCallback] Banned ip '%s:%d' tries to login!", GetRemoteIpAddress().to_string().c_str(), GetRemotePort()); + return; + } + } + + AsyncRead(); +} + void AuthSession::ReadHandler() { MessageBuffer& packet = GetReadBuffer(); @@ -153,6 +233,12 @@ void AuthSession::ReadHandler() break; } + if (_status != itr->second.status) + { + CloseSocket(); + return; + } + uint16 size = uint16(itr->second.packetSize); if (packet.GetActiveSize() < size) break; @@ -161,12 +247,17 @@ void AuthSession::ReadHandler() { sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(packet.GetReadPointer()); size += challenge->size; + if (size > MAX_ACCEPTED_CHALLENGE_SIZE) + { + CloseSocket(); + return; + } } if (packet.GetActiveSize() < size) break; - if (!(*this.*Handlers.at(cmd).handler)()) + if (!(*this.*itr->second.handler)()) { CloseSocket(); return; @@ -196,224 +287,206 @@ void AuthSession::SendPacket(ByteBuffer& packet) bool AuthSession::HandleLogonChallenge() { + if (_sentChallenge) + return false; + + _sentChallenge = true; + sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(GetReadBuffer().GetReadPointer()); + if (challenge->size - (sizeof(sAuthLogonChallenge_C) - AUTH_LOGON_CHALLENGE_INITIAL_SIZE - 1) != challenge->I_len) + return false; - //TC_LOG_DEBUG("server.authserver", "[AuthChallenge] got full packet, %#04x bytes", challenge->size); - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] name(%d): '%s'", challenge->I_len, challenge->I); + std::string login((const char*)challenge->I, challenge->I_len); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] '%s'", login.c_str()); - ByteBuffer pkt; + if (_queryCallback) + { + ByteBuffer pkt; + pkt << uint8(AUTH_LOGON_CHALLENGE); + pkt << uint8(0x00); + pkt << uint8(WOW_FAIL_DB_BUSY); + SendPacket(pkt); + + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] %s attempted to log too quick after previous attempt!", login.c_str()); + return true; + } - _login.assign((const char*)challenge->I, challenge->I_len); _build = challenge->build; _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG)); - _os = (const char*)challenge->os; - - if (_os.size() > 4) - return false; + std::array<char, 5> os; + os.fill('\0'); + memcpy(os.data(), challenge->os, sizeof(challenge->os)); + _os = os.data(); // Restore string order as its byte order is reversed std::reverse(_os.begin(), _os.end()); + _localizationName.resize(4); + for (int i = 0; i < 4; ++i) + _localizationName[i] = challenge->country[4 - i - 1]; + + // Get the account details from the account table + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGONCHALLENGE); + stmt->setString(0, login); + + _queryCallback = std::bind(&AuthSession::LogonChallengeCallback, this, std::placeholders::_1); + _queryFuture = LoginDatabase.AsyncQuery(stmt); + return true; +} + +void AuthSession::LogonChallengeCallback(PreparedQueryResult result) +{ + ByteBuffer pkt; pkt << uint8(AUTH_LOGON_CHALLENGE); pkt << uint8(0x00); - // Verify that this IP is not in the ip_banned table - LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS)); + if (!result) + { + pkt << uint8(WOW_FAIL_UNKNOWN_ACCOUNT); + SendPacket(pkt); + return; + } + + Field* fields = result->Fetch(); + + _accountInfo.LoadResult(fields); std::string ipAddress = GetRemoteIpAddress().to_string(); uint16 port = GetRemotePort(); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED); - stmt->setString(0, ipAddress); - PreparedQueryResult result = LoginDatabase.Query(stmt); - if (result) + // If the IP is 'locked', check that the player comes indeed from the correct IP address + if (_accountInfo.IsLockedToIP) { - pkt << uint8(WOW_FAIL_BANNED); - TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Banned ip tries to login!", ipAddress.c_str(), port); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to IP - '%s' is logging in from '%s'", _accountInfo.Login.c_str(), _accountInfo.LastIP.c_str(), ipAddress.c_str()); + if (_accountInfo.LastIP != ipAddress) + { + pkt << uint8(WOW_FAIL_LOCKED_ENFORCED); + SendPacket(pkt); + return; + } } else { - // Get the account details from the account table - // No SQL injection (prepared statement) - stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGONCHALLENGE); - stmt->setString(0, _login); - - PreparedQueryResult res2 = LoginDatabase.Query(stmt); - if (res2) + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to ip", _accountInfo.Login.c_str()); + if (_accountInfo.LockCountry.empty() || _accountInfo.LockCountry == "00") + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to country", _accountInfo.Login.c_str()); + else if (!_accountInfo.LockCountry.empty() && !_ipCountry.empty()) { - Field* fields = res2->Fetch(); - - // If the IP is 'locked', check that the player comes indeed from the correct IP address - bool locked = false; - if (fields[2].GetUInt8() == 1) // if ip is locked - { - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[4].GetCString()); - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Player address is '%s'", ipAddress.c_str()); - - if (strcmp(fields[4].GetCString(), ipAddress.c_str()) != 0) - { - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account IP differs"); - pkt << uint8(WOW_FAIL_LOCKED_ENFORCED); - locked = true; - } - else - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account IP matches"); - } - else + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to country: '%s' Player country is '%s'", _accountInfo.Login.c_str(), _accountInfo.LockCountry.c_str(), _ipCountry.c_str()); + if (_ipCountry != _accountInfo.LockCountry) { - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to ip", _login.c_str()); - std::string accountCountry = fields[3].GetString(); - if (accountCountry.empty() || accountCountry == "00") - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to country", _login.c_str()); - else if (!accountCountry.empty()) - { - uint32 ip = inet_addr(ipAddress.c_str()); - EndianConvertReverse(ip); - - stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGON_COUNTRY); - stmt->setUInt32(0, ip); - if (PreparedQueryResult sessionCountryQuery = LoginDatabase.Query(stmt)) - { - std::string loginCountry = (*sessionCountryQuery)[0].GetString(); - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to country: '%s' Player country is '%s'", _login.c_str(), - accountCountry.c_str(), loginCountry.c_str()); - - if (loginCountry != accountCountry) - { - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account country differs."); - pkt << uint8(WOW_FAIL_UNLOCKABLE_LOCK); - locked = true; - } - else - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account country matches"); - } - else - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] IP2NATION Table empty"); - } + pkt << uint8(WOW_FAIL_UNLOCKABLE_LOCK); + SendPacket(pkt); + return; } + } + } - if (!locked) - { - //set expired bans to inactive - LoginDatabase.DirectExecute(LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS)); - - // If the account is banned, reject the logon attempt - stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED); - stmt->setUInt32(0, fields[1].GetUInt32()); - PreparedQueryResult banresult = LoginDatabase.Query(stmt); - if (banresult) - { - if ((*banresult)[0].GetUInt32() == (*banresult)[1].GetUInt32()) - { - pkt << uint8(WOW_FAIL_BANNED); - TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Banned account %s tried to login!", ipAddress.c_str(), - port, _login.c_str()); - } - else - { - pkt << uint8(WOW_FAIL_SUSPENDED); - TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", - ipAddress.c_str(), port, _login.c_str()); - } - } - else - { - // Get the password from the account table, upper it, and make the SRP6 calculation - std::string rI = fields[0].GetString(); - - // Don't calculate (v, s) if there are already some in the database - std::string databaseV = fields[6].GetString(); - std::string databaseS = fields[7].GetString(); - - TC_LOG_DEBUG("network", "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); - - // multiply with 2 since bytes are stored as hexstring - if (databaseV.size() != size_t(BufferSizes::SRP_6_V) * 2 || databaseS.size() != size_t(BufferSizes::SRP_6_S) * 2) - SetVSFields(rI); - else - { - s.SetHexStr(databaseS.c_str()); - v.SetHexStr(databaseV.c_str()); - } - - b.SetRand(19 * 8); - BigNumber gmod = g.ModExp(b, N); - B = ((v * 3) + gmod) % N; - - ASSERT(gmod.GetNumBytes() <= 32); - - BigNumber unk3; - unk3.SetRand(16 * 8); - - // Fill the response packet with the result - if (AuthHelper::IsAcceptedClientBuild(_build)) - pkt << uint8(WOW_SUCCESS); - else - pkt << uint8(WOW_FAIL_VERSION_INVALID); - - // B may be calculated < 32B so we force minimal length to 32B - pkt.append(B.AsByteArray(32).get(), 32); // 32 bytes - pkt << uint8(1); - pkt.append(g.AsByteArray(1).get(), 1); - pkt << uint8(32); - pkt.append(N.AsByteArray(32).get(), 32); - pkt.append(s.AsByteArray(int32(BufferSizes::SRP_6_S)).get(), size_t(BufferSizes::SRP_6_S)); // 32 bytes - pkt.append(unk3.AsByteArray(16).get(), 16); - uint8 securityFlags = 0; - - // Check if token is used - _tokenKey = fields[8].GetString(); - if (!_tokenKey.empty()) - securityFlags = 4; - - pkt << uint8(securityFlags); // security flags (0x0...0x04) - - if (securityFlags & 0x01) // PIN input - { - pkt << uint32(0); - pkt << uint64(0) << uint64(0); // 16 bytes hash? - } - - if (securityFlags & 0x02) // Matrix input - { - pkt << uint8(0); - pkt << uint8(0); - pkt << uint8(0); - pkt << uint8(0); - pkt << uint64(0); - } - - if (securityFlags & 0x04) // Security token input - pkt << uint8(1); - - uint8 secLevel = fields[5].GetUInt8(); - _accountSecurityLevel = secLevel <= SEC_ADMINISTRATOR ? AccountTypes(secLevel) : SEC_ADMINISTRATOR; - - _localizationName.resize(4); - for (int i = 0; i < 4; ++i) - _localizationName[i] = challenge->country[4 - i - 1]; - - TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", - ipAddress.c_str(), port, _login.c_str(), - challenge->country[3], challenge->country[2], challenge->country[1], challenge->country[0], - GetLocaleByName(_localizationName) - ); - } - } + //set expired bans to inactive + LoginDatabase.DirectExecute(LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS)); + + // If the account is banned, reject the logon attempt + if (_accountInfo.IsBanned) + { + if (_accountInfo.IsPermanenetlyBanned) + { + pkt << uint8(WOW_FAIL_BANNED); + SendPacket(pkt); + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Banned account %s tried to login!", ipAddress.c_str(), port, _accountInfo.Login.c_str()); + return; + } + else + { + pkt << uint8(WOW_FAIL_SUSPENDED); + SendPacket(pkt); + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", ipAddress.c_str(), port, _accountInfo.Login.c_str()); + return; } - else //no account - pkt << uint8(WOW_FAIL_UNKNOWN_ACCOUNT); } + // Get the password from the account table, upper it, and make the SRP6 calculation + std::string rI = fields[10].GetString(); + + // Don't calculate (v, s) if there are already some in the database + std::string databaseV = fields[11].GetString(); + std::string databaseS = fields[12].GetString(); + + TC_LOG_DEBUG("network", "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); + + // multiply with 2 since bytes are stored as hexstring + if (databaseV.size() != size_t(BufferSizes::SRP_6_V) * 2 || databaseS.size() != size_t(BufferSizes::SRP_6_S) * 2) + SetVSFields(rI); + else + { + s.SetHexStr(databaseS.c_str()); + v.SetHexStr(databaseV.c_str()); + } + + b.SetRand(19 * 8); + BigNumber gmod = g.ModExp(b, N); + B = ((v * 3) + gmod) % N; + + ASSERT(gmod.GetNumBytes() <= 32); + + BigNumber unk3; + unk3.SetRand(16 * 8); + + // Fill the response packet with the result + if (AuthHelper::IsAcceptedClientBuild(_build)) + pkt << uint8(WOW_SUCCESS); + else + pkt << uint8(WOW_FAIL_VERSION_INVALID); + + // B may be calculated < 32B so we force minimal length to 32B + pkt.append(B.AsByteArray(32).get(), 32); // 32 bytes + pkt << uint8(1); + pkt.append(g.AsByteArray(1).get(), 1); + pkt << uint8(32); + pkt.append(N.AsByteArray(32).get(), 32); + pkt.append(s.AsByteArray(int32(BufferSizes::SRP_6_S)).get(), size_t(BufferSizes::SRP_6_S)); // 32 bytes + pkt.append(unk3.AsByteArray(16).get(), 16); + uint8 securityFlags = 0; + + // Check if token is used + _tokenKey = fields[9].GetString(); + if (!_tokenKey.empty()) + securityFlags = 4; + + pkt << uint8(securityFlags); // security flags (0x0...0x04) + + if (securityFlags & 0x01) // PIN input + { + pkt << uint32(0); + pkt << uint64(0) << uint64(0); // 16 bytes hash? + } + + if (securityFlags & 0x02) // Matrix input + { + pkt << uint8(0); + pkt << uint8(0); + pkt << uint8(0); + pkt << uint8(0); + pkt << uint64(0); + } + + if (securityFlags & 0x04) // Security token input + pkt << uint8(1); + + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s is using '%s' locale (%u)", + ipAddress.c_str(), port, _accountInfo.Login.c_str(), _localizationName.c_str(), GetLocaleByName(_localizationName)); + SendPacket(pkt); - return true; } // Logon Proof command handler bool AuthSession::HandleLogonProof() { - TC_LOG_DEBUG("server.authserver", "Entering _HandleLogonProof"); + if (_sentProof) + return false; + + _sentProof = true; + // Read the packet sAuthLogonProof_C *logonProof = reinterpret_cast<sAuthLogonProof_C*>(GetReadBuffer().GetReadPointer()); @@ -487,7 +560,7 @@ bool AuthSession::HandleLogonProof() t3.SetBinary(hash, 20); sha.Initialize(); - sha.UpdateData(_login); + sha.UpdateData(_accountInfo.Login); sha.Finalize(); uint8 t4[SHA_DIGEST_LENGTH]; memcpy(t4, sha.GetDigest(), SHA_DIGEST_LENGTH); @@ -503,7 +576,7 @@ bool AuthSession::HandleLogonProof() // Check if SRP6 results match (password is correct), else send an error if (!memcmp(M.AsByteArray(sha.GetLength()).get(), logonProof->M1, 20)) { - TC_LOG_DEBUG("server.authserver", "'%s:%d' User '%s' successfully authenticated", GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str()); + TC_LOG_DEBUG("server.authserver", "'%s:%d' User '%s' successfully authenticated", GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str()); // Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account // No SQL injection (escaped user name) and IP address as received by socket @@ -514,7 +587,7 @@ bool AuthSession::HandleLogonProof() stmt->setString(1, GetRemoteIpAddress().to_string().c_str()); stmt->setUInt32(2, GetLocaleByName(_localizationName)); stmt->setString(3, _os); - stmt->setString(4, _login); + stmt->setString(4, _accountInfo.Login); LoginDatabase.DirectExecute(stmt); OPENSSL_free((void*)K_hex); @@ -531,6 +604,7 @@ bool AuthSession::HandleLogonProof() std::string token(reinterpret_cast<char*>(GetReadBuffer().GetReadPointer() + sizeof(sAuthLogonProof_C) + sizeof(size)), size); GetReadBuffer().ReadCompleted(sizeof(size) + size); uint32 validToken = TOTP::GenerateToken(_tokenKey.c_str()); + _tokenKey.clear(); uint32 incomingToken = atoi(token.c_str()); if (validToken != incomingToken) { @@ -571,7 +645,7 @@ bool AuthSession::HandleLogonProof() } SendPacket(packet); - _isAuthenticated = true; + _status = STATUS_AUTHED; } else { @@ -583,7 +657,7 @@ bool AuthSession::HandleLogonProof() SendPacket(packet); TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", - GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str()); + GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str()); uint32 MaxWrongPassCount = sConfigMgr->GetIntDefault("WrongPass.MaxCount", 0); @@ -591,7 +665,7 @@ bool AuthSession::HandleLogonProof() if (sConfigMgr->GetBoolDefault("WrongPass.Logging", false)) { PreparedStatement* logstmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_FALP_IP_LOGGING); - logstmt->setString(0, _login); + logstmt->setString(0, _accountInfo.Login); logstmt->setString(1, GetRemoteIpAddress().to_string()); logstmt->setString(2, "Logged on failed AccountLogin due wrong password"); @@ -602,42 +676,33 @@ bool AuthSession::HandleLogonProof() { //Increment number of failed logins by one and if it reaches the limit temporarily ban that account or IP PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_FAILEDLOGINS); - stmt->setString(0, _login); + stmt->setString(0, _accountInfo.Login); LoginDatabase.Execute(stmt); - stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_FAILEDLOGINS); - stmt->setString(0, _login); - - if (PreparedQueryResult loginfail = LoginDatabase.Query(stmt)) + if (_accountInfo.FailedLogins >= MaxWrongPassCount) { - uint32 failed_logins = (*loginfail)[1].GetUInt32(); + uint32 WrongPassBanTime = sConfigMgr->GetIntDefault("WrongPass.BanTime", 600); + bool WrongPassBanType = sConfigMgr->GetBoolDefault("WrongPass.BanType", false); + + if (WrongPassBanType) + { + stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED); + stmt->setUInt32(0, _accountInfo.Id); + stmt->setUInt32(1, WrongPassBanTime); + LoginDatabase.Execute(stmt); - if (failed_logins >= MaxWrongPassCount) + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", + GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str(), WrongPassBanTime, _accountInfo.FailedLogins); + } + else { - uint32 WrongPassBanTime = sConfigMgr->GetIntDefault("WrongPass.BanTime", 600); - bool WrongPassBanType = sConfigMgr->GetBoolDefault("WrongPass.BanType", false); - - if (WrongPassBanType) - { - uint32 acc_id = (*loginfail)[0].GetUInt32(); - stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED); - stmt->setUInt32(0, acc_id); - stmt->setUInt32(1, WrongPassBanTime); - LoginDatabase.Execute(stmt); - - TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", - GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins); - } - else - { - stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_AUTO_BANNED); - stmt->setString(0, GetRemoteIpAddress().to_string()); - stmt->setUInt32(1, WrongPassBanTime); - LoginDatabase.Execute(stmt); - - TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] IP got banned for '%u' seconds because account %s failed to authenticate '%u' times", - GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), WrongPassBanTime, _login.c_str(), failed_logins); - } + stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_AUTO_BANNED); + stmt->setString(0, GetRemoteIpAddress().to_string()); + stmt->setUInt32(1, WrongPassBanTime); + LoginDatabase.Execute(stmt); + + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] IP got banned for '%u' seconds because account %s failed to authenticate '%u' times", + GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), WrongPassBanTime, _accountInfo.Login.c_str(), _accountInfo.FailedLogins); } } } @@ -648,61 +713,88 @@ bool AuthSession::HandleLogonProof() bool AuthSession::HandleReconnectChallenge() { - TC_LOG_DEBUG("server.authserver", "Entering _HandleReconnectChallenge"); - sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(GetReadBuffer().GetReadPointer()); + if (_sentChallenge) + return false; - //TC_LOG_DEBUG("server.authserver", "[AuthChallenge] got full packet, %#04x bytes", challenge->size); - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] name(%d): '%s'", challenge->I_len, challenge->I); + _sentChallenge = true; - _login.assign((const char*)challenge->I, challenge->I_len); + sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(GetReadBuffer().GetReadPointer()); + if (challenge->size - (sizeof(sAuthLogonChallenge_C) - AUTH_LOGON_CHALLENGE_INITIAL_SIZE - 1) != challenge->I_len) + return false; - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_SESSIONKEY); - stmt->setString(0, _login); - PreparedQueryResult result = LoginDatabase.Query(stmt); + std::string login((const char*)challenge->I, challenge->I_len); + TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] '%s'", login.c_str()); - // Stop if the account is not found - if (!result) + if (_queryCallback) { - TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login and we cannot find his session key in the database.", - GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str()); - return false; + ByteBuffer pkt; + pkt << uint8(AUTH_RECONNECT_CHALLENGE); + pkt << uint8(WOW_FAIL_DB_BUSY); + SendPacket(pkt); + + TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] %s attempted to log too quick after previous attempt!", login.c_str()); + return true; } - // Reinitialize build, expansion and the account securitylevel _build = challenge->build; _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG)); - _os = (const char*)challenge->os; - - if (_os.size() > 4) - return false; + std::array<char, 5> os; + os.fill('\0'); + memcpy(os.data(), challenge->os, sizeof(challenge->os)); + _os = os.data(); // Restore string order as its byte order is reversed std::reverse(_os.begin(), _os.end()); - Field* fields = result->Fetch(); - uint8 secLevel = fields[2].GetUInt8(); - _accountSecurityLevel = secLevel <= SEC_ADMINISTRATOR ? AccountTypes(secLevel) : SEC_ADMINISTRATOR; + _localizationName.resize(4); + for (int i = 0; i < 4; ++i) + _localizationName[i] = challenge->country[4 - i - 1]; - K.SetHexStr((*result)[0].GetCString()); + // Get the account details from the account table + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_RECONNECTCHALLENGE); + stmt->setString(0, login); + + _queryCallback = std::bind(&AuthSession::ReconnectChallengeCallback, this, std::placeholders::_1); + _queryFuture = LoginDatabase.AsyncQuery(stmt); + return true; +} - // Sending response +void AuthSession::ReconnectChallengeCallback(PreparedQueryResult result) +{ ByteBuffer pkt; pkt << uint8(AUTH_RECONNECT_CHALLENGE); - pkt << uint8(0x00); + + if (!result) + { + pkt << uint8(WOW_FAIL_UNKNOWN_ACCOUNT); + SendPacket(pkt); + return; + } + + Field* fields = result->Fetch(); + + _accountInfo.LoadResult(fields); + K.SetHexStr(fields[9].GetCString()); _reconnectProof.SetRand(16 * 8); - pkt.append(_reconnectProof.AsByteArray(16).get(), 16); // 16 bytes random + + pkt << uint8(WOW_SUCCESS); + pkt.append(_reconnectProof.AsByteArray(16).get(), 16); // 16 bytes random pkt << uint64(0x00) << uint64(0x00); // 16 bytes zeros SendPacket(pkt); - - return true; } + bool AuthSession::HandleReconnectProof() { TC_LOG_DEBUG("server.authserver", "Entering _HandleReconnectProof"); + if (_sentProof) + return false; + + _sentProof = true; + sAuthReconnectProof_C *reconnectProof = reinterpret_cast<sAuthReconnectProof_C*>(GetReadBuffer().GetReadPointer()); - if (_login.empty() || !_reconnectProof.GetNumBytes() || !K.GetNumBytes()) + if (_accountInfo.Login.empty() || !_reconnectProof.GetNumBytes() || !K.GetNumBytes()) return false; BigNumber t1; @@ -710,7 +802,7 @@ bool AuthSession::HandleReconnectProof() SHA1Hash sha; sha.Initialize(); - sha.UpdateData(_login); + sha.UpdateData(_accountInfo.Login); sha.UpdateBigNumbers(&t1, &_reconnectProof, &K, NULL); sha.Finalize(); @@ -722,13 +814,13 @@ bool AuthSession::HandleReconnectProof() pkt << uint8(0x00); pkt << uint16(0x00); // 2 bytes zeros SendPacket(pkt); - _isAuthenticated = true; + _status = STATUS_AUTHED; return true; } else { TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login, but session is invalid.", GetRemoteIpAddress().to_string().c_str(), - GetRemotePort(), _login.c_str()); + GetRemotePort(), _accountInfo.Login.c_str()); return false; } } @@ -772,20 +864,31 @@ bool AuthSession::HandleRealmList() { TC_LOG_DEBUG("server.authserver", "Entering _HandleRealmList"); - // Get the user id (else close the connection) - // No SQL injection (prepared statement) - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME); - stmt->setString(0, _login); - PreparedQueryResult result = LoginDatabase.Query(stmt); - if (!result) + if (_queryCallback) { - TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login but we cannot find him in the database.", GetRemoteIpAddress().to_string().c_str(), - GetRemotePort(), _login.c_str()); + TC_LOG_DEBUG("server.authserver", "[RealmList] %s attempted to get realmlist too quick after previous attempt!", _accountInfo.Login.c_str()); return false; } - Field* fields = result->Fetch(); - uint32 id = fields[0].GetUInt32(); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALM_CHARACTER_COUNTS); + stmt->setUInt32(0, _accountInfo.Id); + + _queryCallback = std::bind(&AuthSession::RealmListCallback, this, std::placeholders::_1); + _queryFuture = LoginDatabase.AsyncQuery(stmt); + return true; +} + +void AuthSession::RealmListCallback(PreparedQueryResult result) +{ + std::map<uint32, uint8> characterCounts; + if (result) + { + do + { + Field* fields = result->Fetch(); + characterCounts[fields[0].GetUInt32()] = fields[1].GetUInt8(); + } while (result->NextRow()); + } // Update realm list if need sRealmList->UpdateIfNeed(); @@ -822,25 +925,17 @@ bool AuthSession::HandleRealmList() name = ss.str(); } - uint8 lock = (realm.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0; - - uint8 AmountOfCharacters = 0; - stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_NUM_CHARS_ON_REALM); - stmt->setUInt32(0, realm.m_ID); - stmt->setUInt32(1, id); - result = LoginDatabase.Query(stmt); - if (result) - AmountOfCharacters = (*result)[0].GetUInt8(); + uint8 lock = (realm.allowedSecurityLevel > _accountInfo.SecurityLevel) ? 1 : 0; - pkt << realm.icon; // realm type + pkt << uint8(realm.icon); // realm type if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients - pkt << lock; // if 1, then realm locked + pkt << uint8(lock); // if 1, then realm locked pkt << uint8(flag); // RealmFlags pkt << name; pkt << boost::lexical_cast<std::string>(GetAddressForClient(realm, GetRemoteIpAddress())); - pkt << realm.populationLevel; - pkt << AmountOfCharacters; - pkt << realm.timezone; // realm category + pkt << float(realm.populationLevel); + pkt << uint8(characterCounts[realm.m_ID]); + pkt << uint8(realm.timezone); // realm category if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients pkt << uint8(realm.m_ID); else @@ -882,32 +977,6 @@ bool AuthSession::HandleRealmList() hdr.append(RealmListSizeBuffer); // append RealmList's size buffer hdr.append(pkt); // append realms in the realmlist SendPacket(hdr); - return true; -} - -// Resume patch transfer -bool AuthSession::HandleXferResume() -{ - TC_LOG_DEBUG("server.authserver", "Entering _HandleXferResume"); - //uint8 - //uint64 - return true; -} - -// Cancel patch transfer -bool AuthSession::HandleXferCancel() -{ - TC_LOG_DEBUG("server.authserver", "Entering _HandleXferCancel"); - //uint8 - return false; -} - -// Accept patch transfer -bool AuthSession::HandleXferAccept() -{ - TC_LOG_DEBUG("server.authserver", "Entering _HandleXferAccept"); - //uint8 - return true; } // Make the SRP6 calculation from hash in dB @@ -940,7 +1009,7 @@ void AuthSession::SetVSFields(const std::string& rI) PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_VS); stmt->setString(0, v_hex); stmt->setString(1, s_hex); - stmt->setString(2, _login); + stmt->setString(2, _accountInfo.Login); LoginDatabase.Execute(stmt); OPENSSL_free(v_hex); diff --git a/src/server/authserver/Server/AuthSession.h b/src/server/authserver/Server/AuthSession.h index d40e0852b57..1babb7407a9 100644 --- a/src/server/authserver/Server/AuthSession.h +++ b/src/server/authserver/Server/AuthSession.h @@ -23,29 +23,48 @@ #include "ByteBuffer.h" #include "Socket.h" #include "BigNumber.h" +#include "Callback.h" #include <memory> #include <boost/asio/ip/tcp.hpp> using boost::asio::ip::tcp; +class Field; struct AuthHandler; +enum AuthStatus +{ + STATUS_CONNECTED = 0, + STATUS_AUTHED +}; + +struct AccountInfo +{ + void LoadResult(Field* fields); + + uint32 Id = 0; + std::string Login; + bool IsLockedToIP = false; + std::string LockCountry; + std::string LastIP; + uint32 FailedLogins = 0; + bool IsBanned = false; + bool IsPermanenetlyBanned = false; + AccountTypes SecurityLevel = SEC_PLAYER; + std::string TokenKey; +}; + class AuthSession : public Socket<AuthSession> { + typedef Socket<AuthSession> AuthSocket; + public: static std::unordered_map<uint8, AuthHandler> InitHandlers(); - AuthSession(tcp::socket&& socket) : Socket(std::move(socket)), - _isAuthenticated(false), _build(0), _expversion(0), _accountSecurityLevel(SEC_PLAYER) - { - N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"); - g.SetDword(7); - } + AuthSession(tcp::socket&& socket); - void Start() override - { - AsyncRead(); - } + void Start() override; + bool Update() override; void SendPacket(ByteBuffer& packet); @@ -59,10 +78,10 @@ private: bool HandleReconnectProof(); bool HandleRealmList(); - //data transfer handle for patch - bool HandleXferResume(); - bool HandleXferCancel(); - bool HandleXferAccept(); + void CheckIpCallback(PreparedQueryResult result); + void LogonChallengeCallback(PreparedQueryResult result); + void ReconnectChallengeCallback(PreparedQueryResult result); + void RealmListCallback(PreparedQueryResult result); void SetVSFields(const std::string& rI); @@ -71,22 +90,27 @@ private: BigNumber K; BigNumber _reconnectProof; - bool _isAuthenticated; + bool _sentChallenge; + bool _sentProof; + + AuthStatus _status; + AccountInfo _accountInfo; std::string _tokenKey; - std::string _login; std::string _localizationName; std::string _os; + std::string _ipCountry; uint16 _build; uint8 _expversion; - AccountTypes _accountSecurityLevel; + PreparedQueryResultFuture _queryFuture; + std::function<void(PreparedQueryResult)> _queryCallback; }; #pragma pack(push, 1) struct AuthHandler { - uint32 status; + AuthStatus status; size_t packetSize; bool (AuthSession::*handler)(); }; diff --git a/src/server/database/Database/Implementation/CharacterDatabase.cpp b/src/server/database/Database/Implementation/CharacterDatabase.cpp index 140f3bf31c9..ab68aca2a8c 100644 --- a/src/server/database/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/database/Database/Implementation/CharacterDatabase.cpp @@ -72,7 +72,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() "FROM characters WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_BOTH); - PrepareStatement(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, extendState, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_AURAS, "SELECT casterGuid, spell, effectMask, recalculateMask, stackCount, amount0, amount1, amount2, " "base_amount0, base_amount1, base_amount2, maxDuration, remainTime, remainCharges FROM character_aura WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_SPELL, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?", CONNECTION_ASYNC); @@ -405,8 +405,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_UPD_WORLDSTATE, "UPDATE worldstates SET value = ? WHERE entry = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_INS_WORLDSTATE, "INSERT INTO worldstates (entry, value) VALUES (?, ?)", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID, "DELETE FROM character_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); - PrepareStatement(CHAR_UPD_CHAR_INSTANCE, "UPDATE character_instance SET instance = ?, permanent = ? WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); - PrepareStatement(CHAR_INS_CHAR_INSTANCE, "INSERT INTO character_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_INSTANCE, "UPDATE character_instance SET instance = ?, permanent = ?, extendState = ? WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_INSTANCE, "INSERT INTO character_instance (guid, instance, permanent, extendState) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(CHAR_UPD_GENDER_PLAYERBYTES, "UPDATE characters SET gender = ?, playerBytes = ?, playerBytes2 = ? WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_CHARACTER_SKILL, "DELETE FROM character_skills WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS, "UPDATE character_social SET flags = flags | ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); @@ -434,6 +434,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, "SELECT class, level, at_login, knownTitles FROM characters WHERE guid = ?", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_CHAR_AT_LOGIN_TITLES, "SELECT at_login, knownTitles FROM characters WHERE guid = ?", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_INSTANCE, "SELECT data, completedEncounters FROM instance WHERE map = ? AND id = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_PERM_BIND_BY_INSTANCE, "SELECT guid FROM character_instance WHERE instance = ? and permanent = 1", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_CHAR_COD_ITEM_MAIL, "SELECT id, messageType, mailTemplateId, sender, subject, body, money, has_items FROM mail WHERE receiver = ? AND has_items <> 0 AND cod <> 0", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_CHAR_SOCIAL, "SELECT DISTINCT guid FROM character_social WHERE friend = ?", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_CHAR_OLD_CHARS, "SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < ?", CONNECTION_SYNCH); @@ -470,9 +471,10 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_INS_CHAR_GIFT, "INSERT INTO character_gifts (guid, item_guid, entry, flags) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_INSTANCE_BY_INSTANCE, "DELETE FROM instance WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE, "DELETE FROM character_instance WHERE instance = ?", CONNECTION_ASYNC); - PrepareStatement(CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF, "DELETE FROM character_instance USING character_instance LEFT JOIN instance ON character_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_EXPIRED_CHAR_INSTANCE_BY_MAP_DIFF, "DELETE FROM character_instance USING character_instance LEFT JOIN instance ON character_instance.instance = id WHERE (extendState = 0 or permanent = 0) and map = ? and difficulty = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, "DELETE FROM group_instance USING group_instance LEFT JOIN instance ON group_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); - PrepareStatement(CHAR_DEL_INSTANCE_BY_MAP_DIFF, "DELETE FROM instance WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_EXPIRED_INSTANCE_BY_MAP_DIFF, "DELETE FROM instance WHERE map = ? and difficulty = ? and (SELECT guid FROM character_instance WHERE extendState != 0 AND instance = id LIMIT 1) IS NULL", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_EXPIRE_CHAR_INSTANCE_BY_MAP_DIFF, "UPDATE character_instance LEFT JOIN instance ON character_instance.instance = id SET extendState = extendState-1 WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_MAIL_ITEM_BY_ID, "DELETE FROM mail_items WHERE mail_id = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_INS_PETITION, "INSERT INTO petition (ownerguid, petitionguid, name, type) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_PETITION_BY_GUID, "DELETE FROM petition WHERE petitionguid = ?", CONNECTION_ASYNC); diff --git a/src/server/database/Database/Implementation/CharacterDatabase.h b/src/server/database/Database/Implementation/CharacterDatabase.h index c0ff9cbbfbe..19d4a609e77 100644 --- a/src/server/database/Database/Implementation/CharacterDatabase.h +++ b/src/server/database/Database/Implementation/CharacterDatabase.h @@ -365,6 +365,7 @@ enum CharacterDatabaseStatements CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, CHAR_SEL_CHAR_AT_LOGIN_TITLES, CHAR_SEL_INSTANCE, + CHAR_SEL_PERM_BIND_BY_INSTANCE, CHAR_SEL_CHAR_COD_ITEM_MAIL, CHAR_SEL_CHAR_SOCIAL, CHAR_SEL_CHAR_OLD_CHARS, @@ -396,9 +397,10 @@ enum CharacterDatabaseStatements CHAR_INS_CHAR_GIFT, CHAR_DEL_INSTANCE_BY_INSTANCE, CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE, - CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF, + CHAR_DEL_EXPIRED_CHAR_INSTANCE_BY_MAP_DIFF, CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, - CHAR_DEL_INSTANCE_BY_MAP_DIFF, + CHAR_DEL_EXPIRED_INSTANCE_BY_MAP_DIFF, + CHAR_UPD_EXPIRE_CHAR_INSTANCE_BY_MAP_DIFF, CHAR_DEL_MAIL_ITEM_BY_ID, CHAR_INS_PETITION, CHAR_DEL_PETITION_BY_GUID, diff --git a/src/server/database/Database/Implementation/LoginDatabase.cpp b/src/server/database/Database/Implementation/LoginDatabase.cpp index 66847f0a6a0..163a2bebeb9 100644 --- a/src/server/database/Database/Implementation/LoginDatabase.cpp +++ b/src/server/database/Database/Implementation/LoginDatabase.cpp @@ -28,29 +28,30 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_SEL_IP_INFO, "(SELECT unbandate > UNIX_TIMESTAMP() OR unbandate = bandate AS banned, NULL as country FROM ip_banned WHERE ip = ?) " "UNION " "(SELECT NULL AS banned, country FROM ip2nation WHERE INET_NTOA(ip) = ?)", CONNECTION_ASYNC); - PrepareStatement(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban')", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_IP_BANNED_ALL, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) ORDER BY unbandate", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_IP_BANNED_BY_IP, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) AND ip LIKE CONCAT('%%', ?, '%%') ORDER BY unbandate", CONNECTION_SYNCH); - PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED, "SELECT bandate, unbandate FROM account_banned WHERE id = ? AND active = 1", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED_ALL, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 AND username LIKE CONCAT('%%', ?, '%%') GROUP BY account.id", CONNECTION_SYNCH); PrepareStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban', 1)", CONNECTION_ASYNC); PrepareStatement(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC); - PrepareStatement(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_SYNCH); - PrepareStatement(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.lock_country, a.last_ip, aa.gmlevel, a.v, a.s, a.token_key FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.id, UPPER(a.username), a.locked, a.lock_country, a.last_ip, a.failed_logins, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, " + "ab.unbandate = ab.bandate, aa.gmlevel, a.token_key, a.sha_pass_hash, a.v, a.s " + "FROM account a LEFT JOIN account_access aa ON a.id = aa.id LEFT JOIN account_banned ab ON ab.id = a.id AND ab.active = 1 WHERE a.username = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_SEL_RECONNECTCHALLENGE, "SELECT a.id, UPPER(a.username), a.locked, a.lock_country, a.last_ip, a.failed_logins, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, " + "ab.unbandate = ab.bandate, aa.gmlevel, a.sessionKey " + "FROM account a LEFT JOIN account_access aa ON a.id = aa.id LEFT JOIN account_banned ab ON ab.id = a.id AND ab.active = 1 WHERE a.username = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_LOGON_COUNTRY, "SELECT country FROM ip2nation WHERE ip < ? ORDER BY ip DESC LIMIT 0,1", CONNECTION_SYNCH); PrepareStatement(LOGIN_UPD_FAILEDLOGINS, "UPDATE account SET failed_logins = failed_logins + 1 WHERE username = ?", CONNECTION_ASYNC); - PrepareStatement(LOGIN_SEL_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME, "SELECT id, username FROM account WHERE username = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME, "SELECT a.id, a.sessionkey, a.last_ip, a.locked, a.lock_country, a.expansion, a.mutetime, a.locale, a.recruiter, a.os, aa.gmLevel, " "ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, r.id FROM account a LEFT JOIN account_access aa ON a.id = aa.id AND aa.RealmID IN (-1, ?) " "LEFT JOIN account_banned ab ON a.id = ab.id AND ab.active = 1 LEFT JOIN account r ON a.id = r.recruiter WHERE a.username = ? ORDER BY aa.RealmID DESC LIMIT 1", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, "SELECT id, username FROM account WHERE email = ?", CONNECTION_SYNCH); - PrepareStatement(LOGIN_SEL_NUM_CHARS_ON_REALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_REALM_CHARACTER_COUNTS, "SELECT realmid, numchars FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id, username FROM account WHERE last_ip = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_BY_ID, "SELECT 1 FROM account WHERE id = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_INS_IP_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?)", CONNECTION_ASYNC); diff --git a/src/server/database/Database/Implementation/LoginDatabase.h b/src/server/database/Database/Implementation/LoginDatabase.h index 69c2e758551..a3789fa2557 100644 --- a/src/server/database/Database/Implementation/LoginDatabase.h +++ b/src/server/database/Database/Implementation/LoginDatabase.h @@ -33,25 +33,22 @@ enum LoginDatabaseStatements LOGIN_DEL_EXPIRED_IP_BANS, LOGIN_UPD_EXPIRED_ACCOUNT_BANS, LOGIN_SEL_IP_INFO, - LOGIN_SEL_IP_BANNED, LOGIN_INS_IP_AUTO_BANNED, - LOGIN_SEL_ACCOUNT_BANNED, LOGIN_SEL_ACCOUNT_BANNED_ALL, LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, LOGIN_INS_ACCOUNT_AUTO_BANNED, LOGIN_DEL_ACCOUNT_BANNED, - LOGIN_SEL_SESSIONKEY, LOGIN_UPD_VS, LOGIN_UPD_LOGONPROOF, LOGIN_SEL_LOGONCHALLENGE, + LOGIN_SEL_RECONNECTCHALLENGE, LOGIN_SEL_LOGON_COUNTRY, LOGIN_UPD_FAILEDLOGINS, - LOGIN_SEL_FAILEDLOGINS, LOGIN_SEL_ACCOUNT_ID_BY_NAME, LOGIN_SEL_ACCOUNT_LIST_BY_NAME, LOGIN_SEL_ACCOUNT_INFO_BY_NAME, LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, - LOGIN_SEL_NUM_CHARS_ON_REALM, + LOGIN_SEL_REALM_CHARACTER_COUNTS, LOGIN_SEL_ACCOUNT_BY_IP, LOGIN_INS_IP_BANNED, LOGIN_DEL_IP_NOT_BANNED, diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index c254a9124c1..352ae635878 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -133,7 +133,7 @@ void CreatureAI::MoveInLineOfSight(Unit* who) if (me->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET) // non-combat pets should just stand there and look good;) return; - if (me->CanStartAttack(who, false)) + if (me->HasReactState(REACT_AGGRESSIVE) && me->CanStartAttack(who, false)) AttackStart(who); //else if (who->GetVictim() && me->IsFriendlyTo(who) // && me->IsWithinDistInMap(who, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)) @@ -350,7 +350,7 @@ int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) con return boundsWarning ? LANG_CREATURE_MOVEMENT_MAYBE_UNBOUNDED : 0; } -bool CreatureAI::CheckBoundary(Position* who) const +bool CreatureAI::CheckBoundary(Position const* who) const { if (!who) who = me; diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index f250a79ea25..239fda577a7 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -79,7 +79,7 @@ class CreatureAI : public UnitAI Creature* DoSummon(uint32 entry, WorldObject* obj, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN); Creature* DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN); - bool CheckBoundary(Position* who = nullptr) const; + bool CheckBoundary(Position const* who = nullptr) const; void SetBoundary(CreatureBoundary const* boundary) { _boundary = boundary; me->DoImmediateBoundaryCheck(); } public: enum EvadeReason diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 1f0bbab72c4..5452a033a17 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -360,6 +360,8 @@ class BossAI : public ScriptedAI void JustDied(Unit* /*killer*/) override { _JustDied(); } void JustReachedHome() override { _JustReachedHome(); } + bool CanAIAttack(Unit const* target) const override { return CheckBoundary(target); } + protected: void _Reset(); void _EnterCombat(); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 808491495a9..c08d1508774 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1998,7 +1998,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (Creature* creature = (*itr)->ToCreature()) { creature->GetMotionMaster()->Clear(); - creature->GetMotionMaster()->MoveJump(e.target.x, e.target.y, e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz); + creature->GetMotionMaster()->MoveJump(e.target.x, e.target.y, e.target.z, 0.0f, (float)e.action.jump.speedxy, (float)e.action.jump.speedz); // @todo add optional jump orientation support? } } /// @todo Resume path when reached jump location diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index b030f42bef7..1acfeacbf83 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1399,7 +1399,10 @@ void GameObject::Use(Unit* user) player->SendCinematicStart(info->camera.cinematicId); if (info->camera.eventID) + { GetMap()->ScriptsStart(sEventScripts, info->camera.eventID, player, this); + EventInform(info->camera.eventID, user); + } return; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9ae9f21c967..c7f674ec72c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18375,8 +18375,9 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) uint32 mapId = fields[2].GetUInt16(); uint32 instanceId = fields[0].GetUInt32(); uint8 difficulty = fields[3].GetUInt8(); + BindExtensionState extendState = BindExtensionState(fields[4].GetUInt8()); - time_t resetTime = time_t(fields[4].GetUInt32()); + time_t resetTime = time_t(fields[5].GetUInt32()); // the resettime for normal instances is only saved when the InstanceSave is unloaded // so the value read from the DB may be wrong here but only if the InstanceSave is loaded // and in that case it is not used @@ -18425,13 +18426,13 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) // since non permanent binds are always solo bind, they can always be reset if (InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapId, instanceId, Difficulty(difficulty), resetTime, !perm, true)) - BindToInstance(save, perm, true); + BindToInstance(save, perm, extendState, true); } while (result->NextRow()); } } -InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty) +InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty, bool withExpired) { // some instances only have one difficulty MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(mapid, difficulty); @@ -18440,9 +18441,9 @@ InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid); if (itr != m_boundInstances[difficulty].end()) - return &itr->second; - else - return NULL; + if (itr->second.extendState || withExpired) + return &itr->second; + return nullptr; } InstanceSave* Player::GetInstanceSave(uint32 mapid, bool raid) @@ -18485,24 +18486,32 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu } } -InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, bool load) +InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, BindExtensionState extendState, bool load) { if (save) { InstancePlayerBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()]; + if (extendState == EXTEND_STATE_KEEP) // special flag, keep the player's current extend state when updating for new boss down + { + if (save == bind.save) + extendState = bind.extendState; + else + extendState = EXTEND_STATE_NORMAL; + } if (!load) { if (bind.save) { // update the save when the group kills a boss - if (permanent != bind.perm || save != bind.save) + if (permanent != bind.perm || save != bind.save || extendState != bind.extendState) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INSTANCE); stmt->setUInt32(0, save->GetInstanceId()); stmt->setBool(1, permanent); - stmt->setUInt32(2, GetGUID().GetCounter()); - stmt->setUInt32(3, bind.save->GetInstanceId()); + stmt->setUInt8(2, extendState); + stmt->setUInt32(3, GetGUID().GetCounter()); + stmt->setUInt32(4, bind.save->GetInstanceId()); CharacterDatabase.Execute(stmt); } @@ -18514,6 +18523,7 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b stmt->setUInt32(0, GetGUID().GetCounter()); stmt->setUInt32(1, save->GetInstanceId()); stmt->setBool(2, permanent); + stmt->setUInt8(3, extendState); CharacterDatabase.Execute(stmt); } @@ -18531,9 +18541,10 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b bind.save = save; bind.perm = permanent; + bind.extendState = extendState; if (!load) TC_LOG_DEBUG("maps", "Player::BindToInstance: %s(%d) is now bound to map %d, instance %d, difficulty %d", GetName().c_str(), GetGUID().GetCounter(), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); - sScriptMgr->OnPlayerBindToInstance(this, save->GetDifficulty(), save->GetMapId(), permanent); + sScriptMgr->OnPlayerBindToInstance(this, save->GetDifficulty(), save->GetMapId(), permanent, uint8(extendState)); return &bind; } @@ -18551,7 +18562,7 @@ void Player::BindToInstance() GetSession()->SendPacket(&data); if (!IsGameMaster()) { - BindToInstance(mapSave, true); + BindToInstance(mapSave, true, EXTEND_STATE_KEEP); GetSession()->SendCalendarRaidLockout(mapSave, true); } } @@ -18577,15 +18588,19 @@ void Player::SendRaidInfo() { for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr) { - if (itr->second.perm) - { - InstanceSave* save = itr->second.save; - data << uint32(save->GetMapId()); // map id - data << uint32(save->GetDifficulty()); // difficulty - data << uint64(save->GetInstanceId()); // instance id - data << uint8(1); // expired = 0 - data << uint8(0); // extended = 1 - data << uint32(save->GetResetTime() - now); // reset time + InstancePlayerBind const& bind = itr->second; + if (bind.perm) + { + InstanceSave* save = bind.save; + data << uint32(save->GetMapId()); // map id + data << uint32(save->GetDifficulty()); // difficulty + data << uint64(save->GetInstanceId()); // instance id + data << uint8(bind.extendState != EXTEND_STATE_EXPIRED); // expired = 0 + data << uint8(bind.extendState == EXTEND_STATE_EXTENDED); // extended = 1 + time_t nextReset = save->GetResetTime(); + if (bind.extendState == EXTEND_STATE_EXTENDED) + nextReset = sInstanceSaveMgr->GetSubsequentResetTime(save->GetMapId(), save->GetDifficulty(), save->GetResetTime()); + data << uint32(nextReset - now); // reset time ++counter; } } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 9b64023698c..2388cf9d0c7 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -834,14 +834,27 @@ enum PlayerDelayedOperations // Maximum money amount : 2^31 - 1 extern uint32 const MAX_MONEY_AMOUNT; +enum BindExtensionState +{ + EXTEND_STATE_EXPIRED = 0, + EXTEND_STATE_NORMAL = 1, + EXTEND_STATE_EXTENDED = 2, + EXTEND_STATE_KEEP = 255 // special state: keep current save type +}; struct InstancePlayerBind { InstanceSave* save; - bool perm; /* permanent PlayerInstanceBinds are created in Raid/Heroic instances for players - that aren't already permanently bound when they are inside when a boss is killed - or when they enter an instance that the group leader is permanently bound to. */ - InstancePlayerBind() : save(NULL), perm(false) { } + that aren't already permanently bound when they are inside when a boss is killed + or when they enter an instance that the group leader is permanently bound to. */ + bool perm; + /* extend state listing: + EXPIRED - doesn't affect anything unless manually re-extended by player + NORMAL - standard state + EXTENDED - won't be promoted to EXPIRED at next reset period, will instead be promoted to NORMAL */ + BindExtensionState extendState; + + InstancePlayerBind() : save(NULL), perm(false), extendState(EXTEND_STATE_NORMAL) { } }; struct AccessRequirement @@ -2115,12 +2128,12 @@ class Player : public Unit, public GridObject<Player> bool m_InstanceValid; // permanent binds and solo binds by difficulty BoundInstancesMap m_boundInstances[MAX_DIFFICULTY]; - InstancePlayerBind* GetBoundInstance(uint32 mapid, Difficulty difficulty); + InstancePlayerBind* GetBoundInstance(uint32 mapid, Difficulty difficulty, bool withExpired = false); BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; } InstanceSave* GetInstanceSave(uint32 mapid, bool raid); void UnbindInstance(uint32 mapid, Difficulty difficulty, bool unload = false); void UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficulty, bool unload = false); - InstancePlayerBind* BindToInstance(InstanceSave* save, bool permanent, bool load = false); + InstancePlayerBind* BindToInstance(InstanceSave* save, bool permanent, BindExtensionState extendState = EXTEND_STATE_NORMAL, bool load = false); void BindToInstance(); void SetPendingBind(uint32 instanceId, uint32 bindTimer); bool HasPendingBind() const { return _pendingBindId > 0; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bdc97e22649..c21301c27b2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4355,13 +4355,10 @@ void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelCharges if (aura->GetSpellInfo()->GetDispelMask() & dispelMask) { - if (aura->GetSpellInfo()->Dispel == DISPEL_MAGIC) - { - // do not remove positive auras if friendly target - // negative auras if non-friendly target - if (aurApp->IsPositive() == IsFriendlyTo(caster)) - continue; - } + // do not remove positive auras if friendly target + // negative auras if non-friendly target + if (aurApp->IsPositive() == IsFriendlyTo(caster)) + continue; // The charges / stack amounts don't count towards the total number of auras that can be dispelled. // Ie: A dispel on a target with 5 stacks of Winters Chill and a Polymorph has 1 / (1 + 1) -> 50% chance to dispell @@ -8328,8 +8325,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg case 52914: case 52915: case 52910: - // Honor Among Thieves - case 52916: { target = triggeredByAura->GetBase()->GetCaster(); if (!target) @@ -16861,12 +16856,12 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward) } } -void Unit::JumpTo(WorldObject* obj, float speedZ) +void Unit::JumpTo(WorldObject* obj, float speedZ, bool withOrientation) { float x, y, z; obj->GetContactPoint(this, x, y, z); float speedXY = GetExactDist2d(x, y) * 10.0f / speedZ; - GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ); + GetMotionMaster()->MoveJump(x, y, z, GetAngle(obj), speedXY, speedZ, EVENT_JUMP, withOrientation); } bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 8572c791d67..4565160dc93 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1567,7 +1567,7 @@ class Unit : public WorldObject void KnockbackFrom(float x, float y, float speedXY, float speedZ); void JumpTo(float speedXY, float speedZ, bool forward = true); - void JumpTo(WorldObject* obj, float speedZ); + void JumpTo(WorldObject* obj, float speedZ, bool withOrientation = false); void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath = false, bool forceDestination = false); //void SetFacing(float ori, WorldObject* obj = NULL); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index c48d1947eec..2cdbdca4e4f 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -131,7 +131,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u) if (!u->IsAlive() || !c->IsAlive() || c == u || u->IsInFlight()) return; - if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STATE_SIGHTLESS)) + if (!c->HasUnitState(UNIT_STATE_SIGHTLESS)) { if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true)) c->AI()->MoveInLineOfSight_Safe(u); diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 43159828a3c..99c5d610e64 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -687,7 +687,8 @@ void Group::ConvertLeaderInstancesToGroup(Player* player, Group* group, bool swi for (Player::BoundInstancesMap::iterator itr = player->m_boundInstances[i].begin(); itr != player->m_boundInstances[i].end();) { if (!switchLeader || !group->GetBoundInstance(itr->second.save->GetDifficulty(), itr->first)) - group->BindToInstance(itr->second.save, itr->second.perm, false); + if (itr->second.extendState) // not expired + group->BindToInstance(itr->second.save, itr->second.perm, false); // permanent binds are not removed if (switchLeader && !itr->second.perm) diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 8bd7086fc1b..540eeba0752 100644 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -695,6 +695,21 @@ void WorldSession::HandleSetSavedInstanceExtend(WorldPacket& recvData) recvData >> mapId >> difficulty>> toggleExtend; TC_LOG_DEBUG("network", "CMSG_SET_SAVED_INSTANCE_EXTEND - MapId: %u, Difficulty: %u, ToggleExtend: %s", mapId, difficulty, toggleExtend ? "On" : "Off"); + if (Player* player = GetPlayer()) + { + InstancePlayerBind* instanceBind = player->GetBoundInstance(mapId, Difficulty(difficulty), toggleExtend == 1); // include expired instances if we are toggling extend on + if (!instanceBind || !instanceBind->save || !instanceBind->perm) + return; + + BindExtensionState newState; + if (!toggleExtend || instanceBind->extendState == EXTEND_STATE_EXPIRED) + newState = EXTEND_STATE_NORMAL; + else + newState = EXTEND_STATE_EXTENDED; + + player->BindToInstance(instanceBind->save, true, newState, false); + } + /* InstancePlayerBind* instanceBind = _player->GetBoundInstance(mapId, Difficulty(difficulty)); if (!instanceBind || !instanceBind->save) diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 9a64335e6f0..3538262ed35 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -439,6 +439,23 @@ void InstanceSaveManager::LoadResetTimes() } } +time_t InstanceSaveManager::GetSubsequentResetTime(uint32 mapid, Difficulty difficulty, time_t resetTime) const +{ + MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty); + if (!mapDiff || !mapDiff->resetTime) + { + TC_LOG_ERROR("misc", "InstanceSaveManager::GetSubsequentResetTime: not valid difficulty or no reset delay for map %u", mapid); + return 0; + } + + time_t diff = sWorld->getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR; + time_t period = uint32(((mapDiff->resetTime * sWorld->getRate(RATE_INSTANCE_RESET_TIME)) / DAY) * DAY); + if (period < DAY) + period = DAY; + + return ((resetTime + MINUTE) / DAY * DAY) + period + diff; +} + void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent event) { if (!add) @@ -476,6 +493,17 @@ void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent ev m_resetTimeQueue.insert(std::pair<time_t, InstResetEvent>(time, event)); } +void InstanceSaveManager::ForceGlobalReset(uint32 mapId, Difficulty difficulty) +{ + if (!GetDownscaledMapDifficultyData(mapId, difficulty)) + return; + // remove currently scheduled reset times + ScheduleReset(false, 0, InstResetEvent(1, mapId, difficulty, 0)); + ScheduleReset(false, 0, InstResetEvent(4, mapId, difficulty, 0)); + // force global reset on the instance + _ResetOrWarnAll(mapId, difficulty, false, time(nullptr)); +} + void InstanceSaveManager::Update() { time_t now = time(NULL); @@ -516,10 +544,26 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr) // do not allow UnbindInstance to automatically unload the InstanceSaves lock_instLists = true; + bool shouldDelete = true; InstanceSave::PlayerListType &pList = itr->second->m_playerList; - while (!pList.empty()) + std::vector<Player*> temp; // list of expired binds that should be unbound + for (Player* player : pList) + { + if (InstancePlayerBind* bind = player->GetBoundInstance(itr->second->GetMapId(), itr->second->GetDifficulty())) + { + ASSERT(bind->save == itr->second); + if (bind->perm && bind->extendState) // permanent and not already expired + { + // actual promotion in DB already happened in caller + bind->extendState = bind->extendState == EXTEND_STATE_EXTENDED ? EXTEND_STATE_NORMAL : EXTEND_STATE_EXPIRED; + shouldDelete = false; + continue; + } + } + temp.push_back(player); + } + for (Player* player : temp) { - Player* player = *(pList.begin()); player->UnbindInstance(itr->second->GetMapId(), itr->second->GetDifficulty(), true); } @@ -530,8 +574,13 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr) group->UnbindInstance(itr->second->GetMapId(), itr->second->GetDifficulty(), true); } - delete itr->second; - m_instanceSaveById.erase(itr++); + if (shouldDelete) + { + delete itr->second; + itr = m_instanceSaveById.erase(itr); + } + else + ++itr; lock_instLists = false; } @@ -572,31 +621,21 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b MapEntry const* mapEntry = sMapStore.LookupEntry(mapid); if (!mapEntry->Instanceable()) return; + TC_LOG_DEBUG("misc", "InstanceSaveManager::ResetOrWarnAll: Processing map %s (%u) on difficulty %u (warn? %u)", mapEntry->name[0], mapid, uint8(difficulty), warn); time_t now = time(NULL); if (!warn) { - MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty); - if (!mapDiff || !mapDiff->resetTime) - { - TC_LOG_ERROR("misc", "InstanceSaveManager::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid); + // calculate the next reset time + time_t next_reset = GetSubsequentResetTime(mapid, difficulty, resetTime); + if (!next_reset) return; - } - // remove all binds to instances of the given map - for (InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end();) - { - if (itr->second->GetMapId() == mapid && itr->second->GetDifficulty() == difficulty) - _ResetSave(itr); - else - ++itr; - } - - // delete them from the DB, even if not loaded + // delete/promote instance binds from the DB, even if not loaded SQLTransaction trans = CharacterDatabase.BeginTransaction(); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_CHAR_INSTANCE_BY_MAP_DIFF); stmt->setUInt16(0, uint16(mapid)); stmt->setUInt8(1, uint8(difficulty)); trans->Append(stmt); @@ -606,21 +645,26 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b stmt->setUInt8(1, uint8(difficulty)); trans->Append(stmt); - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INSTANCE_BY_MAP_DIFF); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_INSTANCE_BY_MAP_DIFF); stmt->setUInt16(0, uint16(mapid)); stmt->setUInt8(1, uint8(difficulty)); trans->Append(stmt); - CharacterDatabase.CommitTransaction(trans); - - // calculate the next reset time - uint32 diff = sWorld->getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR; + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_EXPIRE_CHAR_INSTANCE_BY_MAP_DIFF); + stmt->setUInt16(0, uint16(mapid)); + stmt->setUInt8(1, uint8(difficulty)); + trans->Append(stmt); - uint32 period = uint32(((mapDiff->resetTime * sWorld->getRate(RATE_INSTANCE_RESET_TIME))/DAY) * DAY); - if (period < DAY) - period = DAY; + CharacterDatabase.CommitTransaction(trans); - uint32 next_reset = uint32(((resetTime + MINUTE) / DAY * DAY) + period + diff); + // promote loaded binds to instances of the given map + for (InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end();) + { + if (itr->second->GetMapId() == mapid && itr->second->GetDifficulty() == difficulty) + _ResetSave(itr); + else + ++itr; + } SetResetTimeFor(mapid, difficulty, next_reset); ScheduleReset(true, time_t(next_reset-3600), InstResetEvent(1, mapid, difficulty, 0)); diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h index e3d8175cbc4..d2b3237b3cf 100644 --- a/src/server/game/Instances/InstanceSaveMgr.h +++ b/src/server/game/Instances/InstanceSaveMgr.h @@ -190,6 +190,7 @@ class InstanceSaveManager ResetTimeByMapDifficultyMap::const_iterator itr = m_resetTimeByMapDifficulty.find(MAKE_PAIR32(mapid, d)); return itr != m_resetTimeByMapDifficulty.end() ? itr->second : 0; } + time_t GetSubsequentResetTime(uint32 mapid, Difficulty difficulty, time_t resetTime) const; // Use this on startup when initializing reset times void InitializeResetTimeFor(uint32 mapid, Difficulty d, time_t t) @@ -210,6 +211,7 @@ class InstanceSaveManager return m_resetTimeByMapDifficulty; } void ScheduleReset(bool add, time_t time, InstResetEvent event); + void ForceGlobalReset(uint32 mapId, Difficulty difficulty); void Update(); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 1560d4bdd08..ccc599b6de8 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -37,7 +37,7 @@ #include "VMapFactory.h" u_map_magic MapMagic = { {'M','A','P','S'} }; -u_map_magic MapVersionMagic = { {'v','1','.','7'} }; +u_map_magic MapVersionMagic = { {'v','1','.','8'} }; u_map_magic MapAreaMagic = { {'A','R','E','A'} }; u_map_magic MapHeightMagic = { {'M','H','G','T'} }; u_map_magic MapLiquidMagic = { {'M','L','I','Q'} }; @@ -1805,10 +1805,10 @@ bool GridMap::loadHeightData(FILE* in, uint32 offset, uint32 /*size*/) if (header.flags & MAP_HEIGHT_HAS_FLIGHT_BOUNDS) { - _maxHeight = new float[16 * 16]; - _minHeight = new float[16 * 16]; - if (fread(_maxHeight, sizeof(float), 16 * 16, in) != 16 * 16 || - fread(_minHeight, sizeof(float), 16 * 16, in) != 16 * 16) + _maxHeight = new int16[3 * 3]; + _minHeight = new int16[3 * 3]; + if (fread(_maxHeight, sizeof(int16), 3 * 3, in) != 3 * 3 || + fread(_minHeight, sizeof(int16), 3 * 3, in) != 3 * 3) return false; } @@ -2087,11 +2087,59 @@ float GridMap::getMinHeight(float x, float y) const if (!_minHeight) return -500.0f; - x = 16 * (CENTER_GRID_ID - x / SIZE_OF_GRIDS); - y = 16 * (CENTER_GRID_ID - y / SIZE_OF_GRIDS); - int lx = (int)x & 15; - int ly = (int)y & 15; - return _minHeight[lx * 16 + ly]; + static uint32 const indices[] = + { + 3, 0, 4, + 0, 1, 4, + 1, 2, 4, + 2, 5, 4, + 5, 8, 4, + 8, 7, 4, + 7, 6, 4, + 6, 3, 4 + }; + + static float const boundGridCoords[] = + { + 0.0f, 0.0f, + 0.0f, -266.66666f, + 0.0f, -533.33331f, + -266.66666f, 0.0f, + -266.66666f, -266.66666f, + -266.66666f, -533.33331f, + -533.33331f, 0.0f, + -533.33331f, -266.66666f, + -533.33331f, -533.33331f + }; + + Cell cell(x, y); + float gx = x - (int32(cell.GridX()) - CENTER_GRID_ID + 1) * SIZE_OF_GRIDS; + float gy = y - (int32(cell.GridY()) - CENTER_GRID_ID + 1) * SIZE_OF_GRIDS; + + uint32 quarterIndex = 0; + if (cell.CellY() < MAX_NUMBER_OF_CELLS / 2) + { + if (cell.CellX() < MAX_NUMBER_OF_CELLS / 2) + { + quarterIndex = 4 + (gy > gx); + } + else + quarterIndex = 2 + ((-SIZE_OF_GRIDS - gx) > gy); + } + else if (cell.CellX() < MAX_NUMBER_OF_CELLS / 2) + { + quarterIndex = 6 + ((-SIZE_OF_GRIDS - gx) <= gy); + } + else + quarterIndex = gx > gy; + + quarterIndex *= 3; + + return G3D::Plane( + G3D::Vector3(boundGridCoords[indices[quarterIndex + 0] * 2 + 0], boundGridCoords[indices[quarterIndex + 0] * 2 + 1], _minHeight[indices[quarterIndex + 0]]), + G3D::Vector3(boundGridCoords[indices[quarterIndex + 1] * 2 + 0], boundGridCoords[indices[quarterIndex + 1] * 2 + 1], _minHeight[indices[quarterIndex + 1]]), + G3D::Vector3(boundGridCoords[indices[quarterIndex + 2] * 2 + 0], boundGridCoords[indices[quarterIndex + 2] * 2 + 1], _minHeight[indices[quarterIndex + 2]]) + ).distance(G3D::Vector3(gx, gy, 0.0f)); } float GridMap::getLiquidLevel(float x, float y) const @@ -2380,7 +2428,7 @@ uint32 Map::GetAreaId(float x, float y, float z, bool *isOutdoors) const atEntry = sAreaTableStore.LookupEntry(wmoEntry->areaId); } - uint32 areaId; + uint32 areaId = 0; if (atEntry) areaId = atEntry->ID; @@ -2388,8 +2436,9 @@ uint32 Map::GetAreaId(float x, float y, float z, bool *isOutdoors) const { if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y)) areaId = gmap->getArea(x, y); + // this used while not all *.map files generated (instances) - else + if (!areaId) areaId = i_mapEntry->linked_zone; } @@ -3209,22 +3258,37 @@ bool InstanceMap::Reset(uint8 method) } else { + bool doUnload = true; if (method == INSTANCE_RESET_GLOBAL) + { // set the homebind timer for players inside (1 minute) for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr) - itr->GetSource()->m_InstanceValid = false; + { + InstancePlayerBind* bind = itr->GetSource()->GetBoundInstance(GetId(), GetDifficulty()); + if (bind && bind->extendState && bind->save->GetInstanceId() == GetInstanceId()) + doUnload = false; + else + itr->GetSource()->m_InstanceValid = false; + } - // the unload timer is not started - // instead the map will unload immediately after the players have left - m_unloadWhenEmpty = true; - m_resetAfterUnload = true; + if (doUnload && HasPermBoundPlayers()) // check if any unloaded players have a nonexpired save to this + doUnload = false; + } + + if (doUnload) + { + // the unload timer is not started + // instead the map will unload immediately after the players have left + m_unloadWhenEmpty = true; + m_resetAfterUnload = true; + } } } else { // unloaded at next update m_unloadTimer = MIN_UNLOAD_DELAY; - m_resetAfterUnload = true; + m_resetAfterUnload = !(method == INSTANCE_RESET_GLOBAL && HasPermBoundPlayers()); } return m_mapRefManager.isEmpty(); @@ -3305,6 +3369,13 @@ MapDifficulty const* Map::GetMapDifficulty() const return GetMapDifficultyData(GetId(), GetDifficulty()); } +bool InstanceMap::HasPermBoundPlayers() const +{ + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PERM_BIND_BY_INSTANCE); + stmt->setUInt16(0,GetInstanceId()); + return !!CharacterDatabase.Query(stmt); +} + uint32 InstanceMap::GetMaxPlayers() const { MapDifficulty const* mapDiff = GetMapDifficulty(); diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 13d48db0f9d..bc2bf72f271 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -167,8 +167,8 @@ class GridMap uint16* m_uint16_V8; uint8* m_uint8_V8; }; - float* _maxHeight; - float* _minHeight; + int16* _maxHeight; + int16* _minHeight; // Height level data float _gridHeight; float _gridIntHeightMultiplier; @@ -771,6 +771,9 @@ class InstanceMap : public Map void SendResetWarnings(uint32 timeLeft) const; void SetResetSchedule(bool on); + /* this checks if any players have a permanent bind (included reactivatable expired binds) to the instance ID + it needs a DB query, so use sparingly */ + bool HasPermBoundPlayers() const; uint32 GetMaxPlayers() const; uint32 GetMaxResetDelay() const; diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 3fcae1398f9..05948b987ad 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -366,10 +366,10 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ) float moveTimeHalf = speedZ / Movement::gravity; float dist = 2 * moveTimeHalf * speedXY; _owner->GetClosePoint(x, y, z, _owner->GetObjectSize(), dist, angle); - MoveJump(x, y, z, speedXY, speedZ); + MoveJump(x, y, z, 0.0f, speedXY, speedZ); } -void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id) +void MotionMaster::MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint32 id, bool hasOrientation /* = false*/) { TC_LOG_DEBUG("misc", "Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUID().GetCounter(), x, y, z); if (speedXY <= 0.1f) @@ -382,6 +382,8 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee init.MoveTo(x, y, z, false); init.SetParabolic(max_height, 0); init.SetVelocity(speedXY); + if (hasOrientation) + init.SetFacing(o); init.Launch(); Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); } diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index ce0f1f7836e..76ae12986d5 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -181,9 +181,11 @@ class MotionMaster //: private std::stack<MovementGenerator *> void MoveCharge(PathGenerator const& path, float speed = SPEED_CHARGE); void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ); void MoveJumpTo(float angle, float speedXY, float speedZ); - void MoveJump(Position const& pos, float speedXY, float speedZ, uint32 id = EVENT_JUMP) - { MoveJump(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speedXY, speedZ, id); } - void MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id = EVENT_JUMP); + void MoveJump(Position const& pos, float speedXY, float speedZ, uint32 id = EVENT_JUMP, bool hasOrientation = false) + { + MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), speedXY, speedZ, id, hasOrientation); + } + void MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint32 id = EVENT_JUMP, bool hasOrientation = false); void MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount); void MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk); void MoveFall(uint32 id = 0); diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 3fa16cf4517..4b26ba96c9b 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -37,7 +37,6 @@ // namespace // { - UnusedScriptContainer UnusedScripts; UnusedScriptNamesContainer UnusedScriptNames; // } @@ -107,8 +106,9 @@ class ScriptRegistry // The actual list of scripts. This will be accessed concurrently, so it must not be modified // after server startup. static ScriptMap ScriptPointerList; + static std::vector<TScript*> Scripts; - static void AddScript(TScript* const script) + static void AddScript(TScript* const script, bool addToDeleteContainer = true) { ASSERT(script); @@ -126,6 +126,8 @@ class ScriptRegistry } AddScript(is_script_database_bound<TScript>{}, script); + if (addToDeleteContainer) + Scripts.push_back(script); } // Gets a script by its ID (assigned by ObjectMgr). @@ -186,11 +188,6 @@ class ScriptRegistry { // The script uses a script name from database, but isn't assigned to anything. TC_LOG_ERROR("sql.sql", "Script named '%s' does not have a script name assigned in database.", script->GetName().c_str()); - - // Avoid calling "delete script;" because we are currently in the script constructor - // In a valid scenario this will not happen because every script has a name assigned in the database - UnusedScripts.push_back(script); - return; } } @@ -210,6 +207,7 @@ class ScriptRegistry #define SCR_REG_MAP(T) ScriptRegistry<T>::ScriptMap #define SCR_REG_ITR(T) ScriptRegistry<T>::ScriptMapIterator #define SCR_REG_LST(T) ScriptRegistry<T>::ScriptPointerList +#define SCR_REG_VEC(T) ScriptRegistry<T>::Scripts // Utility macros for looping over scripts. #define FOR_SCRIPTS(T, C, E) \ @@ -266,17 +264,15 @@ void ScriptMgr::Initialize() } #endif - UnloadUnusedScripts(); - TC_LOG_INFO("server.loading", ">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime)); } void ScriptMgr::Unload() { #define SCR_CLEAR(T) \ - for (SCR_REG_ITR(T) itr = SCR_REG_LST(T).begin(); itr != SCR_REG_LST(T).end(); ++itr) \ - delete itr->second; \ - SCR_REG_LST(T).clear(); + for (T* scr : SCR_REG_VEC(T)) \ + delete scr; \ + SCR_REG_VEC(T).clear(); // Clear scripts for every script type. SCR_CLEAR(SpellScriptLoader); @@ -308,19 +304,10 @@ void ScriptMgr::Unload() #undef SCR_CLEAR - UnloadUnusedScripts(); - delete[] SpellSummary; delete[] UnitAI::AISpellInfo; } -void ScriptMgr::UnloadUnusedScripts() -{ - for (size_t i = 0; i < UnusedScripts.size(); ++i) - delete UnusedScripts[i]; - UnusedScripts.clear(); -} - void ScriptMgr::LoadDatabase() { sScriptSystemMgr->LoadScriptWaypoints(); @@ -1368,9 +1355,9 @@ void ScriptMgr::OnPlayerSave(Player* player) FOREACH_SCRIPT(PlayerScript)->OnSave(player); } -void ScriptMgr::OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent) +void ScriptMgr::OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent, uint8 extendState) { - FOREACH_SCRIPT(PlayerScript)->OnBindToInstance(player, difficulty, mapid, permanent); + FOREACH_SCRIPT(PlayerScript)->OnBindToInstance(player, difficulty, mapid, permanent, extendState); } void ScriptMgr::OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea) @@ -1555,8 +1542,7 @@ FormulaScript::FormulaScript(const char* name) UnitScript::UnitScript(const char* name, bool addToScripts) : ScriptObject(name) { - if (addToScripts) - ScriptRegistry<UnitScript>::AddScript(this); + ScriptRegistry<UnitScript>::AddScript(this, addToScripts); } WorldMapScript::WorldMapScript(const char* name, uint32 mapId) @@ -1696,6 +1682,7 @@ GroupScript::GroupScript(const char* name) // Instantiate static members of ScriptRegistry. template<class TScript> std::map<uint32, TScript*> ScriptRegistry<TScript>::ScriptPointerList; +template<class TScript> std::vector<TScript*> ScriptRegistry<TScript>::Scripts; template<class TScript> uint32 ScriptRegistry<TScript>::_scriptIdCounter = 0; // Specialize for each script type class like so: diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 5dfc0be688a..8a00305b4da 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -734,7 +734,7 @@ class PlayerScript : public UnitScript virtual void OnSave(Player* /*player*/) { } // Called when a player is bound to an instance - virtual void OnBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/) { } + virtual void OnBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/, uint8 /*extendState*/) { } // Called when a player switches to a new zone virtual void OnUpdateZone(Player* /*player*/, uint32 /*newZone*/, uint32 /*newArea*/) { } @@ -843,10 +843,7 @@ class GroupScript : public ScriptObject // namespace // { - typedef std::vector<ScriptObject*> UnusedScriptContainer; typedef std::list<std::string> UnusedScriptNamesContainer; - - extern UnusedScriptContainer UnusedScripts; extern UnusedScriptNamesContainer UnusedScriptNames; // } @@ -878,7 +875,6 @@ class ScriptMgr public: /* Unloading */ void Unload(); - void UnloadUnusedScripts(); public: /* SpellScriptLoader */ @@ -1054,7 +1050,7 @@ class ScriptMgr void OnPlayerDelete(ObjectGuid guid, uint32 accountId); void OnPlayerFailedDelete(ObjectGuid guid, uint32 accountId); void OnPlayerSave(Player* player); - void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent); + void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent, uint8 extendState); void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea); void OnQuestStatusChange(Player* player, uint32 questId, QuestStatus status); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index b72ceecfff0..207908c6d51 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4683,11 +4683,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (target->GetTypeId() == TYPEID_PLAYER) target->ToPlayer()->RemoveAmmo(); // not use ammo and not allow use break; - case 52916: // Honor Among Thieves - if (target->GetTypeId() == TYPEID_PLAYER) - if (Unit* spellTarget = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget())) - target->CastSpell(spellTarget, 51699, true); - break; case 71563: if (Aura* newAura = target->AddAura(71564, target)) newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 7c1ccbdb463..23e2f144ff2 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2429,7 +2429,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) if (missInfo != SPELL_MISS_EVADE && !m_caster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL))) { - m_caster->CombatStart(unit, !m_spellInfo->HasAttribute(SPELL_ATTR3_NO_INITIAL_AGGRO)); + m_caster->CombatStart(unit, m_spellInfo->HasInitialAggro()); if (!unit->IsStandState()) unit->SetStandState(UNIT_STAND_STATE_STAND); @@ -2535,7 +2535,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA if (m_caster->GetTypeId() == TYPEID_PLAYER) m_caster->ToPlayer()->UpdatePvP(true); } - if (unit->IsInCombat() && !m_spellInfo->HasAttribute(SPELL_ATTR3_NO_INITIAL_AGGRO)) + if (unit->IsInCombat() && m_spellInfo->HasInitialAggro()) { m_caster->SetInCombatState(unit->GetCombatTimer() > 0, unit); unit->getHostileRefManager().threatAssist(m_caster, 0.0f); @@ -4611,8 +4611,7 @@ void Spell::HandleThreatSpells() if (m_UniqueTargetInfo.empty()) return; - if (m_spellInfo->HasAttribute(SPELL_ATTR1_NO_THREAT) || - m_spellInfo->HasAttribute(SPELL_ATTR3_NO_INITIAL_AGGRO)) + if (!m_spellInfo->HasInitialAggro()) return; float threat = 0.0f; @@ -4623,7 +4622,7 @@ void Spell::HandleThreatSpells() threat += threatEntry->flatMod; } - else if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_NO_INITIAL_THREAT) == 0) + else if (!m_spellInfo->HasAttribute(SPELL_ATTR0_CU_NO_INITIAL_THREAT)) threat += m_spellInfo->SpellLevel; // past this point only multiplicative effects occur diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index b2aa44e28df..9535ca291eb 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1021,7 +1021,7 @@ void Spell::EffectJump(SpellEffIndex effIndex) float speedXY, speedZ; CalculateJumpSpeeds(effIndex, m_caster->GetExactDist2d(x, y), speedXY, speedZ); - m_caster->GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ); + m_caster->GetMotionMaster()->MoveJump(x, y, z, 0.0f, speedXY, speedZ, EVENT_JUMP, false); } void Spell::EffectJumpDest(SpellEffIndex effIndex) @@ -1035,13 +1035,9 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex) if (!m_targets.HasDst()) return; - // Init dest coordinates - float x, y, z; - destTarget->GetPosition(x, y, z); - float speedXY, speedZ; - CalculateJumpSpeeds(effIndex, m_caster->GetExactDist2d(x, y), speedXY, speedZ); - m_caster->GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ); + CalculateJumpSpeeds(effIndex, m_caster->GetExactDist2d(destTarget), speedXY, speedZ); + m_caster->GetMotionMaster()->MoveJump(*destTarget, speedXY, speedZ, EVENT_JUMP, true); } void Spell::CalculateJumpSpeeds(uint8 i, float dist, float & speedXY, float & speedZ) @@ -4903,7 +4899,7 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex) float speedXY = float(m_spellInfo->Effects[effIndex].MiscValue) * 0.1f; float speedZ = unitTarget->GetDistance(pos) / speedXY * 0.5f * Movement::gravity; - unitTarget->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ); + unitTarget->GetMotionMaster()->MoveJump(pos, speedXY, speedZ); } void Spell::EffectDispelMechanic(SpellEffIndex effIndex) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 699e4857ee0..069c794ca8b 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1180,6 +1180,11 @@ bool SpellInfo::IsAutoRepeatRangedSpell() const return HasAttribute(SPELL_ATTR2_AUTOREPEAT_FLAG); } +bool SpellInfo::HasInitialAggro() const +{ + return !(HasAttribute(SPELL_ATTR1_NO_THREAT) || HasAttribute(SPELL_ATTR3_NO_INITIAL_AGGRO)); +} + bool SpellInfo::IsAffectedBySpellMods() const { return !HasAttribute(SPELL_ATTR3_NO_DONE_BONUS); diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index dbbab5fb30b..ba658c885fa 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -420,6 +420,7 @@ public: bool IsBreakingStealth() const; bool IsRangedWeaponSpell() const; bool IsAutoRepeatRangedSpell() const; + bool HasInitialAggro() const; bool IsAffectedBySpellMods() const; bool IsAffectedBySpellMod(SpellModifier const* mod) const; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 40e8f2d4e24..f5bb1c920fe 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2987,13 +2987,6 @@ void SpellMgr::LoadSpellInfoCorrections() case 36350: // They Must Burn Bomb Aura (self) spellInfo->Effects[EFFECT_0].TriggerSpell = 36325; // They Must Burn Bomb Drop (DND) break; - case 49838: // Stop Time - case 69438: // Sample Satisfaction - case 69445: // Perfume Spritz - case 69489: // Chocolate Sample - case 69563: // Cologne Spritz - spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_INITIAL_AGGRO; - break; case 61407: // Energize Cores case 62136: // Energize Cores case 54069: // Energize Cores diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 9902b83ff63..b937fc4e0a4 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -93,7 +93,8 @@ public: { "moveflags", rbac::RBAC_PERM_COMMAND_DEBUG_MOVEFLAGS, false, &HandleDebugMoveflagsCommand, "" }, { "transport", rbac::RBAC_PERM_COMMAND_DEBUG_TRANSPORT, false, &HandleDebugTransportCommand, "" }, { "loadcells", rbac::RBAC_PERM_COMMAND_DEBUG_LOADCELLS, false, &HandleDebugLoadCellsCommand, "" }, - { "boundary", rbac::RBAC_PERM_COMMAND_DEBUG_BOUNDARY, false, &HandleDebugBoundaryCommand, "" } + { "boundary", rbac::RBAC_PERM_COMMAND_DEBUG_BOUNDARY, false, &HandleDebugBoundaryCommand, "" }, + { "raidreset", rbac::RBAC_PERM_COMMAND_INSTANCE_UNBIND, false, &HandleDebugRaidResetCommand, "" } }; static std::vector<ChatCommand> commandTable = { @@ -1442,6 +1443,32 @@ public: return true; } + + static bool HandleDebugRaidResetCommand(ChatHandler* /*handler*/, char const* args) + { + char* map_str = args ? strtok((char*)args, " ") : nullptr; + char* difficulty_str = args ? strtok(nullptr, " ") : nullptr; + + int32 map = map_str ? atoi(map_str) : -1; + if (map <= 0) + return false; + MapEntry const* mEntry = sMapStore.LookupEntry(map); + if (!mEntry || !mEntry->IsRaid()) + return false; + int32 difficulty = difficulty_str ? atoi(difficulty_str) : -1; + if (difficulty >= MAX_RAID_DIFFICULTY || difficulty < -1) + return false; + + if (difficulty == -1) + for (uint8 diff = 0; diff < MAX_RAID_DIFFICULTY; ++diff) + { + if (GetMapDifficultyData(mEntry->MapID, Difficulty(diff))) + sInstanceSaveMgr->ForceGlobalReset(mEntry->MapID, Difficulty(diff)); + } + else + sInstanceSaveMgr->ForceGlobalReset(mEntry->MapID, Difficulty(difficulty)); + return true; + } }; void AddSC_debug_commandscript() diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp index a53d1f00b54..d0325a317db 100644 --- a/src/server/scripts/Commands/cs_instance.cpp +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -82,7 +82,7 @@ public: { InstanceSave* save = itr->second.save; std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", itr->second.extendState == EXTEND_STATE_EXPIRED ? "expired" : itr->second.extendState == EXTEND_STATE_EXTENDED ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); counter++; } } @@ -98,7 +98,7 @@ public: { InstanceSave* save = itr->second.save; std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", "-", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); counter++; } } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index b48f0edec25..6386bb50e1a 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -16,8 +16,10 @@ */ #include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "InstanceScript.h" #include "magisters_terrace.h" +#include "EventMap.h" /* 0 - Selin Fireheart @@ -36,6 +38,8 @@ DoorData const doorData[] = { 0, 0, DOOR_TYPE_ROOM } // END }; +Position const KalecgosSpawnPos = { 164.3747f, -397.1197f, 2.151798f, 1.66219f }; + class instance_magisters_terrace : public InstanceMapScript { public: @@ -93,6 +97,10 @@ class instance_magisters_terrace : public InstanceMapScript case NPC_DELRISSA: DelrissaGUID = creature->GetGUID(); break; + case NPC_KALECGOS: + case NPC_HUMAN_KALECGOS: + KalecgosGUID = creature->GetGUID(); + break; default: break; } @@ -139,6 +147,25 @@ class instance_magisters_terrace : public InstanceMapScript } } + void ProcessEvent(WorldObject* obj, uint32 eventId) override + { + if (eventId == EVENT_SPAWN_KALECGOS) + if (!ObjectAccessor::GetCreature(*obj, KalecgosGUID) && Events.Empty()) + Events.ScheduleEvent(EVENT_SPAWN_KALECGOS, Minutes(1)); + } + + void Update(uint32 diff) override + { + Events.Update(diff); + + if (Events.ExecuteEvent() == EVENT_SPAWN_KALECGOS) + if (Creature* kalecgos = instance->SummonCreature(NPC_KALECGOS, KalecgosSpawnPos)) + { + kalecgos->GetMotionMaster()->MovePath(PATH_KALECGOS_FLIGHT, false); + kalecgos->AI()->Talk(SAY_KALECGOS_SPAWN); + } + } + bool SetBossState(uint32 type, EncounterState state) override { if (!InstanceScript::SetBossState(type, state)) @@ -177,10 +204,12 @@ class instance_magisters_terrace : public InstanceMapScript } protected: + EventMap Events; ObjectGuid SelinGUID; ObjectGuid DelrissaGUID; ObjectGuid KaelStatue[2]; ObjectGuid EscapeOrbGUID; + ObjectGuid KalecgosGUID; uint32 DelrissaDeathCount; }; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp index e216a024468..5b90ac8ccf4 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp @@ -31,7 +31,8 @@ EndContentData */ #include "ScriptedCreature.h" #include "ScriptedGossip.h" #include "Player.h" -#include "SpellInfo.h" +#include "magisters_terrace.h" +#include "EventMap.h" /*###### ## npc_kalecgos @@ -39,30 +40,29 @@ EndContentData */ enum Spells { - SPELL_TRANSFORM_TO_KAEL = 44670, + SPELL_KALECGOS_TRANSFORM = 44670, + SPELL_TRANSFORM_VISUAL = 24085, + SPELL_CAMERA_SHAKE = 44762, SPELL_ORB_KILL_CREDIT = 46307 }; -enum Creatures +enum MovementPoints { - NPC_KAEL = 24848 //human form entry + POINT_ID_PREPARE_LANDING = 6 }; -enum Misc +enum EventIds { - POINT_ID_LAND = 1 + EVENT_KALECGOS_TRANSFORM = 1, + EVENT_KALECGOS_LANDING = 2 }; -const float afKaelLandPoint[] = {225.045f, -276.236f, -5.434f}; - #define GOSSIP_ITEM_KAEL_1 "Who are you?" #define GOSSIP_ITEM_KAEL_2 "What can we do to assist you?" #define GOSSIP_ITEM_KAEL_3 "What brings you to the Sunwell?" #define GOSSIP_ITEM_KAEL_4 "You're not alone here?" #define GOSSIP_ITEM_KAEL_5 "What would Kil'jaeden want with a mortal woman?" -// This is friendly keal that appear after used Orb. -// If we assume DB handle summon, summon appear somewhere outside the platform where Orb is class npc_kalecgos : public CreatureScript { public: @@ -115,52 +115,46 @@ public: struct npc_kalecgosAI : public ScriptedAI { - npc_kalecgosAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - } + npc_kalecgosAI(Creature* creature) : ScriptedAI(creature) { } - void Initialize() + void MovementInform(uint32 type, uint32 pointId) override { - m_uiTransformTimer = 0; - } - - uint32 m_uiTransformTimer; - - void Reset() override - { - Initialize(); - - // we must assume he appear as dragon somewhere outside the platform of orb, and then move directly to here - if (me->GetEntry() != NPC_KAEL) - me->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]); - } - - void MovementInform(uint32 uiType, uint32 uiPointId) override - { - if (uiType != POINT_MOTION_TYPE) + if (type != WAYPOINT_MOTION_TYPE) return; - if (uiPointId == POINT_ID_LAND) - m_uiTransformTimer = MINUTE*IN_MILLISECONDS; + if (pointId == POINT_ID_PREPARE_LANDING) + { + me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + me->SetDisableGravity(false); + me->SetHover(false); + events.ScheduleEvent(EVENT_KALECGOS_LANDING, Seconds(2)); + } } - void UpdateAI(uint32 uiDiff) override + void UpdateAI(uint32 diff) override { - if (m_uiTransformTimer) + events.Update(diff); + + switch (events.ExecuteEvent()) { - if (m_uiTransformTimer <= uiDiff) - { + case EVENT_KALECGOS_LANDING: + DoCastAOE(SPELL_CAMERA_SHAKE); + me->SetObjectScale(0.6f); + events.ScheduleEvent(EVENT_KALECGOS_TRANSFORM, Seconds(1)); + break; + case EVENT_KALECGOS_TRANSFORM: DoCast(me, SPELL_ORB_KILL_CREDIT, true); - - // Transform and update entry, now ready for quest/read gossip - DoCast(me, SPELL_TRANSFORM_TO_KAEL, false); - me->UpdateEntry(NPC_KAEL); - - m_uiTransformTimer = 0; - } else m_uiTransformTimer -= uiDiff; + DoCast(me, SPELL_TRANSFORM_VISUAL, false); + DoCast(me, SPELL_KALECGOS_TRANSFORM, false); + me->UpdateEntry(NPC_HUMAN_KALECGOS); + break; + default: + break; } } + + private: + EventMap events; }; }; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h index 917ad0eb50b..05718dfc1dd 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h @@ -42,7 +42,9 @@ enum CreatureIds { NPC_SELIN = 24723, NPC_DELRISSA = 24560, - NPC_FEL_CRYSTAL = 24722 + NPC_FEL_CRYSTAL = 24722, + NPC_KALECGOS = 24844, + NPC_HUMAN_KALECGOS = 24848 }; enum GameObjectIds @@ -57,4 +59,19 @@ enum GameObjectIds GO_ESCAPE_ORB = 188173 }; +enum InstanceEventIds +{ + EVENT_SPAWN_KALECGOS = 16547 +}; + +enum InstanceText +{ + SAY_KALECGOS_SPAWN = 0 +}; + +enum MovementData +{ + PATH_KALECGOS_FLIGHT = 248440 +}; + #endif diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index c0b4e06cfff..99556587e65 100644 --- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -157,7 +157,7 @@ public: { if (Creature* target = ObjectAccessor::GetCreature(*summoned, targetGUID)) { - target->GetMotionMaster()->MoveJump(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ() + 15.0f, 0); + target->GetMotionMaster()->MoveJump(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ() + 15.0f, me->GetOrientation(), 0); target->SetPosition(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f); summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } diff --git a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp index b1a00f35bb5..a01b93a140b 100644 --- a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp @@ -25,7 +25,6 @@ EndScriptData */ /* ContentData npcs_dithers_and_arbington -npc_myranda_the_hag npc_the_scourge_cauldron npc_andorhal_tower EndContentData */ @@ -33,7 +32,6 @@ EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" #include "Player.h" #include "WorldSession.h" @@ -120,54 +118,6 @@ public: }; /*###### -## npc_myranda_the_hag -######*/ - -enum Myranda -{ - ILLUSION_GOSSIP = 4773, - QUEST_SUBTERFUGE = 5862, - QUEST_IN_DREAMS = 5944, - SPELL_SCARLET_ILLUSION = 17961 -}; - -class npc_myranda_the_hag : public CreatureScript -{ -public: - npc_myranda_the_hag() : CreatureScript("npc_myranda_the_hag") { } - - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) override - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_SCARLET_ILLUSION, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_SUBTERFUGE) == QUEST_STATUS_COMPLETE && - player->GetQuestStatus(QUEST_IN_DREAMS) != QUEST_STATUS_COMPLETE && - !player->HasAura(SPELL_SCARLET_ILLUSION)) - { - player->ADD_GOSSIP_ITEM_DB(Player::GetDefaultGossipMenuForSource(creature), 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(ILLUSION_GOSSIP, creature->GetGUID()); - return true; - } - else - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -/*###### ## npc_the_scourge_cauldron ######*/ @@ -195,7 +145,7 @@ public: me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); //override any database `spawntimesecs` to prevent duplicated summons uint32 rTime = me->GetRespawnDelay(); - if (rTime<600) + if (rTime < 600) me->SetRespawnDelay(600); } @@ -274,7 +224,6 @@ public: } void MoveInLineOfSight(Unit* who) override - { if (!who || who->GetTypeId() != TYPEID_PLAYER) return; @@ -286,14 +235,9 @@ public: }; }; -/*###### -## -######*/ - void AddSC_western_plaguelands() { new npcs_dithers_and_arbington(); - new npc_myranda_the_hag(); new npc_the_scourge_cauldron(); new npc_andorhal_tower(); } diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp index fb5642c6f3b..84d7d92acfe 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp @@ -135,9 +135,9 @@ class boss_general_zarithrian : public CreatureScript Talk(SAY_KILL); } - bool CanAIAttack(Unit const* /*target*/) const override + bool CanAIAttack(Unit const* target) const override { - return (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE); + return (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE && BossAI::CanAIAttack(target)); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 1e860fb6ec5..6c1b516c7de 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -461,13 +461,13 @@ class boss_toc_champion_controller : public CreatureScript if (playerTeam == ALLIANCE) { temp->SetHomePosition(vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 0); - temp->GetMotionMaster()->MoveJump(vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 20.0f, 20.0f); + temp->GetMotionMaster()->MoveJump(vChampionJumpTarget[pos], 20.0f, 20.0f); temp->SetOrientation(0); } else { temp->SetHomePosition((ToCCommonLoc[1].GetPositionX()*2)-vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 3); - temp->GetMotionMaster()->MoveJump((ToCCommonLoc[1].GetPositionX()*2)-vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 20.0f, 20.0f); + temp->GetMotionMaster()->MoveJump((ToCCommonLoc[1].GetPositionX() * 2) - vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), vChampionJumpTarget[pos].GetOrientation(), 20.0f, 20.0f); temp->SetOrientation(3); } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 83daa6e35a2..e3720503d0a 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -390,7 +390,7 @@ class npc_snobold_vassal : public CreatureScript else if (Unit* target2 = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) { _targetGUID = target2->GetGUID(); - me->GetMotionMaster()->MoveJump(target2->GetPositionX(), target2->GetPositionY(), target2->GetPositionZ(), 15.0f, 15.0f); + me->GetMotionMaster()->MoveJump(*target2, 15.0f, 15.0f); } } } @@ -981,7 +981,7 @@ class boss_icehowl : public CreatureScript events.ScheduleEvent(EVENT_WHIRL, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS)); return; case EVENT_MASSIVE_CRASH: - me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 20.0f, 20.0f, 0); // 1: Middle of the room + me->GetMotionMaster()->MoveJump(ToCCommonLoc[1], 20.0f, 20.0f, 0); // 1: Middle of the room SetCombatMovement(false); me->AttackStop(); _stage = 7; //Invalid (Do nothing more than move) @@ -1034,7 +1034,7 @@ class boss_icehowl : public CreatureScript _trampleTargetY = target->GetPositionY(); _trampleTargetZ = target->GetPositionZ(); // 2: Hop Backwards - me->GetMotionMaster()->MoveJump(2*me->GetPositionX() - _trampleTargetX, 2*me->GetPositionY() - _trampleTargetY, me->GetPositionZ(), 30.0f, 20.0f, 0); + me->GetMotionMaster()->MoveJump(2*me->GetPositionX() - _trampleTargetX, 2*me->GetPositionY() - _trampleTargetY, me->GetPositionZ(), me->GetOrientation(), 30.0f, 20.0f, 0); _stage = 7; //Invalid (Do nothing more than move) } else diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 7e9083115b8..3ea0de31764 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -598,7 +598,7 @@ class boss_deathbringer_saurfang : public CreatureScript if (target->GetTransport()) return false; - return true; + return BossAI::CanAIAttack(target); } static uint32 const FightWonValue; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index da028aad643..9fa624aaad3 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -580,7 +580,7 @@ class boss_the_lich_king : public CreatureScript bool CanAIAttack(Unit const* target) const override { // The Lich King must not select targets in frostmourne room if he killed everyone outside - return !target->HasAura(SPELL_IN_FROSTMOURNE_ROOM); + return !target->HasAura(SPELL_IN_FROSTMOURNE_ROOM) && BossAI::CanAIAttack(target); } void EnterEvadeMode(EvadeReason /*why*/) override diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 81f1e071da0..be12894ebea 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -375,8 +375,12 @@ class boss_gothik : public CreatureScript _gateIsOpen = true; for (ObjectGuid summonGuid : summons) + { if (Creature* summon = ObjectAccessor::GetCreature(*me, summonGuid)) summon->AI()->DoAction(ACTION_GATE_OPENED); + if (summons.empty()) // ACTION_GATE_OPENED may cause an evade, despawning summons and invalidating our iterator + break; + } } void DamageTaken(Unit* /*who*/, uint32& damage) override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 01c4704592f..6dfc3bf01e7 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1768,9 +1768,7 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader else { passenger->ExitVehicle(); - float x, y, z; - targets.GetDstPos()->GetPosition(x, y, z); - passenger->GetMotionMaster()->MoveJump(x, y, z, targets.GetSpeedXY(), targets.GetSpeedZ()); + passenger->GetMotionMaster()->MoveJump(*targets.GetDstPos(), targets.GetSpeedXY(), targets.GetSpeedZ()); } } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index f435c669935..e694433c614 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -444,7 +444,7 @@ class boss_mimiron : public CreatureScript DoCastAOE(SPELL_DESPAWN_ASSAULT_BOTS); me->ExitVehicle(); // ExitVehicle() offset position is not implemented, so we make up for that with MoveJump()... - me->GetMotionMaster()->MoveJump(me->GetPositionX() + (10.f * std::cos(me->GetOrientation())), me->GetPositionY() + (10.f * std::sin(me->GetOrientation())), me->GetPositionZ(), 10.f, 5.f); + me->GetMotionMaster()->MoveJump(me->GetPositionX() + (10.f * std::cos(me->GetOrientation())), me->GetPositionY() + (10.f * std::sin(me->GetOrientation())), me->GetPositionZ(), me->GetOrientation(), 10.f, 5.f); events.ScheduleEvent(EVENT_OUTTRO_1, 7000); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 77b376bf7d5..d7b65093898 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -238,7 +238,7 @@ public: me->SetInCombatWithZone(); instance->SetBossState(DATA_SKADI_THE_RUTHLESS, IN_PROGRESS); instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); - me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f); + me->GetMotionMaster()->MoveJump(Location[0], 5.0f, 10.0f); me->SetWalk(false); m_uiMountTimer = 1000; Summons.DespawnEntry(NPC_GRAUF); @@ -289,7 +289,7 @@ public: pGrauf->GetMotionMaster()->MoveFall(); pGrauf->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); } - me->GetMotionMaster()->MoveJump(Location[4].GetPositionX(), Location[4].GetPositionY(), Location[4].GetPositionZ(), 5.0f, 10.0f); + me->GetMotionMaster()->MoveJump(Location[4], 5.0f, 10.0f); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); Talk(SAY_DRAKE_DEATH); m_uiCrushTimer = 8000; diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp index 14d862eca39..68121e940c9 100644 --- a/src/server/scripts/Northrend/isle_of_conquest.cpp +++ b/src/server/scripts/Northrend/isle_of_conquest.cpp @@ -206,7 +206,7 @@ class spell_ioc_parachute_ic : public SpellScriptLoader class StartLaunchEvent : public BasicEvent { public: - StartLaunchEvent(float x, float y, float z, ObjectGuid::LowType lowGuid) : _x(x), _y(y), _z(z), _lowGuid(lowGuid) + StartLaunchEvent(Position const& pos, ObjectGuid::LowType lowGuid) : _pos(pos), _lowGuid(lowGuid) { } @@ -218,15 +218,15 @@ class StartLaunchEvent : public BasicEvent player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage float speedZ = 10.0f; - float dist = player->GetExactDist2d(_x, _y); + float dist = player->GetExactDist2d(&_pos); player->ExitVehicle(); - player->GetMotionMaster()->MoveJump(_x, _y, _z, dist, speedZ); + player->GetMotionMaster()->MoveJump(_pos, dist, speedZ, EVENT_JUMP, true); return true; } private: - float _x, _y, _z; + Position _pos; ObjectGuid::LowType _lowGuid; }; @@ -244,11 +244,7 @@ class spell_ioc_launch : public SpellScriptLoader if (!GetCaster()->ToCreature() || !GetExplTargetDest()) return; - float x, y, z; - x = GetExplTargetDest()->GetPositionX(); - y = GetExplTargetDest()->GetPositionY(); - z = GetExplTargetDest()->GetPositionZ(); - GetCaster()->ToCreature()->m_Events.AddEvent(new StartLaunchEvent(x, y, z, GetHitPlayer()->GetGUID().GetCounter()), GetCaster()->ToCreature()->m_Events.CalculateTime(2500)); + GetCaster()->ToCreature()->m_Events.AddEvent(new StartLaunchEvent(*GetExplTargetDest(), GetHitPlayer()->GetGUID().GetCounter()), GetCaster()->ToCreature()->m_Events.CalculateTime(2500)); } void Register() override diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index e5812390bd2..be27932e6b4 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -144,6 +144,7 @@ enum Spells // Thaladred the Darkener spells SPELL_PSYCHIC_BLOW = 10689, SPELL_SILENCE = 30225, + SPELL_REND = 36965, // Lord Sanguinar spells SPELL_BELLOWING_ROAR = 40636, // Grand Astromancer Capernian spells @@ -881,11 +882,13 @@ class boss_thaladred_the_darkener : public CreatureScript { Gaze_Timer = 100; Silence_Timer = 20000; + Rend_Timer = 4000; PsychicBlow_Timer = 10000; } uint32 Gaze_Timer; uint32 Silence_Timer; + uint32 Rend_Timer; uint32 PsychicBlow_Timer; void Reset() override @@ -939,6 +942,15 @@ class boss_thaladred_the_darkener : public CreatureScript else Silence_Timer -= diff; + //Rend_Timer + if (Rend_Timer <= diff) + { + DoCastVictim(SPELL_REND); + Rend_Timer = 4000; + } + else + Rend_Timer -= diff; + //PsychicBlow_Timer if (PsychicBlow_Timer <= diff) { diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 7b853c36075..c088ae07e66 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -991,6 +991,37 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader } }; +// -33943 - Flight Form +class spell_dru_flight_form : public SpellScriptLoader +{ + public: + spell_dru_flight_form() : SpellScriptLoader("spell_dru_flight_form") { } + + class spell_dru_flight_form_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dru_flight_form_SpellScript); + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (caster->IsInDisallowedMountForm()) + return SPELL_FAILED_NOT_SHAPESHIFT; + + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_dru_flight_form_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_dru_flight_form_SpellScript(); + } +}; + // -5217 - Tiger's Fury class spell_dru_tiger_s_fury : public SpellScriptLoader { @@ -1196,6 +1227,7 @@ void AddSC_druid_spell_scripts() new spell_dru_starfall_dummy(); new spell_dru_survival_instincts(); new spell_dru_swift_flight_passive(); + new spell_dru_flight_form(); new spell_dru_tiger_s_fury(); new spell_dru_typhoon(); new spell_dru_t10_restoration_4p_bonus(); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 3ca2db40d65..9b577d4e140 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -41,6 +41,9 @@ enum RogueSpells SPELL_ROGUE_SHIV_TRIGGERED = 5940, SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST = 57933, SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC = 59628, + SPELL_ROGUE_HONOR_AMONG_THIEVES = 51698, + SPELL_ROGUE_HONOR_AMONG_THIEVES_PROC = 52916, + SPELL_ROGUE_HONOR_AMONG_THIEVES_2 = 51699 }; // 13877, 33735, (check 51211, 65956) - Blade Flurry @@ -703,6 +706,143 @@ class spell_rog_tricks_of_the_trade_proc : public SpellScriptLoader } }; +// 51698,51700,51701 - Honor Among Thieves +class spell_rog_honor_among_thieves : public SpellScriptLoader +{ +public: + spell_rog_honor_among_thieves() : SpellScriptLoader("spell_rog_honor_among_thieves") { } + + class spell_rog_honor_among_thieves_AuraScript : public AuraScript + { + PrepareAuraScript(spell_rog_honor_among_thieves_AuraScript); + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + Unit* caster = GetCaster(); + if (!caster) + return false; + + if (!caster->GetSpellHistory()->HasCooldown(GetSpellInfo()->Effects[EFFECT_0].TriggerSpell)) + return true; + + return false; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + + Unit* caster = GetCaster(); + if (!caster) + return; + + Unit* target = GetTarget(); + target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD), nullptr, aurEff, caster->GetGUID()); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_rog_honor_among_thieves_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_rog_honor_among_thieves_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_rog_honor_among_thieves_AuraScript(); + } +}; + +// 52916 - Honor Among Thieves (Proc) +class spell_rog_honor_among_thieves_proc : public SpellScriptLoader +{ +public: + spell_rog_honor_among_thieves_proc() : SpellScriptLoader("spell_rog_honor_among_thieves_proc") { } + + class spell_rog_honor_among_thieves_proc_SpellScript : public SpellScript + { + PrepareSpellScript(spell_rog_honor_among_thieves_proc_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_HONOR_AMONG_THIEVES_PROC)) + return false; + + return true; + } + + void FilterTargets(std::list<WorldObject*>& targets) + { + targets.clear(); + + Unit* target = GetOriginalCaster(); + if (!target) + return; + + targets.push_back(target); + } + + void HandleBeforeHit() + { + Unit* target = GetHitUnit(); + if (!target) + return; + + /* + * The applied aura has a duration of 8 seconds + * This prevents new applications while its active + * Removing it on each new proc enables the application from different sources (different grouped players) + * and on new procs after the source cooldown is finished (1 second) + */ + if (target->HasAura(GetSpellInfo()->Id)) + target->RemoveAura(GetSpellInfo()->Id); + } + + void TriggerCooldown() + { + Unit* target = GetHitUnit(); + if (!target) + return; + + target->GetSpellHistory()->AddCooldown(GetSpellInfo()->Id, 0, std::chrono::seconds(1)); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rog_honor_among_thieves_proc_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); + BeforeHit += SpellHitFn(spell_rog_honor_among_thieves_proc_SpellScript::HandleBeforeHit); + AfterHit += SpellHitFn(spell_rog_honor_among_thieves_proc_SpellScript::TriggerCooldown); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_rog_honor_among_thieves_proc_SpellScript(); + } + + class spell_rog_honor_among_thieves_proc_AuraScript : public AuraScript + { + PrepareAuraScript(spell_rog_honor_among_thieves_proc_AuraScript); + + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Player* player = GetTarget()->ToPlayer()) + if (Unit* spellTarget = ObjectAccessor::GetUnit(*player, player->GetTarget())) + player->CastSpell(spellTarget, SPELL_ROGUE_HONOR_AMONG_THIEVES_2, true); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_rog_honor_among_thieves_proc_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_rog_honor_among_thieves_proc_AuraScript(); + } +}; + void AddSC_rogue_spell_scripts() { new spell_rog_blade_flurry(); @@ -716,4 +856,6 @@ void AddSC_rogue_spell_scripts() new spell_rog_shiv(); new spell_rog_tricks_of_the_trade(); new spell_rog_tricks_of_the_trade_proc(); + new spell_rog_honor_among_thieves(); + new spell_rog_honor_among_thieves_proc(); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 56d48949fac..80b4fac4333 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -39,6 +39,7 @@ npc_shadowfiend 100% restore 5% of owner's mana when shadowfiend die f npc_locksmith 75% list of keys needs to be confirmed npc_firework 100% NPC's summoned by rockets and rocket clusters, for making them cast visual npc_train_wrecker 100% Wind-Up Train Wrecker that kills train set +npc_egbert 100% Egbert run's around EndContentData */ #include "ScriptMgr.h" @@ -2192,7 +2193,7 @@ public: // Check if we are near Elune'ara lake south, if so try to summon Omen or a minion if (me->GetZoneId() == ZONE_MOONGLADE) { - if (!me->FindNearestCreature(NPC_OMEN, 100.0f, false) && me->GetDistance2d(omenSummonPos.GetPositionX(), omenSummonPos.GetPositionY()) <= 100.0f) + if (!me->FindNearestCreature(NPC_OMEN, 100.0f) && me->GetDistance2d(omenSummonPos.GetPositionX(), omenSummonPos.GetPositionY()) <= 100.0f) { switch (urand(0, 9)) { @@ -2574,8 +2575,8 @@ class npc_train_wrecker : public CreatureScript enum EgbertMisc { - EVENT_MOVE_POS = 1, - EVENT_RETURN = 2 + SPELL_EGBERT = 40669, + EVENT_RETURN = 3 }; class npc_egbert : public CreatureScript @@ -2583,9 +2584,9 @@ class npc_egbert : public CreatureScript public: npc_egbert() : CreatureScript("npc_egbert") {} - struct npc_egbertAI : public PetAI + struct npc_egbertAI : public NullCreatureAI { - npc_egbertAI(Creature* creature) : PetAI(creature) + npc_egbertAI(Creature* creature) : NullCreatureAI(creature) { if (Unit* owner = me->GetCharmerOrOwner()) if (owner->GetMap()->GetEntry()->addon > 1) @@ -2595,29 +2596,40 @@ public: void Reset() override { _events.Reset(); - _events.ScheduleEvent(EVENT_MOVE_POS, urandms(1, 20)); + if (Unit* owner = me->GetCharmerOrOwner()) + me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); + } + + void EnterEvadeMode(EvadeReason why) override + { + if (!_EnterEvadeMode(why)) + return; + + Reset(); } void UpdateAI(uint32 diff) override { _events.Update(diff); + if (Unit* owner = me->GetCharmerOrOwner()) + { + if (!me->IsWithinDist(owner, 40.f)) + { + me->RemoveAura(SPELL_EGBERT); + me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); + } + } + + if (me->HasAura(SPELL_EGBERT)) + _events.ScheduleEvent(EVENT_RETURN, urandms(5, 20)); + while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { - case EVENT_MOVE_POS: - if (Unit* owner = me->GetCharmerOrOwner()) - { - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(0, owner->GetPositionX() + frand(-30.0f, 30.0f), owner->GetPositionY() + frand(-30.0f, 30.0f), owner->GetPositionZ()); - } - _events.ScheduleEvent(EVENT_RETURN, urandms(3, 4)); - break; case EVENT_RETURN: - if (Unit* owner = me->GetCharmerOrOwner()) - me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); - _events.ScheduleEvent(EVENT_MOVE_POS, urandms(1, 20)); + me->RemoveAura(SPELL_EGBERT); break; default: break; diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 3694a2f9d41..f3a761fd437 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -257,7 +257,7 @@ void ReadLiquidTypeTableDBC() // Map file format data static char const* MAP_MAGIC = "MAPS"; -static char const* MAP_VERSION_MAGIC = "v1.7"; +static char const* MAP_VERSION_MAGIC = "v1.8"; static char const* MAP_AREA_MAGIC = "AREA"; static char const* MAP_HEIGHT_MAGIC = "MHGT"; static char const* MAP_LIQUID_MAGIC = "MLIQ"; @@ -348,8 +348,8 @@ uint8 liquid_flags[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE]; float liquid_height[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; -float flight_box_max[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; -float flight_box_min[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; +int16 flight_box_max[3][3]; +int16 flight_box_min[3][3]; bool ConvertADT(std::string const& inputPath, std::string const& outputPath, int /*cell_y*/, int /*cell_x*/, uint32 build) { @@ -529,76 +529,8 @@ bool ConvertADT(std::string const& inputPath, std::string const& outputPath, int bool hasFlightBox = false; if (adt_MFBO* mfbo = adt.a_grid->getMFBO()) { - static uint32 const indices[] = - { - 3, 0, 4, - 0, 1, 4, - 1, 2, 4, - 2, 5, 4, - 5, 8, 4, - 8, 7, 4, - 7, 6, 4, - 6, 3, 4 - }; - - static float const boundGridCoords[] = - { - 0.0f, 0.0f, - 0.0f, -266.66666f, - 0.0f, -533.33331f, - -266.66666f, 0.0f, - -266.66666f, -266.66666f, - -266.66666f, -533.33331f, - -533.33331f, 0.0f, - -533.33331f, -266.66666f, - -533.33331f, -533.33331f - }; - - for (int gy = 0; gy < ADT_CELLS_PER_GRID; ++gy) - { - for (int gx = 0; gx < ADT_CELLS_PER_GRID; ++gx) - { - int32 quarterIndex = 0; - if (gy > ADT_CELLS_PER_GRID / 2) - { - if (gx > ADT_CELLS_PER_GRID / 2) - { - quarterIndex = 4 + gx < gy; - } - else - quarterIndex = 2; - } - else if (gx > ADT_CELLS_PER_GRID / 2) - { - quarterIndex = 7; - } - else - quarterIndex = gx > gy; - - quarterIndex *= 3; - G3D::Plane planeMax( - G3D::Vector3(boundGridCoords[indices[quarterIndex + 0] * 2 + 0], boundGridCoords[indices[quarterIndex + 0] * 2 + 1], mfbo->max.coords[indices[quarterIndex + 0]]), - G3D::Vector3(boundGridCoords[indices[quarterIndex + 1] * 2 + 0], boundGridCoords[indices[quarterIndex + 1] * 2 + 1], mfbo->max.coords[indices[quarterIndex + 1]]), - G3D::Vector3(boundGridCoords[indices[quarterIndex + 2] * 2 + 0], boundGridCoords[indices[quarterIndex + 2] * 2 + 1], mfbo->max.coords[indices[quarterIndex + 2]]) - ); - - G3D::Plane planeMin( - G3D::Vector3(boundGridCoords[indices[quarterIndex + 0] * 2 + 0], boundGridCoords[indices[quarterIndex + 0] * 2 + 1], mfbo->min.coords[indices[quarterIndex + 0]]), - G3D::Vector3(boundGridCoords[indices[quarterIndex + 1] * 2 + 0], boundGridCoords[indices[quarterIndex + 1] * 2 + 1], mfbo->min.coords[indices[quarterIndex + 1]]), - G3D::Vector3(boundGridCoords[indices[quarterIndex + 2] * 2 + 0], boundGridCoords[indices[quarterIndex + 2] * 2 + 1], mfbo->min.coords[indices[quarterIndex + 2]]) - ); - - auto non_nan_distance = [](G3D::Plane const& plane) { - auto d = plane.distance(G3D::Vector3(0.0f, 0.0f, 0.0f)); - assert(!G3D::isNaN(d)); - return d; - }; - - flight_box_max[gy][gx] = non_nan_distance(planeMax); - flight_box_min[gy][gx] = non_nan_distance(planeMin); - } - } - + memcpy(flight_box_max, &mfbo->max, sizeof(flight_box_max)); + memcpy(flight_box_min, &mfbo->min, sizeof(flight_box_min)); hasFlightBox = true; } diff --git a/src/tools/mmaps_generator/TerrainBuilder.cpp b/src/tools/mmaps_generator/TerrainBuilder.cpp index 70ab7fca0c9..69b1ffcb062 100644 --- a/src/tools/mmaps_generator/TerrainBuilder.cpp +++ b/src/tools/mmaps_generator/TerrainBuilder.cpp @@ -80,7 +80,7 @@ struct map_liquidHeader namespace MMAP { - char const* MAP_VERSION_MAGIC = "v1.7"; + char const* MAP_VERSION_MAGIC = "v1.8"; TerrainBuilder::TerrainBuilder(bool skipLiquid) : m_skipLiquid (skipLiquid){ } TerrainBuilder::~TerrainBuilder() { } |