diff options
370 files changed, 8105 insertions, 2522 deletions
diff --git a/.gitignore b/.gitignore index 5bceef179b9..ace64225d0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ + build*/ .directory .mailmap @@ -9,3 +10,7 @@ build*/ *.bak *.patch *.diff +*.REMOTE.* +*.BACKUP.* +*.BASE.* +*.LOCAL.*
\ No newline at end of file diff --git a/cmake/macros/FindMySQL.cmake b/cmake/macros/FindMySQL.cmake index d42dc5caf74..036b8302c75 100644 --- a/cmake/macros/FindMySQL.cmake +++ b/cmake/macros/FindMySQL.cmake @@ -72,19 +72,20 @@ find_path(MYSQL_INCLUDE_DIR /usr/local/include /usr/local/include/mysql /usr/local/mysql/include - "C:/Program Files/MySQL/include" - "C:/Program Files/MySQL/MySQL Server 5.0/include" - "C:/Program Files/MySQL/MySQL Server 5.1/include" "C:/Program Files/MySQL/MySQL Server 5.6/include" + "C:/Program Files/MySQL/MySQL Server 5.5/include" + "C:/Program Files/MySQL/MySQL Server 5.1/include" + "C:/Program Files/MySQL/MySQL Server 5.0/include" + "C:/Program Files/MySQL/include" "C:/MySQL/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.5;Location]/include" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.5;Location]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/include" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/include" "$ENV{ProgramFiles}/MySQL/*/include" "$ENV{SystemDrive}/MySQL/*/include" "c:/msys/local/include" @@ -115,20 +116,28 @@ if( WIN32 ) libmysql PATHS ${MYSQL_ADD_LIBRARIES_PATH} - "C:/Program Files/MySQL/lib" - "C:/Program Files/MySQL/MySQL Server 5.0/lib/opt" - "C:/Program Files/MySQL/MySQL Server 5.1/lib/opt" "C:/Program Files/MySQL/MySQL Server 5.6/lib/opt" + "C:/Program Files/MySQL/MySQL Server 5.5/lib/opt" + "C:/Program Files/MySQL/MySQL Server 5.1/lib/opt" + "C:/Program Files/MySQL/MySQL Server 5.0/lib/opt" + "C:/Program Files/MySQL/lib" "C:/MySQL/lib/debug" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib/opt" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.5;Location]/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.5;Location]/lib/opt" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/lib/opt" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/lib/opt" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt" "$ENV{ProgramFiles}/MySQL/*/lib/opt" "$ENV{SystemDrive}/MySQL/*/lib/opt" "c:/msys/local/include" diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 4e81308119f..f02ae80e472 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1946,6 +1946,30 @@ LOCK TABLES `lag_reports` WRITE; UNLOCK TABLES; -- +-- Table structure for table `lfg_data` +-- + +DROP TABLE IF EXISTS `lfg_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `lfg_data` ( + `guid` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `dungeon` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `state` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`) +) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT='LFG Data'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `lfg_data` +-- + +LOCK TABLES `lfg_data` WRITE; +/*!40000 ALTER TABLE `lfg_data` DISABLE KEYS */; +/*!40000 ALTER TABLE `lfg_data` ENABLE KEYS */; +UNLOCK TABLES; + +-- -- Table structure for table `mail` -- diff --git a/sql/old/3.3.5a/2011_11_21_01_pilgrim_achievement_reward.sql b/sql/old/3.3.5a/2011_11_21_01_world_pilgrim_achievement_reward.sql index 7083107a8c2..7083107a8c2 100644 --- a/sql/old/3.3.5a/2011_11_21_01_pilgrim_achievement_reward.sql +++ b/sql/old/3.3.5a/2011_11_21_01_world_pilgrim_achievement_reward.sql diff --git a/sql/old/3.3.5a/2011_11_21_02_pilgrim_achievement_criteria_data.sql b/sql/old/3.3.5a/2011_11_21_02_world_pilgrim_achievement_criteria_data.sql index 589dbb0b2a4..589dbb0b2a4 100644 --- a/sql/old/3.3.5a/2011_11_21_02_pilgrim_achievement_criteria_data.sql +++ b/sql/old/3.3.5a/2011_11_21_02_world_pilgrim_achievement_criteria_data.sql diff --git a/sql/old/3.3.5a/2011_11_21_03_pilgrim_misc.sql b/sql/old/3.3.5a/2011_11_21_03_world_pilgrim_misc.sql index 6547fe9a53a..6547fe9a53a 100644 --- a/sql/old/3.3.5a/2011_11_21_03_pilgrim_misc.sql +++ b/sql/old/3.3.5a/2011_11_21_03_world_pilgrim_misc.sql diff --git a/sql/old/3.3.5a/2011_11_21_04_pilgrim_misc.sql b/sql/old/3.3.5a/2011_11_21_04_world_pilgrim_misc.sql index 194c084ebc5..194c084ebc5 100644 --- a/sql/old/3.3.5a/2011_11_21_04_pilgrim_misc.sql +++ b/sql/old/3.3.5a/2011_11_21_04_world_pilgrim_misc.sql diff --git a/sql/old/3.3.5a/2011_11_21_05_pilgrim_tables.sql b/sql/old/3.3.5a/2011_11_21_05_world_pilgrim_tables.sql index 18881e14eaf..18881e14eaf 100644 --- a/sql/old/3.3.5a/2011_11_21_05_pilgrim_tables.sql +++ b/sql/old/3.3.5a/2011_11_21_05_world_pilgrim_tables.sql diff --git a/sql/updates/characters/2012_01_23_00_characters_character_queststatus_rewarded.sql b/sql/updates/characters/2012_01_23_00_characters_character_queststatus_rewarded.sql new file mode 100644 index 00000000000..d81cf3a6617 --- /dev/null +++ b/sql/updates/characters/2012_01_23_00_characters_character_queststatus_rewarded.sql @@ -0,0 +1 @@ +DELETE FROM `character_queststatus_rewarded` WHERE `quest` IN (8619,8635,8636,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8688,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8862,8863,8864,8865,8866,8867,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,13012,13013,13014,13015,13016,13017,13018,13019,13020,13021,13022,13023,13024,13025,13026,13027,13028,13029,13030,13031,13032,13033,13065,13066,13067,11120,11431,11442,11409,11318,11117,11400,11419,11118,11122,11293,11294,11321,11407,11408,11412,11413,11441,11446,11454,11486,11487,12020,12022,12318,12193,12062,12491,11447,12191,12492,12194,12192,12278,12306,12420,12421,13932,13649,13931,11127,11320,11347,11437,11438,11444,11445,9319,9322,9323,9324,9325,9326,9330,9331,9332,9339,9365,9367,9368,9386,9388,9389,11657,11691,11731,11882,11883,11886,11891,11915,11917,11921,11922,11923,11924,11925,11926,11933,11935,11947,11948,11952,11953,11954,11955,11964,11966,11970,11971,11972,12012,14022,114023,114024,114028,114030,114033,114036,114037,114040,114041,114043,114044,114064,114065,114035,114047,114048,114051,114053,114054,114055,114058,114059,114060,114061,114062,114488,24597,24609,24656,24657,24745,24848,24849,24666,24792,24804,24611,24536,24612,24635,24636,24655,24610,24629,24614,24576,24613,24615,24638,24645,24647,24648,24649,24650,24651,24652,24658,24659,24660,24662,24663,24664,24665,24793,24805,24850,24851,24541,14483,24661,1657,1658,6961,6962,6963,6964,6983,6984,7021,7022,7023,7024,7025,7042,7043,7045,7061,7062,7063,8149,8150,8311,8312,8322,8353,8354,8355,8356,8357,8358,8359,8360,8373,8409,8744,8746,8762,8763,8767,8768,8769,8788,8799,8803,8827,8828,8860,8861,8868,8897,8898,8899,8900,8901,8902,8903,8904,8971,8972,8973,8974,8975,8976,8979,8980,8981,8982,8983,8984,8993,9024,9025,9026,9027,9028,11131,11135,11219,11220,11242,11356,11357,11360,11361,11392,11401,11403,11404,11405,11435,11439,11440,11449,11450,11528,11558,11580,11581,11583,11584,11696,11732,11734,11735,11736,11737,11738,11739,11740,11741,11742,11743,11744,11745,11746,11747,11748,11749,11750,11751,11752,11753,11754,11755,11756,11757,11758,11759,11760,11761,11762,11763,11764,11765,11766,11767,11768,11769,11770,11771,11772,11773,11774,11775,11776,11777,11778,11779,11780,11781,11782,11783,11784,11785,11786,11787,11799,11800,11801,11802,11803,11804,11805,11806,11807,11808,11809,11810,11811,11812,11813,11814,11815,11816,11817,11818,11819,11820,11821,11822,11823,11824,11825,11826,11827,11828,11829,11830,11831,11832,11833,11834,11835,11836,11837,11838,11839,11840,11841,11842,11843,11844,11845,11846,11847,11848,11849,11850,11851,11852,11853,11854,11855,11856,11857,11858,11859,11860,11861,11862,11863,11937,11976,12133,12135,12139,12155,12286,12313,12331,12332,12333,12334,12335,12336,12337,12338,12339,12340,12341,12342,12343,12344,12345,12346,12347,12348,12349,12350,12351,12352,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12940,12941,12944,12945,12946,12947,12950,13203,13433,13434,13435,13436,13437,13438,13439,13440,13441,13442,13443,13444,13445,13446,13447,13448,13449,13450,13451,13452,13453,13454,13455,13456,13457,13458,13459,13460,13461,13462,13463,13464,13465,13466,13467,13468,13469,13470,13471,13472,13473,13474,13485,13486,13487,13488,13489,13490,13491,13492,13493,13494,13495,13496,13497,13498,13499,13500,13501,13548,13966); diff --git a/sql/updates/world/2012_01_12_00_world_sai.sql b/sql/updates/world/2012_01_12_00_world_sai.sql index 1833479eaf1..6acbd0bd293 100644 --- a/sql/updates/world/2012_01_12_00_world_sai.sql +++ b/sql/updates/world/2012_01_12_00_world_sai.sql @@ -6,7 +6,7 @@ SET @ENTRY := 9521; SET @SPELL_POISON := 744; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,0,0,100,0,2000,5000,12000,15000,11,@SPELL_POISON,1,0,0,0,0,2,0,0,0,0,0,0,0,"Enraged Felbat - In Combat - Cast Poison"); @@ -15,7 +15,7 @@ SET @ENTRY := 9526; SET @SPELL_REND := 18106; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,0,0,100,0,3000,6000,12000,15000,11,@SPELL_REND,1,0,0,0,0,2,0,0,0,0,0,0,0,"Enraged Gryphon - In Combat - Cast Rend"); @@ -24,7 +24,7 @@ SET @ENTRY := 9297; SET @SPELL_POISON := 744; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,0,0,100,0,2000,5000,12000,15000,11,@SPELL_POISON,1,0,0,0,0,2,0,0,0,0,0,0,0,"Enraged Wyvern - In Combat - Cast Poison"); @@ -33,7 +33,7 @@ SET @ENTRY := 9527; SET @SPELL_REND := 18106; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,0,0,100,0,3000,6000,12000,15000,11,@SPELL_REND,1,0,0,0,0,2,0,0,0,0,0,0,0,"Enraged Hippogryph - In Combat - Cast Rend"); @@ -41,7 +41,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type SET @ENTRY := 352; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Dungar Longdrink - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Dungar Longdrink - On Aggro - Summon Enraged Gryphon"), @@ -55,7 +55,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 523; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Thor - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Thor - On Aggro - Summon Enraged Gryphon"), @@ -69,7 +69,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 931; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Ariena Stormfeather - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Ariena Stormfeather - On Aggro - Summon Enraged Gryphon"), @@ -83,7 +83,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 1387; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Thysta - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Thysta - On Aggro - Summon Enraged Gryphon"), @@ -97,7 +97,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 1571; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Shellei Brondir - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Shellei Brondir - On Aggro - Summon Enraged Gryphon"), @@ -111,7 +111,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 1572; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Thorgrum Borrelson - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Thorgrum Borrelson - On Aggro - Summon Enraged Gryphon"), @@ -125,7 +125,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 1573; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gryth Thurden - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gryth Thurden - On Aggro - Summon Enraged Gryphon"), @@ -139,7 +139,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2226; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Karos Razok - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Karos Razok - On Aggro - Summon Enraged Felbat"), @@ -153,7 +153,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2299; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Borgus Stoutarm - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Borgus Stoutarm - On Aggro - Summon Enraged Gryphon"), @@ -167,7 +167,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2389; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Zarise - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Zarise - On Aggro - Summon Enraged Felbat"), @@ -181,7 +181,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2409; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Felicia Maline - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Felicia Maline - On Aggro - Summon Enraged Gryphon"), @@ -195,7 +195,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2432; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Darla Harris - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Darla Harris - On Aggro - Summon Enraged Gryphon"), @@ -209,7 +209,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2835; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Cedrik Prose - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Cedrik Prose - On Aggro - Summon Enraged Gryphon"), @@ -223,7 +223,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2851; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Urda - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Urda - On Aggro - Summon Enraged Wyvern"), @@ -237,7 +237,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2858; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gringer - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gringer - On Aggro - Summon Enraged Wyvern"), @@ -251,7 +251,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2859; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gyll - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gyll - On Aggro - Summon Enraged Gryphon"), @@ -265,7 +265,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2861; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gorrik - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gorrik - On Aggro - Summon Enraged Wyvern"), @@ -279,7 +279,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2941; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Lanie Reed - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Lanie Reed - On Aggro - Summon Enraged Gryphon"), @@ -293,7 +293,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 2995; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Tal - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Tal - On Aggro - Summon Enraged Wyvern"), @@ -307,7 +307,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 3305; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Grisha - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Grisha - On Aggro - Summon Enraged Wyvern"), @@ -321,7 +321,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 3310; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Doras - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Doras - On Aggro - Summon Enraged Wyvern"), @@ -335,7 +335,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 3615; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Devrak - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Devrak - On Aggro - Summon Enraged Wyvern"), @@ -349,7 +349,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 3838; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Vesprystus - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Vesprystus - On Aggro - Summon Enraged Hippogryph"), @@ -363,7 +363,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 3841; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Caylais Moonfeather - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Caylais Moonfeather - On Aggro - Summon Enraged Hippogryph"), @@ -377,7 +377,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 4267; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Daelyshia - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Daelyshia - On Aggro - Summon Enraged Hippogryph"), @@ -391,7 +391,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 4312; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Tharm - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Tharm - On Aggro - Summon Enraged Wyvern"), @@ -405,7 +405,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 4314; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gorkas - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gorkas - On Aggro - Summon Enraged Wyvern"), @@ -419,7 +419,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 4317; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Nyse - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Nyse - On Aggro - Summon Enraged Wyvern"), @@ -433,7 +433,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 4319; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Thyssiana - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Thyssiana - On Aggro - Summon Enraged Hippogryph"), @@ -447,7 +447,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 4321; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Baldruc - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Baldruc - On Aggro - Summon Enraged Gryphon"), @@ -461,7 +461,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 4407; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Teloren - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Teloren - On Aggro - Summon Enraged Hippogryph"), @@ -475,7 +475,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 4551; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Michael Garrett - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Michael Garrett - On Aggro - Summon Enraged Felbat"), @@ -489,7 +489,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 6026; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Breyk - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Breyk - On Aggro - Summon Enraged Wyvern"), @@ -503,7 +503,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 6706; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Baritanas Skyriver - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Baritanas Skyriver - On Aggro - Summon Enraged Hippogryph"), @@ -517,7 +517,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 6726; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Thalon - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Thalon - On Aggro - Summon Enraged Wyvern"), @@ -531,7 +531,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 7823; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bera Stonehammer - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bera Stonehammer - On Aggro - Summon Enraged Gryphon"), @@ -545,7 +545,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 7824; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bulkrek Ragefist - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bulkrek Ragefist - On Aggro - Summon Enraged Wyvern"), @@ -559,7 +559,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 8018; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Guthrum Thunderfist - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Guthrum Thunderfist - On Aggro - Summon Enraged Gryphon"), @@ -573,7 +573,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 8019; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Fyldren Moonfeather - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Fyldren Moonfeather - On Aggro - Summon Enraged Hippogryph"), @@ -587,7 +587,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 8020; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Shyn - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Shyn - On Aggro - Summon Enraged Wyvern"), @@ -601,7 +601,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 8609; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Alexandra Constantine - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Alexandra Constantine - On Aggro - Summon Enraged Gryphon"), @@ -615,7 +615,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 8610; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kroum - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kroum - On Aggro - Summon Enraged Wyvern"), @@ -629,7 +629,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 10378; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Omusa Thunderhorn - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Omusa Thunderhorn - On Aggro - Summon Enraged Wyvern"), @@ -642,7 +642,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr -- Gryfe SAI SET @ENTRY := 10583; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gryfe - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gryfe - On Aggro - Summon Enraged Wyvern"); @@ -651,7 +651,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type SET @ENTRY := 10897; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Sindrayl - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Sindrayl - On Aggro - Summon Enraged Hippogryph"), @@ -665,7 +665,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 11138; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Maethrya - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Maethrya - On Aggro - Summon Enraged Hippogryph"), @@ -679,7 +679,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 11139; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Yugrek - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Yugrek - On Aggro - Summon Enraged Wyvern"), @@ -693,7 +693,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 11899; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Shardi - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Shardi - On Aggro - Summon Enraged Wyvern"), @@ -707,7 +707,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 11900; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Brakkar - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Brakkar - On Aggro - Summon Enraged Wyvern"), @@ -721,7 +721,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 11901; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Andruk - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Andruk - On Aggro - Summon Enraged Wyvern"), @@ -735,7 +735,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 12577; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Jarrodenus - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Jarrodenus - On Aggro - Summon Enraged Hippogryph"), @@ -749,7 +749,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 12578; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Mishellena - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Mishellena - On Aggro - Summon Enraged Hippogryph"), @@ -763,7 +763,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 12596; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bibilfaz Featherwhistle - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bibilfaz Featherwhistle - On Aggro - Summon Enraged Gryphon"), @@ -777,7 +777,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 12616; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Vhulgra - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Vhulgra - On Aggro - Summon Enraged Wyvern"), @@ -791,7 +791,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 12617; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Khaelyn Steelwing - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Khaelyn Steelwing - On Aggro - Summon Enraged Gryphon"), @@ -805,7 +805,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 12636; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Georgia - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Georgia - On Aggro - Summon Enraged Felbat"), @@ -819,7 +819,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 12740; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Faustron - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Faustron - On Aggro - Summon Enraged Wyvern"), @@ -833,7 +833,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 13177; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Vahgruk - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Vahgruk - On Aggro - Summon Enraged Wyvern"), @@ -847,7 +847,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 15177; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Cloud Skydancer - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Cloud Skydancer - On Aggro - Summon Enraged Hippogryph"), @@ -861,7 +861,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 15178; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Runk Windtamer - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Runk Windtamer - On Aggro - Summon Enraged Wyvern"), @@ -875,7 +875,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 16189; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Skymaster Sunwing - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Skymaster Sunwing - On Aggro - Summon Enraged Felbat"), @@ -889,7 +889,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 16192; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Skymistress Gloaming - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Skymistress Gloaming - On Aggro - Summon Enraged Felbat"), @@ -902,7 +902,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr -- Bragok SAI SET @ENTRY := 16227; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bragok - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bragok - On Aggro - Summon Enraged Wyvern"), @@ -916,7 +916,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 16587; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Barley - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Barley - On Aggro - Summon Enraged Wyvern"), @@ -930,7 +930,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 16822; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Flightmaster Krill Bitterhue - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Flightmaster Krill Bitterhue - On Aggro - Summon Enraged Gryphon"), @@ -944,7 +944,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 17554; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Laando - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Laando - On Aggro - Summon Enraged Hippogryph"), @@ -958,7 +958,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 17555; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Stephanos - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Stephanos - On Aggro - Summon Enraged Hippogryph"), @@ -972,7 +972,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 18785; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kuma - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kuma - On Aggro - Summon Enraged Hippogryph"), @@ -986,7 +986,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 17555; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Munci - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Munci - On Aggro - Summon Enraged Hippogryph"), @@ -1000,7 +1000,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 18789; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Furgu - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Furgu - On Aggro - Summon Enraged Hippogryph"), @@ -1014,7 +1014,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 18791; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Du'ga - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Du'ga - On Aggro - Summon Enraged Wyvern"), @@ -1028,7 +1028,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 18807; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kerna - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kerna - On Aggro - Summon Enraged Wyvern"), @@ -1042,7 +1042,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 18808; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gursha - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gursha - On Aggro - Summon Enraged Wyvern"), @@ -1056,7 +1056,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 18809; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Furnan Skysoar - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Furnan Skysoar - On Aggro - Summon Enraged Gryphon"), @@ -1070,7 +1070,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 18937; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Amerun Leafshade - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Amerun Leafshade - On Aggro - Summon Enraged Hippogryph"), @@ -1083,7 +1083,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr -- Krexcil SAI SET @ENTRY := 18938; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Krexcil - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Krexcil - On Aggro - Summon Enraged Wyvern"), @@ -1093,7 +1093,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type SET @ENTRY := 18939; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Brubeck Stormfoot - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Brubeck Stormfoot - On Aggro - Summon Enraged Gryphon"), @@ -1106,7 +1106,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr -- Nutral SAI SET @ENTRY := 18940; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Nutral - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Nutral - On Aggro - Summon Enraged Wyvern"); @@ -1115,7 +1115,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type SET @ENTRY := 18942; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Innalia - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Innalia - On Aggro - Summon Enraged Gryphon"), @@ -1129,7 +1129,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 18953; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Unoke Tenderhoof - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Unoke Tenderhoof - On Aggro - Summon Enraged Wyvern"), @@ -1143,7 +1143,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 19317; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Drek'Gol - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Drek'Gol - On Aggro - Summon Enraged Wyvern"), @@ -1157,7 +1157,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 19558; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Amilya Airheart - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Amilya Airheart - On Aggro - Summon Enraged Wyvern"), @@ -1170,7 +1170,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr -- Maddix SAI SET @ENTRY := 19581; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Maddix - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Maddix - On Aggro - Summon Enraged Wyvern"); @@ -1178,7 +1178,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Grennik SAI SET @ENTRY := 19583; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Grennik - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Grennik - On Aggro - Summon Enraged Wyvern"); @@ -1186,7 +1186,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Harpax SAI SET @ENTRY := 20515; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Harpax - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Harpax - On Aggro - Summon Enraged Wyvern"); @@ -1194,7 +1194,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Alieshor SAI SET @ENTRY := 21766; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Alieshor - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Alieshor - On Aggro - Summon Enraged Wyvern"); @@ -1202,7 +1202,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Fhyn Leafshadow SAI SET @ENTRY := 22216; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Fhyn Leafshadow - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Fhyn Leafshadow - On Aggro - Summon Enraged Wyvern"); @@ -1210,7 +1210,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Sky-Master Maxxor SAI SET @ENTRY := 22455; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Sky-Master Maxxor - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Sky-Master Maxxor - On Aggro - Summon Enraged Wyvern"); @@ -1218,7 +1218,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Gorrim SAI SET @ENTRY := 22931; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gorrim - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gorrim - On Aggro - Summon Enraged Wyvern"); @@ -1226,7 +1226,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Dyslix Silvergrub SAI SET @ENTRY := 23612; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Dyslix Silvergrub - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Dyslix Silvergrub - On Aggro - Summon Enraged Wyvern"); @@ -1234,7 +1234,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Kiz Coilspanner SAI SET @ENTRY := 24851; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kiz Coilspanner - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kiz Coilspanner - On Aggro - Summon Enraged Wyvern"); @@ -1242,7 +1242,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Ohura SAI SET @ENTRY := 26560; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Ohura - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Ohura - On Aggro - Summon Enraged Felbat"); @@ -1250,7 +1250,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Grimwing SAI SET @ENTRY := 29480; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Grimwing - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Grimwing - On Aggro - Summon Enraged Wyvern"); @@ -1258,7 +1258,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Nutral SAI SET @ENTRY := 18940; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Nutral - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Nutral - On Aggro - Summon Enraged Wyvern"); @@ -1267,7 +1267,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type SET @ENTRY := 20234; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Runetog Wildhammer - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Runetog Wildhammer - On Aggro - Summon Enraged Gryphon"), @@ -1281,7 +1281,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 20762; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gur'zil - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gur'zil - On Aggro - Summon Enraged Wyvern"), @@ -1295,7 +1295,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 21107; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Rip Pedalslam - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Rip Pedalslam - On Aggro - Summon Enraged Gryphon"), @@ -1309,7 +1309,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 22485; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Halu - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Halu - On Aggro - Summon Enraged Hippogryph"), @@ -1323,7 +1323,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 22935; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Suralais Farwind - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Suralais Farwind - On Aggro - Summon Enraged Hippogryph"), @@ -1337,7 +1337,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 24366; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Nizzle - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Nizzle - On Aggro - Summon Enraged Gryphon"), @@ -1351,7 +1351,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26879; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Tomas Riverwell - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Tomas Riverwell - On Aggro - Summon Enraged Gryphon"), @@ -1365,7 +1365,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 23736; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Pricilla Winterwind - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Pricilla Winterwind - On Aggro - Summon Enraged Gryphon"), @@ -1379,7 +1379,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 24032; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Celea Frozenmane - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Celea Frozenmane - On Aggro - Summon Enraged Wyvern"), @@ -1393,7 +1393,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 24061; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"James Ormsby - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"James Ormsby - On Aggro - Summon Enraged Gryphon"), @@ -1407,7 +1407,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 24155; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Tobias Sarkhoff - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Tobias Sarkhoff - On Aggro - Summon Enraged Felbat"), @@ -1421,7 +1421,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 25288; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Turida Coldwind - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Turida Coldwind - On Aggro - Summon Enraged Wyvern"), @@ -1435,7 +1435,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26566; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Narzun Skybreaker - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Narzun Skybreaker - On Aggro - Summon Enraged Wyvern"), @@ -1449,7 +1449,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26602; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kara Thricestar - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kara Thricestar - On Aggro - Summon Enraged Gryphon"), @@ -1463,7 +1463,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26844; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Lilleth Radescu - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Lilleth Radescu - On Aggro - Summon Enraged Felbat"), @@ -1477,7 +1477,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26845; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Junter Weiss - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Junter Weiss - On Aggro - Summon Enraged Felbat"), @@ -1490,7 +1490,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr -- Kareg SAI SET @ENTRY := 26846; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kareg - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kareg - On Aggro - Summon Enraged Wyvern"), @@ -1504,7 +1504,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26847; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Omu Spiritbreeze - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Omu Spiritbreeze - On Aggro - Summon Enraged Wyvern"), @@ -1518,7 +1518,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26848; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kimbiza - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kimbiza - On Aggro - Summon Enraged Wyvern"), @@ -1532,7 +1532,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26850; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Numo Spiritbreeze - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Numo Spiritbreeze - On Aggro - Summon Enraged Wyvern"), @@ -1546,7 +1546,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26852; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kragh - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kragh - On Aggro - Summon Enraged Wyvern"), @@ -1560,7 +1560,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26853; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Makki Wintergale - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Makki Wintergale - On Aggro - Summon Enraged Wyvern"), @@ -1574,7 +1574,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26876; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Samuel Clearbook - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Samuel Clearbook - On Aggro - Summon Enraged Gryphon"), @@ -1588,7 +1588,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26877; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Derek Rammel - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Derek Rammel - On Aggro - Summon Enraged Gryphon"), @@ -1602,7 +1602,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26878; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Rodney Wells - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Rodney Wells - On Aggro - Summon Enraged Gryphon"), @@ -1616,7 +1616,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26880; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Vana Grey - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Vana Grey - On Aggro - Summon Enraged Gryphon"), @@ -1630,7 +1630,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 26881; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Palena Silvercloud - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Palena Silvercloud - On Aggro - Summon Enraged Hippogryph"), @@ -1643,7 +1643,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr -- Warmage Adami SAI SET @ENTRY := 27046; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Warmage Adami - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Warmage Adami - On Aggro - Summon Enraged Wyvern"); @@ -1652,7 +1652,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type SET @ENTRY := 27344; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bat Handler Adeline - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bat Handler Adeline - On Aggro - Summon Enraged Felbat"), @@ -1665,7 +1665,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr -- The Spirit of Gnomeregan SAI SET @ENTRY := 28037; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"The Spirit of Gnomeregan - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"The Spirit of Gnomeregan - On Aggro - Summon Enraged Wyvern"); @@ -1673,7 +1673,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Bilko Driftspark SAI SET @ENTRY := 28195; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bilko Driftspark - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Bilko Driftspark - On Aggro - Summon Enraged Wyvern"); @@ -1681,7 +1681,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Cid Flounderfix SAI SET @ENTRY := 28196; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Cid Flounderfix - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Cid Flounderfix - On Aggro - Summon Enraged Wyvern"); @@ -1689,7 +1689,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Kip Trawlskip SAI SET @ENTRY := 28197; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kip Trawlskip - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kip Trawlskip - On Aggro - Summon Enraged Wyvern"); @@ -1697,7 +1697,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Marvin Wobblesprocket SAI SET @ENTRY := 28574; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Marvin Wobblesprocket - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Marvin Wobblesprocket - On Aggro - Summon Enraged Wyvern"); @@ -1705,7 +1705,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Baneflight SAI SET @ENTRY := 28615; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Baneflight - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Baneflight - On Aggro - Summon Enraged Wyvern"); @@ -1713,7 +1713,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Danica Saint SAI SET @ENTRY := 28618; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Danica Saint - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Danica Saint - On Aggro - Summon Enraged Wyvern"); @@ -1721,7 +1721,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Gurric SAI SET @ENTRY := 28623; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gurric - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Gurric - On Aggro - Summon Enraged Wyvern"); @@ -1729,7 +1729,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Maaka SAI SET @ENTRY := 28624; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Maaka - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Maaka - On Aggro - Summon Enraged Wyvern"); @@ -1737,7 +1737,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Aludane Whitecloud SAI SET @ENTRY := 28674; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Aludane Whitecloud - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Aludane Whitecloud - On Aggro - Summon Enraged Wyvern"); @@ -1745,7 +1745,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Skizzle Slickslide SAI SET @ENTRY := 29721; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Skizzle Slickslide - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Skizzle Slickslide - On Aggro - Summon Enraged Wyvern"); @@ -1753,7 +1753,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Faldorf Bitterchill SAI SET @ENTRY := 29750; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Faldorf Bitterchill - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Faldorf Bitterchill - On Aggro - Summon Enraged Wyvern"); @@ -1761,7 +1761,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Kabarg Windtamer SAI SET @ENTRY := 29757; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kabarg Windtamer - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Kabarg Windtamer - On Aggro - Summon Enraged Wyvern"); @@ -1769,7 +1769,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Breck Rockbrow SAI SET @ENTRY := 29950; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Breck Rockbrow - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Breck Rockbrow - On Aggro - Summon Enraged Wyvern"); @@ -1777,7 +1777,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Shavalius the Fancy SAI SET @ENTRY := 29951; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Shavalius the Fancy - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Shavalius the Fancy - On Aggro - Summon Enraged Wyvern"); @@ -1785,7 +1785,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Morlia Doomwing SAI SET @ENTRY := 30314; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Morlia Doomwing - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Morlia Doomwing - On Aggro - Summon Enraged Wyvern"); @@ -1793,7 +1793,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Aedan Moran SAI SET @ENTRY := 30433; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Aedan Moran - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Aedan Moran - On Aggro - Summon Enraged Wyvern"); @@ -1801,7 +1801,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Rafae SAI SET @ENTRY := 30569; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Rafae - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Rafae - On Aggro - Summon Enraged Wyvern"); @@ -1809,7 +1809,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Arzo Safeflight SAI SET @ENTRY := 30869; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Arzo Safeflight - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Arzo Safeflight - On Aggro - Summon Enraged Wyvern"); @@ -1817,7 +1817,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Herzo Safeflight SAI SET @ENTRY := 30870; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Herzo Safeflight - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Herzo Safeflight - On Aggro - Summon Enraged Wyvern"); @@ -1825,7 +1825,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Penumbrius SAI SET @ENTRY := 31069; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Penumbrius - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Penumbrius - On Aggro - Summon Enraged Wyvern"); @@ -1833,7 +1833,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Dreadwind SAI SET @ENTRY := 31078; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Dreadwind - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Dreadwind - On Aggro - Summon Enraged Wyvern"); @@ -1841,7 +1841,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Halvdan SAI SET @ENTRY := 32571; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Halvdan - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Halvdan - On Aggro - Summon Enraged Wyvern"); @@ -1849,7 +1849,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Helidan Lightwing SAI SET @ENTRY := 33849; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Helidan Lightwing - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Helidan Lightwing - On Aggro - Summon Enraged Wyvern"); @@ -1857,7 +1857,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type -- Frax Bucketdrop SAI SET @ENTRY := 37888; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,4,0,100,0,0,0,0,0,12,9526,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Frax Bucketdrop - On Aggro - Summon Enraged Gryphon"), (@ENTRY,0,1,0,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Frax Bucketdrop - On Aggro - Summon Enraged Wyvern"); @@ -1866,7 +1866,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type SET @ENTRY := 30271; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Galendror Whitewing - On Aggro - Summon Enraged Hippogryph"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Galendror Whitewing - On Aggro - Summon Enraged Hippogryph"), @@ -1880,7 +1880,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 31426; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Doras - On Aggro - Summon Enraged Wyvern"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Doras - On Aggro - Summon Enraged Wyvern"), @@ -1894,7 +1894,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr SET @ENTRY := 37915; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +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,4,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Timothy Cunningham - On Aggro - Summon Enraged Felbat"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9521,4,30000,0,0,0,1,0,0,0,0,0,0,0,"Timothy Cunningham - On Aggro - Summon Enraged Felbat"), diff --git a/sql/updates/world/2012_01_13_03_gossip_menu.sql b/sql/updates/world/2012_01_13_03_world_gossip_menu.sql index 98dda69bf1a..98dda69bf1a 100644 --- a/sql/updates/world/2012_01_13_03_gossip_menu.sql +++ b/sql/updates/world/2012_01_13_03_world_gossip_menu.sql diff --git a/sql/updates/world/2011_01_14_03_world_trinity_string.sql b/sql/updates/world/2012_01_14_03_world_trinity_string.sql index 7dab007f774..7dab007f774 100644 --- a/sql/updates/world/2011_01_14_03_world_trinity_string.sql +++ b/sql/updates/world/2012_01_14_03_world_trinity_string.sql diff --git a/sql/updates/world/2012_01_15_00_world_loot_template.sql b/sql/updates/world/2012_01_15_00_world_loot_template.sql new file mode 100644 index 00000000000..af61833536d --- /dev/null +++ b/sql/updates/world/2012_01_15_00_world_loot_template.sql @@ -0,0 +1,5 @@ +UPDATE `creature_loot_template` SET `mincountOrRef`=-10001 WHERE `mincountOrRef`=-24725; +UPDATE `gameobject_loot_template` SET `mincountOrRef`=-10001 WHERE `mincountOrRef`=-24725; +UPDATE `item_loot_template` SET `mincountOrRef`=-10001 WHERE `mincountOrRef`=-24725; + +DELETE FROM `reference_loot_template` WHERE `entry`=24725; diff --git a/sql/updates/world/2012_01_15_02_world_creature_template.sql b/sql/updates/world/2012_01_15_02_world_creature_template.sql new file mode 100644 index 00000000000..4b6dcad8a33 --- /dev/null +++ b/sql/updates/world/2012_01_15_02_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Among the Champions and The Grand Melee updates +UPDATE `creature_template` SET `ScriptName`='npc_valiant', `dmg_multiplier`=2 WHERE `entry`IN (33285,33306,33384,33383,33382,33739,33749,33745,33744,33748,33740,33743,33747,33738,33746,33561,33558,33559,33562); diff --git a/sql/updates/world/2012_01_15_03_world_item_loot_template.sql b/sql/updates/world/2012_01_15_03_world_item_loot_template.sql new file mode 100644 index 00000000000..bbe9994e897 --- /dev/null +++ b/sql/updates/world/2012_01_15_03_world_item_loot_template.sql @@ -0,0 +1,45 @@ +SET @Bag := 20469; +SET @RefA := 10022; +SET @RefB := 10023; +SET @RefC := 10024; +SET @RefD := 10025; + +-- Add missing recipes to "Decoded True Believer Clippings" (i20469) +DELETE FROM `item_loot_template` WHERE `entry` = 20469; +INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@Bag,1,100,1,0,-@RefD,2), -- Decoded Twilight Texts +-- scrolls via reference +(@Bag,2,100,1,0,-10001,1), -- one from level V scrolls +(@Bag,3,4,1,0,-@RefA,1), -- one from Crest of Beckoning +(@Bag,4,4,1,0,-@RefB,1), -- one from Sigil of Beckoning +(@Bag,5,4,1,0,-@RefC,1), -- one from Scepter of Beckoning +-- special pattern drops: +(@Bag,20546,3,1,0,1,1), -- Runed Stygian Leggings +(@Bag,20547,3,1,0,1,1), -- Runed Stygian Boots +(@Bag,20548,3,1,0,1,1), -- Runed Stygian Belt +(@Bag,20553,3,1,0,1,1), -- Darkrune Gauntlets +(@Bag,20554,3,1,0,1,1), -- Darkrune Breastplate +(@Bag,20555,3,1,0,1,1); -- Darkrune Helm +-- References: +DELETE FROM `reference_loot_template` WHERE `entry` IN (@RefA,@RefB,@RefC,@RefD); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@RefA,20518,0,1,1,1,1), -- Scroll: Crest of Beckoning +(@RefA,20526,0,1,1,1,1), -- Scroll: Crest of Beckoning +(@RefA,20527,0,1,1,1,1), -- Scroll: Crest of Beckoning +(@RefA,20528,0,1,1,1,1), -- Scroll: Crest of Beckoning +(@RefB,20531,0,1,1,1,1), -- Scroll: Sigil of Beckoning +(@RefB,20532,0,1,1,1,1), -- Scroll: Sigil of Beckoning +(@RefB,20533,0,1,1,1,1), -- Scroll: Sigil of Beckoning +(@RefB,20535,0,1,1,1,1), -- Scroll: Sigil of Beckoning +(@RefC,20540,0,1,1,1,1), -- Scroll: Scepter of Beckoning +(@RefC,20542,0,1,1,1,1), -- Scroll: Scepter of Beckoning +(@RefC,20543,0,1,1,1,1), -- Scroll: Scepter of Beckoning +(@RefC,20544,0,1,1,1,1), -- Scroll: Scepter of Beckoning +-- Decoded Twilight Texts: +(@RefD,20676,0,1,1,1,3), +(@RefD,20541,0,1,1,1,3), +(@RefD,20545,0,1,1,1,3), +(@RefD,20679,0,1,1,1,3), +(@RefD,20677,0,1,1,1,3), +(@RefD,20678,0,1,1,1,3), +(@RefD,20552,0,1,1,1,3);
\ No newline at end of file diff --git a/sql/updates/world/2012_01_16_00_world_stored_procedure.sql b/sql/updates/world/2012_01_16_00_world_stored_procedure.sql new file mode 100644 index 00000000000..4a5b66df7b2 --- /dev/null +++ b/sql/updates/world/2012_01_16_00_world_stored_procedure.sql @@ -0,0 +1,161 @@ +-- sp_dev_reguid procedure +/*!50003 DROP PROCEDURE IF EXISTS `sp_dev_reguid` */; +DELIMITER ;; +/*!50003 CREATE*/ +/*!50003 PROCEDURE `sp_dev_reguid`() +BEGIN + + DROP TABLE IF EXISTS `creature_temp`; + CREATE TABLE IF NOT EXISTS `creature_temp` ( + `guid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Global Unique Identifier', + `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature Identifier', + `map` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', + `spawnMask` tinyint(3) unsigned NOT NULL DEFAULT '1', + `phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1', + `modelid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `equipment_id` mediumint(9) NOT NULL DEFAULT '0', + `position_x` float NOT NULL DEFAULT '0', + `position_y` float NOT NULL DEFAULT '0', + `position_z` float NOT NULL DEFAULT '0', + `orientation` float NOT NULL DEFAULT '0', + `spawntimesecs` int(10) unsigned NOT NULL DEFAULT '120', + `spawndist` float NOT NULL DEFAULT '0', + `currentwaypoint` mediumint(8) unsigned NOT NULL DEFAULT '0', + `curhealth` int(10) unsigned NOT NULL DEFAULT '1', + `curmana` int(10) unsigned NOT NULL DEFAULT '0', + `MovementType` tinyint(3) unsigned NOT NULL DEFAULT '0', + `npcflag` int(10) unsigned NOT NULL DEFAULT '0', + `unit_flags` int(10) unsigned NOT NULL DEFAULT '0', + `dynamicflags` int(10) unsigned NOT NULL DEFAULT '0', + `old_guid` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`), + KEY `idx_map` (`map`), + KEY `idx_id` (`id`), + KEY `idx_oldguid_tmp` (`old_guid`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature System' AUTO_INCREMENT=250001; + + ALTER TABLE `creature_addon` ADD COLUMN `new_guid` INT(10) UNSIGNED NOT NULL; + ALTER TABLE `creature_formations` ADD COLUMN `new_guid_leader` INT(10) UNSIGNED NOT NULL; + ALTER TABLE `creature_formations` ADD COLUMN `new_guid_member` INT(10) UNSIGNED NOT NULL; + ALTER TABLE `game_event_creature` ADD COLUMN `new_guid` INT(10) UNSIGNED NOT NULL; + ALTER TABLE `pool_creature` ADD COLUMN `new_guid` INT(10) UNSIGNED NOT NULL; + ALTER TABLE `game_event_model_equip` ADD COLUMN `new_guid` INT(10) UNSIGNED NOT NULL; + ALTER TABLE `game_event_npc_vendor` ADD COLUMN `new_guid` INT(10) UNSIGNED NOT NULL; + ALTER TABLE `game_event_npcflag` ADD COLUMN `new_guid` INT(10) UNSIGNED NOT NULL; + ALTER TABLE `smart_scripts` ADD COLUMN `new_guid` INT(10) NOT NULL; + + INSERT INTO `creature_temp` + ( + `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, + `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, + `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, + `unit_flags`, `dynamicflags`, `old_guid` + ) SELECT + `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, + `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, + `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, + `unit_flags`, `dynamicflags`, `guid` + FROM `creature` WHERE `guid` < 250001 ORDER BY `id` ASC; + + INSERT INTO `creature_temp` + ( + `guid`,`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, + `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, + `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, + `unit_flags`, `dynamicflags`, `old_guid` + ) SELECT + `guid`,`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, + `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, + `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, + `unit_flags`, `dynamicflags`, `guid` + FROM `creature` WHERE `guid` >= 250001 ORDER BY `id` ASC; + + UPDATE game_event_npc_vendor p + INNER JOIN creature_temp pp + ON p.guid = pp.old_guid + SET p.new_guid = pp.guid; + UPDATE game_event_npcflag p + INNER JOIN creature_temp pp + ON p.guid = pp.old_guid + SET p.new_guid = pp.guid; + UPDATE game_event_model_equip p + INNER JOIN creature_temp pp + ON p.guid = pp.old_guid + SET p.new_guid = pp.guid; + UPDATE creature_addon p + INNER JOIN creature_temp pp + ON p.guid = pp.old_guid + SET p.new_guid = pp.guid; + UPDATE creature_formations p + INNER JOIN creature_temp pp + ON p.leaderGUID = pp.old_guid + SET p.new_guid_leader = pp.guid; + UPDATE creature_formations p + INNER JOIN creature_temp pp + ON p.memberGUID = pp.old_guid + SET p.new_guid_member = pp.guid; + UPDATE game_event_creature p + INNER JOIN creature_temp pp + ON p.guid = pp.old_guid + SET p.new_guid = pp.guid; + UPDATE pool_creature p + INNER JOIN creature_temp pp + ON p.guid = pp.old_guid + SET p.new_guid = pp.guid; + UPDATE smart_scripts p + INNER JOIN creature_temp pp + ON p.entryorguid = pp.old_guid + SET p.new_guid = -pp.guid + WHERE + entryorguid < 0 AND + source_type = 0; + + DROP TABLE `creature`; + ALTER TABLE `creature_temp` DROP COLUMN `old_guid`; + RENAME TABLE `creature_temp` TO `creature`; + + ALTER TABLE game_event_npc_vendor DISABLE KEYS; + UPDATE `game_event_npc_vendor` SET `guid`=`new_guid`; + ALTER TABLE `game_event_npc_vendor` DROP COLUMN `new_guid`; + ALTER TABLE game_event_npc_vendor ENABLE KEYS; + + ALTER TABLE game_event_npcflag DISABLE KEYS; + UPDATE `game_event_npcflag` SET `guid`=`new_guid`; + ALTER TABLE `game_event_npcflag` DROP COLUMN `new_guid`; + ALTER TABLE game_event_npcflag ENABLE KEYS; + + ALTER TABLE game_event_model_equip DISABLE KEYS; + UPDATE `game_event_model_equip` SET `guid`=`new_guid`; + ALTER TABLE `game_event_model_equip` DROP COLUMN `new_guid`; + ALTER TABLE game_event_model_equip ENABLE KEYS; + + ALTER TABLE `creature_addon` DROP PRIMARY KEY; + UPDATE `creature_addon` SET `guid`=`new_guid`; + ALTER TABLE `creature_addon` DROP COLUMN `new_guid`; + ALTER TABLE `creature_addon` ADD PRIMARY KEY(`guid`); + + ALTER TABLE creature_formations DISABLE KEYS; + UPDATE `creature_formations` SET leaderGUID = new_guid_leader; + ALTER TABLE `creature_formations` DROP COLUMN `new_guid_leader`; + UPDATE `creature_formations` SET memberGUID = new_guid_member; + ALTER TABLE `creature_formations` DROP COLUMN `new_guid_member`; + ALTER TABLE creature_formations ENABLE KEYS; + + ALTER TABLE `game_event_creature` DROP PRIMARY KEY; + UPDATE `game_event_creature` SET guid = new_guid; + ALTER TABLE `game_event_creature` DROP COLUMN `new_guid`; + ALTER TABLE `game_event_creature` ADD PRIMARY KEY(`guid`, `eventEntry`); + + ALTER TABLE `pool_creature` DROP PRIMARY KEY; + UPDATE `pool_creature` SET guid = new_guid; + ALTER TABLE `pool_creature` DROP COLUMN `new_guid`; + ALTER TABLE `pool_creature` ADD PRIMARY KEY(`guid`); + + ALTER TABLE `smart_scripts` DROP PRIMARY KEY; + UPDATE `smart_scripts` SET `entryorguid` = `new_guid` + WHERE entryorguid < 0 AND new_guid < 0 AND source_type = 0; + ALTER TABLE `smart_scripts` DROP COLUMN `new_guid`; + ALTER TABLE `smart_scripts` ADD PRIMARY KEY (`entryorguid`,`source_type`,`id`,`link`); + + END */;; +
\ No newline at end of file diff --git a/sql/updates/world/2012_01_16_01_world_sai.sql b/sql/updates/world/2012_01_16_01_world_sai.sql new file mode 100644 index 00000000000..881f6cb919c --- /dev/null +++ b/sql/updates/world/2012_01_16_01_world_sai.sql @@ -0,0 +1,17 @@ +-- [Q] [A] Report to Goldshire +-- Also moved the emote to creature_text +-- Doesn't work because it's auto-accept.. +-- Marshal McBride SAI +SET @ENTRY := 197; +SET @QUEST := 54; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +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,19,0,100,0,@QUEST,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Marshal McBride - On Quest Accept - Say Line 0"); +-- Text +DELETE FROM `db_script_string` WHERE `entry`=2000000059; +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"You are dismissed, $N.",12,0,100,113,0,0,"Marshal McBride"); diff --git a/sql/updates/world/2012_01_16_02_world_sai.sql b/sql/updates/world/2012_01_16_02_world_sai.sql new file mode 100644 index 00000000000..435675fd143 --- /dev/null +++ b/sql/updates/world/2012_01_16_02_world_sai.sql @@ -0,0 +1,12 @@ +-- [Q] [A/H] The Completed Orb of Noh'Orahil +-- Menara Voidrender SAI +SET @ENTRY := 6266; +SET @QUEST := 4975; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,@QUEST,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Menara Voidrender - On Quest Accept - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,10000,10000,0,0,15,@QUEST,0,0,0,0,0,7,0,0,0,0,0,0,0,"Menara Voidrender - On Script - Quest Credit"); -- After ten seconds diff --git a/sql/updates/world/2012_01_16_03_world_sai.sql b/sql/updates/world/2012_01_16_03_world_sai.sql new file mode 100644 index 00000000000..f5e0d90983f --- /dev/null +++ b/sql/updates/world/2012_01_16_03_world_sai.sql @@ -0,0 +1,16 @@ +-- [Q] [A/H] Proving Allegiance +-- Also moved the emote to creature_text +-- Gunther Arcanus SAI +SET @ENTRY := 1497; +SET @QUEST := 409; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +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,19,0,100,0,@QUEST,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Gunther Arcanus - On Quest Accept - Say Line 0"); +-- Text +DELETE FROM `db_script_string` WHERE `entry`=2000000085; +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Take a Candle of Beckoning from this crate, $N.",12,0,100,25,0,0,"Gunther Arcanus"); diff --git a/sql/updates/world/2012_01_16_04_world_sai.sql b/sql/updates/world/2012_01_16_04_world_sai.sql new file mode 100644 index 00000000000..85087a57dec --- /dev/null +++ b/sql/updates/world/2012_01_16_04_world_sai.sql @@ -0,0 +1,11 @@ +-- [Q] [A/H] Hope Within the Emerald Nightmare +-- This NPC already had SAI so we're only adding additional lines +-- Keeper Remulos SAI +SET @ENTRY := 11832; +SET @QUEST := 13074; +SET @SPELL_FITFUL_DREAM := 57413; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0 AND `id`=4; +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,4,0,19,0,100,0,@QUEST,0,0,0,11,@SPELL_FITFUL_DREAM,0,0,0,0,0,7,0,0,0,0,0,0,0,"Keeper Remulos - On Quest Accept - Cast Fitful Dream"); diff --git a/sql/updates/world/2012_01_16_05_world_sai.sql b/sql/updates/world/2012_01_16_05_world_sai.sql new file mode 100644 index 00000000000..d5966dfc3ec --- /dev/null +++ b/sql/updates/world/2012_01_16_05_world_sai.sql @@ -0,0 +1,15 @@ +-- [Q] [A] A Humble Task +-- Greatmother Hawkwind SAI +SET @ENTRY := 2991; +SET @QUEST := 753; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +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,19,0,100,0,@QUEST,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Greatmother Hawkwind - On Script - Emote Line 0"); +-- Texts +DELETE FROM `db_script_string` WHERE `entry`=2000000077; +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"%s gestures to the pitcher of water sitting on the edge of the well.",16,0,100,0,0,0,"Greatmother Hawkwind"); diff --git a/sql/updates/world/2012_01_16_06_world_sai.sql b/sql/updates/world/2012_01_16_06_world_sai.sql new file mode 100644 index 00000000000..62231b60fdc --- /dev/null +++ b/sql/updates/world/2012_01_16_06_world_sai.sql @@ -0,0 +1,14 @@ +-- [Q] [A/H] The Boon of A'dal +-- A'dal SAI +SET @ENTRY := 18481; +SET @QUEST := 13082; +SET @SPELL_BLESSING := 35076; +SET @SPELL_TP_DALARAN := 53141; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@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,0,0,0,0,11,@SPELL_BLESSING,0,0,0,0,0,1,0,0,0,0,0,0,0,"A'dal - Out of Combat - Cast Blessing of A'dal"), -- From EAI +(@ENTRY,0,1,0,19,0,100,0,@QUEST,0,0,0,11,@SPELL_TP_DALARAN,0,0,0,0,0,7,0,0,0,0,0,0,0,"A'dal - On Quest Accept - Cast Teleport Dalaran"); diff --git a/sql/updates/world/2012_01_16_07_world_sai.sql b/sql/updates/world/2012_01_16_07_world_sai.sql new file mode 100644 index 00000000000..79324bd2c0b --- /dev/null +++ b/sql/updates/world/2012_01_16_07_world_sai.sql @@ -0,0 +1,32 @@ +-- [Q] [A] The Missing Diplomat +-- Dashel Stonefist SAI +SET @ENTRY := 4961; +SET @QUEST := 1447; +SET @SPELL_PUMMEL := 12555; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0,`EmoteOnComplete`=11 WHERE `id`=@QUEST; -- ONESHOT_LAUGH +UPDATE `quest_template` SET `EmoteOnComplete`=14 WHERE `id`=1246; -- Previous version should make him rude against player +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100,@ENTRY*100+1) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,13,0,100,0,6000,21000,0,0,11,@SPELL_PUMMEL,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dashel Stonefist - Player Casting - Cast Pummel"), +(@ENTRY,0,1,0,19,0,100,0,@QUEST,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Dashel Stonefist - On Quest Accept - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dashel Stonefist - On Script - Say Line 0"), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,2,168,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dashel Stonefist - On Script - Set Faction Hostile"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dashel Stonefist - On Script - Attack Player"), +(@ENTRY*100,9,3,0,0,0,100,0,2000,2000,0,0,12,4969,1,300000,0,0,0,8,0,0,0,-8678.246094,440.952606,99.620926,4.364815,"Dashel Stonefist - On Script - Summon Old Town Thug"), +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,12,4969,1,300000,0,0,0,8,0,0,0,-8682.465820,441.471161,99.531319,4.871392,"Dashel Stonefist - On Script - Summon Old Town Thug"), +(@ENTRY,0,2,0,2,0,100,0,0,15,0,0,80,@ENTRY*100+1,0,2,0,0,0,1,0,0,0,0,0,0,0,"Dashel Stonefist - On 15% HP - Run Script"), +(@ENTRY*100+1,9,0,0,0,0,100,0,0,0,0,0,15,@QUEST,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dashel Stonefist - On Script - Quest Credit"), -- We are putting this before evade else we lose our target +(@ENTRY*100+1,9,1,0,0,0,100,0,0,0,0,0,20,9,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dashel Stonefist - On Script - Stop Attacking"), +(@ENTRY*100+1,9,2,0,0,0,100,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dashel Stonefist - On Script - Evade"), +(@ENTRY*100+1,9,3,0,0,0,100,0,0,0,0,0,2,84,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dashel Stonefist - On Script - Set Faction Back"), +(@ENTRY*100+1,9,4,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dashel Stonefist - On Script - Say Line 1"), +(@ENTRY*100+1,9,5,0,0,0,100,0,6000,6000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dashel Stonefist - On Script - Say Line 2"); +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Now you're going to get it good!",12,0,100,0,0,0,"Dashel Stonefist"), +(@ENTRY,1,0,"Okay, okay! Enough fighting. No one else needs to get hurt.",12,0,100,0,0,0,"Dashel Stonefist"), +(@ENTRY,2,0,"It's okay, boys. Back off. You've done enough. I'll meet up with you later.",12,0,100,0,0,0,"Dashel Stonefist"); diff --git a/sql/updates/world/2012_01_16_08_world_sai.sql b/sql/updates/world/2012_01_16_08_world_sai.sql new file mode 100644 index 00000000000..0857b8fd45b --- /dev/null +++ b/sql/updates/world/2012_01_16_08_world_sai.sql @@ -0,0 +1,12 @@ +-- [Q] [A/H] In Service Of The Lich King +-- The Lich King SAI +SET @ENTRY := 25462; +SET @QUEST := 12593; +SET @SPELL_EXLOSION := 58024; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,@QUEST,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"The Lich King - On Quest Accept - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,3000,3000,0,0,11,@SPELL_EXLOSION,0,0,0,0,0,7,0,0,0,0,0,0,0,"The Lich King - On Script - Cast 'Icecrown Airship - A - Attack - 02b Cannon Explosion, Shield'"); -- After three seconds diff --git a/sql/updates/world/2012_01_16_09_world_sai.sql b/sql/updates/world/2012_01_16_09_world_sai.sql new file mode 100644 index 00000000000..d82fc341ff0 --- /dev/null +++ b/sql/updates/world/2012_01_16_09_world_sai.sql @@ -0,0 +1,10 @@ +-- [Q] [A] The Legend of Stalvan +-- Sealed Crate SAI +SET @ENTRY := 1561; +SET @QUEST := 74; +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +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,19,0,100,0,@QUEST,0,0,0,12,2044,1,30000,0,0,0,8,0,0,0,-10953.3,988.509,98.984,5.349,"Sealed Crate - On Quest Accept - Summon Forlorn Spirit"); -- What's wrong with those stupid co-ords? .. diff --git a/sql/updates/world/2012_01_17_00_world_misc.sql b/sql/updates/world/2012_01_17_00_world_misc.sql new file mode 100644 index 00000000000..300d239bd43 --- /dev/null +++ b/sql/updates/world/2012_01_17_00_world_misc.sql @@ -0,0 +1,27 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (69672,69673); +INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES +(69672,'spell_gen_sunreaver_disguise'), +(69673,'spell_gen_silver_covenant_disguise'); + +-- Update spells used on script. Now they are always casting the female spell, +-- since the spell script is fixed we should cast now the correct spell. +UPDATE `smart_scripts` SET `action_param1`=69672 WHERE `entryorguid`=36669 AND `action_type`=11 AND `action_param1`=70973; +UPDATE `smart_scripts` SET `action_param1`=69673 WHERE `entryorguid`=36670 AND `action_type`=11 AND `action_param1`=70971; +-- Set correct gossip menus ids for renewing the disguise +UPDATE `smart_scripts` SET `event_param1`=10858 WHERE `entryorguid`=36669 AND `event_param1`=10857; +UPDATE `smart_scripts` SET `event_param1`=10857 WHERE `entryorguid`=36670 AND `event_param1`=10858; + +-- Gossip options were crossed. They should offer to cast the oposing faction disguise,instead of his own faction disguise. +UPDATE `gossip_menu_option` SET `option_text`="Would you renew my Covenant disguise?" WHERE `menu_id`=10857 AND `id`=1; +UPDATE `gossip_menu_option` SET `option_text`="Would you renew my Sunreaver disguise?" WHERE `menu_id`=10858 AND `id`=1; + +-- Correct quest ids on conditios for showing the renew disguise option. +-- Also add a check for male disguise aura. +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (10857,10858) AND `SourceEntry`=1; +INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,10858,1,0,11,70973,0,0,0,'',NULL), +(15,10858,1,0,11,70974,0,0,0,'',NULL), +(15,10858,1,0,9,20439,0,0,0,'',NULL), +(15,10857,1,0,11,70971,0,0,0,'',NULL), +(15,10857,1,0,11,70972,0,0,0,'',NULL), +(15,10857,1,0,9,24451,0,0,0,'',NULL); diff --git a/sql/updates/world/2012_01_17_01_world_conditions.sql b/sql/updates/world/2012_01_17_01_world_conditions.sql new file mode 100644 index 00000000000..6c562ba4d45 --- /dev/null +++ b/sql/updates/world/2012_01_17_01_world_conditions.sql @@ -0,0 +1,12 @@ +-- Condition update to flags +DELETE FROM `conditions` WHERE `ConditionTypeOrReference`=5; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(19,0,13846,0,5,1106,127,0,0,'','Quest Contributin'' To The Cause - Requires Argent Crusade hated thru revered'), +(20,0,13846,0,5,1106,127,0,0,'','Quest Contributin'' To The Cause - Requires Argent Crusade hated thru revered'), +(14,21258,7594,0,5,270,120,0,0,'','Only show text_id 7594 if player is neutral thru revered with Zandalar Tribe (270)'), +(14,21258,7595,0,5,270,128,0,0,'','Only show text_id 7595 if player is exalted with Zandalar Tribe (270)'), +(15,21258,0,0,5,270,128,0,0,'','Only show gossip option if player is exalted with Zandalar Tribe (270)'), +(15,21259,0,0,5,270,128,0,0,'','Only show gossip option if player is exalted with Zandalar Tribe (270)'), +(15,21260,0,0,5,270,128,0,0,'','Only show gossip option if player is exalted with Zandalar Tribe (270)'), +(1,23342,32726,0,5,1015,240,0,0,'','Murkblood Escape Plans - when Netherwing friendly thru exalted'), +(1,23286,32726,0,5,1015,240,0,0,'','Murkblood Escape Plans - when Netherwing friendly thru exalted'); diff --git a/sql/updates/world/2012_01_19_00_world_quest_template.sql b/sql/updates/world/2012_01_19_00_world_quest_template.sql new file mode 100644 index 00000000000..f1af6e7eedd --- /dev/null +++ b/sql/updates/world/2012_01_19_00_world_quest_template.sql @@ -0,0 +1,17 @@ +-- Non sword wielders quests +UPDATE `quest_template` SET `RequiredClasses`=`RequiredClasses` +|16 -- Priest +|64 -- Shaman +|1024 -- Druid +WHERE `Id` IN (24795,24798,24798); + +-- Sword wielders quests +UPDATE `quest_template` SET `RequiredClasses`=`RequiredClasses` +|1 -- Warrior +|2 -- Paladin +|4 -- Hunter +|8 -- Rouge +|32 -- Death Kinght +|128 -- Mage +|256 -- Warlock +WHERE `Id` IN (24796,24800,24801); diff --git a/sql/updates/world/2012_01_19_01_world_sai.sql b/sql/updates/world/2012_01_19_01_world_sai.sql new file mode 100644 index 00000000000..969eea6c4dd --- /dev/null +++ b/sql/updates/world/2012_01_19_01_world_sai.sql @@ -0,0 +1,25 @@ +-- [Q] Mounting Hodir's Helm +-- Hodir's Helm KC Bunny SAI +SET @ENTRY := 30210; +SET @SPELL_READ_PRONOUNCEMENT := 56278; +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,@SPELL_READ_PRONOUNCEMENT,0,0,0,33,@ENTRY,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hodir's Helm KC Bunny - On Spellhit - Quest Credit"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Hodir's Helm KC Bunny - On Spellhit - Say Line 0"), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,50,192080,30000,0,0,0,0,8,0,0,0,7390.143066,-2725.382080,874.256104,2.973291,"Hodir's Helm KC Bunny - On Spellhit - Summon Hodir's Helm"); +-- Text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Sons of Hodir! I humbly present to you... The Helm of Hodir!",42,0,100,0,0,0,"Hodir's Helm KC Bunny"); +-- Update from sniff +UPDATE `gameobject_template` SET `flags`=`flags`|36 WHERE `entry`=192080; +-- Conditions for Read Pronouncement +DELETE FROM `conditions` WHERE `SourceEntry`=@SPELL_READ_PRONOUNCEMENT AND `ConditionValue2`=@ENTRY; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(13,0,@SPELL_READ_PRONOUNCEMENT,18,1,@ENTRY,"Read Pronouncement targets Hodir's Helm KC Bunny"); +-- Spawn a helm bunny +SET @GUID := 40266; -- gap +DELETE FROM `creature` WHERE `id`=@ENTRY; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID,@ENTRY,571,1,1,0,0,7390.14,-2725.38,874.256,2.90103,300,0,0,42,0,0,0,0,0); diff --git a/sql/updates/world/2012_01_19_02_world_quest_template.sql b/sql/updates/world/2012_01_19_02_world_quest_template.sql new file mode 100644 index 00000000000..7bff373242d --- /dev/null +++ b/sql/updates/world/2012_01_19_02_world_quest_template.sql @@ -0,0 +1 @@ +UPDATE `quest_template` SET `SpecialFlags`=0 WHERE `id`=9545; diff --git a/sql/updates/world/2012_01_19_03_world_sai.sql b/sql/updates/world/2012_01_19_03_world_sai.sql new file mode 100644 index 00000000000..6588e6a1ba8 --- /dev/null +++ b/sql/updates/world/2012_01_19_03_world_sai.sql @@ -0,0 +1,19 @@ +-- [Q] [A] The Escape +-- William Pestle SAI +SET @ENTRY := 253; +SET @QUEST := 114; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,@QUEST,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"William Pestle - On Quest Accept - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"William Pestle - On Script - Say Line 0"), +(@ENTRY*100,9,1,0,0,0,100,0,5000,5000,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"William Pestle - On Script - Say Line 1"); +-- Text +DELETE FROM `db_script_string` WHERE `entry` IN (2000000080,2000000081); +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"This shouldn't take long...",12,0,100,432,0,0,"William Pestle"), +(@ENTRY,1,0,"The invisibility liquer is ready for you, $N.",12,0,100,0,0,0,"William Pestle"); diff --git a/sql/updates/world/2012_01_19_04_world_sai.sql b/sql/updates/world/2012_01_19_04_world_sai.sql new file mode 100644 index 00000000000..6c1530ce4ee --- /dev/null +++ b/sql/updates/world/2012_01_19_04_world_sai.sql @@ -0,0 +1,14 @@ +-- [Q] [A/H] This Is Going to Be Hard +-- Lotwil Veriatus SAI +SET @ENTRY := 2921; +SET @QUEST := 778; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,@QUEST,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Lotwil Veriatus - On Quest Accept - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,4000,4000,0,0,11,5001,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lotwil Veriatus - On Script - Cast Lotwil's Summoning"), +(@ENTRY*100,9,1,0,0,0,100,0,1000,1000,0,0,12,2919,1,240000,0,0,0,8,0,0,0,-6666.27,-2728.12,243.136,6.28,"Lotwil Veriatus - On Script - Summon Fam'retor Guardian"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,11,5002,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lotwil Veriatus - On Script - Cast Lotwil's Summon Complete"); diff --git a/sql/updates/world/2012_01_19_05_world_sai.sql b/sql/updates/world/2012_01_19_05_world_sai.sql new file mode 100644 index 00000000000..2e6a743167e --- /dev/null +++ b/sql/updates/world/2012_01_19_05_world_sai.sql @@ -0,0 +1,10 @@ +-- [Q] [A] The Dormant Shade +-- Lillith's Dinner Table SAI +SET @ENTRY := 1557; +SET @QUEST := 410; +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_end_scripts` WHERE `id`=@QUEST; +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,20,0,100,0,@QUEST,0,0,0,12,1946,1,180000,0,0,0,8,0,0,0,2468.28,15.26,23.89,0.37,"Lillith's Dinner Table - On Quest Complete - Summon Lillith Nefara"); diff --git a/sql/updates/world/2012_01_19_06_world_sai.sql b/sql/updates/world/2012_01_19_06_world_sai.sql new file mode 100644 index 00000000000..817d6bd9aaa --- /dev/null +++ b/sql/updates/world/2012_01_19_06_world_sai.sql @@ -0,0 +1,10 @@ +-- [Q] [A/H] Ledger from Tanaris +-- Wooden Outhouse SAI +SET @ENTRY := 173265; +SET @QUEST := 4450; +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +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,19,0,100,0,@QUEST,0,0,0,70,0,0,0,0,0,0,14,47578,173266,0,0,0,0,0,"Wooden Outhouse - On Quest Accept - Respawn Goodsteel Ledger (GO)"); diff --git a/sql/updates/world/2012_01_19_07_world_sai.sql b/sql/updates/world/2012_01_19_07_world_sai.sql new file mode 100644 index 00000000000..3b0e27667e6 --- /dev/null +++ b/sql/updates/world/2012_01_19_07_world_sai.sql @@ -0,0 +1,20 @@ +-- [Q] [A/H] Making Sense of It +-- J.D. Collie SAI +SET @ENTRY := 9117; +SET @QUEST := 4321; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `quest_template` SET `StartScript`=0,`CompleteScript`=0 WHERE `id`=@QUEST; +DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,@QUEST,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"J.D. Collie - On Quest Accept - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,6000,6000,0,0,5,6,0,0,0,0,0,1,0,0,0,0,0,0,0,"J.D. Collie - On Script - Emote ONESHOT_QUESTION"), +(@ENTRY*100,9,1,0,0,0,100,0,4000,4000,0,0,5,22,0,0,0,0,0,1,0,0,0,0,0,0,0,"J.D. Collie - On Script - Emote ONESHOT_SHOUT"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"J.D. Collie - On Script - Say Line 0"), +(@ENTRY*100,9,3,0,0,0,100,0,10000,10000,0,0,15,@QUEST,0,0,0,0,7,0,0,0,0,0,0,0,0,"J.D. Collie - On Script - Quest Credit"); +-- Text +DELETE FROM `db_script_string` WHERE `entry`=2000000030; +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"This makes sense!",12,0,100,0,0,0,"J.D. Collie"); diff --git a/sql/updates/world/2012_01_19_08_world_sai.sql b/sql/updates/world/2012_01_19_08_world_sai.sql new file mode 100644 index 00000000000..5b26998a607 --- /dev/null +++ b/sql/updates/world/2012_01_19_08_world_sai.sql @@ -0,0 +1,94 @@ +-- [QUEST] A Rough Ride (12536) +-- NPC entry 28298 (Captive Crocolisk) +SET @ENTRY := 28298; +SET @GOSSIP := 9674; +SET @TEXT_ID := 13120; +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP,`npcflag`=npcflag|1,`VehicleId`=0 WHERE `entry`=@ENTRY; +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP; +INSERT INTO `gossip_menu` (`entry`,`text_id`) +VALUES (@GOSSIP,@TEXT_ID); +-- Added condition so player can only select it once he has the quest +SET @GOSSIP_ENTRY := 9674; +SET @QUEST := 12536; +DELETE FROM `conditions` WHERE `SourceGroup`=@GOSSIP_ENTRY AND `SourceTypeOrReferenceId`=15; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP_ENTRY,0,0,9,@QUEST,0,0,0,0, 'Only show gossip 9674 when quest 12536 is added'); +-- Add missing gossip +SET @GOSSIP := 9674; +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9674 AND `id`=0; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(@GOSSIP,0,0,"You look safe enough... let's do this.",1,1,0,0,0,0, ''); +-- [SAI] On gossip select - mount and waypoint +SET @ENTRY := 28298; +SET @GOSSIP := 9674; +SET @SPELL := 51258; +SET @ENTRY_MOUNT := 28308; +SET @MODELID_MOUNT := 25107; +SET @QUEST := 12536; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@ENTRY,@ENTRY_MOUNT); +UPDATE `creature_template` SET `VehicleId`=115 WHERE `entry`=@ENTRY_MOUNT; +UPDATE `creature_template` SET `InhabitType`=3 WHERE `entry`=@ENTRY_MOUNT; +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|512|256 WHERE `entry`=@ENTRY_MOUNT; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY_MOUNT) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY_MOUNT*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,62,0,100,0,@GOSSIP,0,0,0,11,@SPELL,0,0,0,0,0,7,0,0,0,0,0,0,0, 'On gossip select - cast spell 51258 - Captive Crocolisk'), +(@ENTRY_MOUNT,0,1,0,54,0,100,0,0,0,0,0,80,@ENTRY_MOUNT*100,0,2,0,0,0,1,0,0,0,0,0,0,0, 'On summon - run script - Captive Crocolisk'), +(@ENTRY_MOUNT*100,9,1,0,0,0,100,0,0,0,0,0,53,1,@ENTRY_MOUNT,0,@QUEST,0,1,1,0,0,0,0,0,0,0, 'Start wp - Captive Crocolisk'), +(@ENTRY_MOUNT,0,2,3,58,0,100,0,47,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'on wp end - despawn - Captive Crocolisk'), +(@ENTRY_MOUNT,0,3,0,61,0,100,0,@ENTRY_MOUNT,0,0,0,15,@QUEST,0,0,0,0,0,7,0,0,0,0,0,0,0, 'on despawn - call area explored of event happens'); +-- Waypoints +DELETE FROM `waypoints` WHERE `entry`=@ENTRY_MOUNT; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY_MOUNT,1,5268.226,4425.439,-95.55899, 'Captive Crocolisk'), +(@ENTRY_MOUNT,2,5249.557,4405.892,-96.04365, 'Captive Crocolisk'), +(@ENTRY_MOUNT,3,5266.678,4365.464,-98.19455, 'Captive Crocolisk'), +(@ENTRY_MOUNT,4,5289.138,4366.553,-102.234, 'Captive Crocolisk'), +(@ENTRY_MOUNT,5,5330.018,4363.27,-121.0311, 'Captive Crocolisk'), +(@ENTRY_MOUNT,6,5349.229,4341.059,-134.0126, 'Captive Crocolisk'), +(@ENTRY_MOUNT,7,5268.226,4425.439,-95.55899, 'Captive Crocolisk'), +(@ENTRY_MOUNT,8,5249.557,4405.892,-96.04365, 'Captive Crocolisk'), +(@ENTRY_MOUNT,9,5266.678,4365.464,-98.19455, 'Captive Crocolisk'), +(@ENTRY_MOUNT,10,5289.138,4366.553,-102.234, 'Captive Crocolisk'), +(@ENTRY_MOUNT,11,5330.018,4363.27,-121.0311, 'Captive Crocolisk'), +(@ENTRY_MOUNT,12,5349.229,4341.059,-134.0126, 'Captive Crocolisk'), +(@ENTRY_MOUNT,13,5365.038,4333.716,-141.5817, 'Captive Crocolisk'), +(@ENTRY_MOUNT,14,5405.443,4307.841,-142.03, 'Captive Crocolisk'), +(@ENTRY_MOUNT,15,5434.999,4305.659,-136.4706, 'Captive Crocolisk'), +(@ENTRY_MOUNT,16,5464.708,4302.066,-133.1981, 'Captive Crocolisk'), +(@ENTRY_MOUNT,17,5490.555,4294.395,-127.5203, 'Captive Crocolisk'), +(@ENTRY_MOUNT,18,5503.808,4269.717,-110.3168, 'Captive Crocolisk'), +(@ENTRY_MOUNT,19,5518.324,4255.308,-103.0638, 'Captive Crocolisk'), +(@ENTRY_MOUNT,20,5540.53,4259.77,-102.3979, 'Captive Crocolisk'), +(@ENTRY_MOUNT,21,5564.194,4263.45,-102.7574, 'Captive Crocolisk'), +(@ENTRY_MOUNT,22,5585.45,4261.137,-99.54807, 'Captive Crocolisk'), +(@ENTRY_MOUNT,23,5609.614,4259.657,-98.87333, 'Captive Crocolisk'), +(@ENTRY_MOUNT,24,5633.434,4259.228,-98.53442, 'Captive Crocolisk'), +(@ENTRY_MOUNT,25,5681.639,4266.31,-99.26748, 'Captive Crocolisk'), +(@ENTRY_MOUNT,26,5708.126,4273.348,-102.9183, 'Captive Crocolisk'), +(@ENTRY_MOUNT,27,5748.732,4284.135,-112.0557, 'Captive Crocolisk'), +(@ENTRY_MOUNT,28,5839.82,4368.61,-112.0805, 'Captive Crocolisk'), +(@ENTRY_MOUNT,29,5865.922,4371.208,-105.5544, 'Captive Crocolisk'), +(@ENTRY_MOUNT,30,5897.276,4408.44,-95.25065, 'Captive Crocolisk'), +(@ENTRY_MOUNT,31,5925.311,4440.624,-94.77592, 'Captive Crocolisk'), +(@ENTRY_MOUNT,32,5953.005,4476.29,-94.3763, 'Captive Crocolisk'), +(@ENTRY_MOUNT,33,5964.229,4503.729,-92.81553, 'Captive Crocolisk'), +(@ENTRY_MOUNT,34,5960.583,4546.558,-95.65462, 'Captive Crocolisk'), +(@ENTRY_MOUNT,35,5965.167,4579.141,-97.39779, 'Captive Crocolisk'), +(@ENTRY_MOUNT,36,5969.295,4613.739,-98.05751, 'Captive Crocolisk'), +(@ENTRY_MOUNT,37,5975.809,4659.289,-99.27143, 'Captive Crocolisk'), +(@ENTRY_MOUNT,38,5992.961,4699.554,-99.30317, 'Captive Crocolisk'), +(@ENTRY_MOUNT,39,6015.139,4743.752,-97.52377, 'Captive Crocolisk'), +(@ENTRY_MOUNT,40,6035.183,4788.787,-94.66938, 'Captive Crocolisk'), +(@ENTRY_MOUNT,41,6064.951,4827.502,-94.54885, 'Captive Crocolisk'), +(@ENTRY_MOUNT,42,6065.57,4870.553,-94.47726, 'Captive Crocolisk'), +(@ENTRY_MOUNT,43,6096.612,4885.741,-94.44479, 'Captive Crocolisk'), +(@ENTRY_MOUNT,44,6120.387,4902.048,-95.06882, 'Captive Crocolisk'), +(@ENTRY_MOUNT,45,6139.616,4913.349,-94.8635, 'Captive Crocolisk'), +(@ENTRY_MOUNT,46,6139.616,4913.349,-94.93861, 'Captive Crocolisk'), +(@ENTRY_MOUNT,47,6139.616,4913.349,-94.93861, 'Captive Crocolisk'); +-- Spawn Zepik +SET @GUID := 40267; +DELETE FROM `creature` WHERE `id`=28216; +INSERT INTO `creature` VALUES +(@GUID,28216,571,1,1,0,0,6147.37,4917.29,-94.094,3.42155,300,0,0,42,0,0,0,0,0); diff --git a/sql/updates/world/2012_01_21_00_world_creature.sql b/sql/updates/world/2012_01_21_00_world_creature.sql new file mode 100644 index 00000000000..b4a015380c3 --- /dev/null +++ b/sql/updates/world/2012_01_21_00_world_creature.sql @@ -0,0 +1,8 @@ +-- Spawns from sniff +SET @GUID := 40279; -- set value +DELETE FROM `creature` WHERE `id`=27791; +INSERT IGNORE INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES +(@GUID+0,27791,571,1,1,0,0,3653.64233,-1204.21200,102.420319,4.04458666,120,0,0), +(@GUID+1,27791,571,1,1,0,0,3673.77515,-1213.68188,102.420319,4.08126450,120,0,0), +(@GUID+2,27791,571,1,1,0,0,3674.53735,-1175.28369,102.420288,1.78801400,120,0,0), +(@GUID+3,27791,571,1,1,0,0,3684.37158,-1180.27942,102.420288,1.22173047,120,0,0); diff --git a/sql/updates/world/2012_01_21_00_world_sai.sql b/sql/updates/world/2012_01_21_00_world_sai.sql new file mode 100644 index 00000000000..e275c521e74 --- /dev/null +++ b/sql/updates/world/2012_01_21_00_world_sai.sql @@ -0,0 +1,11 @@ +-- 7th Legion Rifleman SAI (replaces EAI) +SET @ENTRY := 27791; -- NPC entry +SET @SPELL1 := 62312; -- Cast Net +SET @SPELL2 := 50092; -- Cast Shoot +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,"7th Legion Rifleman - On Aggro - Cast Net"), +(@ENTRY,0,1,0,0,0,100,0,500,3500,5000,6000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0,"7th Legion Rifleman - In Combat - Cast Shoot"), +(@ENTRY,0,2,0,2,0,100,1,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"7th Legion Rifleman - At 15% HP - Flee"); diff --git a/sql/updates/world/2012_01_21_01_world_npc_vendor.sql b/sql/updates/world/2012_01_21_01_world_npc_vendor.sql new file mode 100644 index 00000000000..f8c7d0f4327 --- /dev/null +++ b/sql/updates/world/2012_01_21_01_world_npc_vendor.sql @@ -0,0 +1,6 @@ +-- Remove old one that still required reputation even after you bought it +DELETE FROM `npc_vendor` WHERE `entry`=32538 and`item`=50367 and`ExtendedCost`=0; + +-- Commit for new one +DELETE FROM `npc_vendor` WHERE `entry`=32538 and`item`=44149 and`ExtendedCost`=0; +INSERT INTO `npc_vendor` (`entry`,`slot`,`item`,`maxcount`,`incrtime`,`ExtendedCost`) VALUES (32538,0,44149,0,0,0); diff --git a/sql/updates/world/2012_01_21_02_world_achievement_criteria_data.sql b/sql/updates/world/2012_01_21_02_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..a9c2781d57f --- /dev/null +++ b/sql/updates/world/2012_01_21_02_world_achievement_criteria_data.sql @@ -0,0 +1,5 @@ +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (1237,1240,1241); +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +(1237, 0, 0, 0, ''), -- Achievement: Let's Get This Done +(1240, 0, 0, 0, ''), -- Achievement: Flurry +(1241, 0, 0, 0, ''); -- Achievement: The Alterac Blitz diff --git a/sql/updates/world/2012_01_22_00_world_command.sql b/sql/updates/world/2012_01_22_00_world_command.sql new file mode 100644 index 00000000000..c87b7b3f825 --- /dev/null +++ b/sql/updates/world/2012_01_22_00_world_command.sql @@ -0,0 +1 @@ +UPDATE `command` SET `name`='reload waypoint_data',`help`='Syntax: .reload waypoint_data will reload waypoint_data table.' WHERE `name`='reload wp_data'; diff --git a/sql/updates/world/2012_01_22_00_world_sai.sql b/sql/updates/world/2012_01_22_00_world_sai.sql new file mode 100644 index 00000000000..8df31981de1 --- /dev/null +++ b/sql/updates/world/2012_01_22_00_world_sai.sql @@ -0,0 +1,71 @@ +-- Munci SAI +SET @ENTRY := 18788; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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,4,0,100,0,0,0,0,0,12,9527,1,30000,0,0,0,1,0,0,0,0,0,0,0,"Munci - On Aggro - Summon Enraged Hippogryphs"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,1,30000,0,0,0,1,0,0,0,0,0,0,0,"Munci - On Aggro - Summon Enraged Hippogryphs"), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Munci - On Aggro - Say Line 0"); +-- Text for Munci +DELETE FROM `creature_ai_texts` WHERE `entry`=-549; +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Guards!",14,7,100,0,0,0,"Munci"); + +-- Amish Wildhammer SAI +SET @ENTRY := 18931; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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,4,0,100,0,0,0,0,0,12,9526,1,30000,0,0,0,1,0,0,0,0,0,0,0,"Amish Wildhammer - On Aggro - Summon Enraged Gryphons"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,1,30000,0,0,0,1,0,0,0,0,0,0,0,"Amish Wildhammer - On Aggro - Summon Enraged Gryphons"), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Amish Wildhammer - On Aggro - Say Line 0"); +-- Text for Amish Wildhammer +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Guards!",14,7,100,0,0,0,"Amish Wildhammer"); + +-- Lemla Hopewing SAI +SET @ENTRY := 19181; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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,4,0,100,0,0,0,0,0,12,9526,1,30000,0,0,0,1,0,0,0,0,0,0,0,"Lemla Hopewing - On Aggro - Summon Enraged Gryphons"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9526,1,30000,0,0,0,1,0,0,0,0,0,0,0,"Lemla Hopewing - On Aggro - Summon Enraged Gryphons"), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lemla Hopewing - On Aggro - Say Line 0"); +-- Text for Lemla Hopewing +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Guards!",14,7,100,0,0,0,"Lemla Hopewing"); + +-- Auhula SAI +SET @ENTRY := 22936; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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,4,0,100,0,0,0,0,0,12,9527,1,30000,0,0,0,1,0,0,0,0,0,0,0,"Auhula - On Aggro - Summon Enraged Hippogryphs"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9527,1,30000,0,0,0,1,0,0,0,0,0,0,0,"Auhula - On Aggro - Summon Enraged Hippogryphs"), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Auhula - On Aggro - Say Line 0"); +-- Text for Auhula +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Guards!",14,7,100,0,0,0,"Auhula"); + +-- Hyeyoung Parka SAI +SET @ENTRY := 29762; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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,4,0,100,0,0,0,0,0,12,9297,1,30000,0,0,0,1,0,0,0,0,0,0,0,"Hyeyoung Parka - On Aggro - Summon Enraged Wyverns"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,9297,1,30000,0,0,0,1,0,0,0,0,0,0,0,"Hyeyoung Parka - On Aggro - Summon Enraged Wyverns"), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hyeyoung Parka - On Aggro - Say Line 0"); +-- Text for Hyeyoung Parka +DELETE FROM `creature_ai_texts` WHERE `entry`=-548; +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"Guards!",14,1,100,0,0,0,"Hyeyoung Parka"); diff --git a/sql/updates/world/2012_01_22_01_world_conditions.sql b/sql/updates/world/2012_01_22_01_world_conditions.sql new file mode 100644 index 00000000000..9aaea4f8ac1 --- /dev/null +++ b/sql/updates/world/2012_01_22_01_world_conditions.sql @@ -0,0 +1 @@ +UPDATE `conditions` SET `SourceGroup`=23324 WHERE `SourceTypeOrReferenceId`=1 AND `SourceGroup`=23342; diff --git a/sql/updates/world/2012_01_22_02_world_creature_addon.sql b/sql/updates/world/2012_01_22_02_world_creature_addon.sql new file mode 100644 index 00000000000..808d728610e --- /dev/null +++ b/sql/updates/world/2012_01_22_02_world_creature_addon.sql @@ -0,0 +1,2 @@ +-- cleanups +DELETE FROM `creature_addon` WHERE `guid` in (133434,133435); diff --git a/sql/updates/world/2012_01_23_00_world_game_event_seasonal_questrelation.sql b/sql/updates/world/2012_01_23_00_world_game_event_seasonal_questrelation.sql new file mode 100644 index 00000000000..40bf28a1ead --- /dev/null +++ b/sql/updates/world/2012_01_23_00_world_game_event_seasonal_questrelation.sql @@ -0,0 +1,244 @@ +DELETE FROM `game_event_seasonal_questrelation` WHERE `questId` IN (9319,9322,9323,9324,9325,9326,9330,9331,9332,9339,9365,9367,9368,9386,9388,9389,11657,11691,11731,11882,11883,11886,11891,11915,11917,11921,11922,11923,11924,11925,11926,11933,11935,11947,11948,11952,11953,11954,11955,11964,11966,11970,11971,11972,12012) AND `eventEntry`=1; +DELETE FROM `game_event_seasonal_questrelation` WHERE `questId` IN (8619,8635,8636,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8688,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8862,8863,8864,8865,8866,8867,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,13012,13013,13014,13015,13016,13017,13018,13019,13020,13021,13022,13023,13024,13025,13026,13027,13028,13029,13030,13031,13032,13033,13065,13066,13067) AND `eventEntry`=7; +DELETE FROM `game_event_seasonal_questrelation` WHERE `questId` IN (14488,24597,24609,24656,24657,24745,24848,24849,24666,24792,24804,24611,24536,24612,24635,24636,24655,24610,24629,24614,24576,24613,24615,24638,24645,24647,24648,24649,24650,24651,24652,24658,24659,24660,24662,24663,24664,24665,24793,24805,24850,24851,24541,14483,24661) AND `eventEntry`=8; +DELETE FROM `game_event_seasonal_questrelation` WHERE `questId` IN (13479,13480,13483,13484,13502,13503) AND `eventEntry`=9; +DELETE FROM `game_event_seasonal_questrelation` WHERE `questId` IN (11120,11431,11442,11409,11318,11117,11400,11419,11118,11122,11293,11294,11321,11407,11408,11412,11413,11441,11446,11454,11486,11487,12020,12022,12318,12193,12062,12491,11447,12191,12492,12194,12192,12278,12306,12420,12421,13932,13649,13931,11127,11320,11347,11437,11438,11444,11445) AND `eventEntry`=24; + +INSERT INTO `game_event_seasonal_questrelation` (`questId`,`eventEntry`) VALUES +(8619,7), +(8635,7), +(8636,7), +(8642,7), +(8643,7), +(8644,7), +(8645,7), +(8646,7), +(8647,7), +(8648,7), +(8649,7), +(8650,7), +(8651,7), +(8652,7), +(8653,7), +(8654,7), +(8670,7), +(8671,7), +(8672,7), +(8673,7), +(8674,7), +(8675,7), +(8676,7), +(8677,7), +(8678,7), +(8679,7), +(8680,7), +(8681,7), +(8682,7), +(8683,7), +(8684,7), +(8685,7), +(8686,7), +(8688,7), +(8713,7), +(8714,7), +(8715,7), +(8716,7), +(8717,7), +(8718,7), +(8719,7), +(8720,7), +(8721,7), +(8722,7), +(8723,7), +(8724,7), +(8725,7), +(8726,7), +(8727,7), +(8862,7), +(8863,7), +(8864,7), +(8865,7), +(8866,7), +(8867,7), +(8870,7), +(8871,7), +(8872,7), +(8873,7), +(8874,7), +(8875,7), +(8876,7), +(8877,7), +(8878,7), +(8879,7), +(8880,7), +(8881,7), +(8882,7), +(8883,7), +(13012,7), +(13013,7), +(13014,7), +(13015,7), +(13016,7), +(13017,7), +(13018,7), +(13019,7), +(13020,7), +(13021,7), +(13022,7), +(13023,7), +(13024,7), +(13025,7), +(13026,7), +(13027,7), +(13028,7), +(13029,7), +(13030,7), +(13031,7), +(13032,7), +(13033,7), +(13065,7), +(13066,7), +(13067,7), +(11120,24), +(11431,24), +(11442,24), +(11409,24), +(11318,24), +(11117,24), +(11400,24), +(11419,24), +(11118,24), +(11122,24), +(11293,24), +(11294,24), +(11321,24), +(11407,24), +(11408,24), +(11412,24), +(11413,24), +(11441,24), +(11446,24), +(11454,24), +(11486,24), +(11487,24), +(12020,24), +(12022,24), +(12318,24), +(12193,24), +(12062,24), +(12491,24), +(11447,24), +(12191,24), +(12492,24), +(12194,24), +(12192,24), +(12278,24), +(12306,24), +(12420,24), +(12421,24), +(13932,24), +(13649,24), +(13931,24), +(11127,24), +(11320,24), +(11347,24), +(11437,24), +(11438,24), +(11444,24), +(11445,24), +(9319,1), +(9322,1), +(9323,1), +(9324,1), +(9325,1), +(9326,1), +(9330,1), +(9331,1), +(9332,1), +(9339,1), +(9365,1), +(9367,1), +(9368,1), +(9386,1), +(9388,1), +(9389,1), +(11657,1), +(11691,1), +(11731,1), +(11882,1), +(11883,1), +(11886,1), +(11891,1), +(11915,1), +(11917,1), +(11921,1), +(11922,1), +(11923,1), +(11924,1), +(11925,1), +(11926,1), +(11933,1), +(11935,1), +(11947,1), +(11948,1), +(11952,1), +(11953,1), +(11954,1), +(11955,1), +(11964,1), +(11966,1), +(11970,1), +(11971,1), +(11972,1), +(12012,1), +(13479,9), +(13480,9), +(13483,9), +(13484,9), +(13502,9), +(13503,9), +(14488,8), +(24597,8), +(24609,8), +(24656,8), +(24657,8), +(24745,8), +(24848,8), +(24849,8), +(24666,8), +(24792,8), +(24804,8), +(24611,8), +(24536,8), +(24612,8), +(24635,8), +(24636,8), +(24655,8), +(24610,8), +(24629,8), +(24614,8), +(24576,8), +(24613,8), +(24615,8), +(24638,8), +(24645,8), +(24647,8), +(24648,8), +(24649,8), +(24650,8), +(24651,8), +(24652,8), +(24658,8), +(24659,8), +(24660,8), +(24662,8), +(24663,8), +(24664,8), +(24665,8), +(24793,8), +(24805,8), +(24850,8), +(24851,8), +(24541,8), +(14483,8), +(24661,8); diff --git a/sql/updates/world/2012_01_23_00_world_sai.sql b/sql/updates/world/2012_01_23_00_world_sai.sql new file mode 100644 index 00000000000..d73561b6cd6 --- /dev/null +++ b/sql/updates/world/2012_01_23_00_world_sai.sql @@ -0,0 +1,110 @@ +-- Windle Sparkshine SAI +SET @ENTRY := 29261; +SET @SPELL_LIGHT_LAMP := 60535; +UPDATE `gameobject` SET `state`=1 WHERE `id` IN (191444,192086,192085,192084,192087,192089,192088,192067,191445,192850,192853,192854,192852,192083,191440,192070,192069,192117,192116,192119,191665); +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,68,0,100,0,25,0,0,0,53,0,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - Game Event 25 Start - Start WP"), +(@ENTRY,0,1,0,40,0,100,0,1,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 1 - Run Script"), +(@ENTRY,0,2,0,40,0,100,0,5,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 5 - Run Script"), +(@ENTRY,0,3,0,40,0,100,0,8,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 8 - Run Script"), +(@ENTRY,0,4,0,40,0,100,0,12,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 12 - Run Script"), +(@ENTRY,0,5,0,40,0,100,0,16,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 16 - Run Script"), +(@ENTRY,0,6,0,40,0,100,0,20,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 20 - Run Script"), +(@ENTRY,0,7,0,40,0,100,0,24,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 24 - Run Script"), +(@ENTRY,0,8,0,40,0,100,0,29,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 29 - Run Script"), +(@ENTRY,0,9,0,40,0,100,0,33,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 33 - Run Script"), +(@ENTRY,0,10,0,40,0,100,0,36,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 36 - Run Script"), +(@ENTRY,0,11,0,40,0,100,0,38,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 38 - Run Script"), +(@ENTRY,0,12,0,40,0,100,0,45,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 45 - Run Script"), +(@ENTRY,0,13,0,40,0,100,0,48,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 48 - Run Script"), +(@ENTRY,0,14,0,40,0,100,0,53,@ENTRY,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - At WP 53 - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,54,3500,0,0,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - On Script - Pause WP"), +(@ENTRY*100,9,1,0,0,0,100,0,1000,1000,0,0,11,@SPELL_LIGHT_LAMP,0,0,0,0,0,1,0,0,0,0,0,0,0,"Windle Sparkshine - On Script - Cast Light Lamp"), +(@ENTRY,0,15,0,40,0,100,0,1,@ENTRY,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.654867,"Windle Sparkshine - At WP 56 - Set Orientation"); + +-- Waypoints +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,5747.069,685.3748,643.8239,'Windle Sparkshine'), -- Lamp 1 +(@ENTRY,2,5749.971,682.7211,643.4057,'Windle Sparkshine'), +(@ENTRY,3,5760.647,698.313,642.3947,'Windle Sparkshine'), +(@ENTRY,4,5770.979,712.3667,641.5851,'Windle Sparkshine'), +(@ENTRY,5,5771.641,718.9518,641.9728,'Windle Sparkshine'), -- Lamp 2 +(@ENTRY,6,5793.795,719.567,640.5906,'Windle Sparkshine'), +(@ENTRY,7,5806.629,718.5358,640.7841,'Windle Sparkshine'), +(@ENTRY,8,5807.11,723.0623,641.0547,'Windle Sparkshine'), -- Lamp 3 +(@ENTRY,9,5812.014,718.6132,640.9974,'Windle Sparkshine'), +(@ENTRY,10,5825.027,714.0911,640.9233,'Windle Sparkshine'), +(@ENTRY,11,5836.411,706.2252,641.2604,'Windle Sparkshine'), +(@ENTRY,12,5838.926,710.4177,641.3674,'Windle Sparkshine'), -- Lamp 4 +(@ENTRY,13,5836.411,706.2252,641.2604,'Windle Sparkshine'), +(@ENTRY,14,5850.628,692.9323,642.3394,'Windle Sparkshine'), +(@ENTRY,15,5871.261,679.3507,643.1625,'Windle Sparkshine'), +(@ENTRY,16,5889.708,676.6304,643.6068,'Windle Sparkshine'), -- Lamp 5 +(@ENTRY,17,5885.975,668.9486,643.8263,'Windle Sparkshine'), +(@ENTRY,18,5894.604,656.5289,644.8455,'Windle Sparkshine'), +(@ENTRY,19,5893.215,644.1390,645.6358,'Windle Sparkshine'), +(@ENTRY,20,5891.531,635.5212,647.5772,'Windle Sparkshine'), -- Lamp 6 +(@ENTRY,21,5885.393,639.2025,646.5132,'Windle Sparkshine'), +(@ENTRY,22,5878.637,630.1852,647.6648,'Windle Sparkshine'), +(@ENTRY,23,5865.146,615.7023,650.0197,'Windle Sparkshine'), +(@ENTRY,24,5867.964,613.0705,650.4550,'Windle Sparkshine'), -- Lamp 7 +(@ENTRY,25,5865.146,615.7023,650.0197,'Windle Sparkshine'), +(@ENTRY,26,5854.076,607.8509,650.7210,'Windle Sparkshine'), +(@ENTRY,27,5840.764,590.5446,650.6240,'Windle Sparkshine'), +(@ENTRY,28,5837.371,583.0912,650.7756,'Windle Sparkshine'), +(@ENTRY,29,5840.763,580.3890,651.8137,'Windle Sparkshine'), -- Lamp 8 +(@ENTRY,30,5837.371,583.0912,650.7756,'Windle Sparkshine'), +(@ENTRY,31,5822.904,570.0418,650.1446,'Windle Sparkshine'), +(@ENTRY,32,5805.871,564.1931,650.1898,'Windle Sparkshine'), +(@ENTRY,33,5796.087,561.1876,650.6658,'Windle Sparkshine'), -- Lamp 9 +(@ENTRY,34,5796.753,566.2323,650.1285,'Windle Sparkshine'), +(@ENTRY,35,5772.444,583.8340,649.8836,'Windle Sparkshine'), +(@ENTRY,36,5767.615,579.1342,650.2487,'Windle Sparkshine'), -- Lamp 10 +(@ENTRY,37,5761.446,588.7081,649.6515,'Windle Sparkshine'), +(@ENTRY,38,5750.556,591.0724,649.8145,'Windle Sparkshine'), -- Lamp 11 +(@ENTRY,39,5749.783,599.296,649.0384,'Windle Sparkshine'), +(@ENTRY,40,5737.969,611.5457,647.9193,'Windle Sparkshine'), +(@ENTRY,41,5726.467,621.8894,646.9294,'Windle Sparkshine'), +(@ENTRY,42,5714.581,625.4625,646.4603,'Windle Sparkshine'), +(@ENTRY,43,5702.122,627.8116,646.3648,'Windle Sparkshine'), +(@ENTRY,44,5693.323,629.3795,646.5901,'Windle Sparkshine'), +(@ENTRY,45,5687.516,629.6511,647.1143,'Windle Sparkshine'), -- Lamp 12 +(@ENTRY,46,5692.803,651.879,646.5027,'Windle Sparkshine'), +(@ENTRY,47,5696.018,667.5477,645.7817,'Windle Sparkshine'), +(@ENTRY,48,5695.917,678.2612,646.0887,'Windle Sparkshine'), -- Lamp 13 +(@ENTRY,49,5700.438,674.0465,645.4587,'Windle Sparkshine'), +(@ENTRY,50,5714.589,662.3508,645.9952,'Windle Sparkshine'), +(@ENTRY,51,5723.479,658.3279,646.0461,'Windle Sparkshine'), +(@ENTRY,52,5728.87,666.1133,645.8447,'Windle Sparkshine'), +(@ENTRY,53,5726.601,666.7487,645.8505,'Windle Sparkshine'), -- Lamp 14 +(@ENTRY,54,5736.254,665.7919,644.9579,'Windle Sparkshine'), +(@ENTRY,55,5744.996,676.1825,644.0975,'Windle Sparkshine'), +(@ENTRY,56,5744.94,681.546,644.136,'Windle Sparkshine'); -- Homeposition + +-- Conditions for spell 'Light Lamp' +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@SPELL_LIGHT_LAMP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,@SPELL_LIGHT_LAMP,0,18,0,191444,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192086,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192085,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192084,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192087,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192089,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192088,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192067,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,191445,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192850,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192853,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192854,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192852,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192083,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,191440,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192070,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192069,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192117,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192116,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,192119,0,0,'',NULL), +(13,0,@SPELL_LIGHT_LAMP,0,18,0,191665,0,0,'',NULL); diff --git a/sql/updates/world/2012_01_23_01_world_creature_script_names.sql b/sql/updates/world/2012_01_23_01_world_creature_script_names.sql new file mode 100644 index 00000000000..d7c2b22725e --- /dev/null +++ b/sql/updates/world/2012_01_23_01_world_creature_script_names.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='npc_frost_tomb' WHERE `entry`=23965; +UPDATE `creature_template` SET `ScriptName`='npc_vrykul_skeleton' WHERE `entry`=23970; diff --git a/sql/updates/world/2012_01_23_02_world_disables.sql b/sql/updates/world/2012_01_23_02_world_disables.sql new file mode 100644 index 00000000000..0a1be704dac --- /dev/null +++ b/sql/updates/world/2012_01_23_02_world_disables.sql @@ -0,0 +1 @@ +DELETE FROM `disables` WHERE `entry`=7231 AND `sourceType`=4; diff --git a/sql/updates/world/2012_01_23_03_world_achievement_criteria_data.sql b/sql/updates/world/2012_01_23_03_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..4d1f4536455 --- /dev/null +++ b/sql/updates/world/2012_01_23_03_world_achievement_criteria_data.sql @@ -0,0 +1,3 @@ +DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=7231; +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `ScriptName`) VALUES +(7231,11,'achievement_on_the_rocks'); diff --git a/sql/updates/world/2012_01_23_04_world_creature_text.sql b/sql/updates/world/2012_01_23_04_world_creature_text.sql new file mode 100644 index 00000000000..f505a86b16c --- /dev/null +++ b/sql/updates/world/2012_01_23_04_world_creature_text.sql @@ -0,0 +1,9 @@ +DELETE FROM `script_texts` WHERE `entry` IN (-1574000,-1574001,-1574002,-1574003,-1574004); + +DELETE FROM `creature_text` WHERE `entry`=23953; +INSERT INTO `creature_text` (`entry`, `groupid`, `text`, `sound`, `emote`, `type`) VALUES +(23953,1,'Your blood is mine!',13221,7,14), +(23953,2,'Aranal, ledel! Their fate shall be yours!',13224,0,14), +(23953,3,'Not so fast.',13222,0,14), +(23953,4,'%s casts Frost Tomb on $n.',0,0,41), +(23953,5,'I join... the night.',13225,0,14); diff --git a/sql/updates/world/2012_01_23_05_world_spell_script_names.sql b/sql/updates/world/2012_01_23_05_world_spell_script_names.sql new file mode 100644 index 00000000000..6f3b4907e5b --- /dev/null +++ b/sql/updates/world/2012_01_23_05_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=48400; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(48400,'spell_frost_tomb'); diff --git a/sql/updates/world/2012_01_23_06_world_achievement_criteria_data.sql b/sql/updates/world/2012_01_23_06_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..33899c3f512 --- /dev/null +++ b/sql/updates/world/2012_01_23_06_world_achievement_criteria_data.sql @@ -0,0 +1,3 @@ +DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=7231 AND `type`=12; +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +(7231,12,1,0,''); diff --git a/sql/updates/world/2012_01_23_07_world_creature_text.sql b/sql/updates/world/2012_01_23_07_world_creature_text.sql new file mode 100644 index 00000000000..90ac11e363c --- /dev/null +++ b/sql/updates/world/2012_01_23_07_world_creature_text.sql @@ -0,0 +1,5 @@ +UPDATE `creature_text` SET `comment`='Prince Keleseth - SAY_DEATH' WHERE `groupid`=5 AND `entry`=23953; +UPDATE `creature_text` SET `comment`='Prince Keleseth - SAY_FROST_TOMB_EMOTE' WHERE `groupid`=4 AND `entry`=23953; +UPDATE `creature_text` SET `comment`='Prince Keleseth - SAY_FROST_TOMB' WHERE `groupid`=3 AND `entry`=23953; +UPDATE `creature_text` SET `comment`='Prince Keleseth - SAY_SUMMON_SKELETONS' WHERE `groupid`=2 AND `entry`=23953; +UPDATE `creature_text` SET `comment`='Prince Keleseth - SAY_START_COMBAT' WHERE `groupid`=1 AND `entry`=23953; diff --git a/sql/updates/world/2012_01_24_00_world_misc.sql b/sql/updates/world/2012_01_24_00_world_misc.sql new file mode 100644 index 00000000000..8703cd7aa42 --- /dev/null +++ b/sql/updates/world/2012_01_24_00_world_misc.sql @@ -0,0 +1,18 @@ +-- Make Dame Evniki Kapsalis show vendor gossip option only to players with Crusader title +UPDATE `creature_template` SET `AIName` = 'SmartAI',`ScriptName` = '' WHERE `entry` = 34885; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10598; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`COMMENT`) VALUES +(15,10598,0,0,17,2816,0,0,0,'',"Evniki Kapsalis should only sell to Crusaders"), +(15,10598,0,1,17,2817,0,0,0,'',"Evniki Kapsalis should only sell to Crusaders"); + +SET @SPELL_CHAIN = 68341; +SET @NPC_FJOLA_LIGHTBANE = 36065; +SET @NPC_EYDIS_DARKBANE = 36066; +SET @NPC_PRIESTESS_ALORAH = 36101; +SET @NPC_PRIEST_GRIMMIN = 36102; + +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` IN(@NPC_PRIESTESS_ALORAH,@NPC_PRIEST_GRIMMIN); +DELETE FROM `smart_scripts` WHERE (`entryorguid` IN(@NPC_PRIESTESS_ALORAH,@NPC_PRIEST_GRIMMIN) AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC_PRIESTESS_ALORAH,0,0,0,1,0,100,1,100,100,0,0,11,@SPELL_CHAIN,0,0,0,0,0,19,@NPC_EYDIS_DARKBANE,0,0,0,0,0,0,'Priestess Alorah - Cast chain on Eydis Darkbane'), +(@NPC_PRIEST_GRIMMIN,0,0,0,1,0,100,1,100,100,0,0,11,@SPELL_CHAIN,0,0,0,0,0,19,@NPC_FJOLA_LIGHTBANE,0,0,0,0,0,0,'Priestess Grimmin - Cast chain on Fjola Lightbane'); diff --git a/sql/updates/world/2012_01_24_00_world_spell_script_names.sql b/sql/updates/world/2012_01_24_00_world_spell_script_names.sql new file mode 100644 index 00000000000..0e772c3c200 --- /dev/null +++ b/sql/updates/world/2012_01_24_00_world_spell_script_names.sql @@ -0,0 +1,4 @@ +-- Scriptname for Refocus spell +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_item_refocus'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(24531,'spell_item_refocus'); diff --git a/sql/updates/world/2012_01_26_00_world_sai.sql b/sql/updates/world/2012_01_26_00_world_sai.sql new file mode 100644 index 00000000000..ee69e263e2e --- /dev/null +++ b/sql/updates/world/2012_01_26_00_world_sai.sql @@ -0,0 +1,45 @@ +-- Quest Elven Legends (7481, 7482) +-- Skeletal Remains of Kariel Winthalus SAI +SET @ENTRY := 179544; -- GO entry +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,1,0,0,62,0,100,0,5743,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Skeletal Remains of Kariel Winthalus - On Gossip option select - run script'), +(@ENTRY,1,1,0,62,0,100,0,5743,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Skeletal Remains of Kariel Winthalus - On Gossip option select - run script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Skeletal Remains of Kariel Winthalus - Script - Close Gossip'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Skeletal Remains of Kariel Winthalus - Script - Store target'), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,100,1,0,0,0,0,0,11,14368,30,0,0,0,0,0, 'Skeletal Remains of Kariel Winthalus - Script - Send target'), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,45,0,1,0,0,0,0,11,14368,30,0,0,0,0,0,'Skeletal Remains of Kariel Winthalus - Script - Set data 0 1 for entry 14368'), +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,9,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Skeletal Remains of Kariel Winthalus - Script - Deactivate self'), +(@ENTRY*100,9,5,0,0,0,100,0,28000,28000,28000,28000,32,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Skeletal Remains of Kariel Winthalus - Script - Activate self'); +-- Lorekeeper Lydros SAI +SET @ENTRY := 14368; -- NPC entry +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,38,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Lorekeeper Lydros - On dataset - run script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lorekeeper Lydros - Script - set data 0 0'), +(@ENTRY*100,9,1,0,0,0,100,0,1000,1000,1000,1000,66,0,0,0,0,0,0,12,1,0,0,0,0,0,0,'Lorekeeper Lydros - Script - turn to player'), +(@ENTRY*100,9,2,0,0,0,100,0,1000,1000,1000,1000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lorekeeper Lydros - Script - Say 0'), +(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lorekeeper Lydros - Script - Say 1'), +(@ENTRY*100,9,4,0,0,0,100,0,8000,8000,8000,8000,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lorekeeper Lydros - Script - Say 2'), +(@ENTRY*100,9,5,0,0,0,100,0,11000,11000,11000,11000,15,7481,0,0,0,0,0,12,1,0,0,0,0,0,0,'Lorekeeper Lydros - Script - quest credit'), +(@ENTRY*100,9,6,0,0,0,100,0,0,0,0,0,15,7482,0,0,0,0,0,12,1,0,0,0,0,0,0,'Lorekeeper Lydros - Script - quest credit'), +(@ENTRY*100,9,7,0,0,0,100,0,2000,2000,2000,2000,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lorekeeper Lydros - Script - reset orientation'); +-- NPC talk text insert +DELETE FROM `creature_text` WHERE `entry`=14368; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(14368,0,0, 'I very much doubt that he will have anything to say, stranger...',12,0,100,1,0,0, 'Lorekeeper Lydros'), +(14368,1,0, 'I personally did not mind him. It was the Prince who took exception to a high elf in his domain. Alas, I am not one to question the Prince. In his defense, he did not incinerate Master Winthalus immediately.',12,0,100,1,0,0, 'Lorekeeper Lydros'), +(14368,2,0, 'We most definitely do not need anymore attention drawn to us, stranger. Return to those that sent you in search of the lost master and tell them that nothing could be found. When this is done - and I will know when it is so - return and I shall reveal the secrets of the deceased.',12,0,100,1,0,0, 'Lorekeeper Lydros'); +-- Gossip Fix from nelegalno +DELETE FROM `gossip_menu_option` WHERE `menu_id`=5743; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(5743,0,0,"Mourn the great loss.",1,1,0,0,0,0,NULL), -- A gossip +(5743,1,0,"Mourn the great loss.",1,1,0,0,0,0,NULL); -- H gossip +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=15 AND `SourceGroup`=5743); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,5743,0,0,9,7482,0,0,0,'',"Display gossip option when on Elven Legends A quest"), +(15,5743,1,0,9,7481,0,0,0,'',"Display gossip option when on Elven Legends H quest"); diff --git a/sql/updates/world/2012_01_27_00_world_player_factionchange_items.sql b/sql/updates/world/2012_01_27_00_world_player_factionchange_items.sql new file mode 100644 index 00000000000..1dc2749807e --- /dev/null +++ b/sql/updates/world/2012_01_27_00_world_player_factionchange_items.sql @@ -0,0 +1,4 @@ +-- DB/Faction change: Add some missing items +DELETE FROM `player_factionchange_items` WHERE `alliance_id` IN (47711) AND horde_id IN (47870); +INSERT INTO `player_factionchange_items` (`race_A`,`alliance_id`,`commentA`,`race_H`,`horde_id`,`commentH`) VALUES +(0,47711, 'Girdle of the Nether Champion',0,47870, 'Belt of the Nether Championt'); diff --git a/sql/updates/world/2012_01_28_00_world_conditions.sql b/sql/updates/world/2012_01_28_00_world_conditions.sql new file mode 100644 index 00000000000..e66d893db35 --- /dev/null +++ b/sql/updates/world/2012_01_28_00_world_conditions.sql @@ -0,0 +1,16 @@ +-- Class Condition update to use flags +UPDATE `conditions` SET `ConditionValue1`=8 WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=21194 AND `ConditionTypeOrReference`=15; +UPDATE `conditions` SET `ConditionValue1`=128 WHERE `SourceTypeOrReferenceId` IN (14,15) AND`SourceGroup`=4486 AND `ConditionTypeOrReference`=15; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=20 AND `SourceEntry` IN (13104,13105) AND `ConditionTypeOrReference`=15; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(20,0,13104,1,15,1503,0,0,0,'','Show quest 13104 if player is not a Death Knight'), +(20,0,13105,1,15,32,0,0,0,'','Show quest 13105 if player is a Death Knight'); +-- Race Condition update to use flags +UPDATE `conditions` SET `ConditionValue1`=128 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=24101 AND `ConditionTypeOrReference`=16; +UPDATE `conditions` SET `ConditionValue1`=32 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=24102 AND `ConditionTypeOrReference`=16; +UPDATE `conditions` SET `ConditionValue1`=16 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=24103 AND `ConditionTypeOrReference`=16; +UPDATE `conditions` SET `ConditionValue1`=64 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=24106 AND `ConditionTypeOrReference`=16; +UPDATE `conditions` SET `ConditionValue1`=4 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=24107 AND `ConditionTypeOrReference`=16; +UPDATE `conditions` SET `ConditionValue1`=8 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=24108 AND `ConditionTypeOrReference`=16; +UPDATE `conditions` SET `ConditionValue1`=512 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=69530 AND `ConditionTypeOrReference`=16; +UPDATE `conditions` SET `ConditionValue1`=1024 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=69533 AND `ConditionTypeOrReference`=16; diff --git a/sql/updates/world/2012_01_29_00_world_conditions.sql b/sql/updates/world/2012_01_29_00_world_conditions.sql new file mode 100644 index 00000000000..8a04993a03e --- /dev/null +++ b/sql/updates/world/2012_01_29_00_world_conditions.sql @@ -0,0 +1 @@ +ALTER TABLE `conditions` ADD COLUMN `SourceId` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER SourceEntry; diff --git a/sql/updates/world/2012_01_29_00_world_spell_dbc.sql b/sql/updates/world/2012_01_29_00_world_spell_dbc.sql new file mode 100644 index 00000000000..bbde43e3313 --- /dev/null +++ b/sql/updates/world/2012_01_29_00_world_spell_dbc.sql @@ -0,0 +1,4 @@ +-- Gushing Wound Removal spell +DELETE FROM `spell_dbc` WHERE `id`=30023; +INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES +(30023,0,0,256,0,0,0,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,26,1,0,-1,0,0,164,164,164,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35321,38363,39215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,"Gushing Wound Removal"); diff --git a/sql/updates/world/2012_01_29_01_world_spell_bonus_data.sql b/sql/updates/world/2012_01_29_01_world_spell_bonus_data.sql new file mode 100644 index 00000000000..d31489b8fce --- /dev/null +++ b/sql/updates/world/2012_01_29_01_world_spell_bonus_data.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_bonus_data` WHERE `entry` = 63544; +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(63544, -1, -1, 0, 0, 'Priest - Empowered Renew'); diff --git a/sql/updates/world/2012_01_29_02_world_spell_trigger_spell.sql b/sql/updates/world/2012_01_29_02_world_spell_trigger_spell.sql new file mode 100644 index 00000000000..13f9380c950 --- /dev/null +++ b/sql/updates/world/2012_01_29_02_world_spell_trigger_spell.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 57908 AND `spell_effect` = 57915; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(57908,57915,0,'q13129 - Give quest item'); diff --git a/sql/updates/world/2012_01_29_03_world_misc.sql b/sql/updates/world/2012_01_29_03_world_misc.sql new file mode 100644 index 00000000000..3253b5cd55b --- /dev/null +++ b/sql/updates/world/2012_01_29_03_world_misc.sql @@ -0,0 +1,102 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (26374); +INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES +(26374,'spell_gen_elune_candle'); + +-- Set Gigant Spotlight as not selectable +UPDATE `creature_template` SET `unit_flags`=33554432 WHERE `entry`=15902; + +DELETE FROM `creature_template_addon` WHERE (`entry`IN(15902,15466)); +INSERT INTO `creature_template_addon`(`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(15466,0,0,0,0,0,17327), -- Add spirit particles to Omen minions +(15902,0,0,0,0,0,50236); -- Add Spotlight aura to Gigant Spotlight (ummoned by 26392 on Omen's death) + +UPDATE `creature_template` SET `ScriptName`='npc_giant_spotlight' WHERE `entry`=15902; +UPDATE `creature_template` SET `RegenHealth`=0,`ScriptName`='npc_omen' WHERE `entry`=15467; +UPDATE `creature_template` SET `ScriptName`='npc_firework',`AIName`='',`faction_A`=35,`faction_H`=35,`unit_flags`=33555200 WHERE `entry` IN (15879,15880,15881,15882,15883,15884,15885,15886,15887,15888,15889,15890,15872,15873,15874,15875,15876,15877,15911,15912,15913,15914,15915,15916,15918); +-- Cleanup EventAI and SmartAI +DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (15879,15880,15881,15882,15883,15884,15885,15886,15887,15888,15889,15890,15872,15873,15874,15875,15876,15877,15911,15912,15913,15914,15915,15916,15918); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (15879,15880,15881,15882,15883,15884,15885,15886,15887,15888,15889,15890,15872,15873,15874,15875,15876,15877,15911,15912,15913,15914,15915,15916,15918); + +-- Update al targeting stuff for Fireworks and Rocket clusters +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (26294,26295,26333,26334,26336,26337,26338,26488,26490,26517,26521,26344,26347,26345,26348,26349,26351,26352,26354,26355,26356); +INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +-- Targeting Firework Launcher +(13,0,26294,0,18,0,180771,0,0,'',"Small White Rocket target Firework Launcher"), +(13,0,26294,0,18,0,180850,0,0,'',"Small White Rocket target Firework Launcher"), +(13,0,26294,0,18,0,180868,0,0,'',"Small White Rocket target Firework Launcher"), +(13,0,26295,0,18,0,180771,0,0,'',"Small Yellow Rocket target Firework Launcher"), +(13,0,26295,0,18,0,180850,0,0,'',"Small Yellow Rocket target Firework Launcher"), +(13,0,26295,0,18,0,180868,0,0,'',"Small Yellow Rocket target Firework Launcher"), +(13,0,26333,0,18,0,180771,0,0,'',"Large Blue Rocket target Firework Launcher"), +(13,0,26333,0,18,0,180850,0,0,'',"Large Blue Rocket target Firework Launcher"), +(13,0,26333,0,18,0,180868,0,0,'',"Large Blue Rocket target Firework Launcher"), +(13,0,26334,0,18,0,180771,0,0,'',"Large Green Rocket target Firework Launcher"), +(13,0,26334,0,18,0,180850,0,0,'',"Large Green Rocket target Firework Launcher"), +(13,0,26334,0,18,0,180868,0,0,'',"Large Green Rocket target Firework Launcher"), +(13,0,26336,0,18,0,180771,0,0,'',"Large Red Rocket target Firework Launcher"), +(13,0,26336,0,18,0,180850,0,0,'',"Large Red Rocket target Firework Launcher"), +(13,0,26336,0,18,0,180868,0,0,'',"Large Red Rocket target Firework Launcher"), +(13,0,26337,0,18,0,180771,0,0,'',"Large White Rocket target Firework Launcher"), +(13,0,26337,0,18,0,180850,0,0,'',"Large White Rocket target Firework Launcher"), +(13,0,26337,0,18,0,180868,0,0,'',"Large White Rocket target Firework Launcher"), +(13,0,26338,0,18,0,180771,0,0,'',"Large Yellow Rocket target Firework Launcher"), +(13,0,26338,0,18,0,180850,0,0,'',"Large Yellow Rocket target Firework Launcher"), +(13,0,26338,0,18,0,180868,0,0,'',"Large Yellow Rocket target Firework Launcher"), +-- Targeting Cluster Launcher +(13,0,26488,0,18,0,180772,0,0,'',"Large Blue Rocket Cluster target Cluster Launcher"), +(13,0,26488,0,18,0,180859,0,0,'',"Large Blue Rocket Cluster target Cluster Launcher"), +(13,0,26488,0,18,0,180869,0,0,'',"Large Blue Rocket Cluster target Cluster Launcher"), +(13,0,26488,0,18,0,180874,0,0,'',"Large Blue Rocket Cluster target Cluster Launcher"), +(13,0,26490,0,18,0,180772,0,0,'',"Large Green Rocket Cluster target Cluster Launcher"), +(13,0,26490,0,18,0,180859,0,0,'',"Large Green Rocket Cluster target Cluster Launcher"), +(13,0,26490,0,18,0,180869,0,0,'',"Large Green Rocket Cluster target Cluster Launcher"), +(13,0,26490,0,18,0,180874,0,0,'',"Large Green Rocket Cluster target Cluster Launcher"), +(13,0,26517,0,18,0,180772,0,0,'',"Large Red Rocket Cluster target Cluster Launcher"), +(13,0,26517,0,18,0,180859,0,0,'',"Large Red Rocket Cluster target Cluster Launcher"), +(13,0,26517,0,18,0,180869,0,0,'',"Large Red Rocket Cluster target Cluster Launcher"), +(13,0,26517,0,18,0,180874,0,0,'',"Large Red Rocket Cluster target Cluster Launcher"), +(13,0,26521,0,18,0,180772,0,0,'',"Lucky Lunar rocket Cluster target Cluster Launcher"), +(13,0,26521,0,18,0,180859,0,0,'',"Lucky Lunar rocket Cluster target Cluster Launcher"), +(13,0,26521,0,18,0,180869,0,0,'',"Lucky Lunar rocket Cluster target Cluster Launcher"), +(13,0,26521,0,18,0,180874,0,0,'',"Lucky Lunar rocket Cluster target Cluster Launcher"), +-- Targeting Firework Launcher (Again) +(13,0,26347,0,18,0,180771,0,0,'',"Rocket, RED target Firework Launcher"), +(13,0,26347,0,18,0,180850,0,0,'',"Rocket, RED target Firework Launcher"), +(13,0,26347,0,18,0,180868,0,0,'',"Rocket, RED target Firework Launcher"), +(13,0,26344,0,18,0,180771,0,0,'',"Rocket, BLUE target Firework Launcher"), +(13,0,26344,0,18,0,180850,0,0,'',"Rocket, BLUE target Firework Launcher"), +(13,0,26344,0,18,0,180868,0,0,'',"Rocket, BLUE target Firework Launcher"), +(13,0,26345,0,18,0,180771,0,0,'',"Rocket, GREEEN target Firework Launcher"), +(13,0,26345,0,18,0,180850,0,0,'',"Rocket, GREEEN target Firework Launcher"), +(13,0,26345,0,18,0,180868,0,0,'',"Rocket, GREEEN target Firework Launcher"), +(13,0,26348,0,18,0,180771,0,0,'',"Rocket, WHITE target Firework Launcher"), +(13,0,26348,0,18,0,180850,0,0,'',"Rocket, WHITE target Firework Launcher"), +(13,0,26348,0,18,0,180868,0,0,'',"Rocket, WHITE target Firework Launcher"), +(13,0,26349,0,18,0,180771,0,0,'',"Rocket, YELLOW target Firework Launcher"), +(13,0,26349,0,18,0,180850,0,0,'',"Rocket, YELLOW target Firework Launcher"), +(13,0,26349,0,18,0,180868,0,0,'',"Rocket, YELLOW target Firework Launcher"), +(13,0,26351,0,18,0,180771,0,0,'',"Rocket, BLUE BIG target Firework Launcher"), +(13,0,26351,0,18,0,180850,0,0,'',"Rocket, BLUE BIG target Firework Launcher"), +(13,0,26351,0,18,0,180868,0,0,'',"Rocket, BLUE BIG target Firework Launcher"), +(13,0,26352,0,18,0,180771,0,0,'',"Rocket, GREEN BIG target Firework Launcher"), +(13,0,26352,0,18,0,180850,0,0,'',"Rocket, GREEN BIG target Firework Launcher"), +(13,0,26352,0,18,0,180868,0,0,'',"Rocket, GREEN BIG target Firework Launcher"), +(13,0,26354,0,18,0,180771,0,0,'',"Rocket, RED BIG target Firework Launcher"), +(13,0,26354,0,18,0,180850,0,0,'',"Rocket, RED BIG target Firework Launcher"), +(13,0,26354,0,18,0,180868,0,0,'',"Rocket, RED BIG target Firework Launcher"), +(13,0,26355,0,18,0,180771,0,0,'',"Rocket, WHITE BIG target Firework Launcher"), +(13,0,26355,0,18,0,180850,0,0,'',"Rocket, WHITE BIG target Firework Launcher"), +(13,0,26355,0,18,0,180868,0,0,'',"Rocket, WHITE BIG target Firework Launcher"), +(13,0,26356,0,18,0,180771,0,0,'',"Rocket, YELLOW BIG target Firework Launcher"), +(13,0,26356,0,18,0,180850,0,0,'',"Rocket, YELLOW BIG target Firework Launcher"), +(13,0,26356,0,18,0,180868,0,0,'',"Rocket, YELLOW BIG target Firework Launcher"); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=15466; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=15466 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 +(15466,0,0,0,8,0,100,0,26636,0,8000,9000,11,25495,0,0,0,0,0,1,0,0,0,0,0,0,0,"Minion of Omen - Cast Firework Dazzled when hitted by Elune's Candle firework"); + +-- Cast quest credit spell when getting Elune's Blessing buff +DELETE FROM `spell_scripts` WHERE `id`=26393; +INSERT INTO `spell_scripts`(`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(26393,1,0,15,26394,2,0,0,0,0,0); diff --git a/sql/updates/world/2012_01_29_04_world_misc.sql b/sql/updates/world/2012_01_29_04_world_misc.sql new file mode 100644 index 00000000000..3686957e433 --- /dev/null +++ b/sql/updates/world/2012_01_29_04_world_misc.sql @@ -0,0 +1,116 @@ +-- remove aura_required for clickspells on tournament mounts and add more cases (Thanks to @Tassader) +DELETE FROM `npc_spellclick_spells` WHERE npc_entry IN (33842,33796,33798,33791,33792,33799,33843,33800,33795,33790,33793,33794); +INSERT INTO `npc_spellclick_spells`(`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(33842,63791,13668,0,13687,1,0,0,0),-- Aspirant +(33799,62783,13691,0,0,1,0,0,0),-- A Valiant Of Orgrimmar +(33799,62783,13707,0,0,1,0,0,0),-- Valiant Of Orgrimmar +(33796,62784,13693,0,0,1,0,0,0),-- A Valiant Of Sen'jin +(33796,62784,13708,0,0,1,0,0,0),-- Valiant Of Sen'jin +(33792,62785,13694,0,0,1,0,0,0),-- A Valiant Of Thunder Bluff +(33792,62785,13709,0,0,1,0,0,0),-- Valiant Of Thunder Bluff +(33791,62786,13696,0,0,1,0,0,0),-- A Valiant Of Silvermoon +(33791,62786,13711,0,0,1,0,0,0),-- Valiant Of Silvermoon +(33798,62787,13695,0,0,1,0,0,0),-- A Valiant Of Undercity +(33798,62787,13710,0,0,1,0,0,0), -- Valiant Of Undercity +(33843,63792,13667,0,13686,1,0,0,0),-- Aspirant +(33800,62774,13593,0,0,1,0,0,0),-- A Valiant Of Stormwind +(33800,62774,13684,0,0,1,0,0,0),-- Valiant Of Stormwind +(33795,62779,13685,0,0,1,0,0,0),-- A Valiant Of Ironforge +(33795,62779,13703,0,0,1,0,0,0),-- Valiant Of Ironforge +(33793,62780,13688,0,0,1,0,0,0),-- A Valiant Of Gnomregan +(33793,62780,13704,0,0,1,0,0,0),-- Valiant Of Gnomregan +(33790,62781,13690,0,0,1,0,0,0),-- A Valiant Of Exodar +(33790,62781,13705,0,0,1,0,0,0),-- Valiant Of Exodar +(33794,62782,13689,0,0,1,0,0,0),-- A Valiant Of Darnassus +(33794,62782,13706,0,0,1,0,0,0); -- Valiant Of Darnassus +UPDATE `npc_spellclick_spells` SET `aura_required`=0 WHERE `aura_required`=62853; + +-- Break-Shield spells +DELETE FROM `spell_script_names` WHERE `spell_id` IN (62575,62626,64342,64507,64590,64595,64686,65147,66480,68504); +-- Charge spells +DELETE FROM `spell_script_names` WHERE `spell_id` IN (62874,62960,63661,62563,63003,63010,64591,66481,68282,68284,68321,68498,68501); +-- Defend spells +DELETE FROM `spell_script_names` WHERE `spell_id` IN (62552,62719,66482); +-- Pennant and summon spells +DELETE FROM `spell_script_names` WHERE `spell_id` IN (62863,63034,62774,62779,62780,62781,62782,62783,62784,62785,62786,62787,63663,63791,63792,62595,62596,62594,63394,63395,63396,63397,63398,63401,63402,63403,63404,63405,63406,63421,63422,63423,63425,63426,63427,63428,63429,63430,63431,63432,63433,63434,63435,63436,63606,63500,63501,63607,63608,63609); +INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES +(62575,'spell_gen_break_shield'), +(62626,'spell_gen_break_shield'), +(64342,'spell_gen_break_shield'), +(64507,'spell_gen_break_shield'), +(64590,'spell_gen_break_shield'), +(64595,'spell_gen_break_shield'), +(64686,'spell_gen_break_shield'), +(65147,'spell_gen_break_shield'), +(66480,'spell_gen_break_shield'), +(68504,'spell_gen_break_shield'), +(62874,'spell_gen_mounted_charge'), +(62960,'spell_gen_mounted_charge'), +(63661,'spell_gen_mounted_charge'), +(62563,'spell_gen_mounted_charge'), +(63003,'spell_gen_mounted_charge'), +(63010,'spell_gen_mounted_charge'), +(64591,'spell_gen_mounted_charge'), +(66481,'spell_gen_mounted_charge'), +(68282,'spell_gen_mounted_charge'), +(68284,'spell_gen_mounted_charge'), +(68321,'spell_gen_mounted_charge'), +(68498,'spell_gen_mounted_charge'), +(68501,'spell_gen_mounted_charge'), +(62552,'spell_gen_defend'), +(62719,'spell_gen_defend'), +(66482,'spell_gen_defend'), +(62863 ,'spell_gen_tournament_duel'), +(63034,'spell_gen_on_tournament_mount'), +(62595,'spell_gen_tournament_pennant'), +(62596,'spell_gen_tournament_pennant'), +(62594,'spell_gen_tournament_pennant'), +(63394,'spell_gen_tournament_pennant'), +(63395,'spell_gen_tournament_pennant'), +(63396,'spell_gen_tournament_pennant'), +(63397,'spell_gen_tournament_pennant'), +(63398,'spell_gen_tournament_pennant'), +(63401,'spell_gen_tournament_pennant'), +(63402,'spell_gen_tournament_pennant'), +(63403,'spell_gen_tournament_pennant'), +(63404,'spell_gen_tournament_pennant'), +(63405,'spell_gen_tournament_pennant'), +(63406,'spell_gen_tournament_pennant'), +(63421,'spell_gen_tournament_pennant'), +(63422,'spell_gen_tournament_pennant'), +(63423,'spell_gen_tournament_pennant'), +(63425,'spell_gen_tournament_pennant'), +(63426,'spell_gen_tournament_pennant'), +(63427,'spell_gen_tournament_pennant'), +(63428,'spell_gen_tournament_pennant'), +(63429,'spell_gen_tournament_pennant'), +(63430,'spell_gen_tournament_pennant'), +(63431,'spell_gen_tournament_pennant'), +(63432,'spell_gen_tournament_pennant'), +(63433,'spell_gen_tournament_pennant'), +(63434,'spell_gen_tournament_pennant'), +(63435,'spell_gen_tournament_pennant'), +(63436,'spell_gen_tournament_pennant'), +(63606,'spell_gen_tournament_pennant'), +(63500,'spell_gen_tournament_pennant'), +(63501,'spell_gen_tournament_pennant'), +(63607,'spell_gen_tournament_pennant'), +(63608,'spell_gen_tournament_pennant'), +(63609,'spell_gen_tournament_pennant'), +(62774,'spell_gen_summon_tournament_mount'), +(62779,'spell_gen_summon_tournament_mount'), +(62780,'spell_gen_summon_tournament_mount'), +(62781,'spell_gen_summon_tournament_mount'), +(62782,'spell_gen_summon_tournament_mount'), +(62783,'spell_gen_summon_tournament_mount'), +(62784,'spell_gen_summon_tournament_mount'), +(62785,'spell_gen_summon_tournament_mount'), +(62786,'spell_gen_summon_tournament_mount'), +(62787,'spell_gen_summon_tournament_mount'), +(63663,'spell_gen_summon_tournament_mount'), +(63791,'spell_gen_summon_tournament_mount'), +(63792,'spell_gen_summon_tournament_mount'); + +DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=9798 AND `type`=11; +INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES +(9798,11,0,0, 'achievement_tilted'); diff --git a/sql/updates/world/2012_01_30_00_world_conditions.sql b/sql/updates/world/2012_01_30_00_world_conditions.sql new file mode 100644 index 00000000000..48b9c63b5cb --- /dev/null +++ b/sql/updates/world/2012_01_30_00_world_conditions.sql @@ -0,0 +1,3 @@ +ALTER TABLE `conditions` CHANGE `SourceId` `SourceId` INT(10) NOT NULL DEFAULT '0'; +ALTER TABLE `conditions` DROP PRIMARY KEY, + ADD PRIMARY KEY (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`); diff --git a/sql/updates/world/2012_01_30_01_world_conditions.sql b/sql/updates/world/2012_01_30_01_world_conditions.sql new file mode 100644 index 00000000000..bcaf0af435a --- /dev/null +++ b/sql/updates/world/2012_01_30_01_world_conditions.sql @@ -0,0 +1,3 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=72618; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,72618,0,0,18,1,0,0,0, '', 'Mutated Plague Clear - target players'); diff --git a/sql/updates/world/2012_01_30_01_world_spell_script_names.sql b/sql/updates/world/2012_01_30_01_world_spell_script_names.sql new file mode 100644 index 00000000000..6e4b10094e5 --- /dev/null +++ b/sql/updates/world/2012_01_30_01_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_putricide_clear_mutated_plague'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(72618,'spell_putricide_clear_mutated_plague'); diff --git a/sql/updates/world/2012_01_30_02_world_creature_loot_template.sql b/sql/updates/world/2012_01_30_02_world_creature_loot_template.sql new file mode 100644 index 00000000000..429d470a77f --- /dev/null +++ b/sql/updates/world/2012_01_30_02_world_creature_loot_template.sql @@ -0,0 +1 @@ +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=15571 AND `item`=21137; diff --git a/sql/updates/world/2012_01_30_03_world_creature_loot_template.sql b/sql/updates/world/2012_01_30_03_world_creature_loot_template.sql new file mode 100644 index 00000000000..531c472c263 --- /dev/null +++ b/sql/updates/world/2012_01_30_03_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- Set 25 Heroic loot to 68% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=68 WHERE `entry`=38586 AND `item`= 50274; diff --git a/sql/updates/world/2012_01_30_04_world_gameobject_loot_template.sql b/sql/updates/world/2012_01_30_04_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..3ef39fe43d2 --- /dev/null +++ b/sql/updates/world/2012_01_30_04_world_gameobject_loot_template.sql @@ -0,0 +1,14 @@ +SET @ITEM :=50274; +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (28074,28088,28082,28096) AND `item`=@ITEM; +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(28074,@ITEM,-38,1,0,1,1), -- Deathbringer Cache 25 Normal +(28088,@ITEM,-68,1,0,1,1), -- Deathbringer Cache 25 Heroic +(28082,@ITEM,-38,1,0,1,1), -- Cache of the Dreamwalker 25 Normal +(28096,@ITEM,-68,1,0,1,1); -- Cache of the Dreamwalker 25 Heroic +-- only drop if someone is on the quest (negative ChanceOrQuestChance) +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`= -(ABS(`ChanceOrQuestChance`)) WHERE `item`=50274; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`= -(ABS(`ChanceOrQuestChance`)) WHERE `item`=50274; + +-- Dreamwalker and Council should drop 3 items +UPDATE `gameobject_loot_template` SET `maxcount`=3 WHERE `entry`IN (28052,28082,28064,28096) AND `item`=1; +UPDATE `creature_loot_template` SET `maxcount`=3 WHERE `entry` IN (37970,38401,38784,38785) AND `item`=1; diff --git a/sql/updates/world/2012_01_30_05_world_gameobject_loot_template.sql b/sql/updates/world/2012_01_30_05_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..8196663eebe --- /dev/null +++ b/sql/updates/world/2012_01_30_05_world_gameobject_loot_template.sql @@ -0,0 +1,94 @@ +SET @ThoriumGems = 12900; +DELETE FROM `reference_loot_template` WHERE `entry` IN (@ThoriumGems,12901,12902,12903,12904,12905,12906,12907,12908); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ThoriumGems +(@ThoriumGems,12363,40,1,1,1,1), -- Arcane Crystal +(@ThoriumGems, 7910,12,1,1,1,1), -- Star Ruby +(@ThoriumGems,12800,12,1,1,1,1), -- Azerothian Diamond +(@ThoriumGems,12361,12,1,1,1,1), -- Blue Sapphire +(@ThoriumGems,12364,12,1,1,1,1), -- Huge Emerald +(@ThoriumGems,12799,12,1,1,1,1); -- Large Opal + +SET @Copper := 1502; +SET @Tin := 1503; +SET @Silver := 1504; +SET @Iron := 1505; +SET @Gold :=1506; +SET @Mithril :=1742; +SET @Truesilver := 5045; +SET @SmallThorium := 9597; +SET @RichThorium := 12883; + +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@Copper,@Tin,@Silver,@Iron,@Gold,@Mithril,@Truesilver,@SmallThorium,@RichThorium,17938,13960,17241); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Copper Vein +(@Copper,2770,100,1,0,1,9), -- Copper Ore +(@Copper,2835, 25,1,0,1,11), -- Rough Stone +(@Copper,774 ,5,1,1,1,1), -- Malachite +(@Copper,1210,5,1,1,1,1), -- Shadowgem +(@Copper,818 ,5,1,1,1,1), -- Tigerseye +(@Copper,22634,-100,1,0,1,2), -- Underlight Ore (only on quest) +-- Tin Vein +(@Tin,2771,100,1,0,1,9), -- Tin Ore +(@Tin,2836,25,1,0,1,13), -- Coarse Stone +(@Tin,1206,5,1,1,1,1), -- Moss Agate +(@Tin,1705,5,1,1,1,1), -- Lesser Moonstone +(@Tin,1210,5,1,1,1,1), -- Shadowgem +(@Tin,1529,5,1,1,1,1), -- Jade +(@Tin,2798,-100,1,0,1,2), -- Rethban Ore (only on quest) +(@Tin,22634,-100,1,0,1,2), -- Underlight Ore (only on quest) +-- Silver Vein +(@Silver,2775,100,1,0,2,8), -- Silver Ore +(@Silver,1206,5,1,1,1,1), -- Moss Agate +(@Silver,1705,5,1,1,1,1), -- Lesser Moonstone +(@Silver,1210,5,1,1,1,1), -- Shadowgem +-- Iron Deposit +(@Iron,2772,100,1,0,2,9), -- Iron Ore +(@Iron,2838,100,1,0,2,10), -- Heavy Stone +(@Iron,1529,5,1,1,1,1), -- Jade +(@Iron,3864,5,1,1,1,1), -- Citrine +(@Iron,1705,5,1,1,1,1), -- Lesser Moonstone +(@Iron,7909,5,1,1,1,1), -- Aquamarine +-- Gold Vein +(@Gold,2776,100,1,0,2,8), -- Gold Ore +(@Gold,3864,5,1,1,1,1), -- Citrine +(@Gold,1705,5,1,1,1,1), -- Lesser Moonstone +(@Gold,7909,5,1,1,1,1), -- Aquamarine +-- Mithril Deposit +(@Mithril,3858,100,1,0,1,9), -- Mithril Ore +(@Mithril,7912,80,1,0,1,13), -- Solid Stone +(@Mithril,7909,5,1,1,1,1), -- Aquamarine +(@Mithril,3864,5,1,1,1,1), -- Citrine +(@Mithril,7910,5,1,1,1,1), -- Star Ruby +(@Mithril,9262,5,1,1,1,1), -- Black Vitriol +-- Truesilver Deposit +(@Truesilver,7911,100,1,0,2,8), -- Truesilver Ore +(@Truesilver,7909,5,1,1,1,1), -- Aquamarine +(@Truesilver,3864,5,1,1,1,1), -- Citrine +(@Truesilver,7910,5,1,1,1,1), -- Star Ruby +-- Small Thorium Vein +(@SmallThorium,10620,100,1,0,1,8), -- Thorium Ore +(@SmallThorium,12365,100,1,0,1,10), -- Dense Stone +(@SmallThorium,1,15,1,0,-@ThoriumGems,1), -- One From Gems +-- Rich Thorium Vein +(@RichThorium,10620,100,1,0,3,10), -- Thorium Ore +(@RichThorium,12365,100,1,0,4,12), -- Dense Stone +(@RichThorium,1,25,1,0,-@ThoriumGems,1), -- One From Gems +-- Special Cases: +-- Truesilver Vein+Tainted Vitriol +(17938,7911,100,1,0,2,8), -- Truesilver Ore +(17938,7909,5,1,1,1,1), -- Aquamarine +(17938,3864,5,1,1,1,1), -- Citrine +(17938,7910,5,1,1,1,1), -- Star Ruby +(17938,11513,50,1,0,1,1), -- Tainted Vitriol +-- Small Thorium Vein+Tainted Vitriol +(13960,10620,100,1,0,1,8), -- Thorium Ore +(13960,12365,100,1,0,1,10), -- Dense Stone +(13960,1,15,1,0,-@ThoriumGems,1), -- One From Gems +(13960,11513,50,1,0,1,1), -- Tainted Vitriol +-- Hakkari Thorium Vein +(17241,10620,100,1,0,1,8), -- Thorium Ore +(17241,12365,100,1,0,1,10), -- Dense Stone +(17241,1,15,1,0,-@ThoriumGems,1), -- One From Gems +(17241,19774,40,1,0,5,10); -- Souldarite + diff --git a/sql/updates/world/2012_01_31_00_world_gameobject_loot_template.sql b/sql/updates/world/2012_01_31_00_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..91f26990488 --- /dev/null +++ b/sql/updates/world/2012_01_31_00_world_gameobject_loot_template.sql @@ -0,0 +1,136 @@ +-- Change all Copper Ore Nodes in the Underlight Mines to be other id +UPDATE `gameobject` SET `id`=181248 WHERE `guid` IN (75024,75051,75090,75099,75105) AND `id`=1731; +-- Same for the Tin Nodes in the Underlight Mines +UPDATE `gameobject` SET `id`=181249 WHERE `guid` IN (75025,75052,75091,75100,75106) AND `id`=1732; + +-- Change all Copper Ore Nodes in Beal Modan to match the other id +UPDATE `gameobject` SET `id`=103713 WHERE `guid` IN (5096,13067,120336) AND `id` IN (1731,3763); + +-- fix wrongly increased counts (aka cata guildperk changed data) +-- Copper +UPDATE `gameobject_loot_template` SET `maxcount`=5 WHERE `entry`=1502 AND `item`=2770; +UPDATE `gameobject_loot_template` SET `maxcount`=6 WHERE `entry`=1502 AND `item`=2835; +-- Tin +UPDATE `gameobject_loot_template` SET `maxcount`=5 WHERE `entry`=1503 AND `item`=2771; +UPDATE `gameobject_loot_template` SET `maxcount`=7 WHERE `entry`=1503 AND `item`=2836; +-- Silver +UPDATE `gameobject_loot_template` SET `mincountOrRef`=1 WHERE `entry`=1504 AND `item`=2775; +UPDATE `gameobject_loot_template` SET `maxcount`=4 WHERE `entry`=1504 AND `item`=2775; +-- Iron +UPDATE `gameobject_loot_template` SET `mincountOrRef`=1 WHERE `entry`=1505 AND `item`=2772; +UPDATE `gameobject_loot_template` SET `maxcount`=4 WHERE `entry`=1505 AND `item`=2772; +UPDATE `gameobject_loot_template` SET `mincountOrRef`=1 WHERE `entry`=1505 AND `item`=2838; +UPDATE `gameobject_loot_template` SET `maxcount`=5 WHERE `entry`=1505 AND `item`=2838; +-- Gold +UPDATE `gameobject_loot_template` SET `mincountOrRef`=1 WHERE `entry`=1506 AND `item`=2776; +UPDATE `gameobject_loot_template` SET `maxcount`=4 WHERE `entry`=1506 AND `item`=2776; +-- Mithril +UPDATE `gameobject_loot_template` SET `maxcount`=5 WHERE `entry`=1742 AND `item`=3858; +UPDATE `gameobject_loot_template` SET `maxcount`=7 WHERE `entry`=1742 AND `item`=7912; +-- Truesilver +UPDATE `gameobject_loot_template` SET `mincountOrRef`=1 WHERE `entry`=5045 AND `item`=7911; +UPDATE `gameobject_loot_template` SET `maxcount`=4 WHERE `entry`=5045 AND `item`=7911; +-- Small Thorium +UPDATE `gameobject_loot_template` SET `mincountOrRef`=1 WHERE `entry`=9597 AND `item`=10620; +UPDATE `gameobject_loot_template` SET `maxcount`=4 WHERE `entry`=9597 AND `item`=10620; +UPDATE `gameobject_loot_template` SET `maxcount`=4 WHERE `entry`=9597 AND `item`=12365; +-- Rich Thorium +UPDATE `gameobject_loot_template` SET `mincountOrRef`=2 WHERE `entry`=12883 AND `item`=10620; +UPDATE `gameobject_loot_template` SET `maxcount`=5 WHERE `entry`=12883 AND `item`=10620; +UPDATE `gameobject_loot_template` SET `mincountOrRef`=2 WHERE `entry`=12883 AND `item`=12365; +UPDATE `gameobject_loot_template` SET `maxcount`=6 WHERE `entry`=12883 AND `item`=12365; + +-- Remove Underlight Ore from all other copper ore nodes: +DELETE FROM `gameobject_loot_template` WHERE `item`=22634; -- Underlight Ore +DELETE FROM `gameobject_loot_template` WHERE `item`=2798; -- Rethban Ore +DELETE FROM `gameobject_loot_template` WHERE `item`=11513; -- Tainted Vitriol + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=4 AND `SourceGroup`=17939 AND `SourceEntry`=11513; + +-- Set LootIDvariables for Special Nodes +SET @CopperUM := 18092; +SET @TinUM := 18093; +SET @CopperRR := 1735; +SET @TinRR := 1736; +SET @CopperB := 2626; +SET @TinB := 2627; +SET @GoldOoze := 17939; +SET @MithrilFW := 13961; +SET @TruesilverFW := 17938; +SET @ThoriumFW := 13960; +SET @ThoriumGems = 12900; + +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@CopperUM,@CopperRR,@TinUM,@TinRR,@CopperB,@TinB,@GoldOoze,@MithrilFW,@TruesilverFW,@ThoriumFW); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Underlight Mine Special Nodes +(@CopperUM,2770,100,1,0,1,5), -- Copper Ore +(@CopperUM,2835, 25,1,0,1,6), -- Rough Stone +(@CopperUM,774 ,5,1,1,1,1), -- Malachite +(@CopperUM,1210,5,1,1,1,1), -- Shadowgem +(@CopperUM,818 ,5,1,1,1,1), -- Tigerseye +(@CopperUM,22634,-100,1,0,1,2), -- Underlight Ore (only if on quest) +-- Chanced Tin also have to drop it +(@TinUM,2771,100,1,0,1,5), -- Tin Ore +(@TinUM,2836,25,1,0,1,7), -- Coarse Stone +(@TinUM,1206,5,1,1,1,1), -- Moss Agate +(@TinUM,1705,5,1,1,1,1), -- Lesser Moonstone +(@TinUM,1210,5,1,1,1,1), -- Shadowgem +(@TinUM,1529,5,1,1,1,1), -- Jade +(@TinUM,22634,-100,1,0,1,2), -- Underlight Ore (only on quest) +-- Redridge Special Nodes +(@CopperRR,2770,100,1,0,1,5), -- Copper Ore +(@CopperRR,2835, 25,1,0,1,6), -- Rough Stone +(@CopperRR,774 ,5,1,1,1,1), -- Malachite +(@CopperRR,1210,5,1,1,1,1), -- Shadowgem +(@CopperRR,818 ,5,1,1,1,1), -- Tigerseye +(@CopperRR,2798,-100,1,0,1,4), -- Rethban Ore +-- Chanced Tin also have to drop it +(@TinRR,2771,100,1,0,1,5), -- Tin Ore +(@TinRR,2836,25,1,0,1,7), -- Coarse Stone +(@TinRR,1206,5,1,1,1,1), -- Moss Agate +(@TinRR,1705,5,1,1,1,1), -- Lesser Moonstone +(@TinRR,1210,5,1,1,1,1), -- Shadowgem +(@TinRR,1529,5,1,1,1,1), -- Jade +(@TinRR,2798,-100,1,0,1,2), -- Rethban Ore (only on quest) +-- The Barrens Copper Vein contain Blood Shards +(@CopperB,2770,100,1,0,1,5), -- Copper Ore +(@CopperB,2835, 25,1,0,1,6), -- Rough Stone +(@CopperB,774 ,5,1,1,1,1), -- Malachite +(@CopperB,1210,5,1,1,1,1), -- Shadowgem +(@CopperB,818 ,5,1,1,1,1), -- Tigerseye +(@CopperB,5075,5,1,1,1,3), -- Blood Shard (only in barrens) +-- Chanced Tin also have to drop it +(@TinB,2771,100,1,0,1,5), -- Tin Ore +(@TinB,2836,25,1,0,1,7), -- Coarse Stone +(@TinB,1206,5,1,1,1,1), -- Moss Agate +(@TinB,1705,5,1,1,1,1), -- Lesser Moonstone +(@TinB,1210,5,1,1,1,1), -- Shadowgem +(@TinB,1529,5,1,1,1,1), -- Jade +(@TinB,5075,5,1,1,1,4), -- Blood Shard (only in barrens ?) +-- Ooze Covered Gold Vein +(@GoldOoze,2776,100,1,0,2,4), -- Gold Ore +(@GoldOoze,3864,5,1,1,1,1), -- Citrine +(@GoldOoze,1705,5,1,1,1,1), -- Lesser Moonstone +(@GoldOoze,7909,5,1,1,1,1), -- Aquamarine +-- Felwood Mithril Vein +(@MithrilFW,3858,100,1,0,1,5), -- Mithril Ore +(@MithrilFW,7912,80,1,0,1,7), -- Solid Stone +(@MithrilFW,7909,5,1,1,1,1), -- Aquamarine +(@MithrilFW,3864,5,1,1,1,1), -- Citrine +(@MithrilFW,7910,5,1,1,1,1), -- Star Ruby +(@MithrilFW,9262,5,1,1,1,1), -- Black Vitriol +(@MithrilFW,11513,25,1,0,1,4), -- Tainted Vitriol +-- Chanced Truesilver also needs it +(@TruesilverFW,7911,100,1,0,1,4), -- Truesilver Ore +(@TruesilverFW,7909,5,1,1,1,1), -- Aquamarine +(@TruesilverFW,3864,5,1,1,1,1), -- Citrine +(@TruesilverFW,7910,5,1,1,1,1), -- Star Ruby +(@TruesilverFW,11513,25,1,0,1,4), -- Tainted Vitriol +-- Chance Thoriuym also needs it +-- Small Thorium Vein+Tainted Vitriol +(@ThoriumFW,10620,100,1,0,1,8), -- Thorium Ore +(@ThoriumFW,12365,100,1,0,1,10), -- Dense Stone +(@ThoriumFW,1,15,1,0,-@ThoriumGems,1), -- One From Gems +(@ThoriumFW,11513,50,1,0,1,1); -- Tainted Vitriol + + diff --git a/sql/updates/world/2012_01_31_01_world_misc.sql b/sql/updates/world/2012_01_31_01_world_misc.sql new file mode 100644 index 00000000000..c359f186431 --- /dev/null +++ b/sql/updates/world/2012_01_31_01_world_misc.sql @@ -0,0 +1,8 @@ +-- Delete the criteria from the disables table +DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=3880; + +-- criteria data for achievement Not So Fast +DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=3880; +INSERT INTO `achievement_criteria_data` (`criteria_id`, `TYPE`, `value1`, `value2`, `ScriptName`) VALUES +(3880,6,3277,0, ''), +(3880,7,23451,0, ''); diff --git a/sql/updates/world/2012_02_01_00_world_misc.sql b/sql/updates/world/2012_02_01_00_world_misc.sql new file mode 100644 index 00000000000..e137f7a8238 --- /dev/null +++ b/sql/updates/world/2012_02_01_00_world_misc.sql @@ -0,0 +1,5 @@ +DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=9798 AND `type`=6; + +DELETE FROM `spell_script_names` WHERE `spell_id`=63399; +INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES +(63399, 'spell_gen_tournament_pennant'); diff --git a/sql/updates/world/2012_02_02_00_world_item_loot_template.sql b/sql/updates/world/2012_02_02_00_world_item_loot_template.sql new file mode 100644 index 00000000000..4223835bee3 --- /dev/null +++ b/sql/updates/world/2012_02_02_00_world_item_loot_template.sql @@ -0,0 +1,60 @@ +-- Update reference for hallowed end +SET @Ref := 10020; +DELETE FROM `reference_loot_template` WHERE `entry` IN (@Ref,10021); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Masks +(@Ref,20391,2,1,0,1,1), -- Flimsy Male Gnome Mask +(@Ref,20392,2,1,0,1,1), -- Flimsy Female Gnome Mask +(@Ref,20561,2,1,0,1,1), -- Flimsy Male Dwarf Mask +(@Ref,20562,2,1,0,1,1), -- Flimsy Female Dwarf Mask +(@Ref,20563,2,1,0,1,1), -- Flimsy Female Night Elf Mask +(@Ref,20564,2,1,0,1,1), -- Flimsy Male Night Elf Mask +(@Ref,20565,2,1,0,1,1), -- Flimsy Female Human Mask +(@Ref,20566,2,1,0,1,1), -- Flimsy Male Human Mask +(@Ref,20567,2,1,0,1,1), -- Flimsy Female Troll Mask +(@Ref,20568,2,1,0,1,1), -- Flimsy Male Troll Mask +(@Ref,20569,2,1,0,1,1), -- Flimsy Female Orc Mask +(@Ref,20570,2,1,0,1,1), -- Flimsy Male Orc Mask +(@Ref,20571,2,1,0,1,1), -- Flimsy Female Tauren Mask +(@Ref,20572,2,1,0,1,1), -- Flimsy Male Tauren Mask +(@Ref,20573,2,1,0,1,1), -- Flimsy Male Undead Mask +(@Ref,20574,2,1,0,1,1), -- Flimsy Female Undead Mask +(@Ref,34000,2,1,0,1,1), -- Flimsy Female Blood Elf Mask +(@Ref,34001,2,1,0,1,1), -- Flimsy Female Draenei Mask +(@Ref,34002,2,1,0,1,1), -- Flimsy Male Blood Elf Mask +(@Ref,34003,2,1,0,1,1), -- Flimsy Male Draenei Mask +-- Wands +(@Ref,20397,2,1,0,1,1), -- Hallowed Wand - Pirate +(@Ref,20398,2,1,0,1,1), -- Hallowed Wand - Ninja +(@Ref,20399,2,1,0,1,1), -- Hallowed Wand - Leper Gnome +(@Ref,20409,2,1,0,1,1), -- Hallowed Wand - Ghost +(@Ref,20410,2,1,0,1,1), -- Hallowed Wand - Bat +(@Ref,20411,2,1,0,1,1), -- Hallowed Wand - Skeleton +(@Ref,20413,2,1,0,1,1), -- Hallowed Wand - Random +(@Ref,20414,2,1,0,1,1), -- Hallowed Wand - Wisp +-- Pets +(@Ref,33154,5,1,0,1,1), -- Sinister Squashling +(@Ref,33292,5,1,0,1,1), -- Hallowed Helm +-- Candies +(@Ref,20388,15,1,0,4,6), -- Lollipop +(@Ref,20389,15,1,0,4,6), -- Candy Corn +(@Ref,20390,15,1,0,4,6), -- Candy Bar +(@Ref,37604,30,1,0,10,10), -- Tooth Pick +(@Ref,37582,30,1,0,1,2), -- Pyroblast Cinnamon Ball +(@Ref,37583,30,1,0,1,2), -- G.N.E.R.D.S. +(@Ref,37584,30,1,0,1,2), -- Soothing Spearmint Candy +(@Ref,37585,30,1,0,1,2), -- Chewy Fel Taffy +(@Ref,37606,15,1,0,1,1); -- Penny Pouch + +-- Assign loot to the special bags +DELETE FROM `item_loot_template` WHERE `entry` IN (54516,37586); +INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Loot Filled Pumpkin: +(54516,33226,100,1,0,2,3), -- Tricky Treat +(54516,1,100,1,0,-@Ref,1), -- Referenced Specials +(54516,33808,2,1,0,1,1), -- The Horseman's Helm +(54516,38175,2,1,0,1,1), -- The Horseman's Blade +(54516,37012,0.1,1,0,1,1), -- The Horseman's Reins +-- Handfull of Treats: +(37586,33226,100,1,0,2,3), -- Tricky Treat +(37586,1,100,1,0,-@Ref,1); -- Referenced Specials diff --git a/sql/updates/world/2012_02_03_00_world_gossip_menu.sql b/sql/updates/world/2012_02_03_00_world_gossip_menu.sql new file mode 100644 index 00000000000..e56662f2e9d --- /dev/null +++ b/sql/updates/world/2012_02_03_00_world_gossip_menu.sql @@ -0,0 +1,2196 @@ +-- XXXXXXXXXXXXXXXXXXXXX +-- X Mage Trainers X +-- XXXXXXXXXXXXXXXXXXXXX + +-- Gossip Condition for Mage Trainers +SET @GOSSIP := 63; -- http://www.wowhead.com/npc=2128 "Tirisfal Glades" http://www.wowhead.com/npc=23103 "Undercity" +SET @TEXTYES := 562; +SET @TEXTNO := 563; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=23103; + +SET @GOSSIP := 64; -- http://www.wowhead.com/npc=5880 "Durotar" +SET @TEXTYES := 564; +SET @TEXTNO := 565; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4484; -- http://www.wowhead.com/npc=5498 "Stormwind City" +SET @TEXTYES := 538; +SET @TEXTNO := 539; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4485; -- http://www.wowhead.com/npc=5497 "Stormwind City" +SET @TEXTYES := 538; +SET @TEXTNO := 539; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4486; -- http://www.wowhead.com/npc=331 "Stormwind City" +SET @TEXTYES := 538; +SET @TEXTNO := 539; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4517; -- http://www.wowhead.com/npc=7311 "Orgrimmar" +SET @TEXTYES := 564; +SET @TEXTNO := 565; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4518; -- http://old.wowhead.com/npc=5883 "Orgrimmar" +SET @TEXTYES := 564; +SET @TEXTNO := 565; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4519; -- http://old.wowhead.com/npc=5885 "Orgrimmar" +SET @TEXTYES := 564; +SET @TEXTNO := 565; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4520; -- http://old.wowhead.com/npc=5882 "Orgrimmar" +SET @TEXTYES := 564; +SET @TEXTNO := 565; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4537; -- http://www.wowhead.com/npc=4568 "Undercity" +SET @TEXTYES := 562; +SET @TEXTNO := 563; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4538; -- http://www.wowhead.com/npc=4567 "Undercity" +SET @TEXTYES := 562; +SET @TEXTNO := 563; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4539; -- http://www.wowhead.com/npc=4566 "Undercity" +SET @TEXTYES := 562; +SET @TEXTNO := 563; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4552; -- http://www.wowhead.com/npc=5144 5145,5146,7312 "Ironforge" +SET @TEXTYES := 560; +SET @TEXTNO := 561; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4651; -- http://old.wowhead.com/npc=5884 "Durotar" +SET @TEXTYES := 564; +SET @TEXTNO := 565; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4654; -- http://www.wowhead.com/npc=2124 "Tirisfal Glades" +SET @TEXTYES := 562; +SET @TEXTNO := 563; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4660; -- http://www.wowhead.com/npc=198 "Elwynn Forest" +SET @TEXTYES := 538; +SET @TEXTNO := 539; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4661; -- http://www.wowhead.com/npc=328 "Elwynn Forest" +SET @TEXTYES := 538; +SET @TEXTNO := 539; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4685; -- http://www.wowhead.com/npc=1228 "Dun Morogh" +SET @TEXTYES := 558; +SET @TEXTNO := 559; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 4686; -- http://old.wowhead.com/npc=944 "Dun Morogh" +SET @TEXTYES := 560; +SET @TEXTNO := 561; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 6648; -- 15279,16269,16651,16652,16653 "Blood elf Mage trainers" +SET @TEXTYES := 9190; +SET @TEXTNO := 9191; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 7264; -- 16500,16749,17481,17513,17514 "Draenei Mage Trainers" +SET @TEXTYES := 8589; +SET @TEXTNO := 8590; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 9990; -- http://www.wowhead.com/npc=28956 28958 "Dalaran Mage Trainers" +SET @TEXTYES := 13845; +SET @TEXTNO := 13846; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +SET @GOSSIP := 9580; -- http://www.wowhead.com/npc=27704 "Dustwallow Marsh" +SET @TEXTYES := 12929; +SET @TEXTNO := 12930; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=27704; + +-- Gossip Condition for Mage Trainers +SET @GOSSIP := 7366; -- http://www.wowhead.com/npc=17105 "Darnassus" +SET @TEXTYES := 8799; +SET @TEXTNO := 8800; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=17105; + +-- Gossip Condition for Mage Trainers +SET @GOSSIP := 4535; -- http://www.wowhead.com/npc=3049 "Thunder Bluff" +SET @TEXTYES := 562; +SET @TEXTNO := 663; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'), +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in mage training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=3049; + +-- XXXXXXXXXXXXXXXXXXXXXX +-- X Warlock Trainers X +-- XXXXXXXXXXXXXXXXXXXXXX + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 1503; +SET @TEXTYES := 2175; +SET @TEXTNO := 5722; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 1522; +SET @TEXTYES := 2193; +SET @TEXTNO := 5722; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 2381; +SET @TEXTYES := 2193; +SET @TEXTNO := 5723; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 2383; +SET @TEXTYES := 5714; +SET @TEXTNO := 5715; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 2384; +SET @TEXTYES := 2193; +SET @TEXTNO := 5722; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4503; +SET @TEXTYES := 5693; +SET @TEXTNO := 5722; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4504; +SET @TEXTYES := 5693; +SET @TEXTNO := 5722; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4505; +SET @TEXTYES := 5693; +SET @TEXTNO := 5722; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4566; +SET @TEXTYES := 2193; +SET @TEXTNO := 5722; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4567; +SET @TEXTYES := 2193; +SET @TEXTNO := 5723; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4603; +SET @TEXTYES := 2193; +SET @TEXTNO := 5723; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4604; +SET @TEXTYES := 2193; +SET @TEXTNO := 5723; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4609; +SET @TEXTYES := 5719; +SET @TEXTNO := 5720; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I submit myself for further training my master.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4610; +SET @TEXTYES := 5719; +SET @TEXTNO := 5720; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I submit myself for further training, my master.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=4565; + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4641; +SET @TEXTYES := 5714; +SET @TEXTNO := 5715; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4643; +SET @TEXTYES := 5714; +SET @TEXTNO := 5715; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4655; +SET @TEXTYES := 5719; +SET @TEXTNO := 5720; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I submit myself for further training my master.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4656; +SET @TEXTYES := 5719; +SET @TEXTNO := 5720; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I submit myself for further training my master.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4667; +SET @TEXTYES := 2193; +SET @TEXTNO := 5722; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4681; +SET @TEXTYES := 2193; +SET @TEXTNO := 5723; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4682; +SET @TEXTYES := 2193; +SET @TEXTNO := 5722; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 6628; +SET @TEXTYES := 7882; +SET @TEXTNO := 7903; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 7437; +SET @TEXTYES := 9006; +SET @TEXTNO := 7903; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am interested in warlock training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"Learn about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 7566; +SET @TEXTYES := 9184; +SET @TEXTNO := 9185; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"It is a greater knowledge of the ways of the warlock that I crave.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warlock Trainers +SET @GOSSIP := 4642; +SET @TEXTYES := 5714; +SET @TEXTNO := 5715; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,256,0,0,0,'','Show gossip text if player is a Warlock'), +(14,@GOSSIP,@TEXTNO,0,15,1279,0,0,0,'','Show gossip text if player is not a Warlock'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"It is a greater knowledge of the ways of the warlock that I crave.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=988; + +-- XXXXXXXXXXXXXXXXXXXXXX +-- X Paladin Trainers X +-- XXXXXXXXXXXXXXXXXXXXXX + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 2304; +SET @TEXTYES := 2999; +SET @TEXTNO := 3975; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=5149; + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 4556; +SET @TEXTYES := 3974; +SET @TEXTNO := 3975; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=5148; + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 4557; +SET @TEXTYES := 3974; +SET @TEXTNO := 3975; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=5147; + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 4469; +SET @TEXTYES := 3976; +SET @TEXTNO := 3977; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 4470; +SET @TEXTYES := 3976; +SET @TEXTNO := 3977; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 4471; +SET @TEXTYES := 3976; +SET @TEXTNO := 3977; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 4662; +SET @TEXTYES := 3976; +SET @TEXTNO := 3977; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=8140; + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 4463; +SET @TEXTYES := 3976; +SET @TEXTNO := 3977; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 4464; +SET @TEXTYES := 3976; +SET @TEXTNO := 3977; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 4477; +SET @TEXTYES := 3974; +SET @TEXTNO := 3975; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 4478; +SET @TEXTYES := 3974; +SET @TEXTNO := 3975; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 7260; +SET @TEXTYES := 8582; +SET @TEXTNO := 8584; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Paladin Trainers +SET @GOSSIP := 8111; +SET @TEXTYES := 10040; +SET @TEXTNO := 10041; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,2,0,0,0,'','Show gossip text if player is a Paladin'), +(14,@GOSSIP,@TEXTNO,0,15,1533,0,0,0,'','Show gossip text if player is not a Paladin'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train further in the ways of the Light.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- XXXXXXXXXXXXXXXXXXXXXX +-- X Warrior Trainers X +-- XXXXXXXXXXXXXXXXXXXXXX + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 523; +SET @TEXTYES := 1040; +SET @TEXTNO := 4985; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=985; + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 655; +SET @TEXTYES := 1218; +SET @TEXTNO := 4973; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=3408; + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 656; +SET @TEXTYES := 1219; +SET @TEXTNO := 4984; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4091; +SET @TEXTYES := 4992; +SET @TEXTNO := 4993; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"Yes. I have.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4475; +SET @TEXTYES := 1216; +SET @TEXTNO := 5721; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4481; +SET @TEXTYES := 1216; +SET @TEXTNO := 5721; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4482; +SET @TEXTYES := 1216; +SET @TEXTNO := 5721; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4509; +SET @TEXTYES := 1040; +SET @TEXTNO := 4985; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4511; +SET @TEXTYES := 1040; +SET @TEXTNO := 4985; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4525; +SET @TEXTYES := 1218; +SET @TEXTNO := 4973; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4526; +SET @TEXTYES := 1218; +SET @TEXTNO := 4973; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4527; +SET @TEXTYES := 1218; +SET @TEXTNO := 4973; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4546; +SET @TEXTYES := 1219; +SET @TEXTNO := 4984; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4547; +SET @TEXTYES := 1219; +SET @TEXTNO := 4984; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4548; +SET @TEXTYES := 1219; +SET @TEXTNO := 4984; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4568; +SET @TEXTYES := 4989; +SET @TEXTNO := 4988; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4569; +SET @TEXTYES := 1215; +SET @TEXTNO := 5724; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4570; +SET @TEXTYES := 1215; +SET @TEXTNO := 5724; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4578; +SET @TEXTYES := 1217; +SET @TEXTNO := 5725; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=4089; + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4579; +SET @TEXTYES := 1217; +SET @TEXTNO := 5725; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4581; +SET @TEXTYES := 1217; +SET @TEXTNO := 5725; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4645; +SET @TEXTYES := 1218; +SET @TEXTNO := 4973; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4649; +SET @TEXTYES := 1216; +SET @TEXTNO := 5721; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4650; +SET @TEXTYES := 1216; +SET @TEXTNO := 5721; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4653; +SET @TEXTYES := 1219; +SET @TEXTNO := 4984; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=2119; + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4683; +SET @TEXTYES := 1215; +SET @TEXTNO := 5724; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4684; +SET @TEXTYES := 1215; +SET @TEXTNO := 5724; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4696; +SET @TEXTYES := 1217; +SET @TEXTNO := 5725; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 4697; +SET @TEXTYES := 1217; +SET @TEXTNO := 5725; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Warrior Trainers +SET @GOSSIP := 7263; +SET @TEXTYES := 8587; +SET @TEXTNO := 8588; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1,0,0,0,'','Show gossip text if player is a Warrior'), +(14,@GOSSIP,@TEXTNO,0,15,1534,0,0,0,'','Show gossip text if player is not a Warrior'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require warrior training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- XXXXXXXXXXXXXXXXXXXXXX +-- X Druid Trainers X +-- XXXXXXXXXXXXXXXXXXXXXX + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 1403; +SET @TEXTYES := 4786; +SET @TEXTNO := 2037; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 3921; +SET @TEXTYES := 4774; +SET @TEXTNO := 4775; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 3924; +SET @TEXTYES := 4782; +SET @TEXTNO := 4781; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 3925; +SET @TEXTYES := 4784; +SET @TEXTNO := 4783; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=9465; + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 3926; +SET @TEXTYES := 4786; +SET @TEXTNO := 4785; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 4507; +SET @TEXTYES := 4784; +SET @TEXTNO := 4783; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=5506; + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 4508; +SET @TEXTYES := 4784; +SET @TEXTNO := 4783; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 4571; +SET @TEXTYES := 4782; +SET @TEXTNO := 4781; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 4605; +SET @TEXTYES := 5716; +SET @TEXTNO := 5717; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 4606; +SET @TEXTYES := 5716; +SET @TEXTNO := 5717; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 4607; +SET @TEXTYES := 5716; +SET @TEXTNO := 5717; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 4687; +SET @TEXTYES := 4784; +SET @TEXTNO := 4783; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 4688; +SET @TEXTYES := 4784; +SET @TEXTNO := 4783; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=3597; + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 7567; +SET @TEXTYES := 9195; +SET @TEXTNO := 9194; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 4646; +SET @TEXTYES := 5716; +SET @TEXTNO := 5717; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=8142; + +-- Gossip Condition for Druid Trainers +SET @GOSSIP := 7567; +SET @TEXTYES := 9195; +SET @TEXTNO := 9194; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,1024,0,0,0,'','Show gossip text if player is a Druid'), +(14,@GOSSIP,@TEXTNO,0,15,511,0,0,0,'','Show gossip text if player is not a Druid'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training as a druid.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + diff --git a/sql/updates/world/2012_02_03_01_world_quest_template.sql b/sql/updates/world/2012_02_03_01_world_quest_template.sql new file mode 100644 index 00000000000..9871fbf979e --- /dev/null +++ b/sql/updates/world/2012_02_03_01_world_quest_template.sql @@ -0,0 +1,2 @@ +-- Set quest "Feedin' Da Goolz" available to all races +UPDATE `quest_template` SET `RequiredRaces`=1791 WHERE `id`=12652; diff --git a/sql/updates/world/2012_02_04_00_world_gameobject_template.sql b/sql/updates/world/2012_02_04_00_world_gameobject_template.sql new file mode 100644 index 00000000000..d824c35da51 --- /dev/null +++ b/sql/updates/world/2012_02_04_00_world_gameobject_template.sql @@ -0,0 +1,2 @@ +-- set correct type from sniff +UPDATE `gameobject_template` SET `type`=33 WHERE `entry`=166872; diff --git a/sql/updates/world/2012_02_04_01_world_creature.sql b/sql/updates/world/2012_02_04_01_world_creature.sql new file mode 100644 index 00000000000..09f135c2715 --- /dev/null +++ b/sql/updates/world/2012_02_04_01_world_creature.sql @@ -0,0 +1,12 @@ +-- Spawn Petrov +SET @GUID :=40268; +DELETE FROM `creature` WHERE `id`=26932; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID,26932,571,1,1,0,0,4698.392,-4004.781,212.3551,0.5061455,300,0,0,1,0,0,0,0,0); + +-- Template updates for creature 26932 (Petrov) +UPDATE `creature_template` SET `baseattacktime`=1500,`unit_flags`=`unit_flags`|512 WHERE `entry`=26932; -- Petrov +-- Addon data for creature 26932 (Petrov) +DELETE FROM `creature_template_addon` WHERE `entry`=26932; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(26932,0,0,257,333, NULL); -- Petrov diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 1f85cb6bc5b..6d295a0bbee 100755 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -209,7 +209,7 @@ AuthSocket::~AuthSocket(void) {} // Accept the connection and set the s random value for SRP6 void AuthSocket::OnAccept(void) { - sLog->outBasic("Accepting connection from '%s'", socket().get_remote_address().c_str()); + sLog->outBasic("'%s:%d' Accepting connection", socket().getRemoteAddress().c_str(), socket().getRemotePort()); } void AuthSocket::OnClose(void) @@ -247,7 +247,7 @@ void AuthSocket::OnRead() // Report unknown packets in the error log if (i == AUTH_TOTAL_COMMANDS) { - sLog->outError("[Auth] got unknown packet from '%s'", socket().get_remote_address().c_str()); + sLog->outError("[Auth] got unknown packet from '%s'", socket().getRemoteAddress().c_str()); socket().shutdown(); return; } @@ -350,14 +350,14 @@ bool AuthSocket::_HandleLogonChallenge() // Verify that this IP is not in the ip_banned table LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS)); - const std::string& ip_address = socket().get_remote_address(); + const std::string& ip_address = socket().getRemoteAddress(); PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED); stmt->setString(0, ip_address); PreparedQueryResult result = LoginDatabase.Query(stmt); if (result) { pkt << (uint8)WOW_FAIL_BANNED; - sLog->outBasic("[AuthChallenge] Banned ip %s tried to login!", ip_address.c_str()); + sLog->outBasic("'%s:%d' [AuthChallenge] Banned ip tries to login!",socket().getRemoteAddress().c_str(), socket().getRemotePort()); } else { @@ -404,12 +404,12 @@ bool AuthSocket::_HandleLogonChallenge() if ((*banresult)[0].GetUInt64() == (*banresult)[1].GetUInt64()) { pkt << (uint8)WOW_FAIL_BANNED; - sLog->outBasic("[AuthChallenge] Banned account %s tried to login!", _login.c_str()); + sLog->outBasic("'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); } else { pkt << (uint8)WOW_FAIL_SUSPENDED; - sLog->outBasic("[AuthChallenge] Temporarily banned account %s tried to login!", _login.c_str()); + sLog->outBasic("'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); } } else @@ -480,7 +480,9 @@ bool AuthSocket::_HandleLogonChallenge() for (int i = 0; i < 4; ++i) _localizationName[i] = ch->country[4-i-1]; - sLog->outBasic("[AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName)); + sLog->outBasic("'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(), + _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName) + ); } } } @@ -590,7 +592,7 @@ bool AuthSocket::_HandleLogonProof() // Check if SRP6 results match (password is correct), else send an error if (!memcmp(M.AsByteArray(), lp.M1, 20)) { - sLog->outBasic("User '%s' successfully authenticated", _login.c_str()); + sLog->outBasic("'%s:%d' User '%s' successfully authenticated", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _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 @@ -598,7 +600,7 @@ bool AuthSocket::_HandleLogonProof() PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGONPROOF); stmt->setString(0, K_hex); - stmt->setString(1, socket().get_remote_address().c_str()); + stmt->setString(1, socket().getRemoteAddress().c_str()); stmt->setUInt32(2, GetLocaleByName(_localizationName)); stmt->setString(3, _login); LoginDatabase.Execute(stmt); @@ -638,7 +640,7 @@ bool AuthSocket::_HandleLogonProof() char data[4] = { AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0 }; socket().send(data, sizeof(data)); - sLog->outBasic("[AuthChallenge] account %s tried to login with wrong password!", _login.c_str()); + sLog->outBasic("'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); uint32 MaxWrongPassCount = ConfigMgr::GetIntDefault("WrongPass.MaxCount", 0); if (MaxWrongPassCount > 0) @@ -668,17 +670,18 @@ bool AuthSocket::_HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); - sLog->outBasic("[AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", - _login.c_str(), WrongPassBanTime, failed_logins); + sLog->outBasic("'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", + socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins); } else { stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_AUTO_BANNED); - stmt->setString(0, socket().get_remote_address()); + stmt->setString(0, socket().getRemoteAddress()); stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); - sLog->outBasic("[AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", socket().get_remote_address().c_str(), WrongPassBanTime, _login.c_str(), failed_logins); + sLog->outBasic("'%s:%d' [AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", + socket().getRemoteAddress().c_str(), socket().getRemotePort(), socket().getRemoteAddress().c_str(), WrongPassBanTime, _login.c_str(), failed_logins); } } } @@ -730,7 +733,7 @@ bool AuthSocket::_HandleReconnectChallenge() // Stop if the account is not found if (!result) { - sLog->outError("[ERROR] user %s tried to login and we cannot find his session key in the database.", _login.c_str()); + sLog->outError("'%s:%d' [ERROR] user %s tried to login and we cannot find his session key in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); socket().shutdown(); return false; } @@ -790,7 +793,7 @@ bool AuthSocket::_HandleReconnectProof() } else { - sLog->outError("[ERROR] user %s tried to login, but session invalid.", _login.c_str()); + sLog->outError("'%s:%d' [ERROR] user %s tried to login, but session is invalid.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); socket().shutdown(); return false; } @@ -812,7 +815,7 @@ bool AuthSocket::_HandleRealmList() PreparedQueryResult result = LoginDatabase.Query(stmt); if (!result) { - sLog->outError("[ERROR] user %s tried to login and we cannot find him in the database.", _login.c_str()); + sLog->outError("'%s:%d' [ERROR] user %s tried to login but we cannot find him in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); socket().shutdown(); return false; } diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp index a796daae17d..72c36fc6646 100755 --- a/src/server/authserver/Server/RealmSocket.cpp +++ b/src/server/authserver/Server/RealmSocket.cpp @@ -31,7 +31,7 @@ RealmSocket::Session::Session(void) {} RealmSocket::Session::~Session(void) { } -RealmSocket::RealmSocket(void) : input_buffer_(4096), session_(NULL), remote_address_() +RealmSocket::RealmSocket(void) : input_buffer_(4096), session_(NULL), _remoteAddress() { reference_counting_policy().value(ACE_Event_Handler::Reference_Counting_Policy::ENABLED); @@ -63,7 +63,8 @@ int RealmSocket::open(void * arg) return -1; } - remote_address_ = addr.get_host_addr(); + _remoteAddress = addr.get_host_addr(); + _remotePort = addr.get_port_number(); // Register with ACE Reactor if (Base::open(arg) == -1) @@ -89,9 +90,14 @@ int RealmSocket::close(int) return 0; } -const std::string& RealmSocket::get_remote_address(void) const +const std::string& RealmSocket::getRemoteAddress(void) const { - return remote_address_; + return _remoteAddress; +} + +const uint16 RealmSocket::getRemotePort(void) const +{ + return _remotePort; } size_t RealmSocket::recv_len(void) const diff --git a/src/server/authserver/Server/RealmSocket.h b/src/server/authserver/Server/RealmSocket.h index c532f016dcb..9682b5e4559 100755 --- a/src/server/authserver/Server/RealmSocket.h +++ b/src/server/authserver/Server/RealmSocket.h @@ -52,7 +52,9 @@ public: bool send(const char *buf, size_t len); - const std::string& get_remote_address(void) const; + const std::string& getRemoteAddress(void) const; + + const uint16 getRemotePort(void) const; virtual int open(void *); @@ -70,7 +72,8 @@ private: ACE_Message_Block input_buffer_; Session* session_; - std::string remote_address_; + std::string _remoteAddress; + uint16 _remotePort; }; #endif /* __REALMSOCKET_H__ */ diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index a83fb6f2789..e178efc7eee 100755 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -99,7 +99,7 @@ void CombatAI::UpdateAI(const uint32 diff) events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (uint32 spellId = events.ExecuteEvent()) @@ -158,7 +158,7 @@ void CasterAI::UpdateAI(const uint32 diff) events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (uint32 spellId = events.ExecuteEvent()) diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index 501959d67f9..b9d385ba675 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -50,7 +50,7 @@ class GameObjectAI virtual void Destroyed(Player* /*player*/, uint32 /*eventId*/) {} virtual void SetData(uint32 /*id*/, uint32 /*value*/) {} virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {} - virtual void OnStateChanged(uint32 state) { } + virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) { } }; class NullGameObjectAI : public GameObjectAI diff --git a/src/server/game/AI/CoreAI/PassiveAI.cpp b/src/server/game/AI/CoreAI/PassiveAI.cpp index 1244e032dbd..3738d5bab6c 100755 --- a/src/server/game/AI/CoreAI/PassiveAI.cpp +++ b/src/server/game/AI/CoreAI/PassiveAI.cpp @@ -61,14 +61,14 @@ void PossessedAI::KilledUnit(Unit* victim) void CritterAI::DamageTaken(Unit* /*done_by*/, uint32&) { - if (!me->HasUnitState(UNIT_STAT_FLEEING)) - me->SetControlled(true, UNIT_STAT_FLEEING); + if (!me->HasUnitState(UNIT_STATE_FLEEING)) + me->SetControlled(true, UNIT_STATE_FLEEING); } void CritterAI::EnterEvadeMode() { - if (me->HasUnitState(UNIT_STAT_FLEEING)) - me->SetControlled(false, UNIT_STAT_FLEEING); + if (me->HasUnitState(UNIT_STATE_FLEEING)) + me->SetControlled(false, UNIT_STATE_FLEEING); CreatureAI::EnterEvadeMode(); } diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 015e20415b1..83a89a966c5 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -116,14 +116,14 @@ void PetAI::UpdateAI(const uint32 diff) else HandleReturnMovement(); } - else if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim + else if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) // no charm info and no victim me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); if (!me->GetCharmInfo()) return; // Autocast (casted only in combat or persistent spells in any state) - if (!me->HasUnitState(UNIT_STAT_CASTING)) + if (!me->HasUnitState(UNIT_STATE_CASTING)) { typedef std::vector<std::pair<Unit*, Spell*> > TargetSpellList; TargetSpellList targetSpellStore; diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 38504b90b19..bf50909eeee 100755 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -40,7 +40,7 @@ void UnitAI::AttackStartCaster(Unit* victim, float dist) void UnitAI::DoMeleeAttackIfReady() { - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; Unit* victim = me->getVictim(); @@ -60,7 +60,7 @@ void UnitAI::DoMeleeAttackIfReady() bool UnitAI::DoSpellAttackIfReady(uint32 spell) { - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return true; if (me->isAttackReady()) diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index 147e829b0df..f568da80b49 100755 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -596,7 +596,7 @@ inline bool CreatureAI::_EnterEvadeMode() inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered) { - if (!victim || (me->HasUnitState(UNIT_STAT_CASTING) && !triggered)) + if (!victim || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered)) return; me->CastSpell(victim, spellId, triggered); @@ -609,7 +609,7 @@ inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered) inline void UnitAI::DoCastAOE(uint32 spellId, bool triggered) { - if (!triggered && me->HasUnitState(UNIT_STAT_CASTING)) + if (!triggered && me->HasUnitState(UNIT_STATE_CASTING)) return; me->CastSpell((Unit*)NULL, spellId, triggered); diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index c507262bd3f..5db9d0b1cdb 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -577,7 +577,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { if (action.combat_movement.melee) { - me->AddUnitState(UNIT_STAT_MELEE_ATTACKING); + me->AddUnitState(UNIT_STATE_MELEE_ATTACKING); me->SendMeleeAttackStart(victim); } if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE) @@ -591,7 +591,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 Unit* victim = me->getVictim(); if (action.combat_movement.melee && victim) { - me->ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + me->ClearUnitState(UNIT_STATE_MELEE_ATTACKING); me->SendMeleeAttackStop(victim); } if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 1b6fde6d132..bd6c901f99c 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -595,7 +595,7 @@ void BossAI::UpdateAI(uint32 const diff) events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -654,7 +654,7 @@ void WorldBossAI::UpdateAI(uint32 const diff) events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index c5f04d4ff5f..048cc8b3d68 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -90,7 +90,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who) void npc_escortAI::MoveInLineOfSight(Unit* who) { - if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) + if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) { if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who)) return; diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 53747d0c799..d83ad9b756c 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -38,8 +38,8 @@ void FollowerAI::AttackStart(Unit* who) me->SetInCombatWith(who); who->SetInCombatWith(me); - if (me->HasUnitState(UNIT_STAT_FOLLOW)) - me->ClearUnitState(UNIT_STAT_FOLLOW); + if (me->HasUnitState(UNIT_STATE_FOLLOW)) + me->ClearUnitState(UNIT_STATE_FOLLOW); if (IsCombatMovementAllowed()) me->GetMotionMaster()->MoveChase(who); @@ -88,7 +88,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who) void FollowerAI::MoveInLineOfSight(Unit* who) { - if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) + if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) { if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who)) return; @@ -340,9 +340,9 @@ Player* FollowerAI::GetLeaderForFollower() void FollowerAI::SetFollowComplete(bool bWithEndEvent) { - if (me->HasUnitState(UNIT_STAT_FOLLOW)) + if (me->HasUnitState(UNIT_STATE_FOLLOW)) { - me->ClearUnitState(UNIT_STAT_FOLLOW); + me->ClearUnitState(UNIT_STATE_FOLLOW); me->StopMoving(); me->GetMotionMaster()->Clear(); @@ -369,9 +369,9 @@ void FollowerAI::SetFollowPaused(bool paused) { AddFollowState(STATE_FOLLOW_PAUSED); - if (me->HasUnitState(UNIT_STAT_FOLLOW)) + if (me->HasUnitState(UNIT_STATE_FOLLOW)) { - me->ClearUnitState(UNIT_STAT_FOLLOW); + me->ClearUnitState(UNIT_STATE_FOLLOW); me->StopMoving(); me->GetMotionMaster()->Clear(); diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 1a26e241c5e..07a8e3fdca7 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -46,7 +46,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) // spawn in run mode me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - mRun = true; + mRun = false; me->GetPosition(&mLastOOCPos); @@ -68,6 +68,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) mFollowCredit = 0; mFollowArrivedEntry = 0; mFollowCreditType = 0; + mInvinceabilityHpLevel = 0; } void SmartAI::UpdateDespawn(const uint32 diff) @@ -89,7 +90,7 @@ void SmartAI::UpdateDespawn(const uint32 diff) void SmartAI::Reset() { if (!HasEscortState(SMART_ESCORT_ESCORTING))//dont mess up escort movement after combat - SetRun(true); + SetRun(mRun); GetScript()->OnReset(); } @@ -637,6 +638,8 @@ void SmartAI::SpellHitTarget(Unit* target, const SpellInfo* spellInfo) void SmartAI::DamageTaken(Unit* doneBy, uint32& damage) { GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage); + if ((me->GetHealth() - damage) <= mInvinceabilityHpLevel) + damage -= mInvinceabilityHpLevel; } void SmartAI::HealReceived(Unit* doneBy, uint32& addhealth) @@ -937,9 +940,9 @@ void SmartGameObjectAI::OnGameEvent(bool start, uint16 eventId) GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId); } -void SmartGameObjectAI::OnStateChanged(uint32 state) +void SmartGameObjectAI::OnStateChanged(uint32 state, Unit* unit) { - GetScript()->ProcessEventsFor(SMART_EVENT_GO_STATE_CHANGED, NULL, state); + GetScript()->ProcessEventsFor(SMART_EVENT_GO_STATE_CHANGED, unit, state); } class SmartTrigger : public AreaTriggerScript diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index 297ac88fbb0..a40254fe384 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -175,6 +175,8 @@ class SmartAI : public CreatureAI void SetSwim(bool swim = true); + void SetInvinceabilityHpLevel(uint32 level) { mInvinceabilityHpLevel = level; } + void sGossipHello(Player* player); void sGossipSelect(Player* player, uint32 sender, uint32 action); void sGossipSelectCode(Player* player, uint32 sender, uint32 action, const char* code); @@ -222,6 +224,7 @@ class SmartAI : public CreatureAI bool mCanAutoAttack; bool mCanCombatMove; bool mForcedPaused; + uint32 mInvinceabilityHpLevel; bool AssistPlayerInCombat(Unit* who); @@ -253,7 +256,7 @@ public: void SetData(uint32 id, uint32 value); void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker); void OnGameEvent(bool start, uint16 eventId); - void OnStateChanged(uint32 state); + void OnStateChanged(uint32 state, Unit* unit); protected: GameObject* const go; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 4328eafc962..a6923ea19e0 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -39,7 +39,6 @@ SmartScript::SmartScript() go = NULL; me = NULL; mEventPhase = 0; - mInvinceabilityHpLevel = 0; mPathId = 0; mTargetStorage = new ObjectListMap(); mStoredEvents.clear(); @@ -84,7 +83,20 @@ void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint3 continue; if (eventType == e/* && (!(*i).event.event_phase_mask || IsInPhase((*i).event.event_phase_mask)) && !((*i).event.event_flags & SMART_EVENT_FLAG_NOT_REPEATABLE && (*i).runOnce)*/) - ProcessEvent(*i, unit, var0, var1, bvar, spell, gob); + { + bool meets = true; + if (unit) + { + if (Player* player = unit->ToPlayer()) + { + ConditionList conds = sConditionMgr->GetConditionsForSmartEvent((*i).entryOrGuid, (*i).event_id, (*i).source_type); + meets = sConditionMgr->IsPlayerMeetToConditions(player, conds); + } + } + + if (meets) + ProcessEvent(*i, unit, var0, var1, bvar, spell, gob); + } } } @@ -102,15 +114,6 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (unit) mLastInvoker = unit->GetGUID(); - if (e.link && e.link != e.event_id) - { - SmartScriptHolder linked = FindLinkedEvent(e.link); - if (linked.GetActionType() && linked.GetEventType() == SMART_EVENT_LINK) - ProcessEvent(linked, unit, var0, var1, bvar, spell, gob); - else - sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Link Event %u not found or invalid, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link); - } - if (Unit* tempInvoker = GetLastInvoker()) sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: Invoker: %s (guidlow: %u)", tempInvoker->GetName(), tempInvoker->GetGUIDLow()); @@ -119,7 +122,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_TALK: { if (!me) - return; + break; ObjectList* targets = GetTargets(e, unit); Creature* talker = me; @@ -257,7 +260,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -300,7 +303,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -319,7 +322,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -340,7 +343,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_SET_REACT_STATE: { if (!me) - return; + break; me->SetReactState(ReactStates(e.action.react.state)); sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_REACT_STATE: Creature guidLow %u set reactstate %u", @@ -351,7 +354,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; uint32 emotes[SMART_ACTION_PARAM_COUNT]; emotes[0] = e.action.randomEmote.emote1; @@ -388,7 +391,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_THREAT_ALL_PCT: { if (!me) - return; + break; std::list<HostileReference*> const& threatList = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::const_iterator i = threatList.begin(); i != threatList.end(); ++i) @@ -405,11 +408,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_THREAT_SINGLE_PCT: { if (!me) - return; + break; ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -428,7 +431,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -446,11 +449,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_SEND_CASTCREATUREORGO: { if (!GetBaseObject()) - return; + break; ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -468,11 +471,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_CAST: { if (!me) - return; + break; ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -494,11 +497,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { Unit* tempLastInvoker = GetLastInvoker(); if (!tempLastInvoker) - return; + break; ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -520,7 +523,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -539,7 +542,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -547,7 +550,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { // Activate (*itr)->ToGameObject()->SetLootState(GO_READY); - (*itr)->ToGameObject()->UseDoorOrButton(); + (*itr)->ToGameObject()->UseDoorOrButton(0, false, unit); sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject %u (entry: %u) activated", (*itr)->GetGUIDLow(), (*itr)->GetEntry()); } @@ -560,7 +563,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -579,7 +582,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -598,7 +601,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -617,7 +620,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -635,7 +638,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_AUTO_ATTACK: { if (!IsSmart()) - return; + break; CAST_AI(SmartAI, me->AI())->SetAutoAttack(e.action.autoAttack.attack ? true : false); sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: %u bool on = %u", @@ -645,7 +648,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_ALLOW_COMBAT_MOVEMENT: { if (!IsSmart()) - return; + break; bool move = e.action.combatMove.move ? true : false; CAST_AI(SmartAI, me->AI())->SetCombatMove(move); @@ -656,7 +659,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_SET_EVENT_PHASE: { if (!GetBaseObject()) - return; + break; SetPhase(e.action.setEventPhase.phase); sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature %u set event phase %u", @@ -666,7 +669,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_INC_EVENT_PHASE: { if (!GetBaseObject()) - return; + break; IncPhase(e.action.incEventPhase.inc); DecPhase(e.action.incEventPhase.dec); @@ -677,7 +680,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_EVADE: { if (!me) - return; + break; me->AI()->EnterEvadeMode(); sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_EVADE: Creature %u EnterEvadeMode", me->GetGUIDLow()); @@ -686,7 +689,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_FLEE_FOR_ASSIST: { if (!me) - return; + break; me->DoFleeToGetAssistance(); if (e.action.flee.withEmote) @@ -707,11 +710,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_CALL_CASTEDCREATUREORGO: { if (!GetBaseObject()) - return; + break; ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -730,7 +733,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -748,11 +751,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_FOLLOW: { if (!IsSmart()) - return; + break; ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -771,7 +774,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_RANDOM_PHASE: { if (!GetBaseObject()) - return; + break; uint32 phases[SMART_ACTION_PARAM_COUNT]; phases[0] = e.action.randomPhase.phase1; @@ -800,7 +803,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_RANDOM_PHASE_RANGE: { if (!GetBaseObject()) - return; + break; uint32 phase = urand(e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax); SetPhase(phase); @@ -820,7 +823,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -849,13 +852,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u obj = unit; if (!obj) - return; + break; InstanceScript* instance = obj->GetInstanceScript(); if (!instance) { sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); - return; + break; } instance->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data); @@ -870,18 +873,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u obj = unit; if (!obj) - return; + break; InstanceScript* instance = obj->GetInstanceScript(); if (!instance) { sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); - return; + break; } ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; instance->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID()); sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: "UI64FMTD, @@ -893,7 +896,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_UPDATE_TEMPLATE: { if (!me || me->GetEntry() == e.action.updateTemplate.creature) - return; + break; me->UpdateEntry(e.action.updateTemplate.creature, e.action.updateTemplate.team ? HORDE : ALLIANCE); sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_UPDATE_TEMPLATE: Creature %u, Template: %u, Team: %u", @@ -940,7 +943,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_FORCE_DESPAWN: { if (!IsSmart()) - return; + break; CAST_AI(SmartAI, me->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1);//next tick CAST_AI(SmartAI, me->AI())->StartDespawn(); @@ -956,7 +959,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -986,19 +989,24 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL: { if (!me) - return; + break; + + SmartAI* ai = CAST_AI(SmartAI, me->AI()); + + if (!ai) + break; if (e.action.invincHP.percent) - mInvinceabilityHpLevel = me->CountPctFromMaxHealth(e.action.invincHP.percent); + ai->SetInvinceabilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent)); else - mInvinceabilityHpLevel = e.action.invincHP.minHP; + ai->SetInvinceabilityHpLevel(e.action.invincHP.minHP); break; } case SMART_ACTION_SET_DATA: { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1014,7 +1022,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_MOVE_FORWARD: { if (!me) - return; + break; float x, y, z; me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)e.action.moveRandom.distance); @@ -1036,11 +1044,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_ATTACK_START: { if (!me) - return; + break; ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1075,7 +1083,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } if (e.GetTargetType() != SMART_TARGET_POSITION) - return; + break; if (Creature* summon = GetBaseObject()->SummonCreature(e.action.summonCreature.creature, e.target.x, e.target.y, e.target.z, e.target.o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) if (unit && e.action.summonCreature.attackInvoker) @@ -1085,7 +1093,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_SUMMON_GO: { if (!GetBaseObject()) - return; + break; float x, y, z, o; ObjectList* targets = GetTargets(e, unit); @@ -1104,7 +1112,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } if (e.GetTargetType() != SMART_TARGET_POSITION) - return; + break; GetBaseObject()->SummonGameObject(e.action.summonGO.entry, e.target.x, e.target.y, e.target.z, e.target.o, 0, 0, 0, 0, e.action.summonGO.despawnTime); break; @@ -1113,7 +1121,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1135,7 +1143,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1152,7 +1160,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1182,7 +1190,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1198,7 +1206,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_SET_FLY: { if (!IsSmart()) - return; + break; CAST_AI(SmartAI, me->AI())->SetFly(e.action.setFly.fly ? true : false); break; @@ -1206,7 +1214,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_SET_RUN: { if (!IsSmart()) - return; + break; CAST_AI(SmartAI, me->AI())->SetRun(e.action.setRun.run ? true : false); break; @@ -1214,7 +1222,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_SET_SWIM: { if (!IsSmart()) - return; + break; CAST_AI(SmartAI, me->AI())->SetSwim(e.action.setSwim.swim ? true : false); break; @@ -1222,7 +1230,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_WP_START: { if (!IsSmart()) - return; + break; bool run = e.action.wpStart.run ? true : false; uint32 entry = e.action.wpStart.pathID; @@ -1241,7 +1249,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_WP_PAUSE: { if (!IsSmart()) - return; + break; uint32 delay = e.action.wpPause.delay; CAST_AI(SmartAI, me->AI())->PausePath(delay, e.GetEventType() == SMART_EVENT_WAYPOINT_REACHED ? false : true); @@ -1250,7 +1258,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_WP_STOP: { if (!IsSmart()) - return; + break; uint32 DespawnTime = e.action.wpStop.despawnTime; uint32 quest = e.action.wpStop.quest; @@ -1261,7 +1269,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_WP_RESUME: { if (!IsSmart()) - return; + break; CAST_AI(SmartAI, me->AI())->ResumePath(); break; @@ -1269,7 +1277,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_SET_ORIENTATION: { if (!me) - return; + break; ObjectList* targets = GetTargets(e, unit); if (e.GetTargetType() == SMART_TARGET_SELF) @@ -1286,7 +1294,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1302,7 +1310,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_MOVE_TO_POS: { if (!IsSmart()) - return; + break; WorldObject* target = NULL; @@ -1314,7 +1322,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; target = targets->front(); } @@ -1329,7 +1337,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1346,7 +1354,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsPlayer(*itr)) @@ -1359,7 +1367,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1436,7 +1444,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1476,7 +1484,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (e.GetTargetType() == SMART_TARGET_NONE) { sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); - return; + break; } ObjectList* targets = GetTargets(e, unit); @@ -1504,7 +1512,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsUnit(*itr)) @@ -1517,7 +1525,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsUnit(*itr)) @@ -1530,7 +1538,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsUnit(*itr)) @@ -1543,13 +1551,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* casters = GetTargets(CreateEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, 0, 0, SMART_ACTION_NONE, 0, 0, 0, 0, 0, 0, (SMARTAI_TARGETS)e.action.cast.targetType, e.action.cast.targetParam1, e.action.cast.targetParam2, e.action.cast.targetParam3, 0), unit); if (!casters) - return; + break; ObjectList* targets = GetTargets(e, unit); if (!targets) { delete casters; // casters already validated, delete now - return; + break; } for (ObjectList::const_iterator itr = casters->begin(); itr != casters->end(); ++itr) @@ -1593,7 +1601,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (e.GetTargetType() == SMART_TARGET_NONE) { sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); - return; + break; } ObjectList* targets = GetTargets(e, unit); @@ -1623,7 +1631,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (e.GetTargetType() == SMART_TARGET_NONE) { sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); - return; + break; } ObjectList* targets = GetTargets(e, unit); @@ -1651,7 +1659,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsPlayer(*itr)) @@ -1664,7 +1672,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { @@ -1684,7 +1692,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsUnit(*itr)) (*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.setunitByte.byte1); @@ -1696,7 +1704,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsUnit(*itr)) @@ -1709,7 +1717,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsUnit(*itr)) @@ -1722,7 +1730,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsGameObject(*itr)) @@ -1735,7 +1743,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsUnit(*itr)) @@ -1748,7 +1756,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsUnit(*itr)) @@ -1761,7 +1769,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsUnit(*itr)) @@ -1773,7 +1781,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_JUMP_TO_POS: { if (!me) - return; + break; me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveJump(e.target.x, e.target.y, e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz); @@ -1783,10 +1791,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_GO_SET_LOOT_STATE: { ObjectList* targets = GetTargets(e, unit); - + if (!targets) - return; - + break; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (IsGameObject(*itr)) (*itr)->ToGameObject()->SetLootState((LootState)e.action.setGoLootState.state); @@ -1794,17 +1802,44 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u delete targets; break; } + case SMART_ACTION_SEND_TARGET_TO_TARGET: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature(*itr)) + { + if (SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI())) + ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id); + else + sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping"); + } + else if (IsGameObject(*itr)) + { + if (SmartGameObjectAI* ai = CAST_AI(SmartGameObjectAI, (*itr)->ToGameObject()->AI())) + ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id); + else + sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping"); + } + } + + delete targets; + break; + } case SMART_ACTION_SEND_GOSSIP_MENU: { if (!GetBaseObject()) - return; + break; sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossipNpcTextId %d", e.action.sendGossipMenu.gossipMenuId, e.action.sendGossipMenu.gossipNpcTextId); ObjectList* targets = GetTargets(e, unit); if (!targets) - return; + break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) if (Player* player = (*itr)->ToPlayer()) @@ -1824,6 +1859,15 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType()); break; } + + if (e.link && e.link != e.event_id) + { + SmartScriptHolder linked = FindLinkedEvent(e.link); + if (linked.GetActionType() && linked.GetEventType() == SMART_EVENT_LINK) + ProcessEvent(linked, unit, var0, var1, bvar, spell, gob); + else + sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Link Event %u not found or invalid, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link); + } } void SmartScript::InstallTemplate(SmartScriptHolder const& e) @@ -2674,7 +2718,7 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) { if (!(e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS)) { - if (me && me->HasUnitState(UNIT_STAT_CASTING)) + if (me && me->HasUnitState(UNIT_STATE_CASTING)) { e.timer = 1; return; diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index f55d91ed52f..fec38a690ed 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -236,7 +236,6 @@ class SmartScript SmartScriptType mScriptType; uint32 mEventPhase; - uint32 mInvinceabilityHpLevel; UNORDERED_MAP<int32, int32> mStoredDecimals; uint32 mPathId; SmartAIEventList mStoredEvents; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 15423c7aff2..9a23d9e1390 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -282,6 +282,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e) case SMART_TARGET_HOSTILE_RANDOM: case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP: case SMART_TARGET_ACTION_INVOKER: + case SMART_TARGET_INVOKER_PARTY: case SMART_TARGET_POSITION: case SMART_TARGET_NONE: case SMART_TARGET_ACTION_INVOKER_VEHICLE: @@ -801,6 +802,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_REMOVE_DYNAMIC_FLAG: case SMART_ACTION_JUMP_TO_POS: case SMART_ACTION_SEND_GOSSIP_MENU: + case SMART_ACTION_GO_SET_LOOT_STATE: + case SMART_ACTION_SEND_TARGET_TO_TARGET: break; default: sLog->outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 6b99a7dc5be..e08fe331d3d 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -473,8 +473,9 @@ enum SMART_ACTION SMART_ACTION_JUMP_TO_POS = 97, // speedXY, speedZ, targetX, targetY, targetZ SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId SMART_ACTION_GO_SET_LOOT_STATE = 99, // state + SMART_ACTION_SEND_TARGET_TO_TARGET = 100, // id - SMART_ACTION_END = 100, + SMART_ACTION_END = 101, }; struct SmartAction @@ -885,6 +886,11 @@ struct SmartAction struct { + uint32 id; + } sendTargetToTarget; + + struct + { uint32 param1; uint32 param2; uint32 param3; diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 02686993fbb..271e78abf67 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1176,10 +1176,9 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // speedup for non-login case if (miscValue1 && achievementCriteria->own_item.itemID != miscValue1) continue; - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetItemCount(achievementCriteria->own_item.itemID, true)); + SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: - // miscvalue1 contains the personal rating if (!miscValue1) // no update at login continue; diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 8e30743f107..02707261d13 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -455,7 +455,7 @@ void ArenaTeam::Inspect(WorldSession* session, uint64 guid) session->SendPacket(&data); } -void ArenaTeamMember::ModifyPersonalRating(Player* player, int32 mod, uint32 slot) +void ArenaTeamMember::ModifyPersonalRating(Player* player, int32 mod, uint32 type) { if (int32(PersonalRating) + mod < 0) PersonalRating = 0; @@ -464,8 +464,8 @@ void ArenaTeamMember::ModifyPersonalRating(Player* player, int32 mod, uint32 slo if (player) { - player->SetArenaTeamInfoField(slot, ARENA_TEAM_PERSONAL_RATING, PersonalRating); - player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING, PersonalRating, slot); + player->SetArenaTeamInfoField(ArenaTeam::GetSlotByType(type), ARENA_TEAM_PERSONAL_RATING, PersonalRating); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING, PersonalRating, type); } } @@ -725,7 +725,7 @@ void ArenaTeam::MemberLost(Player* player, uint32 againstMatchmakerRating, int32 { // Update personal rating int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, false); - itr->ModifyPersonalRating(player, mod, GetSlot()); + itr->ModifyPersonalRating(player, mod, GetType()); // Update matchmaker rating itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot()); @@ -751,7 +751,7 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, i { // update personal rating int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, false); - itr->ModifyPersonalRating(NULL, mod, GetSlot()); + itr->ModifyPersonalRating(NULL, mod, GetType()); // update matchmaker rating itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot()); @@ -773,7 +773,7 @@ void ArenaTeam::MemberWon(Player* player, uint32 againstMatchmakerRating, int32 { // update personal rating int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, true); - itr->ModifyPersonalRating(player, mod, GetSlot()); + itr->ModifyPersonalRating(player, mod, GetType()); // update matchmaker rating itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot()); diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h index 03ddea1dd3a..d8ad2c09e59 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.h +++ b/src/server/game/Battlegrounds/ArenaTeam.h @@ -97,7 +97,7 @@ struct ArenaTeamMember uint16 PersonalRating; uint16 MatchMakerRating; - void ModifyPersonalRating(Player* player, int32 mod, uint32 slot); + void ModifyPersonalRating(Player* player, int32 mod, uint32 type); void ModifyMatchmakerRating(int32 mod, uint32 slot); }; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 6a758695116..08ca406e373 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -771,6 +771,7 @@ void Battleground::EndBattleground(uint32 winner) } } + uint8 aliveWinners = GetAlivePlayersCountByTeam(winner); for (BattlegroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) { uint32 team = itr->second.Team; @@ -796,6 +797,10 @@ void Battleground::EndBattleground(uint32 winner) if (player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION)) player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT); + // Last standing - Rated 5v5 arena & be solely alive player + if (team == winner && isArena() && isRated() && GetArenaType() == ARENA_TYPE_5v5 && aliveWinners == 1 && player->isAlive()) + player->CastSpell(player, SPELL_THE_LAST_STANDING, true); + if (!player->isAlive()) { player->ResurrectPlayer(1.0f); @@ -819,7 +824,7 @@ void Battleground::EndBattleground(uint32 winner) // update achievement BEFORE personal rating update ArenaTeamMember* member = winner_arena_team->GetMember(player->GetGUID()); if (member) - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, member->PersonalRating); + player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, 1); winner_arena_team->MemberWon(player, loser_matchmaker_rating, winner_matchmaker_change); } @@ -895,19 +900,6 @@ uint32 Battleground::GetBonusHonorFromKill(uint32 kills) const return Trinity::Honor::hk_honor_at_level(maxLevel, float(kills)); } -uint32 Battleground::GetBattlemasterEntry() const -{ - switch (GetTypeID(true)) - { - case BATTLEGROUND_AV: return 15972; - case BATTLEGROUND_WS: return 14623; - case BATTLEGROUND_AB: return 14879; - case BATTLEGROUND_EY: return 22516; - case BATTLEGROUND_NA: return 20200; - default: return 0; - } -} - void Battleground::BlockMovement(Player* player) { player->SetClientControl(player, 0); // movement disabled NOTE: the effect will be automatically removed by client when the player is teleported from the battleground, so no need to send with uint8(1) in RemovePlayerAtLeave() diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index fcfc0c48cb4..6eb64a2caba 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -98,7 +98,8 @@ enum BattlegroundSpells SPELL_RECENTLY_DROPPED_FLAG = 42792, // Recently Dropped Flag SPELL_AURA_PLAYER_INACTIVE = 43681, // Inactive SPELL_HONORABLE_DEFENDER_25Y = 68652, // +50% honor when standing at a capture point that you control, 25yards radius (added in 3.2) - SPELL_HONORABLE_DEFENDER_60Y = 66157 // +50% honor when standing at a capture point that you control, 60yards radius (added in 3.2), probably for 40+ player battlegrounds + SPELL_HONORABLE_DEFENDER_60Y = 66157, // +50% honor when standing at a capture point that you control, 60yards radius (added in 3.2), probably for 40+ player battlegrounds + SPELL_THE_LAST_STANDING = 26549, // Arena achievement related }; enum BattlegroundTimeIntervals @@ -360,7 +361,6 @@ class Battleground uint8 GetArenaType() const { return m_ArenaType; } uint8 GetWinner() const { return m_Winner; } uint32 GetScriptId() const { return ScriptId; } - uint32 GetBattlemasterEntry() const; uint32 GetBonusHonorFromKill(uint32 kills) const; bool IsRandom() const { return m_IsRandom; } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index d64b2a9913d..5e529768c04 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -202,6 +202,9 @@ void BattlegroundAB::StartingEventOpenDoors() } DoorOpen(BG_AB_OBJECT_GATE_A); DoorOpen(BG_AB_OBJECT_GATE_H); + + // Achievement: Let's Get This Done + StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, AB_EVENT_START_BATTLE); } void BattlegroundAB::AddPlayer(Player* player) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index 38c8f4a21d4..c86076f0250 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -181,6 +181,8 @@ enum BG_AB_Objectives #define BG_AB_NotABBGWeekendReputationTicks 200 #define BG_AB_ABBGWeekendReputationTicks 150 +#define AB_EVENT_START_BATTLE 9158 // Achievement: Let's Get This Done + // x, y, z, o const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = { {1166.785f, 1200.132f, -56.70859f, 0.9075713f}, // stables diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 01f62bfcf35..f2e8c2bf0af 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -420,6 +420,9 @@ void BattlegroundAV::StartingEventOpenDoors() DoorOpen(BG_AV_OBJECT_DOOR_H); DoorOpen(BG_AV_OBJECT_DOOR_A); + + // Achievement: The Alterac Blitz + StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, AV_EVENT_START_BATTLE); } void BattlegroundAV::AddPlayer(Player* player) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index e2902f8fd2d..82e231c63fa 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -50,6 +50,8 @@ class Battleground; #define BG_AV_KILL_SURVIVING_CAPTAIN 2 #define BG_AV_REP_SURVIVING_CAPTAIN 125 +#define AV_EVENT_START_BATTLE 9166 // Achievement: The Alterac Blitz + enum BG_AV_Sounds { //TODO: get out if there comes a sound when neutral team captures mine diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 4595a061e1a..cbc3ec85055 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -120,6 +120,9 @@ void BattlegroundEY::StartingEventOpenDoors() uint8 buff = urand(0, 2); SpawnBGObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + buff + i * 3, RESPAWN_IMMEDIATELY); } + + // Achievement: Flurry + StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EY_EVENT_START_BATTLE); } void BattlegroundEY::AddPoints(uint32 Team, uint32 Points) @@ -193,7 +196,6 @@ void BattlegroundEY::CheckSomeoneLeftPoint() //move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]); m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j); - ++j; continue; } if (!player->CanCaptureTowerPoint() || !player->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS)) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index 5f89e0d7021..baa9ca30cff 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -220,6 +220,8 @@ enum EYBattlegroundObjectTypes #define BG_EY_NotEYWeekendHonorTicks 330 #define BG_EY_EYWeekendHonorTicks 200 +#define EY_EVENT_START_BATTLE 13180 // Achievement: Flurry + enum BG_EY_Score { BG_EY_WARNING_NEAR_VICTORY_SCORE = 1400, diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index e3eefd41d52..40f31cef394 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -175,9 +175,9 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff) { if (siege->isAlive()) { - if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE)) + if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_IMMUNE_TO_PC)) // following sniffs the vehicle always has UNIT_FLAG_UNK_14 - siege->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_OOC_NOT_ATTACKABLE); + siege->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_IMMUNE_TO_PC); else siege->SetHealth(siege->GetMaxHealth()); } @@ -793,7 +793,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) if (Creature* siegeEngine = GetBGCreature(siegeType)) { - siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE); + siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_IMMUNE_TO_PC); siegeEngine->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]); } } diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt index 658e9a15cc8..ac1bb9e5cac 100644 --- a/src/server/game/CMakeLists.txt +++ b/src/server/game/CMakeLists.txt @@ -30,6 +30,7 @@ file(GLOB_RECURSE sources_Globals Globals/*.cpp Globals/*.h) file(GLOB_RECURSE sources_Grids Grids/*.cpp Grids/*.h) file(GLOB_RECURSE sources_Groups Groups/*.cpp Groups/*.h) file(GLOB_RECURSE sources_Guilds Guilds/*.cpp Guilds/*.h) +file(GLOB_RECURSE sources_Handlers Handlers/*.cpp Handlers/*.h) file(GLOB_RECURSE sources_Instances Instances/*.cpp Instances/*.h) file(GLOB_RECURSE sources_Loot Loot/*.cpp Loot/*.h) file(GLOB_RECURSE sources_Mails Mails/*.cpp Mails/*.h) @@ -79,6 +80,7 @@ set(game_STAT_SRCS ${sources_Grids} ${sources_Groups} ${sources_Guilds} + ${sources_Handlers} ${sources_Instances} ${sources_Loot} ${sources_Mails} @@ -115,12 +117,10 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/shared/Database ${CMAKE_SOURCE_DIR}/src/server/shared/DataStores ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging - ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic ${CMAKE_SOURCE_DIR}/src/server/shared/Logging ${CMAKE_SOURCE_DIR}/src/server/shared/Packets - ${CMAKE_SOURCE_DIR}/src/server/shared/Policies ${CMAKE_SOURCE_DIR}/src/server/shared/Threading ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities ${CMAKE_CURRENT_SOURCE_DIR} @@ -165,6 +165,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Grids ${CMAKE_CURRENT_SOURCE_DIR}/Groups ${CMAKE_CURRENT_SOURCE_DIR}/Guilds + ${CMAKE_CURRENT_SOURCE_DIR}/Handlers ${CMAKE_CURRENT_SOURCE_DIR}/Instances ${CMAKE_CURRENT_SOURCE_DIR}/Loot ${CMAKE_CURRENT_SOURCE_DIR}/Mails @@ -181,7 +182,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Reputation ${CMAKE_CURRENT_SOURCE_DIR}/Scripting ${CMAKE_CURRENT_SOURCE_DIR}/Server/Protocol - ${CMAKE_CURRENT_SOURCE_DIR}/Server/Protocol/Handlers ${CMAKE_CURRENT_SOURCE_DIR}/Server ${CMAKE_CURRENT_SOURCE_DIR}/Skills ${CMAKE_CURRENT_SOURCE_DIR}/Spells diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 31942d9e2fa..68961b9de61 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -332,8 +332,8 @@ bool ChatHandler::HandlePInfoCommand(const char* args) QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login, a.mutetime " "FROM account a " "LEFT JOIN account_access aa " - "ON (a.id = aa.id) " - "WHERE a.id = '%u'", accId); + "ON (a.id = aa.id AND (aa.RealmID = -1 OR aa.RealmID = %u)) " + "WHERE a.id = '%u'", realmID, accId); if (result) { Field* fields = result->Fetch(); diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 7833198e3c3..d82e43ba83b 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -180,7 +180,7 @@ void HostileReference::updateOnlineStatus() // target is not in flight if (isValid() && (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster()) - && !getTarget()->HasUnitState(UNIT_STAT_IN_FLIGHT) + && !getTarget()->HasUnitState(UNIT_STATE_IN_FLIGHT) && getTarget()->IsInMap(getSourceUnit()) ) { diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 0bcd1a7864b..330a38ba5dd 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -63,7 +63,7 @@ bool Condition::Meets(Player* player, Unit* invoker) case CONDITION_REPUTATION_RANK: { if (FactionEntry const* faction = sFactionStore.LookupEntry(mConditionValue1)) - condMeets = uint32(player->GetReputationMgr().GetRank(faction)) == mConditionValue2; + condMeets = (mConditionValue2 & (1 << player->GetReputationMgr().GetRank(faction))); break; } case CONDITION_ACHIEVEMENT: @@ -73,10 +73,10 @@ bool Condition::Meets(Player* player, Unit* invoker) condMeets = player->GetTeam() == mConditionValue1; break; case CONDITION_CLASS: - condMeets = player->getClass() == mConditionValue1; + condMeets = player->getClassMask() & mConditionValue1; break; case CONDITION_RACE: - condMeets = player->getRace() == mConditionValue1; + condMeets = player->getRaceMask() & mConditionValue1; break; case CONDITION_SKILL: condMeets = player->HasSkill(mConditionValue1) && player->GetBaseSkillValue(mConditionValue1) >= mConditionValue2; @@ -243,33 +243,33 @@ ConditionMgr::~ConditionMgr() ConditionList ConditionMgr::GetConditionReferences(uint32 refId) { ConditionList conditions; - ConditionReferenceMap::const_iterator ref = m_ConditionReferenceMap.find(refId); - if (ref != m_ConditionReferenceMap.end()) + ConditionReferenceContainer::const_iterator ref = ConditionReferenceStore.find(refId); + if (ref != ConditionReferenceStore.end()) conditions = (*ref).second; return conditions; } bool ConditionMgr::IsPlayerMeetToConditionList(Player* player, ConditionList const& conditions, Unit* invoker /*= NULL*/) { - std::map<uint32, bool> ElseGroupMap; + std::map<uint32, bool> ElseGroupStore; for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i) { sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->mConditionType, (*i)->mConditionValue1); if ((*i)->isLoaded()) { - std::map<uint32, bool>::const_iterator itr = ElseGroupMap.find((*i)->mElseGroup); - if (itr == ElseGroupMap.end()) - ElseGroupMap[(*i)->mElseGroup] = true; + std::map<uint32, bool>::const_iterator itr = ElseGroupStore.find((*i)->mElseGroup); + if (itr == ElseGroupStore.end()) + ElseGroupStore[(*i)->mElseGroup] = true; else if (!(*itr).second) continue; if ((*i)->mReferenceId)//handle reference { - ConditionReferenceMap::const_iterator ref = m_ConditionReferenceMap.find((*i)->mReferenceId); - if (ref != m_ConditionReferenceMap.end()) + ConditionReferenceContainer::const_iterator ref = ConditionReferenceStore.find((*i)->mReferenceId); + if (ref != ConditionReferenceStore.end()) { if (!IsPlayerMeetToConditionList(player, (*ref).second, invoker)) - ElseGroupMap[(*i)->mElseGroup] = false; + ElseGroupStore[(*i)->mElseGroup] = false; } else { @@ -281,11 +281,11 @@ bool ConditionMgr::IsPlayerMeetToConditionList(Player* player, ConditionList con else //handle normal condition { if (!(*i)->Meets(player, invoker)) - ElseGroupMap[(*i)->mElseGroup] = false; + ElseGroupStore[(*i)->mElseGroup] = false; } } } - for (std::map<uint32, bool>::const_iterator i = ElseGroupMap.begin(); i != ElseGroupMap.end(); ++i) + for (std::map<uint32, bool>::const_iterator i = ElseGroupStore.begin(); i != ElseGroupStore.end(); ++i) if (i->second) return true; @@ -309,19 +309,19 @@ bool ConditionMgr::IsPlayerMeetToConditions(Player* player, ConditionList const& return result; } -ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType sType, uint32 uEntry) +ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry) { ConditionList spellCond; - if (sType > CONDITION_SOURCE_TYPE_NONE && sType < CONDITION_SOURCE_TYPE_MAX) + if (sourceType > CONDITION_SOURCE_TYPE_NONE && sourceType < CONDITION_SOURCE_TYPE_MAX) { - ConditionMap::const_iterator itr = m_ConditionMap.find(sType); - if (itr != m_ConditionMap.end()) + ConditionContainer::const_iterator itr = ConditionStore.find(sourceType); + if (itr != ConditionStore.end()) { - ConditionTypeMap::const_iterator i = (*itr).second.find(uEntry); + ConditionTypeContainer::const_iterator i = (*itr).second.find(entry); if (i != (*itr).second.end()) { spellCond = (*i).second; - sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sType), uEntry); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sourceType), entry); } } } @@ -331,10 +331,10 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureID, uint32 spellID) { ConditionList cond; - VehicleSpellConditionMap::const_iterator itr = m_VehicleSpellConditions.find(creatureID); - if (itr != m_VehicleSpellConditions.end()) + VehicleSpellConditionContainer::const_iterator itr = VehicleSpellConditionStore.find(creatureID); + if (itr != VehicleSpellConditionStore.end()) { - ConditionTypeMap::const_iterator i = (*itr).second.find(spellID); + ConditionTypeContainer::const_iterator i = (*itr).second.find(spellID); if (i != (*itr).second.end()) { cond = (*i).second; @@ -344,6 +344,22 @@ ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureID, uint return cond; } +ConditionList ConditionMgr::GetConditionsForSmartEvent(int32 entryOrGuid, uint32 eventId, uint32 sourceType) +{ + ConditionList cond; + SmartEventConditionContainer::const_iterator itr = SmartEventConditionStore.find(std::make_pair(entryOrGuid, sourceType)); + if (itr != SmartEventConditionStore.end()) + { + ConditionTypeContainer::const_iterator i = (*itr).second.find(eventId + 1); + if (i != (*itr).second.end()) + { + cond = (*i).second; + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForSmartEvent: found conditions for Smart Event entry or guid %d event_id %u", entryOrGuid, eventId); + } + } + return cond; +} + void ConditionMgr::LoadConditions(bool isReload) { uint32 oldMSTime = getMSTime(); @@ -374,7 +390,7 @@ void ConditionMgr::LoadConditions(bool isReload) sObjectMgr->LoadGossipMenuItems(); } - QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference, " + QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, " " ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName FROM conditions"); if (!result) @@ -394,14 +410,15 @@ void ConditionMgr::LoadConditions(bool isReload) Condition* cond = new Condition(); int32 iSourceTypeOrReferenceId = fields[0].GetInt32(); cond->mSourceGroup = fields[1].GetUInt32(); - cond->mSourceEntry = fields[2].GetUInt32(); - cond->mElseGroup = fields[3].GetUInt32(); - int32 iConditionTypeOrReference = fields[4].GetInt32(); - cond->mConditionValue1 = fields[5].GetUInt32(); - cond->mConditionValue2 = fields[6].GetUInt32(); - cond->mConditionValue3 = fields[7].GetUInt32(); - cond->ErrorTextd = fields[8].GetUInt32(); - cond->mScriptId = sObjectMgr->GetScriptId(fields[9].GetCString()); + cond->mSourceEntry = fields[2].GetInt32(); + cond->mSourceId = fields[3].GetUInt32(); + cond->mElseGroup = fields[4].GetUInt32(); + int32 iConditionTypeOrReference = fields[5].GetInt32(); + cond->mConditionValue1 = fields[6].GetUInt32(); + cond->mConditionValue2 = fields[7].GetUInt32(); + cond->mConditionValue3 = fields[8].GetUInt32(); + cond->ErrorTextd = fields[9].GetUInt32(); + cond->mScriptId = sObjectMgr->GetScriptId(fields[10].GetCString()); if (iConditionTypeOrReference >= 0) cond->mConditionType = ConditionType(iConditionTypeOrReference); @@ -440,12 +457,12 @@ void ConditionMgr::LoadConditions(bool isReload) if (iSourceTypeOrReferenceId < 0)//it is a reference template { uint32 uRefId = abs(iSourceTypeOrReferenceId); - if (m_ConditionReferenceMap.find(uRefId) == m_ConditionReferenceMap.end())//make sure we have a list for our conditions, based on reference id + if (ConditionReferenceStore.find(uRefId) == ConditionReferenceStore.end())//make sure we have a list for our conditions, based on reference id { ConditionList mCondList; - m_ConditionReferenceMap[uRefId] = mCondList; + ConditionReferenceStore[uRefId] = mCondList; } - m_ConditionReferenceMap[uRefId].push_back(cond);//add to reference storage + ConditionReferenceStore[uRefId].push_back(cond);//add to reference storage count++; continue; }//end of reference templates @@ -468,83 +485,102 @@ void ConditionMgr::LoadConditions(bool isReload) } else if (cond->mSourceGroup) { - bool bIsDone = false; + bool valid = false; //handle grouped conditions switch (cond->mSourceType) { case CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Creature.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Creature.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Disenchant.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Disenchant.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Fishing.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Fishing.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Gameobject.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Gameobject.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Item.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Item.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Mail.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Mail.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Milling.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Milling.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Pickpocketing.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Pickpocketing.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Prospecting.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Prospecting.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Reference.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Reference.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Skinning.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Skinning.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE: - bIsDone = addToLootTemplate(cond, LootTemplates_Spell.GetLootForConditionFill(cond->mSourceGroup)); + valid = addToLootTemplate(cond, LootTemplates_Spell.GetLootForConditionFill(cond->mSourceGroup)); break; case CONDITION_SOURCE_TYPE_GOSSIP_MENU: - bIsDone = addToGossipMenus(cond); + valid = addToGossipMenus(cond); break; case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION: - bIsDone = addToGossipMenuItems(cond); + valid = addToGossipMenuItems(cond); break; case CONDITION_SOURCE_TYPE_VEHICLE_SPELL: { //if no list for vehicle create one - if (m_VehicleSpellConditions.find(cond->mSourceGroup) == m_VehicleSpellConditions.end()) + if (VehicleSpellConditionStore.find(cond->mSourceGroup) == VehicleSpellConditionStore.end()) { - ConditionTypeMap cmap; - m_VehicleSpellConditions[cond->mSourceGroup] = cmap; + ConditionTypeContainer cmap; + VehicleSpellConditionStore[cond->mSourceGroup] = cmap; } //if no list for vehicle's spell create one - if (m_VehicleSpellConditions[cond->mSourceGroup].find(cond->mSourceEntry) == m_VehicleSpellConditions[cond->mSourceGroup].end()) + if (VehicleSpellConditionStore[cond->mSourceGroup].find(cond->mSourceEntry) == VehicleSpellConditionStore[cond->mSourceGroup].end()) { ConditionList clist; - m_VehicleSpellConditions[cond->mSourceGroup][cond->mSourceEntry] = clist; + VehicleSpellConditionStore[cond->mSourceGroup][cond->mSourceEntry] = clist; } - m_VehicleSpellConditions[cond->mSourceGroup][cond->mSourceEntry].push_back(cond); - bIsDone = true; + VehicleSpellConditionStore[cond->mSourceGroup][cond->mSourceEntry].push_back(cond); + valid = true; ++count; continue; // do not add to m_AllocatedMemory to avoid double deleting } + case CONDITION_SOURCE_TYPE_SMART_EVENT: + { + // If the entry does not exist, create a new list + std::pair<int32, uint32> key = std::make_pair(cond->mSourceEntry, cond->mSourceId); + if (SmartEventConditionStore.find(key) == SmartEventConditionStore.end()) + { + ConditionTypeContainer cmap; + SmartEventConditionStore[key] = cmap; + } + if (SmartEventConditionStore[key].find(cond->mSourceGroup) == SmartEventConditionStore[key].end()) + { + ConditionList clist; + SmartEventConditionStore[key][cond->mSourceGroup] = clist; + } + SmartEventConditionStore[key][cond->mSourceGroup].push_back(cond); + valid = true; + ++count; + continue; + } default: break; } - if (!bIsDone) + if (!valid) { sLog->outErrorDb("Not handled grouped condition, SourceGroup %u", cond->mSourceGroup); delete cond; } else { - m_AllocatedMemory.push_back(cond); + AllocatedMemoryStore.push_back(cond); ++count; } continue; @@ -552,21 +588,21 @@ void ConditionMgr::LoadConditions(bool isReload) //handle not grouped conditions //make sure we have a storage list for our SourceType - if (m_ConditionMap.find(cond->mSourceType) == m_ConditionMap.end()) + if (ConditionStore.find(cond->mSourceType) == ConditionStore.end()) { - ConditionTypeMap mTypeMap; - m_ConditionMap[cond->mSourceType] = mTypeMap;//add new empty list for SourceType + ConditionTypeContainer mTypeMap; + ConditionStore[cond->mSourceType] = mTypeMap;//add new empty list for SourceType } //make sure we have a condition list for our SourceType's entry - if (m_ConditionMap[cond->mSourceType].find(cond->mSourceEntry) == m_ConditionMap[cond->mSourceType].end()) + if (ConditionStore[cond->mSourceType].find(cond->mSourceEntry) == ConditionStore[cond->mSourceType].end()) { ConditionList mCondList; - m_ConditionMap[cond->mSourceType][cond->mSourceEntry] = mCondList; + ConditionStore[cond->mSourceType][cond->mSourceEntry] = mCondList; } //add new Condition to storage based on Type/Entry - m_ConditionMap[cond->mSourceType][cond->mSourceEntry].push_back(cond); + ConditionStore[cond->mSourceType][cond->mSourceEntry].push_back(cond); ++count; } while (result->NextRow()); @@ -1004,6 +1040,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) break; case CONDITION_SOURCE_TYPE_GOSSIP_MENU: case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION: + case CONDITION_SOURCE_TYPE_SMART_EVENT: case CONDITION_SOURCE_TYPE_NONE: default: break; @@ -1180,9 +1217,9 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_CLASS: { - if (cond->mConditionValue1 >= MAX_CLASSES) + if (!(cond->mConditionValue1 & CLASSMASK_ALL_PLAYABLE)) { - sLog->outErrorDb("Class condition has non existing class (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Class condition has non existing classmask (%u), skipped", cond->mConditionValue1 & ~CLASSMASK_ALL_PLAYABLE); return false; } @@ -1192,9 +1229,9 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_RACE: { - if (cond->mConditionValue1 >= MAX_RACES) + if (!(cond->mConditionValue1 & RACEMASK_ALL_PLAYABLE)) { - sLog->outErrorDb("Race condition has non existing race (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Race condition has non existing racemask (%u), skipped", cond->mConditionValue1 & ~RACEMASK_ALL_PLAYABLE); return false; } @@ -1375,18 +1412,31 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) void ConditionMgr::Clean() { - for (ConditionReferenceMap::iterator itr = m_ConditionReferenceMap.begin(); itr != m_ConditionReferenceMap.end(); ++itr) + for (ConditionReferenceContainer::iterator itr = ConditionReferenceStore.begin(); itr != ConditionReferenceStore.end(); ++itr) { for (ConditionList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) delete *it; itr->second.clear(); } - m_ConditionReferenceMap.clear(); + ConditionReferenceStore.clear(); + + for (ConditionContainer::iterator itr = ConditionStore.begin(); itr != ConditionStore.end(); ++itr) + { + for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it) + { + for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) + delete *i; + it->second.clear(); + } + itr->second.clear(); + } + + ConditionStore.clear(); - for (ConditionMap::iterator itr = m_ConditionMap.begin(); itr != m_ConditionMap.end(); ++itr) + for (VehicleSpellConditionContainer::iterator itr = VehicleSpellConditionStore.begin(); itr != VehicleSpellConditionStore.end(); ++itr) { - for (ConditionTypeMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it) + for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it) { for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) delete *i; @@ -1395,11 +1445,11 @@ void ConditionMgr::Clean() itr->second.clear(); } - m_ConditionMap.clear(); + VehicleSpellConditionStore.clear(); - for (VehicleSpellConditionMap::iterator itr = m_VehicleSpellConditions.begin(); itr != m_VehicleSpellConditions.end(); ++itr) + for (SmartEventConditionContainer::iterator itr = SmartEventConditionStore.begin(); itr != SmartEventConditionStore.end(); ++itr) { - for (ConditionTypeMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it) + for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it) { for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) delete *i; @@ -1408,11 +1458,11 @@ void ConditionMgr::Clean() itr->second.clear(); } - m_VehicleSpellConditions.clear(); + SmartEventConditionStore.clear(); // this is a BIG hack, feel free to fix it if you can figure out the ConditionMgr ;) - for (std::list<Condition*>::const_iterator itr = m_AllocatedMemory.begin(); itr != m_AllocatedMemory.end(); ++itr) + for (std::list<Condition*>::const_iterator itr = AllocatedMemoryStore.begin(); itr != AllocatedMemoryStore.end(); ++itr) delete *itr; - m_AllocatedMemory.clear(); + AllocatedMemoryStore.clear(); } diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 7e11a9420e7..1641642dd86 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -96,14 +96,16 @@ enum ConditionSourceType CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19, //DONE CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20, //DONE CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21, //DONE - CONDITION_SOURCE_TYPE_MAX = 22//MAX + CONDITION_SOURCE_TYPE_SMART_EVENT = 22, //DONE + CONDITION_SOURCE_TYPE_MAX = 23 //MAX }; struct Condition { ConditionSourceType mSourceType; //SourceTypeOrReferenceId uint32 mSourceGroup; - uint32 mSourceEntry; + int32 mSourceEntry; + uint32 mSourceId; // So far, only used in CONDITION_SOURCE_TYPE_SMART_EVENT uint32 mElseGroup; ConditionType mConditionType; //ConditionTypeOrReference uint32 mConditionValue1; @@ -133,11 +135,12 @@ struct Condition }; typedef std::list<Condition*> ConditionList; -typedef std::map<uint32, ConditionList> ConditionTypeMap; -typedef std::map<ConditionSourceType, ConditionTypeMap> ConditionMap; -typedef std::map<uint32, ConditionTypeMap> VehicleSpellConditionMap; +typedef std::map<uint32, ConditionList> ConditionTypeContainer; +typedef std::map<ConditionSourceType, ConditionTypeContainer> ConditionContainer; +typedef std::map<uint32, ConditionTypeContainer> VehicleSpellConditionContainer; +typedef std::map<std::pair<int32, uint32 /*SAI source_type*/>, ConditionTypeContainer> SmartEventConditionContainer; -typedef std::map<uint32, ConditionList> ConditionReferenceMap;//only used for references +typedef std::map<uint32, ConditionList> ConditionReferenceContainer;//only used for references class ConditionMgr { @@ -153,7 +156,8 @@ class ConditionMgr ConditionList GetConditionReferences(uint32 refId); bool IsPlayerMeetToConditions(Player* player, ConditionList const& conditions, Unit* invoker = NULL); - ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sType, uint32 uEntry); + ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry); + ConditionList GetConditionsForSmartEvent(int32 entryOrGuid, uint32 eventId, uint32 sourceType); ConditionList GetConditionsForVehicleSpell(uint32 creatureID, uint32 spellID); private: @@ -179,15 +183,17 @@ class ConditionMgr sourceType == CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU || sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION || - sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL); + sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL || + sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT); } void Clean(); // free up resources - std::list<Condition*> m_AllocatedMemory; // some garbage collection :) + std::list<Condition*> AllocatedMemoryStore; // some garbage collection :) - ConditionMap m_ConditionMap; - ConditionReferenceMap m_ConditionReferenceMap; - VehicleSpellConditionMap m_VehicleSpellConditions; + ConditionContainer ConditionStore; + ConditionReferenceContainer ConditionReferenceStore; + VehicleSpellConditionContainer VehicleSpellConditionStore; + SmartEventConditionContainer SmartEventConditionStore; }; #define sConditionMgr ACE_Singleton<ConditionMgr, ACE_Null_Mutex>::instance() diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 0f146598a6e..cccb780e412 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -483,7 +483,7 @@ void LFGMgr::InitializeLockedDungeons(Player* player) void LFGMgr::Join(Player* player, uint8 roles, const LfgDungeonSet& selectedDungeons, const std::string& comment) { if (!player || !player->GetSession() || selectedDungeons.empty()) - return; + return; Group* grp = player->GetGroup(); uint64 guid = player->GetGUID(); @@ -1762,7 +1762,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false* error = LFG_TELEPORTERROR_INVALID_LOCATION; else if (!player->isAlive()) error = LFG_TELEPORTERROR_PLAYER_DEAD; - else if (player->IsFalling() || player->HasUnitState(UNIT_STAT_JUMPING)) + else if (player->IsFalling() || player->HasUnitState(UNIT_STATE_JUMPING)) error = LFG_TELEPORTERROR_FALLING; else { diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 23865dd9e41..eb29e681016 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -685,7 +685,7 @@ void Creature::DoFleeToGetAssistance() if (!creature) //SetFeared(true, getVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY)); //TODO: use 31365 - SetControlled(true, UNIT_STAT_FLEEING); + SetControlled(true, UNIT_STATE_FLEEING); else GetMotionMaster()->MoveSeekAssistance(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ()); } @@ -1413,7 +1413,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const if (isCivilian()) return false; - if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE)) + if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC)) return false; // Do not attack non-combat pets @@ -1536,7 +1536,7 @@ void Creature::setDeathState(DeathState s) if (GetCreatureInfo()->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); - ClearUnitState(uint32(UNIT_STAT_ALL_STATE)); + ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); LoadCreaturesAddon(true); Motion_Initialize(); @@ -1565,7 +1565,7 @@ void Creature::Respawn(bool force) if (m_DBTableGuid) sObjectMgr->RemoveCreatureRespawnTime(m_DBTableGuid, GetInstanceId()); - sLog->outStaticDebug("Respawning..."); + sLog->outStaticDebug("Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)", GetName(), GetGUIDLow(), GetGUID(), GetEntry()); m_respawnTime = 0; lootForPickPocketed = false; lootForBody = false; @@ -1905,7 +1905,7 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction / if (isCivilian()) return false; - if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE)) + if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC)) return false; // skip fighting creature @@ -1947,7 +1947,7 @@ bool Creature::_IsTargetAcceptable(const Unit* target) const || (m_vehicle && (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target)))) return false; - if (target->HasUnitState(UNIT_STAT_DIED)) + if (target->HasUnitState(UNIT_STATE_DIED)) { // guards can detect fake death if (isGuard() && target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH)) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 05339f1da53..e622c48761c 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -512,7 +512,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature uint8 getLevelForTarget(WorldObject const* target) const; // overwrite Unit::getLevelForTarget for boss level support - bool IsInEvadeMode() const { return HasUnitState(UNIT_STAT_EVADE); } + bool IsInEvadeMode() const { return HasUnitState(UNIT_STATE_EVADE); } bool AIM_Initialize(CreatureAI* ai = NULL); void Motion_Initialize(); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index fd094938da8..3548ef3bc63 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -974,7 +974,7 @@ void GameObject::ResetDoorOrButton() m_cooldownTime = 0; } -void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */) +void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */, Unit* user /*=NULL*/) { if (m_lootState != GO_READY) return; @@ -983,7 +983,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f time_to_restore = GetGOInfo()->GetAutoCloseTime(); SwitchDoorOrButton(true, alternative); - SetLootState(GO_ACTIVATED); + SetLootState(GO_ACTIVATED, user); m_cooldownTime = time(NULL) + time_to_restore; } @@ -1053,7 +1053,7 @@ void GameObject::Use(Unit* user) case GAMEOBJECT_TYPE_DOOR: //0 case GAMEOBJECT_TYPE_BUTTON: //1 //doors/buttons never really despawn, only reset to default state/flags - UseDoorOrButton(); + UseDoorOrButton(0, false, user); // activate script GetMap()->ScriptsStart(sGameObjectScripts, GetDBTableGUIDLow(), spellCaster, this); @@ -1206,7 +1206,7 @@ void GameObject::Use(Unit* user) TriggeringLinkedGameObject(trapEntry, user); SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); - SetLootState(GO_ACTIVATED); + SetLootState(GO_ACTIVATED, user); // this appear to be ok, however others exist in addition to this that should have custom (ex: 190510, 188692, 187389) if (info->goober.customAnim) @@ -1865,8 +1865,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* } } -void GameObject::SetLootState(LootState s) +void GameObject::SetLootState(LootState s, Unit* unit) { m_lootState = s; - AI()->OnStateChanged(s); + AI()->OnStateChanged(s, unit); } diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 9298c5affee..f677d481c33 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -713,7 +713,8 @@ class GameObject : public WorldObject, public GridObject<GameObject> void Use(Unit* user); LootState getLootState() const { return m_lootState; } - void SetLootState(LootState s); + // Note: unit is only used when s = GO_ACTIVATED + void SetLootState(LootState s, Unit* unit = NULL); uint16 GetLootMode() { return m_LootMode; } bool HasLootMode(uint16 lootMode) { return m_LootMode & lootMode; } @@ -747,7 +748,7 @@ class GameObject : public WorldObject, public GridObject<GameObject> bool hasQuest(uint32 quest_id) const; bool hasInvolvedQuest(uint32 quest_id) const; bool ActivateToQuest(Player* target) const; - void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false); + void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false, Unit* user = NULL); // 0 = use `gameobject`.`spawntimesecs` void ResetDoorOrButton(); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 5c034f1a42a..1a8eb8f82e2 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1543,12 +1543,12 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const { // non fly unit don't must be in air // non swim unit must be at ground (mostly speedup, because it don't must be in water and water level check less fast - if (!((Creature const*)this)->canFly()) + if (!ToCreature()->canFly()) { - bool canSwim = ((Creature const*)this)->canSwim(); + bool canSwim = ToCreature()->canSwim(); float ground_z = z; float max_z = canSwim - ? GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !((Unit const*)this)->HasAuraType(SPELL_AURA_WATER_WALK)) + ? GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK)) : ((ground_z = GetBaseMap()->GetHeight(x, y, z, true))); if (max_z > INVALID_HEIGHT) { @@ -1569,10 +1569,10 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const case TYPEID_PLAYER: { // for server controlled moves playr work same as creature (but it can always swim) - if (!((Player const*)this)->canFly()) + if (!ToPlayer()->canFly()) { float ground_z = z; - float max_z = GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !((Unit const*)this)->HasAuraType(SPELL_AURA_WATER_WALK)); + float max_z = GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK)); if (max_z > INVALID_HEIGHT) { if (z > max_z) @@ -2458,7 +2458,7 @@ namespace Trinity float x, y, z; - if (!c->isAlive() || c->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) || + if (!c->isAlive() || c->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) || !c->GetMotionMaster()->GetDestination(x, y, z)) { x = c->GetPositionX(); @@ -2526,7 +2526,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float { GetNearPoint2D(x, y, distance2d+searcher_size, absAngle); z = GetPositionZ(); - UpdateGroundPositionZ(x, y, z); + UpdateAllowedPositionZ(x, y, z); /* // if detection disabled, return first point diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bed3c0cb1a7..38af97f61cb 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -296,15 +296,24 @@ Item* TradeData::GetItem(TradeSlots slot) const return m_items[slot] ? m_player->GetItemByGuid(m_items[slot]) : NULL; } -bool TradeData::HasItem(uint64 item_guid) const +bool TradeData::HasItem(uint64 itemGuid) const { for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) - if (m_items[i] == item_guid) + if (m_items[i] == itemGuid) return true; return false; } +TradeSlots TradeData::GetTradeSlotForItem(uint64 itemGuid) const +{ + for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) + if (m_items[i] == itemGuid) + return TradeSlots(i); + + return TRADE_SLOT_INVALID; +} + Item* TradeData::GetSpellCastItem() const { return m_spellCastItem ? m_player->GetItemByGuid(m_spellCastItem) : NULL; @@ -1580,7 +1589,7 @@ void Player::Update(uint32 p_time) GetAchievementMgr().UpdateTimedAchievements(p_time); - if (HasUnitState(UNIT_STAT_MELEE_ATTACKING) && !HasUnitState(UNIT_STAT_CASTING)) + if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING)) { if (Unit* pVictim = getVictim()) { @@ -2305,14 +2314,9 @@ bool Player::TeleportToBGEntryPoint() if (m_bgData.joinPos.m_mapId == MAPID_INVALID) return false; - Group* group = GetGroup(); - if (group && group->isLFGGroup() && group->GetMembersCount() == 1) - group->Disband(); - else - ScheduleDelayedOperation(DELAYED_BG_GROUP_RESTORE); - ScheduleDelayedOperation(DELAYED_BG_MOUNT_RESTORE); ScheduleDelayedOperation(DELAYED_BG_TAXI_RESTORE); + ScheduleDelayedOperation(DELAYED_BG_GROUP_RESTORE); return TeleportTo(m_bgData.joinPos); } @@ -3247,7 +3251,7 @@ void Player::InitStatsForLevel(bool reapplyMods) // cleanup unit flags (will be re-applied if need at aura load). RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_ATTACKABLE_1 | - UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE | UNIT_FLAG_LOOTING | + UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_LOOTING | UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_SILENCED | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | UNIT_FLAG_IN_COMBAT | UNIT_FLAG_DISARMED | UNIT_FLAG_CONFUSED | UNIT_FLAG_FLEEING | UNIT_FLAG_NOT_SELECTABLE | @@ -8713,7 +8717,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) } } - go->SetLootState(GO_ACTIVATED); + go->SetLootState(GO_ACTIVATED, this); } if (go->getLootState() == GO_ACTIVATED) @@ -11381,7 +11385,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool { // May be here should be more stronger checks; STUNNED checked // ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked. - if (HasUnitState(UNIT_STAT_STUNNED)) + if (HasUnitState(UNIT_STATE_STUNNED)) return EQUIP_ERR_YOU_ARE_STUNNED; // do not allow equipping gear except weapons, offhands, projectiles, relics in @@ -11981,6 +11985,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update { ItemAddedQuestCheck(item, count); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, count); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item, 1); if (randomPropertyId) pItem->SetItemRandomProperties(randomPropertyId); pItem = StoreItem(dest, pItem, update); @@ -12034,7 +12039,6 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update) lastItem = _StoreItem(pos, pItem, count, true, update); } - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, entry); return lastItem; } @@ -12805,6 +12809,14 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) return; } + //! If trading + if (TradeData* tradeData = GetTradeData()) + { + //! If current item is in trade window (only possible with packet spoofing - silent return) + if (tradeData->GetTradeSlotForItem(pSrcItem->GetGUID()) != TRADE_SLOT_INVALID) + return; + } + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); Item* pNewItem = pSrcItem->CloneItem(count, this); if (!pNewItem) @@ -12833,7 +12845,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) pSrcItem->SetState(ITEM_CHANGED, this); StoreItem(dest, pNewItem, true); } - else if (IsBankPos (dst)) + else if (IsBankPos(dst)) { // change item amount before check (for unique max count check) pSrcItem->SetCount(pSrcItem->GetCount() - count); @@ -12853,7 +12865,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) pSrcItem->SetState(ITEM_CHANGED, this); BankItem(dest, pNewItem, true); } - else if (IsEquipmentPos (dst)) + else if (IsEquipmentPos(dst)) { // change item amount before check (for unique max count check), provide space for splitted items pSrcItem->SetCount(pSrcItem->GetCount() - count); @@ -14311,7 +14323,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men break; case GOSSIP_OPTION_UNLEARNTALENTS: PlayerTalkClass->SendCloseGossip(); - source->ToCreature()->CastSpell(this, 46331, true); // Trainer: Untrain Talents + SendTalentWipeConfirm(guid); break; case GOSSIP_OPTION_UNLEARNPETTALENTS: PlayerTalkClass->SendCloseGossip(); @@ -14812,7 +14824,9 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg) void Player::AddQuest(Quest const* quest, Object* questGiver) { uint16 log_slot = FindQuestSlot(0); - ASSERT(log_slot < MAX_QUEST_LOG_SIZE); + + if (log_slot >= MAX_QUEST_LOG_SIZE) // Player does not have any free slot in the quest log + return; uint32 quest_id = quest->GetQuestId(); @@ -20251,7 +20265,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc return false; // not let cheating with start flight in time of logout process || while in combat || has type state: stunned || has type state: root - if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STAT_STUNNED) || HasUnitState(UNIT_STAT_ROOT)) + if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STATE_STUNNED) || HasUnitState(UNIT_STATE_ROOT)) { WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); data << uint32(ERR_TAXIPLAYERBUSY); @@ -21546,7 +21560,7 @@ void Player::SendInitialVisiblePackets(Unit* target) SendAurasForTarget(target); if (target->isAlive()) { - if (target->HasUnitState(UNIT_STAT_MELEE_ATTACKING) && target->getVictim()) + if (target->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && target->getVictim()) target->SendMeleeAttackStart(target->getVictim()); } } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 7a455590506..489b4eacec5 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -274,13 +274,14 @@ struct PvPInfo struct DuelInfo { - DuelInfo() : initiator(NULL), opponent(NULL), startTimer(0), startTime(0), outOfBound(0) {} + DuelInfo() : initiator(NULL), opponent(NULL), startTimer(0), startTime(0), outOfBound(0), isMounted(false) {} Player* initiator; Player* opponent; time_t startTimer; time_t startTime; time_t outOfBound; + bool isMounted; }; struct Areas @@ -686,7 +687,8 @@ enum TradeSlots { TRADE_SLOT_COUNT = 7, TRADE_SLOT_TRADED_COUNT = 6, - TRADE_SLOT_NONTRADED = 6 + TRADE_SLOT_NONTRADED = 6, + TRADE_SLOT_INVALID = -1, }; enum TransferAbortReason @@ -1001,7 +1003,8 @@ class TradeData TradeData* GetTraderData() const; Item* GetItem(TradeSlots slot) const; - bool HasItem(uint64 item_guid) const; + bool HasItem(uint64 itemGuid) const; + TradeSlots GetTradeSlotForItem(uint64 itemGuid) const; void SetItem(TradeSlots slot, Item* item); uint32 GetSpell() const { return m_spell; } @@ -1803,7 +1806,7 @@ class Player : public Unit, public GridObject<Player> void SetContestedPvPTimer(uint32 newTime) {m_contestedPvPTimer = newTime;} void ResetContestedPvP() { - ClearUnitState(UNIT_STAT_ATTACK_PLAYER); + ClearUnitState(UNIT_STATE_ATTACK_PLAYER); RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP); m_contestedPvPTimer = 0; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 63a56516e8b..bf033627354 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -316,7 +316,7 @@ void Unit::Update(uint32 p_time) // update combat timer only for players and pets (only pets with PetAI) if (isInCombat() && (GetTypeId() == TYPEID_PLAYER || (ToCreature()->isPet() && IsControlledByPlayer()))) { - // Check UNIT_STAT_MELEE_ATTACKING or UNIT_STAT_CHASE (without UNIT_STAT_FOLLOW in this case) so pets can reach far away + // Check UNIT_STATE_MELEE_ATTACKING or UNIT_STATE_CHASE (without UNIT_STATE_FOLLOW in this case) so pets can reach far away // targets without stopping half way there and running off. // These flags are reset after target dies or another command is given. if (m_HostileRefManager.isEmpty()) @@ -518,7 +518,7 @@ bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb) { - if (!victim || !victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) + if (!victim || !victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) { if (absorb) *absorb += damage; @@ -628,6 +628,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam // duel ends when player has 1 or less hp bool duel_hasEnded = false; + bool duel_wasMounted = false; if (victim->GetTypeId() == TYPEID_PLAYER && victim->ToPlayer()->duel && damage >= (health-1)) { // prevent kill only if killed in duel and killed by opponent or opponent controlled creature @@ -636,6 +637,20 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam duel_hasEnded = true; } + else if (victim->IsVehicle() && damage >= (health-1) && victim->GetCharmer() && victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER) + { + Player* victimRider = victim->GetCharmer()->ToPlayer(); + + if (victimRider && victimRider->duel && victimRider->duel->isMounted) + { + // prevent kill only if killed in duel and killed by opponent or opponent controlled creature + if (victimRider->duel->opponent == this || victimRider->duel->opponent->GetGUID() == GetCharmerGUID()) + damage = health - 1; + + duel_wasMounted = true; + duel_hasEnded = true; + } + } if (GetTypeId() == TYPEID_PLAYER && this != victim) { @@ -745,12 +760,25 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam // last damage from duel opponent if (duel_hasEnded) { - ASSERT(victim->GetTypeId() == TYPEID_PLAYER); - Player* he = victim->ToPlayer(); + Player* he; + + if (duel_wasMounted) + { + ASSERT(victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER); + he = victim->GetCharmer()->ToPlayer(); + } + else + { + ASSERT(victim->GetTypeId() == TYPEID_PLAYER); + he = victim->ToPlayer(); + } ASSERT(he->duel); - he->SetHealth(1); + if (duel_wasMounted) // In this case victim==mount + victim->SetHealth(1); + else + he->SetHealth(1); he->duel->opponent->CombatStopWithPets(true); he->CombatStopWithPets(true); @@ -1018,7 +1046,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss) if (!victim) return; - if (!victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) + if (!victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) return; SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(damageInfo->SpellID); @@ -1235,7 +1263,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) { Unit* victim = damageInfo->target; - if (!victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) + if (!victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) return; // Hmmmm dont like this emotes client must by self do all animations @@ -1811,7 +1839,7 @@ void Unit::CalcHealAbsorb(Unit* victim, const SpellInfo* healSpell, uint32 &heal void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool extra) { - if (HasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) + if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) return; if (!victim->isAlive()) @@ -2114,12 +2142,12 @@ void Unit::SendMeleeAttackStart(Unit* victim) void Unit::SendMeleeAttackStop(Unit* victim) { - WorldPacket data(SMSG_ATTACKSTOP, (8+8+4)); // we guess size + WorldPacket data(SMSG_ATTACKSTOP, (8+8+4)); data.append(GetPackGUID()); data.append(victim ? victim->GetPackGUID() : 0); // can be 0x00... data << uint32(0); // can be 0x1 SendMessageToSet(&data, true); - sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART"); + sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTOP"); if (victim) sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow()); @@ -2384,7 +2412,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spell) // Chance hit from victim SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE auras modHitChance += victim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE, schoolMask); // Reduce spell hit chance for Area of effect spells from victim SPELL_AURA_MOD_AOE_AVOIDANCE aura - if (spell->IsAOE()) + if (spell->IsTargetingArea()) modHitChance -= victim->GetTotalAuraModifier(SPELL_AURA_MOD_AOE_AVOIDANCE); // Decrease hit chance from victim rating bonus @@ -2529,7 +2557,7 @@ uint32 Unit::GetDefenseSkillValue(Unit const* target) const float Unit::GetUnitDodgeChance() const { - if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED)) + if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED)) return 0.0f; if (GetTypeId() == TYPEID_PLAYER) @@ -2549,7 +2577,7 @@ float Unit::GetUnitDodgeChance() const float Unit::GetUnitParryChance() const { - if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED)) + if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED)) return 0.0f; float chance = 0.0f; @@ -2595,7 +2623,7 @@ float Unit::GetUnitMissChance(WeaponAttackType attType) const float Unit::GetUnitBlockChance() const { - if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED)) + if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED)) return 0.0f; if (Player const* player = ToPlayer()) @@ -2847,7 +2875,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } - AddUnitState(UNIT_STAT_CASTING); + AddUnitState(UNIT_STATE_CASTING); } break; case CURRENT_CHANNELED_SPELL: @@ -2860,7 +2888,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); - AddUnitState(UNIT_STAT_CASTING); + AddUnitState(UNIT_STATE_CASTING); } break; case CURRENT_AUTOREPEAT_SPELL: @@ -7076,6 +7104,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return false; basepoints0 = CalculatePctN(int32(damage), triggerAmount); triggered_spell_id = 58879; + // Cast on spirit wolf + CastCustomSpell(this, triggered_spell_id, &basepoints0, NULL, NULL, true, NULL, triggeredByAura); break; } // Shaman T8 Elemental 4P Bonus @@ -9325,16 +9355,16 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) // switch to melee attack from ranged/magic if (meleeAttack) { - if (!HasUnitState(UNIT_STAT_MELEE_ATTACKING)) + if (!HasUnitState(UNIT_STATE_MELEE_ATTACKING)) { - AddUnitState(UNIT_STAT_MELEE_ATTACKING); + AddUnitState(UNIT_STATE_MELEE_ATTACKING); SendMeleeAttackStart(victim); return true; } } - else if (HasUnitState(UNIT_STAT_MELEE_ATTACKING)) + else if (HasUnitState(UNIT_STATE_MELEE_ATTACKING)) { - ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STATE_MELEE_ATTACKING); SendMeleeAttackStop(victim); return true; } @@ -9344,7 +9374,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) // switch target InterruptSpell(CURRENT_MELEE_SPELL); if (!meleeAttack) - ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STATE_MELEE_ATTACKING); } if (m_attacking) @@ -9357,7 +9387,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) SetTarget(victim->GetGUID()); if (meleeAttack) - AddUnitState(UNIT_STAT_MELEE_ATTACKING); + AddUnitState(UNIT_STATE_MELEE_ATTACKING); // set position before any AI calls/assistance //if (GetTypeId() == TYPEID_UNIT) @@ -9398,7 +9428,7 @@ bool Unit::AttackStop() // Clear our target SetTarget(0); - ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STATE_MELEE_ATTACKING); InterruptSpell(CURRENT_MELEE_SPELL); @@ -9441,7 +9471,7 @@ void Unit::CombatStopWithPets(bool includingCast) bool Unit::isAttackingPlayer() const { - if (HasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (HasUnitState(UNIT_STATE_ATTACK_PLAYER)) return true; for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr) @@ -11877,7 +11907,7 @@ void Unit::Dismount() { if (Pet* pPet = player->GetPet()) { - if (pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STAT_STUNNED)) + if (pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STATE_STUNNED)) pPet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); } else @@ -11946,7 +11976,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy) if (PvP) m_CombatTimer = 5000; - if (isInCombat() || HasUnitState(UNIT_STAT_EVADE)) + if (isInCombat() || HasUnitState(UNIT_STATE_EVADE)) return; SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); @@ -11964,7 +11994,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy) if (IsAIEnabled) { creature->AI()->EnterCombat(enemy); - RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); // always remove Out of Combat Non Attackable flag if we enter combat and AI is enabled + RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // unit has engaged in combat, remove immunity so players can fight back } if (creature->GetFormation()) creature->GetFormation()->MemberAttackStart(creature, enemy); @@ -11996,10 +12026,10 @@ void Unit::ClearInCombat() // Player's state will be cleared in Player::UpdateContestedPvP if (Creature* creature = ToCreature()) { - if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_OOC_NOT_ATTACKABLE) - SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); // re-apply Out of Combat Non Attackable flag if we leave combat, can be overriden in scripts in EnterEvadeMode() + if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC) + SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // set immunity state to the one from db on evade - ClearUnitState(UNIT_STAT_ATTACK_PLAYER); + ClearUnitState(UNIT_STATE_ATTACK_PLAYER); if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED)) SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureInfo()->dynamicflags); @@ -12025,13 +12055,13 @@ bool Unit::isTargetableForAttack(bool checkFakeDeath) const return false; if (HasFlag(UNIT_FIELD_FLAGS, - UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE)) + UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC)) return false; if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->isGameMaster()) return false; - return !HasUnitState(UNIT_STAT_UNATTACKABLE) && (!checkFakeDeath || !HasUnitState(UNIT_STAT_DIED)); + return !HasUnitState(UNIT_STATE_UNATTACKABLE) && (!checkFakeDeath || !HasUnitState(UNIT_STATE_DIED)); } bool Unit::IsValidAttackTarget(Unit const* target) const @@ -12049,7 +12079,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co return false; // can't attack unattackable units or GMs - if (target->HasUnitState(UNIT_STAT_UNATTACKABLE) + if (target->HasUnitState(UNIT_STATE_UNATTACKABLE) || (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->isGameMaster())) return false; @@ -12059,7 +12089,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co return false; // can't attack invisible (ignore stealth for aoe spells) - if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !canSeeOrDetect(target, bySpell && bySpell->IsAOE())) + if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !canSeeOrDetect(target, bySpell && bySpell->IsAffectingArea())) return false; // can't attack dead @@ -12078,10 +12108,11 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co } // check flags if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_TAXI_FLIGHT | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_UNK_16) - || (!HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE)) - || (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE)) - || (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE)) - || (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))) + || (!HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC)) + || (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC)) + || (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) + // check if this is a world trigger cast - GOs are using world triggers to cast their spells, so we need to ignore their immunity flag here, this is a temp workaround, needs removal when go cast is implemented properly + || (GetEntry() != WORLD_TRIGGER && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))) return false; // CvC case - can attack each other only when one of them is hostile @@ -12143,7 +12174,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co return true; // can't assist unattackable units or GMs - if (target->HasUnitState(UNIT_STAT_UNATTACKABLE) + if (target->HasUnitState(UNIT_STATE_UNATTACKABLE) || (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->isGameMaster())) return false; @@ -12153,7 +12184,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co return false; // can't assist invisible - if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !canSeeOrDetect(target, bySpell && bySpell->IsAOE())) + if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !canSeeOrDetect(target, bySpell && bySpell->IsAffectingArea())) return false; // can't assist dead @@ -12169,12 +12200,12 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co { if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)) { - if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE)) + if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) return false; } else { - if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE)) + if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC)) return false; } } @@ -14574,7 +14605,7 @@ void Unit::SendPetAIReaction(uint64 guid) void Unit::StopMoving() { - ClearUnitState(UNIT_STAT_MOVING); + ClearUnitState(UNIT_STATE_MOVING); // not need send any packets if not in world if (!IsInWorld()) @@ -14848,7 +14879,7 @@ uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectTyp break; } - if (spellProto->Effects[i].IsArea()) + if (spellProto->Effects[i].IsTargetingArea()) AreaEffect = true; } @@ -14956,16 +14987,16 @@ void Unit::SetContestedPvP(Player* attackedPlayer) return; player->SetContestedPvPTimer(30000); - if (!player->HasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (!player->HasUnitState(UNIT_STATE_ATTACK_PLAYER)) { - player->AddUnitState(UNIT_STAT_ATTACK_PLAYER); + player->AddUnitState(UNIT_STATE_ATTACK_PLAYER); player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP); // call MoveInLineOfSight for nearby contested guards UpdateObjectVisibility(); } - if (!HasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (!HasUnitState(UNIT_STATE_ATTACK_PLAYER)) { - AddUnitState(UNIT_STAT_ATTACK_PLAYER); + AddUnitState(UNIT_STATE_ATTACK_PLAYER); // call MoveInLineOfSight for nearby contested guards UpdateObjectVisibility(); } @@ -15533,28 +15564,28 @@ void Unit::SetControlled(bool apply, UnitState state) AddUnitState(state); switch (state) { - case UNIT_STAT_STUNNED: + case UNIT_STATE_STUNNED: SetStunned(true); CastStop(); break; - case UNIT_STAT_ROOT: - if (!HasUnitState(UNIT_STAT_STUNNED)) + case UNIT_STATE_ROOT: + if (!HasUnitState(UNIT_STATE_STUNNED)) SetRooted(true); break; - case UNIT_STAT_CONFUSED: - if (!HasUnitState(UNIT_STAT_STUNNED)) + case UNIT_STATE_CONFUSED: + if (!HasUnitState(UNIT_STATE_STUNNED)) { - ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STATE_MELEE_ATTACKING); SendMeleeAttackStop(); // SendAutoRepeatCancel ? SetConfused(true); CastStop(); } break; - case UNIT_STAT_FLEEING: - if (!HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED)) + case UNIT_STATE_FLEEING: + if (!HasUnitState(UNIT_STATE_STUNNED | UNIT_STATE_CONFUSED)) { - ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STATE_MELEE_ATTACKING); SendMeleeAttackStop(); // SendAutoRepeatCancel ? SetFeared(true); @@ -15569,29 +15600,29 @@ void Unit::SetControlled(bool apply, UnitState state) { switch (state) { - case UNIT_STAT_STUNNED: if (HasAuraType(SPELL_AURA_MOD_STUN)) return; + case UNIT_STATE_STUNNED: if (HasAuraType(SPELL_AURA_MOD_STUN)) return; else SetStunned(false); break; - case UNIT_STAT_ROOT: if (HasAuraType(SPELL_AURA_MOD_ROOT) || GetVehicle()) return; + case UNIT_STATE_ROOT: if (HasAuraType(SPELL_AURA_MOD_ROOT) || GetVehicle()) return; else SetRooted(false); break; - case UNIT_STAT_CONFUSED:if (HasAuraType(SPELL_AURA_MOD_CONFUSE)) return; + case UNIT_STATE_CONFUSED:if (HasAuraType(SPELL_AURA_MOD_CONFUSE)) return; else SetConfused(false); break; - case UNIT_STAT_FLEEING: if (HasAuraType(SPELL_AURA_MOD_FEAR)) return; + case UNIT_STATE_FLEEING: if (HasAuraType(SPELL_AURA_MOD_FEAR)) return; else SetFeared(false); break; default: return; } ClearUnitState(state); - if (HasUnitState(UNIT_STAT_STUNNED)) + if (HasUnitState(UNIT_STATE_STUNNED)) SetStunned(true); else { - if (HasUnitState(UNIT_STAT_ROOT)) + if (HasUnitState(UNIT_STATE_ROOT)) SetRooted(true); - if (HasUnitState(UNIT_STAT_CONFUSED)) + if (HasUnitState(UNIT_STATE_CONFUSED)) SetConfused(true); - else if (HasUnitState(UNIT_STAT_FLEEING)) + else if (HasUnitState(UNIT_STATE_FLEEING)) SetFeared(true); } } @@ -15633,7 +15664,7 @@ void Unit::SetStunned(bool apply) if (!owner || (owner->GetTypeId() == TYPEID_PLAYER && !owner->ToPlayer()->IsMounted())) RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); - if (!HasUnitState(UNIT_STAT_ROOT)) // prevent moving if it also has root effect + if (!HasUnitState(UNIT_STATE_ROOT)) // prevent moving if it also has root effect { WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 8+4); data.append(GetPackGUID()); @@ -15675,7 +15706,7 @@ void Unit::SetRooted(bool apply) } else { - if (!HasUnitState(UNIT_STAT_STUNNED)) // prevent moving if it also has stun effect + if (!HasUnitState(UNIT_STATE_STUNNED)) // prevent moving if it also has stun effect { if (GetTypeId() == TYPEID_PLAYER) { @@ -15767,7 +15798,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au return false; } - //if (HasUnitState(UNIT_STAT_UNATTACKABLE)) + //if (HasUnitState(UNIT_STATE_UNATTACKABLE)) // return false; if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetTransport()) @@ -15855,14 +15886,16 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au case CHARM_TYPE_VEHICLE: SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); charmer->ToPlayer()->SetClientControl(this, 1); + charmer->ToPlayer()->SetMover(this); charmer->ToPlayer()->SetViewpoint(this, true); charmer->ToPlayer()->VehicleSpellInitialize(); break; case CHARM_TYPE_POSSESS: - AddUnitState(UNIT_STAT_POSSESSED); + AddUnitState(UNIT_STATE_POSSESSED); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); charmer->ToPlayer()->SetClientControl(this, 1); + charmer->ToPlayer()->SetMover(this); charmer->ToPlayer()->SetViewpoint(this, true); charmer->ToPlayer()->PossessSpellInitialize(); break; @@ -15909,7 +15942,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) } CharmType type; - if (HasUnitState(UNIT_STAT_POSSESSED)) + if (HasUnitState(UNIT_STATE_POSSESSED)) type = CHARM_TYPE_POSSESS; else if (charmer && charmer->IsOnVehicle(this)) type = CHARM_TYPE_VEHICLE; @@ -15927,7 +15960,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) if (type == CHARM_TYPE_POSSESS) { - ClearUnitState(UNIT_STAT_POSSESSED); + ClearUnitState(UNIT_STATE_POSSESSED); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); } @@ -16958,11 +16991,15 @@ void Unit::_ExitVehicle(Position const* exitPosition) m_vehicle->RemovePassenger(this); + // If player is on mouted duel and exits the mount should immediatly lose the duel + if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->duel && ToPlayer()->duel->isMounted) + ToPlayer()->DuelComplete(DUEL_FLED); + // This should be done before dismiss, because there may be some aura removal Vehicle* vehicle = m_vehicle; m_vehicle = NULL; - SetControlled(false, UNIT_STAT_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT + SetControlled(false, UNIT_STATE_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT Position pos; if (!exitPosition) // Exit position not specified @@ -16970,7 +17007,7 @@ void Unit::_ExitVehicle(Position const* exitPosition) else pos = *exitPosition; - AddUnitState(UNIT_STAT_MOVE); + AddUnitState(UNIT_STATE_MOVE); if (GetTypeId() == TYPEID_PLAYER) ToPlayer()->SetFallInformation(0, GetPositionZ()); @@ -17362,7 +17399,7 @@ bool CharmInfo::IsReturning() void Unit::SetInFront(Unit const* target) { - if (!HasUnitState(UNIT_STAT_CANNOT_TURN)) + if (!HasUnitState(UNIT_STATE_CANNOT_TURN)) SetOrientation(GetAngle(target)); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 1808018d865..5b890ff43c0 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -469,46 +469,46 @@ enum DeathState enum UnitState { - UNIT_STAT_DIED = 0x00000001, // player has fake death aura - UNIT_STAT_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone - //UNIT_STAT_MELEE_ATTACK_BY = 0x00000004, // player is melee attack by someone - UNIT_STAT_STUNNED = 0x00000008, - UNIT_STAT_ROAMING = 0x00000010, - UNIT_STAT_CHASE = 0x00000020, - //UNIT_STAT_SEARCHING = 0x00000040, - UNIT_STAT_FLEEING = 0x00000080, - UNIT_STAT_IN_FLIGHT = 0x00000100, // player is in flight mode - UNIT_STAT_FOLLOW = 0x00000200, - UNIT_STAT_ROOT = 0x00000400, - UNIT_STAT_CONFUSED = 0x00000800, - UNIT_STAT_DISTRACTED = 0x00001000, - UNIT_STAT_ISOLATED = 0x00002000, // area auras do not affect other players - UNIT_STAT_ATTACK_PLAYER = 0x00004000, - UNIT_STAT_CASTING = 0x00008000, - UNIT_STAT_POSSESSED = 0x00010000, - UNIT_STAT_CHARGING = 0x00020000, - UNIT_STAT_JUMPING = 0x00040000, - UNIT_STAT_ONVEHICLE = 0x00080000, - UNIT_STAT_MOVE = 0x00100000, - UNIT_STAT_ROTATING = 0x00200000, - UNIT_STAT_EVADE = 0x00400000, - UNIT_STAT_ROAMING_MOVE = 0x00800000, - UNIT_STAT_CONFUSED_MOVE = 0x01000000, - UNIT_STAT_FLEEING_MOVE = 0x02000000, - UNIT_STAT_CHASE_MOVE = 0x04000000, - UNIT_STAT_FOLLOW_MOVE = 0x08000000, - UNIT_STAT_UNATTACKABLE = (UNIT_STAT_IN_FLIGHT | UNIT_STAT_ONVEHICLE), - //UNIT_STAT_MOVING = (UNIT_STAT_ROAMING | UNIT_STAT_CHASE), + UNIT_STATE_DIED = 0x00000001, // player has fake death aura + UNIT_STATE_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone + //UNIT_STATE_MELEE_ATTACK_BY = 0x00000004, // player is melee attack by someone + UNIT_STATE_STUNNED = 0x00000008, + UNIT_STATE_ROAMING = 0x00000010, + UNIT_STATE_CHASE = 0x00000020, + //UNIT_STATE_SEARCHING = 0x00000040, + UNIT_STATE_FLEEING = 0x00000080, + UNIT_STATE_IN_FLIGHT = 0x00000100, // player is in flight mode + UNIT_STATE_FOLLOW = 0x00000200, + UNIT_STATE_ROOT = 0x00000400, + UNIT_STATE_CONFUSED = 0x00000800, + UNIT_STATE_DISTRACTED = 0x00001000, + UNIT_STATE_ISOLATED = 0x00002000, // area auras do not affect other players + UNIT_STATE_ATTACK_PLAYER = 0x00004000, + UNIT_STATE_CASTING = 0x00008000, + UNIT_STATE_POSSESSED = 0x00010000, + UNIT_STATE_CHARGING = 0x00020000, + UNIT_STATE_JUMPING = 0x00040000, + UNIT_STATE_ONVEHICLE = 0x00080000, + UNIT_STATE_MOVE = 0x00100000, + UNIT_STATE_ROTATING = 0x00200000, + UNIT_STATE_EVADE = 0x00400000, + UNIT_STATE_ROAMING_MOVE = 0x00800000, + UNIT_STATE_CONFUSED_MOVE = 0x01000000, + UNIT_STATE_FLEEING_MOVE = 0x02000000, + UNIT_STATE_CHASE_MOVE = 0x04000000, + UNIT_STATE_FOLLOW_MOVE = 0x08000000, + UNIT_STATE_UNATTACKABLE = (UNIT_STATE_IN_FLIGHT | UNIT_STATE_ONVEHICLE), + //UNIT_STATE_MOVING = (UNIT_STATE_ROAMING | UNIT_STATE_CHASE), // for real move using movegen check and stop (except unstoppable flight) - UNIT_STAT_MOVING = UNIT_STAT_ROAMING_MOVE | UNIT_STAT_CONFUSED_MOVE | UNIT_STAT_FLEEING_MOVE| UNIT_STAT_CHASE_MOVE | UNIT_STAT_FOLLOW_MOVE , - UNIT_STAT_CONTROLLED = (UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING), - UNIT_STAT_LOST_CONTROL = (UNIT_STAT_CONTROLLED | UNIT_STAT_JUMPING | UNIT_STAT_CHARGING), - UNIT_STAT_SIGHTLESS = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_EVADE), - UNIT_STAT_CANNOT_AUTOATTACK = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_CASTING), - UNIT_STAT_CANNOT_TURN = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_ROTATING), + UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE| UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE , + UNIT_STATE_CONTROLLED = (UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING), + UNIT_STATE_LOST_CONTROL = (UNIT_STATE_CONTROLLED | UNIT_STATE_JUMPING | UNIT_STATE_CHARGING), + UNIT_STATE_SIGHTLESS = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE), + UNIT_STATE_CANNOT_AUTOATTACK = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_CASTING), + UNIT_STATE_CANNOT_TURN = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_ROTATING), // stay by different reasons - UNIT_STAT_NOT_MOVE = UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DIED | UNIT_STAT_DISTRACTED, - UNIT_STAT_ALL_STATE = 0xffffffff //(UNIT_STAT_STOPPED | UNIT_STAT_MOVING | UNIT_STAT_IN_COMBAT | UNIT_STAT_IN_FLIGHT) + UNIT_STATE_NOT_MOVE = UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DIED | UNIT_STATE_DISTRACTED, + UNIT_STATE_ALL_STATE = 0xffffffff //(UNIT_STATE_STOPPED | UNIT_STATE_MOVING | UNIT_STATE_IN_COMBAT | UNIT_STATE_IN_FLIGHT) }; enum UnitMoveType @@ -589,8 +589,8 @@ enum UnitFlags UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP UNIT_FLAG_UNK_6 = 0x00000040, UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PVP_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE - UNIT_FLAG_OOC_NOT_ATTACKABLE = 0x00000100, // 2.0.8 - (OOC Out Of Combat) Can not be attacked when not in combat. Removed if unit for some reason enter combat. - UNIT_FLAG_PASSIVE = 0x00000200, // makes you unable to attack everything. Almost identical to our "civilian"-term. Will ignore it's surroundings and not engage in combat unless "called upon" or engaged by another unit. + UNIT_FLAG_IMMUNE_TO_PC = 0x00000100, // disables combat/assistance with PlayerCharacters (PC) - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget + UNIT_FLAG_IMMUNE_TO_NPC = 0x00000200, // disables combat/assistance with NonPlayerCharacters (NPC) - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget UNIT_FLAG_LOOTING = 0x00000400, // loot animation UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8 UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3 @@ -1308,8 +1308,8 @@ class Unit : public WorldObject void ClearUnitState(uint32 f) { m_state &= ~f; } bool CanFreeMove() const { - return !HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_IN_FLIGHT | - UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) && GetOwnerGUID() == 0; + return !HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_FLEEING | UNIT_STATE_IN_FLIGHT | + UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) && GetOwnerGUID() == 0; } uint32 HasUnitTypeMask(uint32 mask) const { return mask & m_unitTypeMask; } @@ -1544,7 +1544,7 @@ class Unit : public WorldObject } bool isSpiritService() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); } - bool isInFlight() const { return HasUnitState(UNIT_STAT_IN_FLIGHT); } + bool isInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); } bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); } void CombatStart(Unit* target, bool initialAggro = true); @@ -1701,8 +1701,8 @@ class Unit : public WorldObject void RemoveAllControlled(); bool isCharmed() const { return GetCharmerGUID() != 0; } - bool isPossessed() const { return HasUnitState(UNIT_STAT_POSSESSED); } - bool isPossessedByPlayer() const { return HasUnitState(UNIT_STAT_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); } + bool isPossessed() const { return HasUnitState(UNIT_STATE_POSSESSED); } + bool isPossessedByPlayer() const { return HasUnitState(UNIT_STATE_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); } bool isPossessing() const { if (Unit* u = GetCharm()) @@ -2067,7 +2067,7 @@ class Unit : public WorldObject MotionMaster* GetMotionMaster() { return &i_motionMaster; } const MotionMaster* GetMotionMaster() const { return &i_motionMaster; } - bool IsStopped() const { return !(HasUnitState(UNIT_STAT_MOVING)); } + bool IsStopped() const { return !(HasUnitState(UNIT_STATE_MOVING)); } void StopMoving(); void AddUnitMovementFlag(uint32 f) { m_movementInfo.flags |= f; } diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index b3531d585c3..fc6c6cb063e 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -176,7 +176,7 @@ void Vehicle::ApplyAllImmunities() case 160: // Strand of the Ancients case 244: // Wintergrasp case 510: // Isle of Conquest - _me->SetControlled(true, UNIT_STAT_ROOT); + _me->SetControlled(true, UNIT_STATE_ROOT); // why we need to apply this? we can simple add immunities to slow mechanic in DB _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_DECREASE_SPEED, true); break; @@ -342,7 +342,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) } if (seat->second.SeatInfo->m_flags && !(seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_UNK1)) - unit->AddUnitState(UNIT_STAT_ONVEHICLE); + unit->AddUnitState(UNIT_STATE_ONVEHICLE); unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); VehicleSeatEntry const* veSeat = seat->second.SeatInfo; @@ -359,13 +359,12 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) { if (!_me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE)) ASSERT(false); - unit->ToPlayer()->SetMover(this->GetBase()); } if (_me->IsInWorld()) { unit->SendClearTarget(); // SMSG_BREAK_TARGET - unit->SetControlled(true, UNIT_STAT_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures) + unit->SetControlled(true, UNIT_STATE_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures) // also adds MOVEMENTFLAG_ROOT unit->SendMonsterMoveTransport(_me); // SMSG_MONSTER_MOVE_TRANSPORT @@ -408,13 +407,10 @@ void Vehicle::RemovePassenger(Unit* unit) ++_usableSeatNum; } - unit->ClearUnitState(UNIT_STAT_ONVEHICLE); + unit->ClearUnitState(UNIT_STATE_ONVEHICLE); if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL) - { _me->RemoveCharmedBy(unit); - unit->ToPlayer()->SetMover(unit->ToPlayer()); - } if (_me->IsInWorld()) { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 086dd610ee2..dc78489070e 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8683,7 +8683,7 @@ void ObjectMgr::CheckScripts(ScriptsType type, std::set<int32>& ids) case SCRIPT_COMMAND_TALK: { if (!GetTrinityStringLocale (itrM->second.Talk.TextID)) - sLog->outErrorDb("Table `db_script_string` not has string id %u used db script (ID: %u)", itrM->second.Talk.TextID, itrMM->first); + sLog->outErrorDb("Table `%s` references invalid text id %u from `db_script_string`, script id: %u.", GetScriptsTableNameByType(type).c_str(), itrM->second.Talk.TextID, itrMM->first); if (ids.find(itrM->second.Talk.TextID) != ids.end()) ids.erase(itrM->second.Talk.TextID); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index 5e5fbf4a9a6..2446e9d4276 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -113,7 +113,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_STAT_SIGHTLESS)) + if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STATE_SIGHTLESS)) if (c->IsAIEnabled && c->canSeeOrDetect(u, false, true)) c->AI()->MoveInLineOfSight_Safe(u); } diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index dd73cdcb1f0..e3029a1be65 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -746,7 +746,7 @@ namespace Trinity bool operator()(Unit* u) { if (u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && - (u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STAT_STUNNED) || u->HasUnitState(UNIT_STAT_CONFUSED))) + (u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED))) { return true; } diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 19bc1ab7dea..b31b632e963 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -203,7 +203,9 @@ void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, // skip non-existed member if (!sObjectMgr->GetPlayerNameByGUID(member.guid, member.name)) { - CharacterDatabase.PQuery("DELETE FROM group_member WHERE memberGuid=%u", guidLow); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER); + stmt->setUInt32(0, guidLow); + CharacterDatabase.Execute(stmt); return; } diff --git a/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp b/src/server/game/Handlers/AddonHandler.cpp index ef537cb6198..ef537cb6198 100755 --- a/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp +++ b/src/server/game/Handlers/AddonHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/AddonHandler.h b/src/server/game/Handlers/AddonHandler.h index 36cb19e5698..36cb19e5698 100755 --- a/src/server/game/Server/Protocol/Handlers/AddonHandler.h +++ b/src/server/game/Handlers/AddonHandler.h diff --git a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index 8fb820713ce..8fb820713ce 100755 --- a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index aaafb09115d..8a98b038efd 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -46,7 +46,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendAuctionHello(guid, unit); @@ -101,14 +101,14 @@ void WorldSession::SendAuctionBidderNotification(uint32 location, uint32 auction //this void causes on client to display: "Your auction sold" void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction) { - WorldPacket data(SMSG_AUCTION_OWNER_NOTIFICATION, (7*4)); - data << auction->Id; - data << auction->bid; - data << (uint32) 0; //unk - data << (uint32) 0; //unk - data << (uint32) 0; //unk - data << auction->item_template; - data << (uint32) 0; //unk + WorldPacket data(SMSG_AUCTION_OWNER_NOTIFICATION, (8*4)); + data << uint32(auction->Id); + data << uint32(auction->bid); + data << uint32(0); //unk + data << uint64(0); //unk (bidder guid?) + data << uint32(auction->item_template); + data << uint32(0); //unk + data << float(0); //unk (time?) SendPacket(&data); } @@ -161,7 +161,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Item* it = player->GetItemByGuid(item); @@ -274,7 +274,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); @@ -394,7 +394,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); @@ -482,7 +482,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); @@ -531,7 +531,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); @@ -586,7 +586,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); diff --git a/src/server/game/Server/Protocol/Handlers/AuthHandler.cpp b/src/server/game/Handlers/AuthHandler.cpp index 9a3e756dda3..9a3e756dda3 100755 --- a/src/server/game/Server/Protocol/Handlers/AuthHandler.cpp +++ b/src/server/game/Handlers/AuthHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index d1aa0021a75..d1aa0021a75 100755 --- a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index be547c84b19..be547c84b19 100755 --- a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index 9b749fa8005..9b749fa8005 100755 --- a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index bd9668ce5b8..0094c20d927 100644 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1004,7 +1004,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), pCurrChar->GetName(), pCurrChar->GetGUIDLow()); - if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STAT_STUNNED)) + if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED)) pCurrChar->SetStandState(UNIT_STAND_STATE_STAND); m_playerLoading = false; diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 3d689196256..966eae598a6 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -481,7 +481,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) void WorldSession::HandleEmoteOpcode(WorldPacket & recv_data) { - if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STATE_DIED)) return; uint32 emote; @@ -558,7 +558,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) break; default: // Only allow text-emotes for "dead" entities (feign death included) - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) break; GetPlayer()->HandleEmoteCommand(emote_anim); break; diff --git a/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp index 6693cdfca27..6693cdfca27 100755 --- a/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp +++ b/src/server/game/Handlers/CombatHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp b/src/server/game/Handlers/DuelHandler.cpp index 8afd9f3b978..8afd9f3b978 100755 --- a/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp +++ b/src/server/game/Handlers/DuelHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 9343a5356b6..9343a5356b6 100755 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index d2a5f8014b8..9115f8f0f1e 100755 --- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -303,7 +303,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) if (GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_TABARDDESIGNER)) { // Remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (Guild* guild = _GetPlayerGuild(this)) diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 47700fd088a..802597e14eb 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -503,7 +503,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Item* pItem = _player->GetItemByGuid(itemguid); @@ -614,7 +614,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Item* pItem = _player->GetItemFromBuyBackSlot(slot); @@ -732,11 +732,11 @@ void WorldSession::SendListInventory(uint64 vendorGuid) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // Stop the npc if moving - if (vendor->HasUnitState(UNIT_STAT_MOVING)) + if (vendor->HasUnitState(UNIT_STATE_MOVING)) vendor->StopMoving(); VendorItemData const* items = vendor->GetVendorItems(); diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index 3c6bd28b5cb..3c6bd28b5cb 100755 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index b17817e196f..6508f08dc22 100755 --- a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -324,7 +324,7 @@ void WorldSession::DoLootRelease(uint64 lguid) else { // not fully looted object - go->SetLootState(GO_ACTIVATED); + go->SetLootState(GO_ACTIVATED, player); // if the round robin player release, reset it. if (player->GetGUID() == loot->roundRobinPlayer) diff --git a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index a8522bb2582..a8522bb2582 100755 --- a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index d1227c9b7d7..f109332e235 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -122,7 +122,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 7d1233c8f70..7d1233c8f70 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index ef49b337b44..1f286a0af05 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -60,7 +60,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendTabardVendorActivate(guid); @@ -89,7 +89,7 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendShowBank(guid); @@ -128,7 +128,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // trainer list loaded at check; @@ -250,7 +250,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (!unit->isCanTrainingOf(_player, true)) @@ -314,7 +314,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); // remove fake death - //if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + //if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) // GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver() || unit->isServiceProvider() || unit->isGuard()) @@ -369,7 +369,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (!code.empty()) @@ -400,7 +400,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendSpiritResurrect(); @@ -455,7 +455,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendBindPoint(unit); @@ -507,7 +507,7 @@ void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data) return; // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // remove mounts this fix bug where getting pet from stable while mounted deletes pet. @@ -609,7 +609,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Pet* pet = _player->GetPet(); @@ -679,7 +679,7 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_ENTRY); @@ -759,7 +759,7 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (GetPlayer()->m_stableSlots < MAX_PET_STABLES) @@ -798,7 +798,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Pet* pet = _player->GetPet(); @@ -886,7 +886,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // reputation discount diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.h b/src/server/game/Handlers/NPCHandler.h index af84b71a74f..af84b71a74f 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.h +++ b/src/server/game/Handlers/NPCHandler.h diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 68ce3153450..16b6a4bb714 100755 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -202,7 +202,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid return; } - pet->ClearUnitState(UNIT_STAT_FOLLOW); + pet->ClearUnitState(UNIT_STATE_FOLLOW); // This is true if pet has no target or has target but targets differs. if (pet->getVictim() != TargetUnit || (pet->getVictim() == TargetUnit && !pet->GetCharmInfo()->IsCommandAttack())) { @@ -777,7 +777,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) targets.Read(recvPacket, caster); HandleClientCastFlags(recvPacket, castFlags, targets); - caster->ClearUnitState(UNIT_STAT_FOLLOW); + caster->ClearUnitState(UNIT_STATE_FOLLOW); Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE); spell->m_cast_count = castCount; // probably pending spell cast diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 26185d3376d..b4c07811598 100755 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -98,7 +98,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); uint32 charterid = 0; diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index 5702eefffec..5702eefffec 100755 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 7e80c780369..f9aa40cdcda 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -95,7 +95,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // Stop the npc if moving creature->StopMoving(); diff --git a/src/server/game/Server/Protocol/Handlers/ReferAFriendHandler.cpp b/src/server/game/Handlers/ReferAFriendHandler.cpp index 58d425ddf98..58d425ddf98 100644 --- a/src/server/game/Server/Protocol/Handlers/ReferAFriendHandler.cpp +++ b/src/server/game/Handlers/ReferAFriendHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp index 520cd89e7d5..355effba0c6 100755 --- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp +++ b/src/server/game/Handlers/SkillHandler.cpp @@ -68,7 +68,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (!(_player->resetTalents())) diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index b8908d0f9f9..b8908d0f9f9 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 3533b153bd8..8eb1eab06d9 100755 --- a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -79,7 +79,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // unknown taxi node case @@ -118,7 +118,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathNode) { // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); while (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE) diff --git a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp index a270d42b000..a270d42b000 100755 --- a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp +++ b/src/server/game/Handlers/TicketHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index ebe54eb17eb..4c39992f344 100755 --- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -561,7 +561,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (GetPlayer()->HasUnitState(UNIT_STAT_STUNNED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_STUNNED)) { SendTradeStatus(TRADE_STATUS_YOU_STUNNED); return; @@ -611,7 +611,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (pOther->HasUnitState(UNIT_STAT_STUNNED)) + if (pOther->HasUnitState(UNIT_STATE_STUNNED)) { SendTradeStatus(TRADE_STATUS_TARGET_STUNNED); return; diff --git a/src/server/game/Server/Protocol/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index ce4f6ccb8fe..ce4f6ccb8fe 100644 --- a/src/server/game/Server/Protocol/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp diff --git a/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp b/src/server/game/Handlers/VoiceChatHandler.cpp index 34ad5ac3eae..34ad5ac3eae 100755 --- a/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp +++ b/src/server/game/Handlers/VoiceChatHandler.cpp diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 9fb2fdf1c25..722b7089a17 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -532,8 +532,8 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) if (iMap && iMap->IsDungeon()) ((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY); - else - sObjectMgr->DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded + + sObjectMgr->DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded // Free up the instance id and allow it to be reused sMapMgr->FreeInstanceId(instanceId); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 53f70096cbd..81b1b14d27d 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -2398,7 +2398,10 @@ enum QuestSort QUEST_SORT_BREWFEST = 370, QUEST_SORT_INSCRIPTION = 371, QUEST_SORT_DEATH_KNIGHT = 372, - QUEST_SORT_JEWELCRAFTING = 373 + QUEST_SORT_JEWELCRAFTING = 373, + QUEST_SORT_NOBLEGARDEN = 374, + QUEST_SORT_PILGRIMS_BOUNTY = 375, + QUEST_SORT_LOVE_IS_IN_THE_AIR = 376, }; inline uint8 ClassByQuestSort(int32 QuestSort) diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 2656d882009..4945ae2a014 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -80,7 +80,7 @@ void MotionMaster::UpdateMotion(uint32 diff) if (!i_owner) return; - if (i_owner->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) // what about UNIT_STAT_DISTRACTED? Why is this not included? + if (i_owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) // what about UNIT_STATE_DISTRACTED? Why is this not included? return; ASSERT(!empty()); @@ -237,7 +237,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE)) return; - //i_owner->ClearUnitState(UNIT_STAT_FOLLOW); + //i_owner->ClearUnitState(UNIT_STATE_FOLLOW); if (i_owner->GetTypeId() == TYPEID_PLAYER) { sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)", @@ -262,7 +262,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE)) return; - //i_owner->AddUnitState(UNIT_STAT_FOLLOW); + //i_owner->AddUnitState(UNIT_STATE_FOLLOW); if (i_owner->GetTypeId() == TYPEID_PLAYER) { sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(), @@ -307,7 +307,7 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed) init.SetVelocity(speed); init.SetAnimation(Movement::ToGround); init.Launch(); - Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); + Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); } void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed) @@ -322,7 +322,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed) init.SetVelocity(speed); init.SetAnimation(Movement::ToFly); init.Launch(); - Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); + Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); } void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ) @@ -365,10 +365,13 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee init.SetParabolic(max_height,0); init.SetVelocity(speedXY); init.Launch(); - Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); + if (i_owner->GetTypeId() == TYPEID_PLAYER) + Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); + else + Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); } -void MotionMaster::MoveFall() +void MotionMaster::MoveFall(uint32 id/*=0*/) { // use larger distance for vmap height search than in most other cases float tz = i_owner->GetMap()->GetHeight(i_owner->GetPositionX(), i_owner->GetPositionY(), i_owner->GetPositionZ(), true, MAX_FALL_DISTANCE); @@ -387,7 +390,7 @@ void MotionMaster::MoveFall() init.MoveTo(i_owner->GetPositionX(),i_owner->GetPositionY(),tz); init.SetFall(); init.Launch(); - Mutate(new EffectMovementGenerator(0), MOTION_SLOT_CONTROLLED); + Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); } void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id) diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 00f1701e591..a5bd0861b04 100755 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -163,7 +163,7 @@ class MotionMaster //: private std::stack<MovementGenerator *> void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ); void MoveJumpTo(float angle, float speedXY, float speedZ); void MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id = 0); - void MoveFall(); + void MoveFall(uint32 id = 0); void MoveSeekAssistance(float x, float y, float z); void MoveSeekAssistanceDistract(uint32 timer); diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index ac09f2d403a..32b960028c2 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -22,6 +22,7 @@ #include "VMapFactory.h" #include "MoveSplineInit.h" #include "MoveSpline.h" +#include "Player.h" #ifdef MAP_BASED_RAND_GEN #define rand_norm() unit.rand_norm() @@ -70,7 +71,7 @@ void ConfusedMovementGenerator<T>::Initialize(T &unit) unit.StopMoving(); unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.AddUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); } template<> @@ -93,19 +94,19 @@ void ConfusedMovementGenerator<T>::Reset(T &unit) i_nextMove = 1; i_nextMoveTime.Reset(0); unit.StopMoving(); - unit.AddUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); } template<class T> bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff) { - if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) return true; if (i_nextMoveTime.Passed()) { // currently moving, update location - unit.AddUnitState(UNIT_STAT_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE); if (unit.movespline->Finalized()) { @@ -120,7 +121,7 @@ bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff) if(i_nextMoveTime.Passed() ) { // start moving - unit.AddUnitState(UNIT_STAT_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE); ASSERT( i_nextMove <= MAX_CONF_WAYPOINTS ); float x = i_waypoints[i_nextMove][0]; @@ -140,14 +141,14 @@ template<> void ConfusedMovementGenerator<Player>::Finalize(Player &unit) { unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.ClearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE); + unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); } template<> void ConfusedMovementGenerator<Creature>::Finalize(Creature &unit) { unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.ClearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE); + unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); if (unit.getVictim()) unit.SetTarget(unit.getVictim()->GetGUID()); } diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index 458e6f9a62c..ed5b73dd378 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -34,7 +34,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner) if (!&owner) return; - if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) return; if (!_setMoveData(owner)) @@ -44,7 +44,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner) if (!_getPoint(owner, x, y, z)) return; - owner.AddUnitState(UNIT_STAT_FLEEING_MOVE); + owner.AddUnitState(UNIT_STATE_FLEEING_MOVE); Movement::MoveSplineInit init(owner); init.MoveTo(x,y,z); @@ -287,7 +287,7 @@ FleeingMovementGenerator<T>::Initialize(T &owner) return; owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - owner.AddUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE); + owner.AddUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE); _Init(owner); @@ -335,14 +335,14 @@ template<> void FleeingMovementGenerator<Player>::Finalize(Player &owner) { owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE); + owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE); } template<> void FleeingMovementGenerator<Creature>::Finalize(Creature &owner) { owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE); + owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE); if (owner.getVictim()) owner.SetTarget(owner.getVictim()->GetGUID()); } @@ -359,9 +359,9 @@ FleeingMovementGenerator<T>::Update(T &owner, const uint32 &time_diff) { if (!&owner || !owner.isAlive()) return false; - if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) { - owner.ClearUnitState(UNIT_STAT_FLEEING_MOVE); + owner.ClearUnitState(UNIT_STATE_FLEEING_MOVE); return true; } @@ -388,7 +388,7 @@ template bool FleeingMovementGenerator<Creature>::Update(Creature &, const uint3 void TimedFleeingMovementGenerator::Finalize(Unit &owner) { owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE); + owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE); if (Unit* victim = owner.getVictim()) { if (owner.isAlive()) @@ -404,9 +404,9 @@ bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32 time_diff) if (!owner.isAlive()) return false; - if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) { - owner.ClearUnitState(UNIT_STAT_FLEEING_MOVE); + owner.ClearUnitState(UNIT_STATE_FLEEING_MOVE); return true; } diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 84997d6d1ae..dc47898352e 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -25,7 +25,7 @@ void HomeMovementGenerator<Creature>::Initialize(Creature & owner) { - owner.AddUnitState(UNIT_STAT_EVADE); + owner.AddUnitState(UNIT_STATE_EVADE); _setTargetLocation(owner); } @@ -38,7 +38,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner) if (!&owner) return; - if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) return; Movement::MoveSplineInit init(owner); @@ -54,7 +54,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner) init.Launch(); arrived = false; - owner.ClearUnitState(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE); + owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE); } bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 time_diff) @@ -67,7 +67,7 @@ void HomeMovementGenerator<Creature>::Finalize(Creature& owner) { if (arrived) { - owner.ClearUnitState(UNIT_STAT_EVADE); + owner.ClearUnitState(UNIT_STATE_EVADE); owner.SetWalk(true); owner.LoadCreaturesAddon(true); owner.AI()->JustReachedHome(); diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 43d3cccfe48..36561e00b93 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -32,19 +32,19 @@ void IdleMovementGenerator::Initialize(Unit &owner) void IdleMovementGenerator::Reset(Unit& owner) { - if (owner.HasUnitState(UNIT_STAT_MOVE)) + if (owner.HasUnitState(UNIT_STATE_MOVE)) owner.StopMoving(); } void RotateMovementGenerator::Initialize(Unit& owner) { - if (owner.HasUnitState(UNIT_STAT_MOVE)) + if (owner.HasUnitState(UNIT_STATE_MOVE)) owner.StopMoving(); if (owner.getVictim()) owner.SetInFront(owner.getVictim()); - owner.AddUnitState(UNIT_STAT_ROTATING); + owner.AddUnitState(UNIT_STATE_ROTATING); owner.AttackStop(); } @@ -75,7 +75,7 @@ bool RotateMovementGenerator::Update(Unit& owner, const uint32 diff) void RotateMovementGenerator::Finalize(Unit &unit) { - unit.ClearUnitState(UNIT_STAT_ROTATING); + unit.ClearUnitState(UNIT_STATE_ROTATING); if (unit.GetTypeId() == TYPEID_UNIT) unit.ToCreature()->AI()->MovementInform(ROTATE_MOTION_TYPE, 0); } @@ -83,13 +83,13 @@ void RotateMovementGenerator::Finalize(Unit &unit) void DistractMovementGenerator::Initialize(Unit& owner) { - owner.AddUnitState(UNIT_STAT_DISTRACTED); + owner.AddUnitState(UNIT_STATE_DISTRACTED); } void DistractMovementGenerator::Finalize(Unit& owner) { - owner.ClearUnitState(UNIT_STAT_DISTRACTED); + owner.ClearUnitState(UNIT_STATE_DISTRACTED); } bool @@ -105,7 +105,7 @@ DistractMovementGenerator::Update(Unit& /*owner*/, const uint32 time_diff) void AssistanceDistractMovementGenerator::Finalize(Unit &unit) { - unit.ClearUnitState(UNIT_STAT_DISTRACTED); + unit.ClearUnitState(UNIT_STATE_DISTRACTED); unit.ToCreature()->SetReactState(REACT_AGGRESSIVE); } diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 505615c07b8..02f9ebce847 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -23,6 +23,7 @@ #include "World.h" #include "MoveSplineInit.h" #include "MoveSpline.h" +#include "Player.h" //----- Point Movement Generator template<class T> @@ -31,7 +32,7 @@ void PointMovementGenerator<T>::Initialize(T &unit) if (!unit.IsStopped()) unit.StopMoving(); - unit.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); Movement::MoveSplineInit init(unit); init.MoveTo(i_x, i_y, i_z); if (speed > 0.0f) @@ -45,20 +46,20 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff) if (!&unit) return false; - if(unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if(unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) { - unit.ClearUnitState(UNIT_STAT_ROAMING_MOVE); + unit.ClearUnitState(UNIT_STATE_ROAMING_MOVE); return true; } - unit.AddUnitState(UNIT_STAT_ROAMING_MOVE); + unit.AddUnitState(UNIT_STATE_ROAMING_MOVE); return !unit.movespline->Finalized(); } template<class T> void PointMovementGenerator<T>:: Finalize(T &unit) { - unit.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + unit.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); if (unit.movespline->Finalized()) MovementInform(unit); @@ -70,7 +71,7 @@ void PointMovementGenerator<T>::Reset(T &unit) if (!unit.IsStopped()) unit.StopMoving(); - unit.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); } template<class T> @@ -119,7 +120,7 @@ void EffectMovementGenerator::Finalize(Unit &unit) if (((Creature&)unit).AI() && unit.movespline->Finalized()) ((Creature&)unit).AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id); // Need restore previous movement since we have no proper states system - //if (unit.isAlive() && !unit.HasUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_FLEEING)) + //if (unit.isAlive() && !unit.HasUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_FLEEING)) //{ // if (Unit * victim = unit.getVictim()) // unit.GetMotionMaster()->MoveChase(victim); diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 0205b734058..22adc7be92f 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -102,7 +102,7 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature) else i_nextMoveTime.Reset(urand(500, 10000)); - creature.AddUnitState(UNIT_STAT_ROAMING_MOVE); + creature.AddUnitState(UNIT_STATE_ROAMING_MOVE); Movement::MoveSplineInit init(creature); init.MoveTo(destX, destY, destZ); @@ -123,7 +123,7 @@ void RandomMovementGenerator<Creature>::Initialize(Creature &creature) if (!wander_distance) wander_distance = creature.GetRespawnRadius(); - creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); _setRandomLocation(creature); } @@ -137,7 +137,7 @@ RandomMovementGenerator<Creature>::Reset(Creature &creature) template<> void RandomMovementGenerator<Creature>::Finalize(Creature &creature) { - creature.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); creature.SetWalk(false); } @@ -145,10 +145,10 @@ template<> bool RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 diff) { - if (creature.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (creature.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) { i_nextMoveTime.Reset(0); // Expire the timer - creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE); + creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE); return true; } diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index bded2fd512c..964b4402438 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -24,6 +24,7 @@ #include "World.h" #include "MoveSplineInit.h" #include "MoveSpline.h" +#include "Player.h" #include <cmath> @@ -33,7 +34,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner) if (!i_target.isValid() || !i_target->IsInWorld()) return; - if (owner.HasUnitState(UNIT_STAT_NOT_MOVE)) + if (owner.HasUnitState(UNIT_STATE_NOT_MOVE)) return; float x, y, z; @@ -124,7 +125,7 @@ bool TargetedMovementGeneratorMedium<T,D>::Update(T &owner, const uint32 & time_ if (!owner.isAlive()) return true; - if (owner.HasUnitState(UNIT_STAT_NOT_MOVE)) + if (owner.HasUnitState(UNIT_STATE_NOT_MOVE)) { D::_clearUnitStateMove(owner); return true; @@ -187,7 +188,7 @@ void ChaseMovementGenerator<T>::_reachTarget(T &owner) template<> void ChaseMovementGenerator<Player>::Initialize(Player &owner) { - owner.AddUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE); + owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE); _setTargetLocation(owner); } @@ -195,14 +196,14 @@ template<> void ChaseMovementGenerator<Creature>::Initialize(Creature &owner) { owner.SetWalk(false); - owner.AddUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE); + owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE); _setTargetLocation(owner); } template<class T> void ChaseMovementGenerator<T>::Finalize(T &owner) { - owner.ClearUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE); + owner.ClearUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE); } template<class T> @@ -211,6 +212,19 @@ void ChaseMovementGenerator<T>::Reset(T &owner) Initialize(owner); } +template<class T> +void ChaseMovementGenerator<T>::MovementInform(T & /*unit*/) +{ +} + +template<> +void ChaseMovementGenerator<Creature>::MovementInform(Creature &unit) +{ + // Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle + if (unit.AI()) + unit.AI()->MovementInform(CHASE_MOTION_TYPE, i_target.getTarget()->GetGUIDLow()); +} + //-----------------------------------------------// template<> bool FollowMovementGenerator<Creature>::EnableWalking() const @@ -245,7 +259,7 @@ void FollowMovementGenerator<Creature>::_updateSpeed(Creature &u) template<> void FollowMovementGenerator<Player>::Initialize(Player &owner) { - owner.AddUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE); + owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE); _updateSpeed(owner); _setTargetLocation(owner); } @@ -253,7 +267,7 @@ void FollowMovementGenerator<Player>::Initialize(Player &owner) template<> void FollowMovementGenerator<Creature>::Initialize(Creature &owner) { - owner.AddUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE); + owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE); _updateSpeed(owner); _setTargetLocation(owner); } @@ -261,7 +275,7 @@ void FollowMovementGenerator<Creature>::Initialize(Creature &owner) template<class T> void FollowMovementGenerator<T>::Finalize(T &owner) { - owner.ClearUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE); + owner.ClearUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE); _updateSpeed(owner); } @@ -300,6 +314,7 @@ template void ChaseMovementGenerator<Player>::Finalize(Player &); template void ChaseMovementGenerator<Creature>::Finalize(Creature &); template void ChaseMovementGenerator<Player>::Reset(Player &); template void ChaseMovementGenerator<Creature>::Reset(Creature &); +template void ChaseMovementGenerator<Player>::MovementInform(Player &unit); template void FollowMovementGenerator<Player>::Finalize(Player &); template void FollowMovementGenerator<Creature>::Finalize(Creature &); diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h index 785d12ba6d2..bf2eecc89f6 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h @@ -22,6 +22,7 @@ #include "MovementGenerator.h" #include "FollowerReference.h" #include "Timer.h" +#include "Unit.h" class TargetedMovementGeneratorBase { @@ -76,10 +77,10 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMo void Initialize(T &); void Finalize(T &); void Reset(T &); - void MovementInform(T &){} + void MovementInform(T &); - static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STAT_CHASE_MOVE); } - static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STAT_CHASE_MOVE); } + static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STATE_CHASE_MOVE); } + static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STATE_CHASE_MOVE); } bool EnableWalking() const { return false;} bool _lostTarget(T &u) const { return u.getVictim() != this->GetTarget(); } void _reachTarget(T &); @@ -102,8 +103,8 @@ class FollowMovementGenerator : public TargetedMovementGeneratorMedium<T, Follow void Reset(T &); void MovementInform(T &); - static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STAT_FOLLOW_MOVE); } - static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STAT_FOLLOW_MOVE); } + static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STATE_FOLLOW_MOVE); } + static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STATE_FOLLOW_MOVE); } bool EnableWalking() const; bool _lostTarget(T &) const { return false; } void _reachTarget(T &) {} diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index ea858eaba84..55cf3c28d46 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -51,18 +51,18 @@ void WaypointMovementGenerator<Creature>::LoadPath(Creature &creature) void WaypointMovementGenerator<Creature>::Initialize(Creature &creature) { LoadPath(creature); - creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); } void WaypointMovementGenerator<Creature>::Finalize(Creature &creature) { - creature.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); creature.SetWalk(false); } void WaypointMovementGenerator<Creature>::Reset(Creature &creature) { - creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); StartMoveNow(creature); } @@ -73,7 +73,7 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature) if (m_isArrivalDone) return; - creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE); + creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE); m_isArrivalDone = true; if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance) @@ -84,6 +84,7 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature) // Inform script MovementInform(creature); + creature.UpdateWaypointID(i_currentNode); Stop(i_path->at(i_currentNode)->delay); } @@ -94,13 +95,11 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature) if (Stopped()) return true; - const WaypointData *node = i_path->at(i_currentNode); - if (m_isArrivalDone) { if ((i_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint { - creature.SetHomePosition(node->x, node->y, node->z, creature.GetOrientation()); + creature.SetHomePosition(i_path->at(i_currentNode)->x, i_path->at(i_currentNode)->y, i_path->at(i_currentNode)->z, creature.GetOrientation()); creature.GetMotionMaster()->Initialize(); return false; } @@ -108,9 +107,11 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature) i_currentNode = (i_currentNode+1) % i_path->size(); } + const WaypointData *node = i_path->at(i_currentNode); + m_isArrivalDone = false; - creature.AddUnitState(UNIT_STAT_ROAMING_MOVE); + creature.AddUnitState(UNIT_STATE_ROAMING_MOVE); Movement::MoveSplineInit init(creature); init.MoveTo(node->x, node->y, node->z); @@ -132,9 +133,9 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3 { // Waypoint movement can be switched on/off // This is quite handy for escort quests and other stuff - if (creature.HasUnitState(UNIT_STAT_NOT_MOVE)) + if (creature.HasUnitState(UNIT_STATE_NOT_MOVE)) { - creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE); + creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE); return true; } // prevent a crash at empty waypoint path. @@ -203,7 +204,7 @@ void FlightPathMovementGenerator::Initialize(Player &player) void FlightPathMovementGenerator::Finalize(Player & player) { // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack) - player.ClearUnitState(UNIT_STAT_IN_FLIGHT); + player.ClearUnitState(UNIT_STATE_IN_FLIGHT); player.Dismount(); player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); @@ -226,7 +227,7 @@ void FlightPathMovementGenerator::Finalize(Player & player) void FlightPathMovementGenerator::Reset(Player & player) { player.getHostileRefManager().setOnlineOfflineState(false); - player.AddUnitState(UNIT_STAT_IN_FLIGHT); + player.AddUnitState(UNIT_STATE_IN_FLIGHT); player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); Movement::MoveSplineInit init(player); diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 885ade57653..b5ae923dc32 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -106,7 +106,6 @@ namespace Movement void MoveSplineInit::SetFacing(const Unit * target) { args.flags.EnableFacingTarget(); - target->GetUInt64Value(OBJECT_FIELD_GUID); //args.facing.target = target->GetObjectGuid().GetRawValue(); args.facing.target = target->GetUInt64Value(OBJECT_FIELD_GUID); } diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 3e142e1d84c..973735b84da 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -251,7 +251,7 @@ class Quest uint32 GetFlags() const { return Flags; } bool IsDaily() const { return Flags & QUEST_FLAGS_DAILY; } bool IsWeekly() const { return Flags & QUEST_FLAGS_WEEKLY; } - bool IsSeasonal() const { return ZoneOrSort == -QUEST_SORT_SEASONAL; } + bool IsSeasonal() const { return (ZoneOrSort == -QUEST_SORT_SEASONAL || ZoneOrSort == -QUEST_SORT_SPECIAL || ZoneOrSort == -QUEST_SORT_LUNAR_FESTIVAL || ZoneOrSort == -QUEST_SORT_MIDSUMMER || ZoneOrSort == -QUEST_SORT_BREWFEST || ZoneOrSort == -QUEST_SORT_LOVE_IS_IN_THE_AIR || ZoneOrSort == -QUEST_SORT_NOBLEGARDEN); } bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } bool IsAutoAccept() const { return Flags & QUEST_FLAGS_AUTO_ACCEPT; } bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 535253f4e13..1972b625a9f 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2417,7 +2417,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo target->VisitNearbyObject(target->GetMap()->GetVisibilityRange(), searcher); for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter) { - if (!(*iter)->HasUnitState(UNIT_STAT_CASTING)) + if (!(*iter)->HasUnitState(UNIT_STATE_CASTING)) continue; for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++) @@ -2448,7 +2448,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo // blizz like 2.0.x target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); - target->AddUnitState(UNIT_STAT_DIED); + target->AddUnitState(UNIT_STATE_DIED); } else { @@ -2465,7 +2465,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo // blizz like 2.0.x target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); - target->ClearUnitState(UNIT_STAT_DIED); + target->ClearUnitState(UNIT_STATE_DIED); } } @@ -3031,7 +3031,7 @@ void AuraEffect::HandleModConfuse(AuraApplication const* aurApp, uint8 mode, boo Unit* target = aurApp->GetTarget(); - target->SetControlled(apply, UNIT_STAT_CONFUSED); + target->SetControlled(apply, UNIT_STATE_CONFUSED); } void AuraEffect::HandleModFear(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3041,7 +3041,7 @@ void AuraEffect::HandleModFear(AuraApplication const* aurApp, uint8 mode, bool a Unit* target = aurApp->GetTarget(); - target->SetControlled(apply, UNIT_STAT_FLEEING); + target->SetControlled(apply, UNIT_STATE_FLEEING); } void AuraEffect::HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3051,7 +3051,7 @@ void AuraEffect::HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bo Unit* target = aurApp->GetTarget(); - target->SetControlled(apply, UNIT_STAT_STUNNED); + target->SetControlled(apply, UNIT_STATE_STUNNED); } void AuraEffect::HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3061,7 +3061,7 @@ void AuraEffect::HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bo Unit* target = aurApp->GetTarget(); - target->SetControlled(apply, UNIT_STAT_ROOT); + target->SetControlled(apply, UNIT_STATE_ROOT); } void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3072,7 +3072,7 @@ void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, Unit* target = aurApp->GetTarget(); if (target->HasAuraType(SPELL_AURA_MOD_FEAR)) - target->SetControlled(!(apply), UNIT_STAT_FLEEING); + target->SetControlled(!(apply), UNIT_STATE_FLEEING); } /***************************/ @@ -3096,17 +3096,9 @@ void AuraEffect::HandleModPossess(AuraApplication const* aurApp, uint8 mode, boo } if (apply) - { - if (target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp)) - caster->ToPlayer()->SetMover(target); - } + target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp); else - { target->RemoveCharmedBy(caster); - caster->ToPlayer()->SetMover(caster); - if (target->GetTypeId() == TYPEID_PLAYER) - target->ToPlayer()->SetMover(target); - } } // only one spell has this aura @@ -3134,13 +3126,11 @@ void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, if (caster->ToPlayer()->GetPet() != pet) return; - if (pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp)) - caster->ToPlayer()->SetMover(pet); + pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp); } else { pet->RemoveCharmedBy(caster); - caster->ToPlayer()->SetMover(caster); if (!pet->IsWithinDistInMap(caster, pet->GetMap()->GetVisibilityRange())) pet->Remove(PET_SAVE_NOT_IN_SLOT, true); @@ -3475,7 +3465,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint if (GetSpellInfo()->Mechanic == MECHANIC_BANISH) { if (apply) - target->AddUnitState(UNIT_STAT_ISOLATED); + target->AddUnitState(UNIT_STATE_ISOLATED); else { bool banishFound = false; @@ -3487,7 +3477,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint break; } if (!banishFound) - target->ClearUnitState(UNIT_STAT_ISOLATED); + target->ClearUnitState(UNIT_STATE_ISOLATED); } } @@ -6166,7 +6156,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const if (!caster || !target->isAlive()) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) + if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) { SendTickImmune(target, caster); return; @@ -6307,7 +6297,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c if (!caster || !caster->isAlive() || !target->isAlive()) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) + if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) { SendTickImmune(target, caster); return; @@ -6373,7 +6363,7 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) if (!caster || !caster->isAlive() || !target->isAlive()) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STATE_ISOLATED)) { SendTickImmune(target, caster); return; @@ -6401,7 +6391,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const if (!caster || !target->isAlive()) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STATE_ISOLATED)) { SendTickImmune(target, caster); return; @@ -6517,7 +6507,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con if (!caster || !caster->isAlive() || !target->isAlive() || target->getPowerType() != powerType) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) + if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) { SendTickImmune(target, caster); return; @@ -6617,7 +6607,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const if (!target->isAlive() || !target->GetMaxPower(powerType)) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STATE_ISOLATED)) { SendTickImmune(target, caster); return; @@ -6648,7 +6638,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons if (!target->isAlive() || !target->GetMaxPower(powerType)) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STATE_ISOLATED)) { SendTickImmune(target, caster); return; @@ -6680,7 +6670,7 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con if (!caster || !target->isAlive() || target->getPowerType() != powerType) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) + if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) { SendTickImmune(target, caster); return; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 8d2309e51f6..166f7b3734c 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1855,7 +1855,7 @@ bool Aura::CanStackWith(Aura const* existingAura) const case SPELL_AURA_OBS_MOD_HEALTH: case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE: // periodic auras which target areas are not allowed to stack this way (replenishment for example) - if (m_spellInfo->Effects[i].IsArea() || existingSpellInfo->Effects[i].IsArea()) + if (m_spellInfo->Effects[i].IsTargetingArea() || existingSpellInfo->Effects[i].IsTargetingArea()) break; return true; default: @@ -1963,6 +1963,13 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo)) return false; + // TODO: + // - do checks using conditions table for eventInfo->GetActor() and eventInfo->GetActionTarget() + // - add DoCheckProc() AuraScript hook + // to allow additional requirements for procs + // this is needed because this is the last moment in which you can prevent aura charge drop on proc + // and possibly a way to prevent default checks (if there're going to be any) + // Check if current equipment meets aura requirements // do that only for passive spells // TODO: this needs to be unified for all kinds of auras @@ -2023,11 +2030,14 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event void Aura::TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) { - // TODO: script hooks here (allowing prevention of selected effects) + // TODO: OnProc hook here for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (aurApp->HasEffect(i)) + // TODO: OnEffectProc hook here (allowing prevention of selected effects) GetEffect(i)->HandleProc(aurApp, eventInfo); - // TODO: script hooks here + // TODO: AfterEffectProc hook here + + // TODO: AfterProc hook here // Remove aura if we've used last charge to proc if (IsUsingCharges() && !GetCharges()) @@ -2356,7 +2366,7 @@ void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) { float radius = GetSpellInfo()->Effects[effIndex].CalcRadius(caster); - if (!GetUnitOwner()->HasUnitState(UNIT_STAT_ISOLATED)) + if (!GetUnitOwner()->HasUnitState(UNIT_STATE_ISOLATED)) { switch (GetSpellInfo()->Effects[effIndex].Effect) { diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 173819a465c..4d87abccda3 100755 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -186,6 +186,9 @@ class Aura bool CanStackWith(Aura const* existingAura) const; // Proc system + // this subsystem is not yet in use - the core of it is functional, but still some research has to be done + // and some dependant problems fixed before it can replace old proc system (for example cooldown handling) + // currently proc system functionality is implemented in Unit::ProcDamageAndSpell bool IsProcOnCooldown() const; void AddProcCooldown(uint32 msec); bool IsUsingCharges() const { return m_isUsingCharges; } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index c8e4c55c7c0..05f672f321b 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1447,7 +1447,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, const uint32 effectMask, bool return SPELL_MISS_EVADE; // assisting case, healing and resurrection - if (unit->HasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (unit->HasUnitState(UNIT_STATE_ATTACK_PLAYER)) { m_caster->SetContestedPvP(); if (m_caster->GetTypeId() == TYPEID_PLAYER) @@ -3214,8 +3214,8 @@ void Spell::cast(bool skipCheck) m_spellState = SPELL_STATE_DELAYED; SetDelayStart(0); - if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) - m_caster->ClearUnitState(UNIT_STAT_CASTING); + if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) + m_caster->ClearUnitState(UNIT_STATE_CASTING); } else { @@ -3581,8 +3581,8 @@ void Spell::finish(bool ok) if (m_spellInfo->IsChanneled()) m_caster->UpdateInterruptMask(); - if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) - m_caster->ClearUnitState(UNIT_STAT_CASTING); + if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) + m_caster->ClearUnitState(UNIT_STATE_CASTING); // Unsummon summon as possessed creatures on spell cancel if (m_spellInfo->IsChanneled() && m_caster->GetTypeId() == TYPEID_PLAYER) @@ -5000,7 +5000,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (strict && m_caster->IsScriptOverriden(m_spellInfo, 6953)) m_caster->RemoveMovementImpairingAuras(); } - if (m_caster->HasUnitState(UNIT_STAT_ROOT)) + if (m_caster->HasUnitState(UNIT_STATE_ROOT)) return SPELL_FAILED_ROOTED; break; } @@ -5228,7 +5228,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; Unit* target = m_targets.GetUnitTarget(); - if (m_caster == target && m_caster->HasUnitState(UNIT_STAT_ROOT)) + if (m_caster == target && m_caster->HasUnitState(UNIT_STATE_ROOT)) { if (m_caster->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_ROOTED; @@ -5401,6 +5401,9 @@ SpellCastResult Spell::CheckCast(bool strict) } case SPELL_AURA_PERIODIC_MANA_LEECH: { + if (m_spellInfo->Effects[i].IsTargetingArea()) + break; + if (!m_targets.GetUnitTarget()) return SPELL_FAILED_BAD_IMPLICIT_TARGETS; @@ -5452,7 +5455,7 @@ SpellCastResult Spell::CheckCast(bool strict) SpellCastResult Spell::CheckPetCast(Unit* target) { - if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS)) //prevent spellcast interruption by another spellcast + if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS)) //prevent spellcast interruption by another spellcast return SPELL_FAILED_SPELL_IN_PROGRESS; // dead owner (pets still alive when owners ressed?) @@ -6627,7 +6630,7 @@ void Spell::HandleLaunchPhase() continue; // do not consume ammo anymore for Hunter's volley spell - if (IsTriggered() && m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellInfo->IsAOE()) + if (IsTriggered() && m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellInfo->IsTargetingArea()) usesAmmo = false; if (usesAmmo) @@ -6678,7 +6681,7 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier) if (m_damage > 0) { - if (m_spellInfo->Effects[i].IsArea()) + if (m_spellInfo->Effects[i].IsTargetingArea()) { m_damage = int32(float(m_damage) * unit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask)); if (m_caster->GetTypeId() == TYPEID_UNIT) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 2699652cfe6..0dd8eb64654 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1338,7 +1338,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } //Any effect which causes you to lose control of your character will supress the starfall effect. - if (m_caster->HasUnitState(UNIT_STAT_CONTROLLED)) + if (m_caster->HasUnitState(UNIT_STATE_CONTROLLED)) return; m_caster->CastSpell(unitTarget, damage, true); @@ -2750,7 +2750,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype) { case GAMEOBJECT_TYPE_DOOR: case GAMEOBJECT_TYPE_BUTTON: - gameObjTarget->UseDoorOrButton(); + gameObjTarget->UseDoorOrButton(0, false, player); player->GetMap()->ScriptsStart(sGameObjectScripts, gameObjTarget->GetDBTableGUIDLow(), player, gameObjTarget); return; @@ -3093,7 +3093,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) summon->SelectLevel(summon->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureInfo()->npcflag); - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); + summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); summon->AI()->EnterEvadeMode(); break; @@ -3360,11 +3360,11 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/) return; // target must be OK to do this - if (unitTarget->HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING)) + if (unitTarget->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING)) return; unitTarget->SetFacingTo(unitTarget->GetAngle(m_targets.GetDst())); - unitTarget->ClearUnitState(UNIT_STAT_MOVING); + unitTarget->ClearUnitState(UNIT_STATE_MOVING); if (unitTarget->GetTypeId() == TYPEID_UNIT) unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS); @@ -5607,6 +5607,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex) duel->opponent = target; duel->startTime = 0; duel->startTimer = 0; + duel->isMounted = (GetSpellInfo()->Id == 62875); // Mounted Duel caster->duel = duel; DuelInfo* duel2 = new DuelInfo; @@ -5614,6 +5615,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex) duel2->opponent = caster; duel2->startTime = 0; duel2->startTimer = 0; + duel2->isMounted = (GetSpellInfo()->Id == 62875); // Mounted Duel target->duel = duel2; caster->SetUInt64Value(PLAYER_DUEL_ARBITER, pGameObj->GetGUID()); @@ -6424,7 +6426,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); pet->setDeathState(ALIVE); - pet->ClearUnitState(uint32(UNIT_STAT_ALL_STATE)); + pet->ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); pet->SetHealth(pet->CountPctFromMaxHealth(damage)); //pet->AIM_Initialize(); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index fb8018fb5ae..ad465767ab0 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -503,7 +503,7 @@ bool SpellEffectInfo::IsAura(AuraType aura) const return IsAura() && ApplyAuraName == aura; } -bool SpellEffectInfo::IsArea() const +bool SpellEffectInfo::IsTargetingArea() const { return TargetA.IsArea() || TargetB.IsArea(); } @@ -1061,10 +1061,19 @@ bool SpellInfo::IsAbilityOfSkillType(uint32 skillType) const return false; } -bool SpellInfo::IsAOE() const +bool SpellInfo::IsAffectingArea() const { for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (Effects[i].IsEffect() && Effects[i].IsArea()) + if (Effects[i].IsEffect() && (Effects[i].IsTargetingArea() || Effects[i].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA) || Effects[i].IsAreaAuraEffect())) + return true; + return false; +} + +// checks if spell targets are selected from area, doesn't include spell effects in check (like area wide auras for example) +bool SpellInfo::IsTargetingArea() const +{ + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (Effects[i].IsEffect() && Effects[i].IsTargetingArea()) return true; return false; } @@ -1604,7 +1613,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b } // not allow casting on flying player - if (target->HasUnitState(UNIT_STAT_IN_FLIGHT)) + if (target->HasUnitState(UNIT_STATE_IN_FLIGHT)) return SPELL_FAILED_BAD_TARGETS; if (TargetAuraState && !target->HasAuraState(AuraStateType(TargetAuraState), this, caster)) diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 90b79d4da28..65be5981c64 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -279,7 +279,7 @@ public: bool IsEffect(SpellEffects effectName) const; bool IsAura() const; bool IsAura(AuraType aura) const; - bool IsArea() const; + bool IsTargetingArea() const; bool IsAreaAuraEffect() const; bool IsFarUnitTargetEffect() const; bool IsFarDestTargetEffect() const; @@ -403,7 +403,8 @@ public: bool IsAbilityLearnedWithProfession() const; bool IsAbilityOfSkillType(uint32 skillType) const; - bool IsAOE() const; + bool IsAffectingArea() const; + bool IsTargetingArea() const; bool NeedsExplicitUnitTarget() const; bool NeedsToBeTriggeredByCaster() const; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index f3d5697c672..171382ba4f7 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2889,6 +2889,22 @@ void SpellMgr::LoadSpellCustomAttr() case 69293: // Wing Buffet case 74439: // Machine Gun case 63278: // Mark of the Faceless (General Vezax) + case 62544: // Thrust (Argent Tournament) + case 64588: // Thrust (Argent Tournament) + case 66479: // Thrust (Argent Tournament) + case 68505: // Thrust (Argent Tournament) + case 62626: // Break-Shield (Argent Tournament, Player) + case 64590: // Break-Shield (Argent Tournament, Player) + case 64342: // Break-Shield (Argent Tournament, NPC) + case 64686: // Break-Shield (Argent Tournament, NPC) + case 65147: // Break-Shield (Argent Tournament, NPC) + case 68504: // Break-Shield (Argent Tournament, NPC) + case 62874: // Charge (Argent Tournament, Player) + case 68498: // Charge (Argent Tournament, Player) + case 64591: // Charge (Argent Tournament, Player) + case 63003: // Charge (Argent Tournament, NPC) + case 63010: // Charge (Argent Tournament, NPC) + case 68321: // Charge (Argent Tournament, NPC) case 72255: // Mark of the Fallen Champion (Deathbringer Saurfang) case 72444: // Mark of the Fallen Champion (Deathbringer Saurfang) case 72445: // Mark of the Fallen Champion (Deathbringer Saurfang) @@ -2972,6 +2988,7 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ENEMY; spellInfo->EffectImplicitTargetB[0] = 0; break; + case 63665: // Charge (Argent Tournament emote on riders) case 31447: // Mark of Kaz'rogal (needs target selection script) case 31298: // Sleep (needs target selection script) case 51904: // Summon Ghouls On Scarlet Crusade (this should use conditions table, script for this spell needs to be fixed) diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index d34b1b8c3c3..56e63af5bbf 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -61,12 +61,10 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/shared/Database ${CMAKE_SOURCE_DIR}/src/server/shared/DataStores ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging - ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic ${CMAKE_SOURCE_DIR}/src/server/shared/Logging ${CMAKE_SOURCE_DIR}/src/server/shared/Packets - ${CMAKE_SOURCE_DIR}/src/server/shared/Policies ${CMAKE_SOURCE_DIR}/src/server/shared/Threading ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities ${CMAKE_SOURCE_DIR}/src/server/collision @@ -112,6 +110,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Notifiers ${CMAKE_SOURCE_DIR}/src/server/game/Groups ${CMAKE_SOURCE_DIR}/src/server/game/Guilds + ${CMAKE_SOURCE_DIR}/src/server/game/Handlers ${CMAKE_SOURCE_DIR}/src/server/game/Instances ${CMAKE_SOURCE_DIR}/src/server/game/LookingForGroup ${CMAKE_SOURCE_DIR}/src/server/game/Loot @@ -130,7 +129,6 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Scripting ${CMAKE_SOURCE_DIR}/src/server/game/Server ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol - ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol/Handlers ${CMAKE_SOURCE_DIR}/src/server/game/Skills ${CMAKE_SOURCE_DIR}/src/server/game/Spells ${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index b69f800327e..9b9d1cfd146 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -26,6 +26,7 @@ EndScriptData */ #include "ObjectMgr.h" #include "Chat.h" #include "AccountMgr.h" +#include "World.h" class gm_commandscript : public CommandScript { @@ -155,7 +156,7 @@ public: static bool HandleGMListFullCommand(ChatHandler* handler, char const* /*args*/) { ///- Get the accounts with GM Level >0 - QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u", SEC_MODERATOR); + QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u AND (aa.realmid = -1 OR aa.realmid = %u)", SEC_MODERATOR, realmID); if (result) { handler->SendSysMessage(LANG_GMLIST); diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 2fb6c3f0d10..74b8272201b 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -97,7 +97,7 @@ public: // Activate object->SetLootState(GO_READY); - object->UseDoorOrButton(10000); + object->UseDoorOrButton(10000, false, handler->GetSession()->GetPlayer()); handler->PSendSysMessage("Object activated!"); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 1b6a6c6fdcf..57932ef56c6 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -130,7 +130,7 @@ public: { uint32 tguid = chr->GetTransport()->AddNPCPassenger(0, id, chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO()); if (tguid > 0) - WorldDatabase.PQuery("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO()); + WorldDatabase.PExecute("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO()); return true; } @@ -679,7 +679,7 @@ public: if (target->GetTransport()) if (target->GetGUIDTransport()) - WorldDatabase.PQuery("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport()); + WorldDatabase.PExecute("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport()); target->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 4d8ce4ef4ed..363f7645f6f 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -404,113 +404,116 @@ public: if (!*args) return false; - uint32 entry = (uint32) atoi((char*)args); - QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry); - if (!result) - { - handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry); - handler->SetSentErrorMessage(true); - return false; - } - - CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry); - if (!cInfo) - { - handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry); - handler->SetSentErrorMessage(true); - return false; - } + Tokens entries(std::string(args), ' '); - sLog->outString("Reloading creature template entry %u", entry); - - Field* fields = result->Fetch(); - - const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->KillCredit[0] = fields[3].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->KillCredit[1] = fields[4].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->Modelid1 = fields[5].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->Modelid2 = fields[6].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->Modelid3 = fields[7].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->Modelid4 = fields[8].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->Name = fields[9].GetString(); - const_cast<CreatureTemplate*>(cInfo)->SubName = fields[10].GetString(); - const_cast<CreatureTemplate*>(cInfo)->IconName = fields[11].GetString(); - const_cast<CreatureTemplate*>(cInfo)->GossipMenuId = fields[12].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->minlevel = fields[13].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->maxlevel = fields[14].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->expansion = fields[15].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->faction_A = fields[16].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->faction_H = fields[17].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->npcflag = fields[18].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->speed_walk = fields[19].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->speed_run = fields[20].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->scale = fields[21].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->rank = fields[22].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->mindmg = fields[23].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->maxdmg = fields[24].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->dmgschool = fields[25].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->attackpower = fields[26].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->dmg_multiplier = fields[27].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->baseattacktime = fields[28].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = fields[29].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->unit_class = fields[30].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->unit_flags = fields[31].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->dynamicflags = fields[32].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->family = fields[33].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->trainer_type = fields[34].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->trainer_spell = fields[35].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->trainer_class = fields[36].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->trainer_race = fields[37].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->minrangedmg = fields[38].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->maxrangedmg = fields[39].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->rangedattackpower = fields[40].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->type = fields[41].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->type_flags = fields[42].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->lootid = fields[43].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->pickpocketLootId = fields[44].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->SkinLootId = fields[45].GetUInt32(); - - for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) + for (Tokens::const_iterator itr = entries.begin(); itr != entries.end(); ++itr) { - const_cast<CreatureTemplate*>(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32(); + uint32 entry = uint32(atoi(*itr)); + QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry); + if (!result) + { + handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry); + continue; + } + + CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry); + if (!cInfo) + { + handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry); + continue; + } + + sLog->outString("Reloading creature template entry %u", entry); + + Field* fields = result->Fetch(); + + const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->KillCredit[0] = fields[3].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->KillCredit[1] = fields[4].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->Modelid1 = fields[5].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->Modelid2 = fields[6].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->Modelid3 = fields[7].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->Modelid4 = fields[8].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->Name = fields[9].GetString(); + const_cast<CreatureTemplate*>(cInfo)->SubName = fields[10].GetString(); + const_cast<CreatureTemplate*>(cInfo)->IconName = fields[11].GetString(); + const_cast<CreatureTemplate*>(cInfo)->GossipMenuId = fields[12].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->minlevel = fields[13].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->maxlevel = fields[14].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->expansion = fields[15].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->faction_A = fields[16].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->faction_H = fields[17].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->npcflag = fields[18].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->speed_walk = fields[19].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->speed_run = fields[20].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->scale = fields[21].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->rank = fields[22].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->mindmg = fields[23].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->maxdmg = fields[24].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->dmgschool = fields[25].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->attackpower = fields[26].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->dmg_multiplier = fields[27].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->baseattacktime = fields[28].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = fields[29].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->unit_class = fields[30].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->unit_flags = fields[31].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->dynamicflags = fields[32].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->family = fields[33].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->trainer_type = fields[34].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->trainer_spell = fields[35].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->trainer_class = fields[36].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->trainer_race = fields[37].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->minrangedmg = fields[38].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->maxrangedmg = fields[39].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->rangedattackpower = fields[40].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->type = fields[41].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->type_flags = fields[42].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->lootid = fields[43].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->pickpocketLootId = fields[44].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->SkinLootId = fields[45].GetUInt32(); + + for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) + { + const_cast<CreatureTemplate*>(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32(); + } + + const_cast<CreatureTemplate*>(cInfo)->spells[0] = fields[52].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[1] = fields[53].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[2] = fields[54].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[3] = fields[55].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[4] = fields[56].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[5] = fields[57].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[6] = fields[58].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[7] = fields[59].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->PetSpellDataId = fields[60].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->VehicleId = fields[61].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->mingold = fields[62].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->maxgold = fields[63].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->AIName = fields[64].GetString(); + const_cast<CreatureTemplate*>(cInfo)->MovementType = fields[65].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->InhabitType = fields[66].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->ModHealth = fields[67].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->ModMana = fields[68].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->ModArmor = fields[69].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->RacialLeader = fields[70].GetBool(); + const_cast<CreatureTemplate*>(cInfo)->questItems[0] = fields[71].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->questItems[1] = fields[72].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->questItems[2] = fields[73].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->questItems[3] = fields[74].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->questItems[4] = fields[75].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->questItems[5] = fields[76].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->movementId = fields[77].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->RegenHealth = fields[78].GetBool(); + const_cast<CreatureTemplate*>(cInfo)->equipmentId = fields[79].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->flags_extra = fields[81].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString()); + + sObjectMgr->CheckCreatureTemplate(cInfo); } - const_cast<CreatureTemplate*>(cInfo)->spells[0] = fields[52].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[1] = fields[53].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[2] = fields[54].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[3] = fields[55].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[4] = fields[56].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[5] = fields[57].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[6] = fields[58].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[7] = fields[59].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->PetSpellDataId = fields[60].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->VehicleId = fields[61].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->mingold = fields[62].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->maxgold = fields[63].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->AIName = fields[64].GetString(); - const_cast<CreatureTemplate*>(cInfo)->MovementType = fields[65].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->InhabitType = fields[66].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->ModHealth = fields[67].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->ModMana = fields[68].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->ModArmor = fields[69].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->RacialLeader = fields[70].GetBool(); - const_cast<CreatureTemplate*>(cInfo)->questItems[0] = fields[71].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->questItems[1] = fields[72].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->questItems[2] = fields[73].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->questItems[3] = fields[74].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->questItems[4] = fields[75].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->questItems[5] = fields[76].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->movementId = fields[77].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->RegenHealth = fields[78].GetBool(); - const_cast<CreatureTemplate*>(cInfo)->equipmentId = fields[79].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->flags_extra = fields[81].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString()); - - sObjectMgr->CheckCreatureTemplate(cInfo); - handler->SendGlobalGMSysMessage("Creature template reloaded."); return true; } @@ -989,7 +992,7 @@ public: return true; } - static bool HandleReloadWpCommand(ChatHandler* handler, const char* args) + static bool HandleReloadWpCommand(ChatHandler* /*handler*/, const char* args) { if (*args != 'a') sLog->outString("Re-Loading Waypoints data from 'waypoints_data'"); diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp index 6b474166e7f..3c8d5fc4fa8 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp @@ -117,7 +117,7 @@ public: player->CLOSE_GOSSIP_MENU(); //start event here creature->setFaction(FACTION_HOSTILE); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); creature->AI()->AttackStart(player); InstanceScript* instance = creature->GetInstanceScript(); if (instance) @@ -165,7 +165,7 @@ public: me->setFaction(FACTION_FRIEND); // was set before event start, so set again - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); if (instance) { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp index f87d87d976c..2ef3ef48ecb 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp @@ -375,7 +375,7 @@ public: if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter])) { boss->setFaction(FACTION_HOSTILE); - boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); if (Unit* target = boss->SelectNearestTarget(500)) boss->AI()->AttackStart(target); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp index 442fd025423..ff17e989cd9 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp @@ -76,7 +76,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index 0edcdfece15..0d8cabcf89c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -105,7 +105,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp index 3a7461f90c4..a944ee6daf8 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp @@ -82,7 +82,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp index 6f5b9079268..bc9de52d91d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp @@ -85,7 +85,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp index cac07469d68..973ffe7e53b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp @@ -77,7 +77,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp index 0975b171f4d..b7492998d56 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp @@ -101,7 +101,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 96cc6e75e4e..d76d0d7f47c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -74,7 +74,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp index 470d41208dc..4fb7e513f5d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp @@ -72,7 +72,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp index 70b2a415a24..ce19a03571a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -73,7 +73,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp index 20eefd5a0bc..f93466cbece 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp @@ -74,7 +74,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp index 77152277742..88a09d57138 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp @@ -73,7 +73,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp index 9f06c2fbd5d..2dc05799e51 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -82,7 +82,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp index a2e41f1af70..7a4ba5777d1 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -24,14 +24,19 @@ SDCategory: Blackwing Lair EndScriptData */ #include "ScriptPCH.h" +enum Say +{ + SAY_AGGRO = -1469000, + SAY_LEASH = -1469001 +}; -#define SAY_AGGRO -1469000 -#define SAY_LEASH -1469001 - -#define SPELL_CLEAVE 26350 -#define SPELL_BLASTWAVE 23331 -#define SPELL_MORTALSTRIKE 24573 -#define SPELL_KNOCKBACK 25778 +enum Spells +{ + SPELL_CLEAVE = 26350, + SPELL_BLASTWAVE = 23331, + SPELL_MORTALSTRIKE = 24573, + SPELL_KNOCKBACK = 25778 +}; class boss_broodlord : public CreatureScript { @@ -45,7 +50,7 @@ public: struct boss_broodlordAI : public ScriptedAI { - boss_broodlordAI(Creature* c) : ScriptedAI(c) {} + boss_broodlordAI(Creature* creature) : ScriptedAI(creature) {} uint32 Cleave_Timer; uint32 BlastWave_Timer; @@ -54,10 +59,10 @@ public: void Reset() { - Cleave_Timer = 8000; //These times are probably wrong - BlastWave_Timer = 12000; - MortalStrike_Timer = 20000; - KnockBack_Timer = 30000; + Cleave_Timer = 8000; // These times are probably wrong + BlastWave_Timer = 12000; + MortalStrike_Timer = 20000; + KnockBack_Timer = 30000; } void EnterCombat(Unit* /*who*/) @@ -108,7 +113,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_broodlord() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp index 50bda73cfc6..818dcace078 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -71,7 +71,7 @@ public: struct boss_chromaggusAI : public ScriptedAI { - boss_chromaggusAI(Creature* c) : ScriptedAI(c) + boss_chromaggusAI(Creature* creature) : ScriptedAI(creature) { //Select the 2 breaths that we are going to use until despawned //5 possiblities for the first breath, 4 for the second, 20 total possiblites @@ -197,9 +197,7 @@ public: Enraged = false; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) { @@ -297,7 +295,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_chromaggus() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp index 09dd0138db8..c91e0fb3303 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp @@ -42,7 +42,7 @@ public: struct boss_ebonrocAI : public ScriptedAI { - boss_ebonrocAI(Creature* c) : ScriptedAI(c) {} + boss_ebonrocAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowFlame_Timer; uint32 WingBuffet_Timer; @@ -100,7 +100,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_ebonroc() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp index 133d61422b2..c2a2350c0e8 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp @@ -41,7 +41,7 @@ public: struct boss_firemawAI : public ScriptedAI { - boss_firemawAI(Creature* c) : ScriptedAI(c) {} + boss_firemawAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowFlame_Timer; uint32 WingBuffet_Timer; @@ -91,7 +91,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_firemaw() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp index b71249dc3a3..41bcb6c5427 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp @@ -25,11 +25,17 @@ EndScriptData */ #include "ScriptPCH.h" -#define EMOTE_FRENZY -1469031 +enum Emotes +{ + EMOTE_FRENZY = -1469031 +}; -#define SPELL_SHADOWFLAME 22539 -#define SPELL_WINGBUFFET 23339 -#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova +enum Spells +{ + SPELL_SHADOWFLAME = 22539, + SPELL_WINGBUFFET = 23339, + SPELL_FRENZY = 23342 //This spell periodically triggers fire nova +}; class boss_flamegor : public CreatureScript { @@ -43,7 +49,7 @@ public: struct boss_flamegorAI : public ScriptedAI { - boss_flamegorAI(Creature* c) : ScriptedAI(c) {} + boss_flamegorAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowFlame_Timer; uint32 WingBuffet_Timer; @@ -94,7 +100,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_flamegor() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index 506189697fe..c4e0d6ea715 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -25,40 +25,46 @@ EndScriptData */ #include "ScriptPCH.h" -#define SAY_AGGRO -1469007 -#define SAY_XHEALTH -1469008 -#define SAY_SHADOWFLAME -1469009 -#define SAY_RAISE_SKELETONS -1469010 -#define SAY_SLAY -1469011 -#define SAY_DEATH -1469012 - -#define SAY_MAGE -1469013 -#define SAY_WARRIOR -1469014 -#define SAY_DRUID -1469015 -#define SAY_PRIEST -1469016 -#define SAY_PALADIN -1469017 -#define SAY_SHAMAN -1469018 -#define SAY_WARLOCK -1469019 -#define SAY_HUNTER -1469020 -#define SAY_ROGUE -1469021 - -#define SPELL_SHADOWFLAME_INITIAL 22972 -#define SPELL_SHADOWFLAME 22539 -#define SPELL_BELLOWINGROAR 22686 -#define SPELL_VEILOFSHADOW 7068 -#define SPELL_CLEAVE 20691 -#define SPELL_TAILLASH 23364 -#define SPELL_BONECONTRUST 23363 //23362, 23361 - -#define SPELL_MAGE 23410 //wild magic -#define SPELL_WARRIOR 23397 //beserk -#define SPELL_DRUID 23398 // cat form -#define SPELL_PRIEST 23401 // corrupted healing -#define SPELL_PALADIN 23418 //syphon blessing -#define SPELL_SHAMAN 23425 //totems -#define SPELL_WARLOCK 23427 //infernals -#define SPELL_HUNTER 23436 //bow broke -#define SPELL_ROGUE 23414 //Paralise +enum Say +{ + SAY_AGGRO = -1469007, + SAY_XHEALTH = -1469008, + SAY_SHADOWFLAME = -1469009, + SAY_RAISE_SKELETONS = -1469010, + SAY_SLAY = -1469011, + SAY_DEATH = -1469012, + + SAY_MAGE = -1469013, + SAY_WARRIOR = -1469014, + SAY_DRUID = -1469015, + SAY_PRIEST = -1469016, + SAY_PALADIN = -1469017, + SAY_SHAMAN = -1469018, + SAY_WARLOCK = -1469019, + SAY_HUNTER = -1469020, + SAY_ROGUE = -1469021 +}; + +enum Spells +{ + SPELL_SHADOWFLAME_INITIAL = 22972, + SPELL_SHADOWFLAME = 22539, + SPELL_BELLOWINGROAR = 22686, + SPELL_VEILOFSHADOW = 7068, + SPELL_CLEAVE = 20691, + SPELL_TAILLASH = 23364, + SPELL_BONECONTRUST = 23363, //23362, 23361 + + SPELL_MAGE = 23410, //wild magic + SPELL_WARRIOR = 23397, //beserk + SPELL_DRUID = 23398, // cat form + SPELL_PRIEST = 23401, // corrupted healing + SPELL_PALADIN = 23418, //syphon blessing + SPELL_SHAMAN = 23425, //totems + SPELL_WARLOCK = 23427, //infernals + SPELL_HUNTER = 23436, //bow broke + SPELL_ROGUE = 23414 //Paralise +}; class boss_nefarian : public CreatureScript { @@ -72,7 +78,7 @@ public: struct boss_nefarianAI : public ScriptedAI { - boss_nefarianAI(Creature* c) : ScriptedAI(c) {} + boss_nefarianAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowFlame_Timer; uint32 BellowingRoar_Timer; @@ -86,15 +92,15 @@ public: void Reset() { - ShadowFlame_Timer = 12000; //These times are probably wrong - BellowingRoar_Timer = 30000; - VeilOfShadow_Timer = 15000; - Cleave_Timer = 7000; - TailLash_Timer = 10000; - ClassCall_Timer = 35000; //35-40 seconds + ShadowFlame_Timer = 12000; // These times are probably wrong + BellowingRoar_Timer = 30000; + VeilOfShadow_Timer = 15000; + Cleave_Timer = 7000; + TailLash_Timer = 10000; + ClassCall_Timer = 35000; // 35-40 seconds Phase3 = false; - DespawnTimer = 5000; + DespawnTimer = 5000; } void KilledUnit(Unit* Victim) @@ -227,7 +233,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_nefarian() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp index b643139a71e..a4fb4ad22a3 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -27,15 +27,21 @@ EndScriptData */ //Razorgore Phase 2 Script -#define SAY_EGGS_BROKEN1 -1469022 -#define SAY_EGGS_BROKEN2 -1469023 -#define SAY_EGGS_BROKEN3 -1469024 -#define SAY_DEATH -1469025 +enum Say +{ + SAY_EGGS_BROKEN1 = -1469022, + SAY_EGGS_BROKEN2 = -1469023, + SAY_EGGS_BROKEN3 = -1469024, + SAY_DEATH = -1469025 +}; -#define SPELL_CLEAVE 22540 -#define SPELL_WARSTOMP 24375 -#define SPELL_FIREBALLVOLLEY 22425 -#define SPELL_CONFLAGRATION 23023 +enum Spells +{ + SPELL_CLEAVE = 22540, + SPELL_WARSTOMP = 24375, + SPELL_FIREBALLVOLLEY = 22425, + SPELL_CONFLAGRATION = 23023 +}; class boss_razorgore : public CreatureScript { @@ -49,7 +55,7 @@ public: struct boss_razorgoreAI : public ScriptedAI { - boss_razorgoreAI(Creature* c) : ScriptedAI(c) {} + boss_razorgoreAI(Creature* creature) : ScriptedAI(creature) {} uint32 Cleave_Timer; uint32 WarStomp_Timer; @@ -120,7 +126,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_razorgore() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index 4961d253a26..4a72bd0ca38 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -25,40 +25,46 @@ EndScriptData */ #include "ScriptPCH.h" -#define SAY_LINE1 -1469026 -#define SAY_LINE2 -1469027 -#define SAY_LINE3 -1469028 -#define SAY_HALFLIFE -1469029 -#define SAY_KILLTARGET -1469030 +enum Says +{ + SAY_LINE1 = -1469026, + SAY_LINE2 = -1469027, + SAY_LINE3 = -1469028, + SAY_HALFLIFE = -1469029, + SAY_KILLTARGET = -1469030 +}; #define GOSSIP_ITEM "Start Event <Needs Gossip Text>" -#define SPELL_ESSENCEOFTHERED 23513 -#define SPELL_FLAMEBREATH 23461 -#define SPELL_FIRENOVA 23462 -#define SPELL_TAILSWIPE 15847 -#define SPELL_BURNINGADRENALINE 23620 -#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect +enum Spells +{ + SPELL_ESSENCEOFTHERED = 23513, + SPELL_FLAMEBREATH = 23461, + SPELL_FIRENOVA = 23462, + SPELL_TAILSWIPE = 15847, + SPELL_BURNINGADRENALINE = 23620, + SPELL_CLEAVE = 20684 //Chain cleave is most likely named something different and contains a dummy effect +}; class boss_vaelastrasz : public CreatureScript { public: boss_vaelastrasz() : CreatureScript("boss_vaelastrasz") { } - void SendDefaultMenu(Player* player, Creature* creature, uint32 uiAction) + void SendDefaultMenu(Player* player, Creature* creature, uint32 Action) { - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + if (Action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time { player->CLOSE_GOSSIP_MENU(); CAST_AI(boss_vaelastrasz::boss_vaelAI, creature->AI())->BeginSpeech(player); } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Action) { player->PlayerTalkClass->ClearMenus(); - if (uiSender == GOSSIP_SENDER_MAIN) - SendDefaultMenu(player, creature, uiAction); + if (Sender == GOSSIP_SENDER_MAIN) + SendDefaultMenu(player, creature, Action); return true; } @@ -81,11 +87,11 @@ public: struct boss_vaelAI : public ScriptedAI { - boss_vaelAI(Creature* c) : ScriptedAI(c) + boss_vaelAI(Creature* creature) : ScriptedAI(creature) { - c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - c->setFaction(35); - c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + creature->setFaction(35); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } uint64 PlayerGUID; @@ -102,17 +108,17 @@ public: void Reset() { - PlayerGUID = 0; - SpeechTimer = 0; - SpeechNum = 0; - Cleave_Timer = 8000; //These times are probably wrong - FlameBreath_Timer = 11000; - BurningAdrenalineCaster_Timer = 15000; - BurningAdrenalineTank_Timer = 45000; - FireNova_Timer = 5000; - TailSwipe_Timer = 20000; - HasYelled = false; - DoingSpeech = false; + PlayerGUID = 0; + SpeechTimer = 0; + SpeechNum = 0; + Cleave_Timer = 8000; //These times are probably wrong + FlameBreath_Timer = 11000; + BurningAdrenalineCaster_Timer = 15000; + BurningAdrenalineTank_Timer = 45000; + FireNova_Timer = 5000; + TailSwipe_Timer = 20000; + HasYelled = false; + DoingSpeech = false; } void BeginSpeech(Unit* target) @@ -213,7 +219,7 @@ public: Unit* target = NULL; uint8 i = 0; - while (i < 3) // max 3 tries to get a random target with power_mana + while (i < 3) // max 3 tries to get a random target with power_mana { ++i; target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader @@ -258,7 +264,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_vael() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index 89b34aada66..2c7cd73c604 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -25,40 +25,49 @@ EndScriptData */ #include "ScriptPCH.h" -#define SAY_GAMESBEGIN_1 -1469004 -#define SAY_GAMESBEGIN_2 -1469005 -#define SAY_VAEL_INTRO -1469006 //when he corrupts Vaelastrasz +enum Says +{ + SAY_GAMESBEGIN_1 = -1469004, + SAY_GAMESBEGIN_2 = -1469005, + SAY_VAEL_INTRO = -1469006 //when he corrupts Vaelastrasz +}; #define GOSSIP_ITEM_1 "I've made no mistakes." #define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles." #define GOSSIP_ITEM_3 "Please do." -#define CREATURE_BRONZE_DRAKANOID 14263 -#define CREATURE_BLUE_DRAKANOID 14261 -#define CREATURE_RED_DRAKANOID 14264 -#define CREATURE_GREEN_DRAKANOID 14262 -#define CREATURE_BLACK_DRAKANOID 14265 - -#define CREATURE_CHROMATIC_DRAKANOID 14302 -#define CREATURE_NEFARIAN 11583 +enum Creatures +{ + CREATURE_BRONZE_DRAKANOID = 14263, + CREATURE_BLUE_DRAKANOID = 14261, + CREATURE_RED_DRAKANOID = 14264, + CREATURE_GREEN_DRAKANOID = 14262, + CREATURE_BLACK_DRAKANOID = 14265, + + CREATURE_CHROMATIC_DRAKANOID = 14302, + CREATURE_NEFARIAN = 11583 +}; -#define ADD_X1 -7591.151855f -#define ADD_X2 -7514.598633f -#define ADD_Y1 -1204.051880f -#define ADD_Y2 -1150.448853f -#define ADD_Z1 476.800476f -#define ADD_Z2 476.796570f +#define ADD_X1 -7591.151855f +#define ADD_X2 -7514.598633f +#define ADD_Y1 -1204.051880f +#define ADD_Y2 -1150.448853f +#define ADD_Z1 476.800476f +#define ADD_Z2 476.796570f -#define NEF_X -7445 -#define NEF_Y -1332 -#define NEF_Z 536 +#define NEF_X -7445 +#define NEF_Y -1332 +#define NEF_Z 536 -#define HIDE_X -7592 -#define HIDE_Y -1264 -#define HIDE_Z 481 +#define HIDE_X -7592 +#define HIDE_Y -1264 +#define HIDE_Z 481 -#define SPELL_SHADOWBOLT 21077 -#define SPELL_FEAR 26070 +enum Spells +{ + SPELL_SHADOWBOLT = 21077, + SPELL_FEAR = 26070 +}; //This script is complicated //Instead of morphing Victor Nefarius we will have him control phase 1 @@ -74,10 +83,10 @@ class boss_victor_nefarius : public CreatureScript public: boss_victor_nefarius() : CreatureScript("boss_victor_nefarius") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 Action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (Action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -110,7 +119,7 @@ public: struct boss_victor_nefariusAI : public ScriptedAI { - boss_victor_nefariusAI(Creature* c) : ScriptedAI(c) + boss_victor_nefariusAI(Creature* creature) : ScriptedAI(creature) { NefarianGUID = 0; switch (urand(0, 19)) @@ -211,13 +220,13 @@ public: void Reset() { - SpawnedAdds = 0; - AddSpawnTimer = 10000; - ShadowBoltTimer = 5000; - FearTimer = 8000; - ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier - NefarianGUID = 0; - NefCheckTime = 2000; + SpawnedAdds = 0; + AddSpawnTimer = 10000; + ShadowBoltTimer = 5000; + FearTimer = 8000; + ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier + NefarianGUID = 0; + NefCheckTime = 2000; me->SetUInt32Value(UNIT_NPC_FLAGS, 1); me->setFaction(35); @@ -342,7 +351,7 @@ public: //Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues) DoTeleportTo(HIDE_X, HIDE_Y, HIDE_Z); - me->AddUnitState(UNIT_STAT_FLEEING); + me->AddUnitState(UNIT_STATE_FLEEING); //Spawn nef and have him attack a random target Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN, NEF_X, NEF_Y, NEF_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); @@ -378,7 +387,6 @@ public: } } }; - }; void AddSC_boss_victor_nefarius() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp index 54c0855512f..8a9b930aa09 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp @@ -24,4 +24,3 @@ SDCategory: Blackwing Lair EndScriptData */ #include "ScriptPCH.h" - diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index ecb909480c5..728446aa833 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -186,7 +186,7 @@ public: void MovementInform(uint32 type, uint32 id) { if (type != POINT_MOTION_TYPE) - return; + return; if (Intro) { diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index a6d7248cc26..14add92fd16 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -393,7 +393,7 @@ public: EnfeebleResetTimer = 0; } else EnfeebleResetTimer -= diff; - if (me->HasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself + if (me->HasUnitState(UNIT_STATE_STUNNED)) // While shifting to phase 2 malchezaar stuns himself return; if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID()) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index a675c355cfc..b15cb7d3da1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -655,7 +655,7 @@ public: { DoScriptText(RAND(SAY_CRONE_AGGRO, SAY_CRONE_AGGRO2), me); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } void JustDied(Unit* /*killer*/) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp index 3959a01e4ba..f792b861c99 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp @@ -80,7 +80,7 @@ class boss_baron_geddon : public CreatureScript return; } - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp index e1bb48dfbb0..a9d32ebca9a 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp @@ -71,7 +71,7 @@ class boss_garr : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp index 9bbbb086abd..7261bbf1fbd 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp @@ -68,7 +68,7 @@ class boss_gehennas : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp index 1ba143a8c03..84e9957a60c 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -91,7 +91,7 @@ class boss_golemagg : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp index 5395b46fef3..e3e04002112 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp @@ -68,7 +68,7 @@ class boss_lucifron : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp index 5551531379b..65a630a58f7 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp @@ -80,7 +80,7 @@ class boss_magmadar : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp index d324150c22f..862a980394a 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -116,7 +116,7 @@ class boss_majordomo : public CreatureScript return; } - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (HealthBelowPct(50)) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp index 97c89f12b5b..f696ec58e1b 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp @@ -73,7 +73,7 @@ class boss_shazzrah : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp index ccefca70d67..9f511c1394a 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp @@ -84,7 +84,7 @@ class boss_sulfuron : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -169,7 +169,7 @@ class mob_flamewaker_priest : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp index eafe55d3821..801a11fbfc8 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp @@ -30,16 +30,19 @@ EndContentData */ #include "ScriptPCH.h" #include "ScriptedSimpleAI.h" -#define SPELL_CONE_OF_FIRE 19630 -#define SPELL_BITE 19771 +enum Spells +{ + SPELL_CONE_OF_FIRE = 19630, + SPELL_BITE = 19771, -//Random Debuff (each hound has only one of these) -#define SPELL_GROUND_STOMP 19364 -#define SPELL_ANCIENT_DREAD 19365 -#define SPELL_CAUTERIZING_FLAMES 19366 -#define SPELL_WITHERING_HEAT 19367 -#define SPELL_ANCIENT_DESPAIR 19369 -#define SPELL_ANCIENT_HYSTERIA 19372 + //Random Debuff (each hound has only one of these) + SPELL_GROUND_STOMP = 19364, + SPELL_ANCIENT_DREAD = 19365, + SPELL_CAUTERIZING_FLAMES = 19366, + SPELL_WITHERING_HEAT = 19367, + SPELL_ANCIENT_DESPAIR = 19369, + SPELL_ANCIENT_HYSTERIA = 19372 +}; class mob_ancient_core_hound : public CreatureScript { @@ -75,7 +78,6 @@ public: return ai; } - }; void AddSC_molten_core() diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index a7d1c3ad8ba..a2c8a890feb 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -125,7 +125,7 @@ public: phase = PHASE_CHAINED; events.Reset(); me->setFaction(7); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); me->LoadEquipment(0, true); } @@ -230,7 +230,7 @@ public: else { me->setFaction(14); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); phase = PHASE_ATTACKING; if (Player* target = Unit::GetPlayer(*me, playerGUID)) @@ -378,7 +378,7 @@ public: return true; } - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32)); @@ -877,7 +877,7 @@ public: { npc_scarlet_miner_cartAI(Creature* c) : PassiveAI(c), minerGUID(0) { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetDisplayId(me->GetCreatureInfo()->Modelid1); // Modelid2 is a horse. } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 1fb8287e54d..4583a33a196 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -264,7 +264,7 @@ public: m_uiValrothGUID = summoned->GetGUID(); summoned->AddThreat(me, 0.0f); - summoned->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + summoned->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } void SummonAcolyte(uint32 uiAmount) @@ -605,7 +605,7 @@ public: ExecuteSpeech_Counter = 0; PlayerGUID = 0; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } bool MeetQuestCondition(Unit* player) @@ -702,7 +702,7 @@ public: case 9: DoScriptText(SAY_EXEC_TIME_6, me, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; case 11: @@ -730,7 +730,7 @@ public: case 9: DoScriptText(SAY_EXEC_TIME_8, me, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; case 11: @@ -758,7 +758,7 @@ public: case 9: DoScriptText(SAY_EXEC_TIME_3, me, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; case 11: @@ -786,7 +786,7 @@ public: case 9: DoScriptText(SAY_EXEC_TIME_7, me, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; case 11: @@ -814,7 +814,7 @@ public: case 9: DoScriptText(SAY_EXEC_TIME_4, me, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; case 11: @@ -842,7 +842,7 @@ public: case 9: DoScriptText(SAY_EXEC_TIME_9, me, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; case 11: @@ -870,7 +870,7 @@ public: case 9: DoScriptText(SAY_EXEC_TIME_5, me, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; case 11: @@ -898,7 +898,7 @@ public: case 9: DoScriptText(SAY_EXEC_TIME_10, me, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; case 11: @@ -926,7 +926,7 @@ public: case 9: DoScriptText(SAY_EXEC_TIME_1, me, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; case 11: @@ -954,7 +954,7 @@ public: case 9: DoScriptText(SAY_EXEC_TIME_2, me, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; case 11: diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp index b3102f2dde7..e5886cc39d4 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -49,7 +49,7 @@ public: struct boss_arcanist_doanAI : public ScriptedAI { - boss_arcanist_doanAI(Creature* c) : ScriptedAI(c) {} + boss_arcanist_doanAI(Creature* creature) : ScriptedAI(creature) {} uint32 Polymorph_Timer; uint32 AoESilence_Timer; @@ -105,26 +105,28 @@ public: DoCast(target, SPELL_POLYMORPH); Polymorph_Timer = 20000; - } else Polymorph_Timer -= diff; + } + else Polymorph_Timer -= diff; //AoESilence_Timer if (AoESilence_Timer <= diff) { DoCast(me->getVictim(), SPELL_AOESILENCE); AoESilence_Timer = urand(15000, 20000); - } else AoESilence_Timer -= diff; + } + else AoESilence_Timer -= diff; //ArcaneExplosion_Timer if (ArcaneExplosion_Timer <= diff) { DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION); ArcaneExplosion_Timer = 8000; - } else ArcaneExplosion_Timer -= diff; + } + else ArcaneExplosion_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_arcanist_doan() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp index 36beecb2029..30105cc7315 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp @@ -25,9 +25,12 @@ EndScriptData */ #include "ScriptPCH.h" -#define SPELL_CALLOFTHEGRAVE 17831 -#define SPELL_TERRIFY 7399 -#define SPELL_SOULSIPHON 7290 +enum Spells +{ + SPELL_CALLOFTHEGRAVE = 17831, + SPELL_TERRIFY = 7399, + SPELL_SOULSIPHON = 7290 +}; class boss_azshir_the_sleepless : public CreatureScript { @@ -41,7 +44,7 @@ public: struct boss_azshir_the_sleeplessAI : public ScriptedAI { - boss_azshir_the_sleeplessAI(Creature* c) : ScriptedAI(c) {} + boss_azshir_the_sleeplessAI(Creature* creature) : ScriptedAI(creature) {} uint32 SoulSiphon_Timer; uint32 CallOftheGrave_Timer; @@ -54,9 +57,7 @@ public: Terrify_Timer = 20000; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) { @@ -73,7 +74,8 @@ public: return; //SoulSiphon_Timer = 20000; - } else SoulSiphon_Timer -= diff; + } + else SoulSiphon_Timer -= diff; } //CallOfTheGrave_Timer @@ -81,19 +83,20 @@ public: { DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE); CallOftheGrave_Timer = 30000; - } else CallOftheGrave_Timer -= diff; + } + else CallOftheGrave_Timer -= diff; //Terrify_Timer if (Terrify_Timer <= diff) { DoCast(me->getVictim(), SPELL_TERRIFY); Terrify_Timer = 20000; - } else Terrify_Timer -= diff; + } + else Terrify_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_azshir_the_sleepless() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp index 794a686a550..466f940621d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -49,7 +49,7 @@ public: struct boss_bloodmage_thalnosAI : public ScriptedAI { - boss_bloodmage_thalnosAI(Creature* c) : ScriptedAI(c) {} + boss_bloodmage_thalnosAI(Creature* creature) : ScriptedAI(creature) {} bool HpYell; uint32 FlameShock_Timer; @@ -93,33 +93,36 @@ public: { DoCast(me->getVictim(), SPELL_FLAMESHOCK); FlameShock_Timer = urand(10000, 15000); - } else FlameShock_Timer -= diff; + } + else FlameShock_Timer -= diff; //FlameSpike_Timer if (FlameSpike_Timer <= diff) { DoCast(me->getVictim(), SPELL_FLAMESPIKE); FlameSpike_Timer = 30000; - } else FlameSpike_Timer -= diff; + } + else FlameSpike_Timer -= diff; //FireNova_Timer if (FireNova_Timer <= diff) { DoCast(me->getVictim(), SPELL_FIRENOVA); FireNova_Timer = 40000; - } else FireNova_Timer -= diff; + } + else FireNova_Timer -= diff; //ShadowBolt_Timer if (ShadowBolt_Timer <= diff) { DoCast(me->getVictim(), SPELL_SHADOWBOLT); ShadowBolt_Timer = 2000; - } else ShadowBolt_Timer -= diff; + } + else ShadowBolt_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_bloodmage_thalnos() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 14b21504be5..77099f2e2d7 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -28,59 +28,66 @@ EndScriptData */ #include "scarlet_monastery.h" //this texts are already used by 3975 and 3976 -#define SAY_ENTRANCE -1189001 -#define SAY_REJOINED -1189002 -#define SAY_LOST_HEAD -1189003 -#define SAY_CONFLAGRATION -1189004 -#define SAY_SPROUTING_PUMPKINS -1189005 -#define SAY_PLAYER_DEATH -1189006 -#define SAY_DEATH -1189007 +enum Says +{ + SAY_ENTRANCE = -1189001, + SAY_REJOINED = -1189002, + SAY_LOST_HEAD = -1189003, + SAY_CONFLAGRATION = -1189004, + SAY_SPROUTING_PUMPKINS = -1189005, + SAY_PLAYER_DEATH = -1189006, + SAY_DEATH = -1189007 +}; uint32 RandomLaugh[] = {11965, 11975, 11976}; - // Entryes -#define HH_MOUNTED 23682 -#define HH_UNHORSED 23800 -#define HEAD 23775 -#define PULSING_PUMPKIN 23694 -#define PUMPKIN_FIEND 23545 -#define HELPER 23686 -#define WISP_INVIS 24034 - - //Spells -#define SPELL_CLEAVE 42587 -#define SPELL_CONFLAGRATION 42380 //Phase 2, can't find real spell(Dim Fire?) -//#define SPELL_CONFL_SPEED 22587 //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell? -#define SPELL_SUMMON_PUMPKIN 42394 - -#define SPELL_WHIRLWIND 43116 -#define SPELL_IMMUNE 42556 -#define SPELL_BODY_REGEN 42403 -#define SPELL_CONFUSE 43105 - -#define SPELL_FLYING_HEAD 42399 //visual flying head -#define SPELL_HEAD 42413 //visual buff, "head" -#define SPELL_HEAD_IS_DEAD 42428 //at killing head, Phase 3 - -#define SPELL_PUMPKIN_AURA 42280 -#define SPELL_PUMPKIN_AURA_GREEN 42294 -#define SPELL_SQUASH_SOUL 42514 -#define SPELL_SPROUTING 42281 -#define SPELL_SPROUT_BODY 42285 +enum Entry +{ + HH_MOUNTED = 23682, + HH_DISMOUNTED = 23800, // unhorsed?? wtf type of engrish was that? + HEAD = 23775, + PULSING_PUMPKIN = 23694, + PUMPKIN_FIEND = 23545, + HELPER = 23686, + WISP_INVIS = 24034 +}; + +enum Spells +{ + SPELL_CLEAVE = 42587, + SPELL_CONFLAGRATION = 42380, //Phase 2, can't find real spell(Dim Fire?) + // SPELL_CONFL_SPEED = 22587, //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell? + SPELL_SUMMON_PUMPKIN = 42394, + + SPELL_WHIRLWIND = 43116, + SPELL_IMMUNE = 42556, + SPELL_BODY_REGEN = 42403, + SPELL_CONFUSE = 43105, + + SPELL_FLYING_HEAD = 42399, //visual flying head + SPELL_HEAD = 42413, //visual buff, "head" + SPELL_HEAD_IS_DEAD = 42428, //at killing head, Phase 3 + + SPELL_PUMPKIN_AURA = 42280, + SPELL_PUMPKIN_AURA_GREEN = 42294, + SPELL_SQUASH_SOUL = 42514, + SPELL_SPROUTING = 42281, + SPELL_SPROUT_BODY = 42285, //Effects -#define SPELL_RHYME_BIG 42909 -//#define SPELL_RHYME_SMALL 42910 -#define SPELL_HEAD_SPEAKS 43129 -#define SPELL_HEAD_LANDS 42400 -#define SPELL_BODY_FLAME 42074 -#define SPELL_HEAD_FLAME 42971 -//#define SPELL_ENRAGE_VISUAL 42438 // he uses this spell? -#define SPELL_WISP_BLUE 42821 -#define SPELL_WISP_FLIGHT_PORT 42818 -//#define SPELL_WISP_INVIS 42823 -#define SPELL_SMOKE 42355 -#define SPELL_DEATH 42566 //not correct spell + SPELL_RHYME_BIG = 42909, + // SPELL_RHYME_SMALL = 42910, + SPELL_HEAD_SPEAKS = 43129, + SPELL_HEAD_LANDS = 42400, + SPELL_BODY_FLAME = 42074, + SPELL_HEAD_FLAME = 42971, + // SPELL_ENRAGE_VISUAL = 42438, // he uses this spell? + SPELL_WISP_BLUE = 42821, + SPELL_WISP_FLIGHT_PORT = 42818, + // SPELL_WISP_INVIS = 42823, + SPELL_SMOKE = 42355, + SPELL_DEATH = 42566 //not correct spell +}; struct Locations { @@ -114,7 +121,7 @@ static Locations FlightPoint[]= static Locations Spawn[]= { - {1776.27f, 1348.74f, 19.20f}, //spawn point for pumpkin shrine mob + {1776.27f, 1348.74f, 19.20f}, //spawn point for pumpkin shrine mob {1765.28f, 1347.46f, 17.55f} //spawn point for smoke }; @@ -126,7 +133,7 @@ static const char* Text[]= "Now, know demise!" }; -#define EMOTE_LAUGHS "Headless Horseman laughs" +#define EMOTE_LAUGHS "Headless Horseman laughs" // needs assigned to db. class mob_wisp_invis : public CreatureScript { @@ -140,7 +147,7 @@ public: struct mob_wisp_invisAI : public ScriptedAI { - mob_wisp_invisAI(Creature* c) : ScriptedAI(c) + mob_wisp_invisAI(Creature* creature) : ScriptedAI(creature) { Creaturetype = delay = spell = spell2 = 0; } @@ -149,8 +156,8 @@ public: uint32 delay; uint32 spell; uint32 spell2; - void Reset(){} - void EnterCombat(Unit* /*who*/){} + void Reset() {} + void EnterCombat(Unit* /*who*/) {} void SetType(uint32 _type) { switch (Creaturetype = _type) @@ -205,7 +212,6 @@ public: } } }; - }; class mob_head : public CreatureScript @@ -220,7 +226,7 @@ public: struct mob_headAI : public ScriptedAI { - mob_headAI(Creature* c) : ScriptedAI(c) {} + mob_headAI(Creature* creature) : ScriptedAI(creature) {} uint64 bodyGUID; @@ -316,7 +322,8 @@ public: if (!me->getVictim()) return; me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveFleeing(me->getVictim()); - } else wait -= diff; + } + else wait -= diff; if (laugh <= diff) { @@ -327,7 +334,8 @@ public: if (speaker) speaker->CastSpell(speaker, SPELL_HEAD_SPEAKS, false); me->MonsterTextEmote(EMOTE_LAUGHS, 0); - } else laugh -= diff; + } + else laugh -= diff; } else { @@ -339,12 +347,12 @@ public: if (Unit* body = Unit::GetUnit((*me), bodyGUID)) body->Kill(body); me->Kill(me); - } else wait -= diff; + } + else wait -= diff; } } } }; - }; class boss_headless_horseman : public CreatureScript @@ -359,9 +367,9 @@ public: struct boss_headless_horsemanAI : public ScriptedAI { - boss_headless_horsemanAI(Creature* c) : ScriptedAI(c) + boss_headless_horsemanAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -636,7 +644,8 @@ public: break; } ++count; - } else say_timer -= diff; + } + else say_timer -= diff; } else { @@ -657,7 +666,8 @@ public: if (Creature* flame = me->SummonCreature(HELPER, Spawn[0].x, Spawn[0].y, Spawn[0].z, 0, TEMPSUMMON_TIMED_DESPAWN, 17000)) CAST_AI(mob_wisp_invis::mob_wisp_invisAI, flame->AI())->SetType(2); burned = true; - } else burn -= diff; + } + else burn -= diff; break; case 2: if (conflagrate <= diff) @@ -665,7 +675,8 @@ public: if (Unit* player = SelectRandomPlayer(30.0f)) DoCast(player, SPELL_CONFLAGRATION, false); conflagrate = urand(10000, 16000); - } else conflagrate -= diff; + } + else conflagrate -= diff; break; case 3: if (summonadds <= diff) @@ -674,7 +685,8 @@ public: DoCast(me, SPELL_SUMMON_PUMPKIN); SaySound(SAY_SPROUTING_PUMPKINS); summonadds = urand(25000, 35000); - } else summonadds -= diff; + } + else summonadds -= diff; break; } @@ -683,7 +695,8 @@ public: laugh = urand(11000, 22000); me->MonsterTextEmote(EMOTE_LAUGHS, 0); DoPlaySoundToSet(me, RandomLaugh[rand()%3]); - } else laugh -= diff; + } + else laugh -= diff; if (UpdateVictim()) { @@ -692,7 +705,8 @@ public: { DoCast(me->getVictim(), SPELL_CLEAVE); cleave = urand(2000, 6000); //1 cleave per 2.0f-6.0fsec - } else cleave -= diff; + } + else cleave -= diff; } } else @@ -725,13 +739,14 @@ public: me->RemoveAurasDueToSpell(SPELL_CONFUSE); DoCast(me, SPELL_WHIRLWIND, true); DoCast(me, SPELL_CONFUSE); - } else + } + else me->RemoveAurasDueToSpell(SPELL_WHIRLWIND); - } else whirlwind -= diff; + } + else whirlwind -= diff; } } }; - }; class mob_pulsing_pumpkin : public CreatureScript @@ -746,7 +761,7 @@ public: struct mob_pulsing_pumpkinAI : public ScriptedAI { - mob_pulsing_pumpkinAI(Creature* c) : ScriptedAI(c) {} + mob_pulsing_pumpkinAI(Creature* creature) : ScriptedAI(creature) {} bool sprouted; uint64 debuffGUID; @@ -771,7 +786,7 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); } - void EnterCombat(Unit* /*who*/){} + void EnterCombat(Unit* /*who*/) {} void SpellHit(Unit* /*caster*/, const SpellInfo* spell) { @@ -813,7 +828,6 @@ public: DoMeleeAttackIfReady(); } }; - }; class go_loosely_turned_soil : public GameObjectScript @@ -846,13 +860,13 @@ public: //} return true; } - }; void mob_head::mob_headAI::Disappear() { if (withbody) return; + if (bodyGUID) { Creature* body = Unit::GetCreature((*me), bodyGUID); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index d99aabd60e8..16b90f89bb5 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -26,19 +26,32 @@ EndScriptData */ #include "ScriptPCH.h" #include "ScriptedEscortAI.h" -#define SAY_AGGRO -1189000 -#define SAY_WHIRLWIND -1189001 -#define SAY_ENRAGE -1189002 -#define SAY_KILL -1189003 -#define EMOTE_ENRAGE -1189004 +enum Says +{ + SAY_AGGRO = -1189000, + SAY_WHIRLWIND = -1189001, + SAY_ENRAGE = -1189002, + SAY_KILL = -1189003 +}; -#define SPELL_RUSHINGCHARGE 8260 -#define SPELL_CLEAVE 15496 -#define SPELL_WHIRLWIND 8989 -#define SPELL_FRENZY 8269 +enum Emotes +{ + EMOTE_ENRAGE = -1189004 +}; -#define ENTRY_SCARLET_TRAINEE 6575 -#define ENTRY_SCARLET_MYRMIDON 4295 +enum Spells +{ + SPELL_RUSHINGCHARGE = 8260, + SPELL_CLEAVE = 15496, + SPELL_WHIRLWIND = 8989, + SPELL_FRENZY = 8269 +}; + +enum Entry +{ + ENTRY_SCARLET_TRAINEE = 6575, + ENTRY_SCARLET_MYRMIDON = 4295 +}; class boss_herod : public CreatureScript { @@ -52,7 +65,7 @@ public: struct boss_herodAI : public ScriptedAI { - boss_herodAI(Creature* c) : ScriptedAI(c) {} + boss_herodAI(Creature* creature) : ScriptedAI(creature) {} bool Enrage; @@ -102,7 +115,8 @@ public: { DoCast(me->getVictim(), SPELL_CLEAVE); Cleave_Timer = 12000; - } else Cleave_Timer -= diff; + } + else Cleave_Timer -= diff; // Whirlwind_Timer if (Whirlwind_Timer <= diff) @@ -110,12 +124,12 @@ public: DoScriptText(SAY_WHIRLWIND, me); DoCast(me->getVictim(), SPELL_WHIRLWIND); Whirlwind_Timer = 30000; - } else Whirlwind_Timer -= diff; + } + else Whirlwind_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; class mob_scarlet_trainee : public CreatureScript @@ -130,7 +144,7 @@ public: struct mob_scarlet_traineeAI : public npc_escortAI { - mob_scarlet_traineeAI(Creature* c) : npc_escortAI(c) + mob_scarlet_traineeAI(Creature* creature) : npc_escortAI(creature) { Start_Timer = urand(1000, 6000); } @@ -138,7 +152,7 @@ public: uint32 Start_Timer; void Reset() {} - void WaypointReached(uint32 /*uiPoint*/) {} + void WaypointReached(uint32 /*point*/) {} void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) @@ -155,7 +169,6 @@ public: npc_escortAI::UpdateAI(diff); } }; - }; void AddSC_boss_herod() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp index 327c84327c5..a64636a4223 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -47,7 +47,7 @@ public: struct boss_high_inquisitor_fairbanksAI : public ScriptedAI { - boss_high_inquisitor_fairbanksAI(Creature* c) : ScriptedAI(c) {} + boss_high_inquisitor_fairbanksAI(Creature* creature) : ScriptedAI(creature) {} uint32 CurseOfBlood_Timer; uint32 DispelMagic_Timer; @@ -68,9 +68,7 @@ public: PowerWordShield = false; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) { @@ -82,7 +80,8 @@ public: { DoCast(me, SPELL_HEAL); Heal_Timer = 30000; - } else Heal_Timer -= diff; + } + else Heal_Timer -= diff; //Fear_Timer if (Fear_Timer <= diff) @@ -91,7 +90,8 @@ public: DoCast(target, SPELL_FEAR); Fear_Timer = 40000; - } else Fear_Timer -= diff; + } + else Fear_Timer -= diff; //Sleep_Timer if (Sleep_Timer <= diff) @@ -100,7 +100,8 @@ public: DoCast(target, SPELL_SLEEP); Sleep_Timer = 30000; - } else Sleep_Timer -= diff; + } + else Sleep_Timer -= diff; //PowerWordShield_Timer if (!PowerWordShield && !HealthAbovePct(25)) @@ -116,19 +117,20 @@ public: DoCast(target, SPELL_DISPELMAGIC); DispelMagic_Timer = 30000; - } else DispelMagic_Timer -= diff; + } + else DispelMagic_Timer -= diff; //CurseOfBlood_Timer if (CurseOfBlood_Timer <= diff) { DoCast(me->getVictim(), SPELL_CURSEOFBLOOD); CurseOfBlood_Timer = 25000; - } else CurseOfBlood_Timer -= diff; + } + else CurseOfBlood_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_high_inquisitor_fairbanks() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp index b070a31d6ee..f311da401d4 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp @@ -44,7 +44,7 @@ public: struct boss_houndmaster_lokseyAI : public ScriptedAI { - boss_houndmaster_lokseyAI(Creature* c) : ScriptedAI(c) {} + boss_houndmaster_lokseyAI(Creature* creature) : ScriptedAI(creature) {} uint32 BloodLust_Timer; @@ -67,12 +67,12 @@ public: { DoCast(me, SPELL_BLOODLUST); BloodLust_Timer = 20000; - } else BloodLust_Timer -= diff; + } + else BloodLust_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_houndmaster_loksey() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 28c9b7ea434..058c688641f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -26,15 +26,18 @@ EndScriptData */ #include "ScriptPCH.h" #include "scarlet_monastery.h" -enum eEnums +enum Says { SAY_AGGRO = -1189011, SAY_HEALTH1 = -1189012, SAY_HEALTH2 = -1189013, SAY_KILL = -1189014, - SAY_TRIGGER_VORREL = -1189015, + SAY_TRIGGER_VORREL = -1189015 +}; - SPELL_SHADOWWORDPAIN = 2767, +enum Spells +{ + SPELL_SHADOWWORDPAIN = 2767 }; class boss_interrogator_vishas : public CreatureScript @@ -49,7 +52,7 @@ public: struct boss_interrogator_vishasAI : public ScriptedAI { - boss_interrogator_vishasAI(Creature* c) : ScriptedAI(c) + boss_interrogator_vishasAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -108,12 +111,12 @@ public: { DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); ShadowWordPain_Timer = urand(5000, 15000); - } else ShadowWordPain_Timer -= diff; + } + else ShadowWordPain_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_interrogator_vishas() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index 7e2d3cb6788..ec6ac34b0bb 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -26,7 +26,7 @@ EndScriptData */ #include "ScriptPCH.h" #include "scarlet_monastery.h" -enum eEnums +enum Says { //Mograine says SAY_MO_AGGRO = -1189005, @@ -37,7 +37,10 @@ enum eEnums SAY_WH_INTRO = -1189008, SAY_WH_KILL = -1189009, SAY_WH_RESSURECT = -1189010, +}; +enum Spells +{ //Mograine Spells SPELL_CRUSADERSTRIKE = 14518, SPELL_HAMMEROFJUSTICE = 5589, @@ -67,43 +70,43 @@ public: { boss_scarlet_commander_mograineAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; - uint32 m_uiCrusaderStrike_Timer; - uint32 m_uiHammerOfJustice_Timer; + uint32 CrusaderStrike_Timer; + uint32 HammerOfJustice_Timer; - bool m_bHasDied; - bool m_bHeal; - bool m_bFakeDeath; + bool _bHasDied; + bool _bHeal; + bool _bFakeDeath; void Reset() { - m_uiCrusaderStrike_Timer = 10000; - m_uiHammerOfJustice_Timer = 10000; + CrusaderStrike_Timer = 10000; + HammerOfJustice_Timer = 10000; //Incase wipe during phase that mograine fake death me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_STAND); - if (m_instance) + if (instance) if (me->isAlive()) - m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); - m_bHasDied = false; - m_bHeal = false; - m_bFakeDeath = false; + _bHasDied = false; + _bHeal = false; + _bFakeDeath = false; } void JustReachedHome() { - if (m_instance) + if (instance) { - if (m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED) - m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); + if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED) + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); } } @@ -120,18 +123,18 @@ public: DoScriptText(SAY_MO_KILL, me); } - void DamageTaken(Unit* /*pDoneBy*/, uint32 &uiDamage) + void DamageTaken(Unit* /*doneBy*/, uint32 &damage) { - if (uiDamage < me->GetHealth() || m_bHasDied || m_bFakeDeath) + if (damage < me->GetHealth() || _bHasDied || _bFakeDeath) return; - if (!m_instance) + if (!instance) return; //On first death, fake death and open door, as well as initiate whitemane if exist - if (Unit* Whitemane = Unit::GetUnit((*me), m_instance->GetData64(DATA_WHITEMANE))) + if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE))) { - m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f); @@ -150,72 +153,73 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_DEAD); - m_bHasDied = true; - m_bFakeDeath = true; + _bHasDied = true; + _bFakeDeath = true; - uiDamage = 0; + damage = 0; } } - void SpellHit(Unit* /*who*/, const SpellInfo* pSpell) + void SpellHit(Unit* /*who*/, const SpellInfo* spell) { //When hit with ressurection say text - if (pSpell->Id == SPELL_SCARLETRESURRECTION) + if (spell->Id == SPELL_SCARLETRESURRECTION) { DoScriptText(SAY_MO_RESSURECTED, me); - m_bFakeDeath = false; + _bFakeDeath = false; - if (m_instance) - m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); + if (instance) + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); } } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; - if (m_bHasDied && !m_bHeal && m_instance && m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) + if (_bHasDied && !_bHeal && instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) { //On ressurection, stop fake death and heal whitemane and resume fight - if (Unit* Whitemane = Unit::GetUnit((*me), m_instance->GetData64(DATA_WHITEMANE))) + if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE))) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_STAND); DoCast(Whitemane, SPELL_LAYONHANDS); - m_uiCrusaderStrike_Timer = 10000; - m_uiHammerOfJustice_Timer = 10000; + CrusaderStrike_Timer = 10000; + HammerOfJustice_Timer = 10000; if (me->getVictim()) me->GetMotionMaster()->MoveChase(me->getVictim()); - m_bHeal = true; + _bHeal = true; } } //This if-check to make sure mograine does not attack while fake death - if (m_bFakeDeath) + if (_bFakeDeath) return; - //m_uiCrusaderStrike_Timer - if (m_uiCrusaderStrike_Timer <= uiDiff) + //CrusaderStrike_Timer + if (CrusaderStrike_Timer <= diff) { DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE); - m_uiCrusaderStrike_Timer = 10000; - } else m_uiCrusaderStrike_Timer -= uiDiff; + CrusaderStrike_Timer = 10000; + } + else CrusaderStrike_Timer -= diff; - //m_uiHammerOfJustice_Timer - if (m_uiHammerOfJustice_Timer <= uiDiff) + //HammerOfJustice_Timer + if (HammerOfJustice_Timer <= diff) { DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE); - m_uiHammerOfJustice_Timer = 60000; - } else m_uiHammerOfJustice_Timer -= uiDiff; + HammerOfJustice_Timer = 60000; + } + else HammerOfJustice_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; class boss_high_inquisitor_whitemane : public CreatureScript @@ -232,37 +236,37 @@ public: { boss_high_inquisitor_whitemaneAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; - uint32 m_uiHeal_Timer; - uint32 m_uiPowerWordShield_Timer; - uint32 m_uiHolySmite_Timer; - uint32 m_uiWait_Timer; + uint32 Heal_Timer; + uint32 PowerWordShield_Timer; + uint32 HolySmite_Timer; + uint32 Wait_Timer; - bool m_bCanResurrectCheck; - bool m_bCanResurrect; + bool _bCanResurrectCheck; + bool _bCanResurrect; void Reset() { - m_uiWait_Timer = 7000; - m_uiHeal_Timer = 10000; - m_uiPowerWordShield_Timer = 15000; - m_uiHolySmite_Timer = 6000; + Wait_Timer = 7000; + Heal_Timer = 10000; + PowerWordShield_Timer = 15000; + HolySmite_Timer = 6000; - m_bCanResurrectCheck = false; - m_bCanResurrect = false; + _bCanResurrectCheck = false; + _bCanResurrect = false; - if (m_instance) + if (instance) if (me->isAlive()) - m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); } void AttackStart(Unit* who) { - if (m_instance && m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) + if (instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) return; ScriptedAI::AttackStart(who); @@ -278,84 +282,86 @@ public: DoScriptText(SAY_WH_KILL, me); } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; - if (m_bCanResurrect) + if (_bCanResurrect) { //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out - if (m_instance && m_uiWait_Timer <= uiDiff) + if (instance && Wait_Timer <= diff) { - if (Unit* Mograine = Unit::GetUnit((*me), m_instance->GetData64(DATA_MOGRAINE))) + if (Unit* Mograine = Unit::GetUnit((*me), instance->GetData64(DATA_MOGRAINE))) { DoCast(Mograine, SPELL_SCARLETRESURRECTION); DoScriptText(SAY_WH_RESSURECT, me); - m_bCanResurrect = false; + _bCanResurrect = false; } } - else m_uiWait_Timer -= uiDiff; + else Wait_Timer -= diff; } //Cast Deep sleep when health is less than 50% - if (!m_bCanResurrectCheck && !HealthAbovePct(50)) + if (!_bCanResurrectCheck && !HealthAbovePct(50)) { if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); DoCast(me->getVictim(), SPELL_DEEPSLEEP); - m_bCanResurrectCheck = true; - m_bCanResurrect = true; + _bCanResurrectCheck = true; + _bCanResurrect = true; return; } //while in "resurrect-mode", don't do anything - if (m_bCanResurrect) + if (_bCanResurrect) return; //If we are <75% hp cast healing spells at self or Mograine - if (m_uiHeal_Timer <= uiDiff) + if (Heal_Timer <= diff) { Creature* target = NULL; if (!HealthAbovePct(75)) target = me; - if (m_instance) + if (instance) { - if (Creature* pMograine = Unit::GetCreature((*me), m_instance->GetData64(DATA_MOGRAINE))) + if (Creature* mograine = Unit::GetCreature((*me), instance->GetData64(DATA_MOGRAINE))) { - // checking m_bCanResurrectCheck prevents her healing Mograine while he is "faking death" - if (m_bCanResurrectCheck && pMograine->isAlive() && !pMograine->HealthAbovePct(75)) - target = pMograine; + // checking _bCanResurrectCheck prevents her healing Mograine while he is "faking death" + if (_bCanResurrectCheck && mograine->isAlive() && !mograine->HealthAbovePct(75)) + target = mograine; } } if (target) DoCast(target, SPELL_HEAL); - m_uiHeal_Timer = 13000; - } else m_uiHeal_Timer -= uiDiff; + Heal_Timer = 13000; + } + else Heal_Timer -= diff; - //m_uiPowerWordShield_Timer - if (m_uiPowerWordShield_Timer <= uiDiff) + //PowerWordShield_Timer + if (PowerWordShield_Timer <= diff) { DoCast(me, SPELL_POWERWORDSHIELD); - m_uiPowerWordShield_Timer = 15000; - } else m_uiPowerWordShield_Timer -= uiDiff; + PowerWordShield_Timer = 15000; + } + else PowerWordShield_Timer -= diff; - //m_uiHolySmite_Timer - if (m_uiHolySmite_Timer <= uiDiff) + //HolySmite_Timer + if (HolySmite_Timer <= diff) { DoCast(me->getVictim(), SPELL_HOLYSMITE); - m_uiHolySmite_Timer = 6000; - } else m_uiHolySmite_Timer -= uiDiff; + HolySmite_Timer = 6000; + } + else HolySmite_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_mograine_and_whitemane() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp index dc10cb4d60f..8035adfc33f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp @@ -25,10 +25,13 @@ EndScriptData */ #include "ScriptPCH.h" -#define SPELL_LICHSLAP 28873 -#define SPELL_FROSTBOLTVOLLEY 8398 -#define SPELL_MINDFLAY 17313 -#define SPELL_FROSTNOVA 15531 +enum Spells +{ + SPELL_LICHSLAP = 28873, + SPELL_FROSTBOLTVOLLEY = 8398, + SPELL_MINDFLAY = 17313, + SPELL_FROSTNOVA = 15531 +}; class boss_scorn : public CreatureScript { @@ -42,7 +45,7 @@ public: struct boss_scornAI : public ScriptedAI { - boss_scornAI(Creature* c) : ScriptedAI(c) {} + boss_scornAI(Creature* creature) : ScriptedAI(creature) {} uint32 LichSlap_Timer; uint32 FrostboltVolley_Timer; @@ -57,9 +60,7 @@ public: FrostNova_Timer = 30000; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) { @@ -71,33 +72,36 @@ public: { DoCast(me->getVictim(), SPELL_LICHSLAP); LichSlap_Timer = 45000; - } else LichSlap_Timer -= diff; + } + else LichSlap_Timer -= diff; //FrostboltVolley_Timer if (FrostboltVolley_Timer <= diff) { DoCast(me->getVictim(), SPELL_FROSTBOLTVOLLEY); FrostboltVolley_Timer = 20000; - } else FrostboltVolley_Timer -= diff; + } + else FrostboltVolley_Timer -= diff; //MindFlay_Timer if (MindFlay_Timer <= diff) { DoCast(me->getVictim(), SPELL_MINDFLAY); MindFlay_Timer = 20000; - } else MindFlay_Timer -= diff; + } + else MindFlay_Timer -= diff; //FrostNova_Timer if (FrostNova_Timer <= diff) { DoCast(me->getVictim(), SPELL_FROSTNOVA); FrostNova_Timer = 15000; - } else FrostNova_Timer -= diff; + } + else FrostNova_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_scorn() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index f1cddb08a69..ba0b854754e 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -26,10 +26,13 @@ EndScriptData */ #include "ScriptPCH.h" #include "scarlet_monastery.h" -#define ENTRY_PUMPKIN_SHRINE 186267 -#define ENTRY_HORSEMAN 23682 -#define ENTRY_HEAD 23775 -#define ENTRY_PUMPKIN 23694 +enum Entry +{ + ENTRY_PUMPKIN_SHRINE = 186267, + ENTRY_HORSEMAN = 23682, + ENTRY_HEAD = 23775, + ENTRY_PUMPKIN = 23694 +}; #define MAX_ENCOUNTER 2 @@ -57,11 +60,11 @@ public: uint64 VorrelGUID; uint64 DoorHighInquisitorGUID; - uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 encounter[MAX_ENCOUNTER]; void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&encounter, 0, sizeof(encounter)); PumpkinShrineGUID = 0; HorsemanGUID = 0; @@ -106,13 +109,13 @@ public: if (data == FAIL) DoUseDoorOrButton(DoorHighInquisitorGUID); - m_auiEncounter[0] = data; + encounter[0] = data; break; case GAMEOBJECT_PUMPKIN_SHRINE: HandleGameObject(PumpkinShrineGUID, false); break; case DATA_HORSEMAN_EVENT: - m_auiEncounter[1] = data; + encounter[1] = data; if (data == DONE) { for (std::set<uint64>::const_iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr) @@ -146,13 +149,12 @@ public: uint32 GetData(uint32 type) { if (type == TYPE_MOGRAINE_AND_WHITE_EVENT) - return m_auiEncounter[0]; + return encounter[0]; if (type == DATA_HORSEMAN_EVENT) - return m_auiEncounter[1]; + return encounter[1]; return 0; } }; - }; void AddSC_instance_scarlet_monastery() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h index ca6bd1d185a..70b18919704 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h @@ -19,14 +19,17 @@ #ifndef DEF_SCARLET_M #define DEF_SCARLET_M -#define TYPE_MOGRAINE_AND_WHITE_EVENT 1 -#define DATA_MOGRAINE 2 -#define DATA_WHITEMANE 3 -#define DATA_DOOR_WHITEMANE 4 +enum eEnums +{ + TYPE_MOGRAINE_AND_WHITE_EVENT = 1, -#define DATA_HORSEMAN_EVENT 5 -#define GAMEOBJECT_PUMPKIN_SHRINE 6 + DATA_MOGRAINE = 2, + DATA_WHITEMANE = 3, + DATA_DOOR_WHITEMANE = 4, -#define DATA_VORREL 7 -#endif + DATA_HORSEMAN_EVENT = 5, + GAMEOBJECT_PUMPKIN_SHRINE = 6, + DATA_VORREL = 7 +}; +#endif diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp index df369bb58b6..57b902ac6d4 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp @@ -252,7 +252,7 @@ public: { case 1: summon = pArchmage->SummonCreature(pArchmage->GetEntry(), SpawnLocation[4], TEMPSUMMON_TIMED_DESPAWN, 10000); - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); summon->SetReactState(REACT_DEFENSIVE); summon->CastSpell(summon, SPELL_ASHCROMBE_TELEPORT, true); DoScriptText(SAY_ARCHMAGE, summon); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index cb7f0de165d..337eea13438 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -425,7 +425,7 @@ public: { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); ScriptedAI::InitializeAI(); } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 2004eec71bc..9b5d941589b 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -151,7 +151,7 @@ public: summoned->CastSpell(summoned, SPELL_DARKFIEND_VISUAL, false); break; case CREATURE_DARKNESS: - summoned->AddUnitState(UNIT_STAT_STUNNED); + summoned->AddUnitState(UNIT_STATE_STUNNED); float x, y, z, o; summoned->GetHomePosition(x, y, z, o); me->SummonCreature(CREATURE_DARK_FIENDS, x, y, z, o, TEMPSUMMON_CORPSE_DESPAWN, 0); @@ -399,7 +399,7 @@ public: InAction = false; SummonSentinel = false; - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); Summons.DespawnAll(); } @@ -472,7 +472,7 @@ public: WaitTimer = 2000; InAction = false; - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); } void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) @@ -491,7 +491,7 @@ public: { if (!InAction) { - me->ClearUnitState(UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_STUNNED); DoCastAOE(SPELL_DARKFIEND_SKIN, false); AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)); InAction = true; @@ -599,7 +599,7 @@ public: SpellTimer = 5000; Phase = 0; - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); DoCastAOE(SPELL_BLACKHOLE_SPAWN, true); } @@ -611,7 +611,7 @@ public: switch (NeedForAHack) { case 0: - me->ClearUnitState(UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_STUNNED); DoCastAOE(SPELL_BLACKHOLE_GROW, false); if (Victim) AttackStart(Victim); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index 3cb0cc2120a..bd6f6ec4748 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -173,7 +173,7 @@ class boss_venoxis : public CreatureScript events.Update(diff); // return back to main code if we're still casting - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index 4d43e4adefe..a4eca1950f8 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -26,7 +26,6 @@ EndScriptData */ /* ContentData npc_archmage_malin npc_bartleby -npc_dashel_stonefist npc_lady_katrana_prestor npc_tyrion npc_tyrion_spybot @@ -148,78 +147,6 @@ public: }; /*###### -## npc_dashel_stonefist -######*/ - -enum eDashel -{ - QUEST_MISSING_DIPLO_PT8 = 1447, - FACTION_HOSTILE = 168 -}; - -class npc_dashel_stonefist : public CreatureScript -{ -public: - npc_dashel_stonefist() : CreatureScript("npc_dashel_stonefist") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT8) - { - creature->setFaction(FACTION_HOSTILE); - CAST_AI(npc_dashel_stonefist::npc_dashel_stonefistAI, creature->AI())->AttackStart(player); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_dashel_stonefistAI(creature); - } - - struct npc_dashel_stonefistAI : public ScriptedAI - { - npc_dashel_stonefistAI(Creature* c) : ScriptedAI(c) - { - m_uiNormalFaction = c->getFaction(); - } - - uint32 m_uiNormalFaction; - - void Reset() - { - if (me->getFaction() != m_uiNormalFaction) - me->setFaction(m_uiNormalFaction); - } - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim()) - return; - - if (me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage)) - { - uiDamage = 0; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_MISSING_DIPLO_PT8); - - EnterEvadeMode(); - } - } - }; - -}; - -/*###### ## npc_lady_katrana_prestor ######*/ @@ -716,7 +643,6 @@ void AddSC_stormwind_city() { new npc_archmage_malin(); new npc_bartleby(); - new npc_dashel_stonefist(); new npc_lady_katrana_prestor(); new npc_tyrion(); new npc_tyrion_spybot(); diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp index 6cbf28f171c..0d72ab6fb2f 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp @@ -53,7 +53,7 @@ public: if (quest->GetQuestId() == QUEST_590) { creature->setFaction(FACTION_HOSTILE); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player); } return true; @@ -80,8 +80,8 @@ public: me->RestoreFaction(); - if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE)) - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } void EnterCombat(Unit* /*who*/) {} @@ -101,7 +101,7 @@ public: uiDamage = 0; me->RestoreFaction(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->CombatStop(true); m_uiPhase = 1; diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 29029803369..878116ad476 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -43,7 +43,6 @@ public: player->AddAura(SPELL_BLESSING_OF_BLACKFATHOM, player); return true; } - }; class go_blackfathom_fire : public GameObjectScript @@ -64,7 +63,6 @@ public: } return false; } - }; class npc_blackfathom_deeps_event : public CreatureScript @@ -92,9 +90,9 @@ public: InstanceScript* instance; - uint32 uiRavageTimer; - uint32 uiFrostNovaTimer; - uint32 uiFrostBoltVolleyTimer; + uint32 ravageTimer; + uint32 frostNovaTimer; + uint32 frostBoltVolleyTimer; bool bFlee; @@ -102,9 +100,9 @@ public: { bFlee = false; - uiRavageTimer = urand(5000, 8000); - uiFrostNovaTimer = urand(9000, 12000); - uiFrostBoltVolleyTimer = urand(2000, 4000); + ravageTimer = urand(5000, 8000); + frostNovaTimer = urand(9000, 12000); + frostBoltVolleyTimer = urand(2000, 4000); } void AttackPlayer() @@ -131,7 +129,7 @@ public: } } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; @@ -140,11 +138,11 @@ public: { case NPC_AKU_MAI_SNAPJAW: { - if (uiRavageTimer <= uiDiff) + if (ravageTimer <= diff) { DoCast(me->getVictim(), SPELL_RAVAGE); - uiRavageTimer = urand(9000, 14000); - } else uiRavageTimer -= uiDiff; + ravageTimer = urand(9000, 14000); + } else ravageTimer -= diff; break; } case NPC_MURKSHALLOW_SOFTSHELL: @@ -159,20 +157,23 @@ public: } case NPC_AKU_MAI_SERVANT: { - if (uiFrostBoltVolleyTimer <= uiDiff) + if (frostBoltVolleyTimer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { if (target) DoCast(target, SPELL_FROST_BOLT_VOLLEY); } - uiFrostBoltVolleyTimer = urand(5000, 8000); - } else uiFrostBoltVolleyTimer -= uiDiff; - if (uiFrostNovaTimer <= uiDiff) + frostBoltVolleyTimer = urand(5000, 8000); + } + else frostBoltVolleyTimer -= diff; + + if (frostNovaTimer <= diff) { DoCastAOE(SPELL_FROST_NOVA, false); - uiFrostNovaTimer = urand(25000, 30000); - } else uiFrostNovaTimer -= uiDiff; + frostNovaTimer = urand(25000, 30000); + } + else frostNovaTimer -= diff; break; } } @@ -187,7 +188,6 @@ public: instance->SetData(DATA_EVENT, instance->GetData(DATA_EVENT) + 1); } }; - }; enum eMorridune @@ -201,12 +201,12 @@ class npc_morridune : public CreatureScript public: npc_morridune() : CreatureScript("npc_morridune") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*Sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { - case GOSSIP_ACTION_INFO_DEF+1: + case GOSSIP_ACTION_INFO_DEF + 1: player->TeleportTo(1, 9952.239f, 2284.277f, 1341.394f, 1.595f); player->CLOSE_GOSSIP_MENU(); break; @@ -216,7 +216,7 @@ public: bool OnGossipHello(Player* player, Creature* creature) { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MORRIDUNE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MORRIDUNE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; @@ -250,7 +250,6 @@ public: } } }; - }; void AddSC_blackfathom_deeps() diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp index 87e8478532d..32a6bcbde77 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp @@ -36,19 +36,19 @@ public: struct boss_aku_maiAI : public ScriptedAI { - boss_aku_maiAI(Creature* c) : ScriptedAI(c) + boss_aku_maiAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - uint32 uiPoisonCloudTimer; + uint32 poisonCloudTimer; bool bIsEnraged; InstanceScript* instance; void Reset() { - uiPoisonCloudTimer = urand(5000, 9000); + poisonCloudTimer = urand(5000, 9000); bIsEnraged = false; if (instance) instance->SetData(TYPE_AKU_MAI, NOT_STARTED); @@ -71,11 +71,11 @@ public: if (!UpdateVictim()) return; - if (uiPoisonCloudTimer < diff) + if (poisonCloudTimer < diff) { DoCastVictim(SPELL_POISON_CLOUD); - uiPoisonCloudTimer = urand(25000, 50000); - } else uiPoisonCloudTimer -= diff; + poisonCloudTimer = urand(25000, 50000); + } else poisonCloudTimer -= diff; if (!bIsEnraged && HealthBelowPct(30)) { @@ -86,7 +86,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_aku_mai() diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp index e7822a6edb3..5a60a849b75 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp @@ -35,18 +35,18 @@ public: struct boss_gelihastAI : public ScriptedAI { - boss_gelihastAI(Creature* c) : ScriptedAI(c) + boss_gelihastAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - uint32 uiNetTimer; + uint32 netTimer; InstanceScript* instance; void Reset() { - uiNetTimer = urand(2000, 4000); + netTimer = urand(2000, 4000); if (instance) instance->SetData(TYPE_GELIHAST, NOT_STARTED); } @@ -68,16 +68,15 @@ public: if (!UpdateVictim()) return; - if (uiNetTimer < diff) + if (netTimer < diff) { DoCastVictim(SPELL_NET); - uiNetTimer = urand(4000, 7000); - } else uiNetTimer -= diff; + netTimer = urand(4000, 7000); + } else netTimer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_gelihast() diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp index 5823ed15ed5..7ee17172102 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp @@ -44,20 +44,20 @@ public: struct boss_kelrisAI : public ScriptedAI { - boss_kelrisAI(Creature* c) : ScriptedAI(c) + boss_kelrisAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - uint32 uiMindBlastTimer; - uint32 uiSleepTimer; + uint32 mindBlastTimer; + uint32 sleepTimer; InstanceScript* instance; void Reset() { - uiMindBlastTimer = urand(2000, 5000); - uiSleepTimer = urand(9000, 12000); + mindBlastTimer = urand(2000, 5000); + sleepTimer = urand(9000, 12000); if (instance) instance->SetData(TYPE_KELRIS, NOT_STARTED); } @@ -81,26 +81,25 @@ public: if (!UpdateVictim()) return; - if (uiMindBlastTimer < diff) + if (mindBlastTimer < diff) { DoCastVictim(SPELL_MIND_BLAST); - uiMindBlastTimer = urand(7000, 9000); - } else uiMindBlastTimer -= diff; + mindBlastTimer = urand(7000, 9000); + } else mindBlastTimer -= diff; - if (uiSleepTimer < diff) + if (sleepTimer < diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) { DoScriptText(SAY_SLEEP, me); DoCast(target, SPELL_SLEEP); } - uiSleepTimer = urand(15000, 20000); - } else uiSleepTimer -= diff; + sleepTimer = urand(15000, 20000); + } else sleepTimer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_kelris() diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp index 8dd4e60f281..ea33499a960 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp @@ -65,33 +65,33 @@ public: { instance_blackfathom_deeps_InstanceMapScript(Map* map) : InstanceScript(map) {} - uint64 m_uiTwilightLordKelrisGUID; - uint64 m_uiShrine1GUID; - uint64 m_uiShrine2GUID; - uint64 m_uiShrine3GUID; - uint64 m_uiShrine4GUID; - uint64 m_uiShrineOfGelihastGUID; - uint64 m_uiAltarOfTheDeepsGUID; - uint64 m_uiMainDoorGUID; + uint64 twilightLordKelrisGUID; + uint64 shrine1GUID; + uint64 shrine2GUID; + uint64 shrine3GUID; + uint64 shrine4GUID; + uint64 shrineOfGelihastGUID; + uint64 altarOfTheDeepsGUID; + uint64 mainDoorGUID; - uint8 m_auiEncounter[MAX_ENCOUNTER]; - uint8 m_uiCountFires; - uint8 uiDeathTimes; + uint8 encounter[MAX_ENCOUNTER]; + uint8 countFires; + uint8 deathTimes; void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&encounter, 0, sizeof(encounter)); - m_uiTwilightLordKelrisGUID = 0; - m_uiShrine1GUID = 0; - m_uiShrine2GUID = 0; - m_uiShrine3GUID = 0; - m_uiShrine4GUID = 0; - m_uiShrineOfGelihastGUID = 0; - m_uiAltarOfTheDeepsGUID = 0; - m_uiMainDoorGUID = 0; - m_uiCountFires = 0; - uiDeathTimes = 0; + twilightLordKelrisGUID = 0; + shrine1GUID = 0; + shrine2GUID = 0; + shrine3GUID = 0; + shrine4GUID = 0; + shrineOfGelihastGUID = 0; + altarOfTheDeepsGUID = 0; + mainDoorGUID = 0; + countFires = 0; + deathTimes = 0; } void OnCreatureCreate(Creature* creature) @@ -99,7 +99,7 @@ public: switch (creature->GetEntry()) { case NPC_TWILIGHT_LORD_KELRIS: - m_uiTwilightLordKelrisGUID = creature->GetGUID(); + twilightLordKelrisGUID = creature->GetGUID(); break; case NPC_LORGUS_JETT: creature->SetHomePosition(LorgusPosition[urand(0, 3)]); @@ -112,150 +112,149 @@ public: switch (go->GetEntry()) { case GO_FIRE_OF_AKU_MAI_1: - m_uiShrine1GUID = go->GetGUID(); + shrine1GUID = go->GetGUID(); break; case GO_FIRE_OF_AKU_MAI_2: - m_uiShrine2GUID = go->GetGUID(); + shrine2GUID = go->GetGUID(); break; case GO_FIRE_OF_AKU_MAI_3: - m_uiShrine3GUID = go->GetGUID(); + shrine3GUID = go->GetGUID(); break; case GO_FIRE_OF_AKU_MAI_4: - m_uiShrine4GUID = go->GetGUID(); + shrine4GUID = go->GetGUID(); break; case GO_SHRINE_OF_GELIHAST: - m_uiShrineOfGelihastGUID = go->GetGUID(); - if (m_auiEncounter[0] != DONE) + shrineOfGelihastGUID = go->GetGUID(); + if (encounter[0] != DONE) go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); break; case GO_ALTAR_OF_THE_DEEPS: - m_uiAltarOfTheDeepsGUID = go->GetGUID(); - if (m_auiEncounter[3] != DONE) + altarOfTheDeepsGUID = go->GetGUID(); + if (encounter[3] != DONE) go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); break; case GO_AKU_MAI_DOOR: - if (m_auiEncounter[2] == DONE) + if (encounter[2] == DONE) HandleGameObject(0, true, go); - m_uiMainDoorGUID = go->GetGUID(); + mainDoorGUID = go->GetGUID(); break; } } - void SetData(uint32 uiType, uint32 uiData) + void SetData(uint32 type, uint32 data) { - switch (uiType) + switch (type) { case TYPE_GELIHAST: - m_auiEncounter[0] = uiData; - if (uiData == DONE) - if (GameObject* go = instance->GetGameObject(m_uiShrineOfGelihastGUID)) + encounter[0] = data; + if (data == DONE) + if (GameObject* go = instance->GetGameObject(shrineOfGelihastGUID)) go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); break; case TYPE_AKU_MAI: - m_auiEncounter[3] = uiData; - if (uiData == DONE) - if (GameObject* go = instance->GetGameObject(m_uiAltarOfTheDeepsGUID)) + encounter[3] = data; + if (data == DONE) + if (GameObject* go = instance->GetGameObject(altarOfTheDeepsGUID)) { go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); go->SummonCreature(NPC_MORRIDUNE, SpawnsLocation[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); } break; case DATA_FIRE: - m_uiCountFires = uiData; - switch (m_uiCountFires) + countFires = data; + switch (countFires) { case 1: - if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID)) + if (GameObject* go = instance->GetGameObject(shrine1GUID)) { - pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); } break; case 2: - if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID)) + if (GameObject* go = instance->GetGameObject(shrine1GUID)) { for (uint8 i = 0; i < 2; ++i) { - pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); } } break; case 3: - if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID)) + if (GameObject* go = instance->GetGameObject(shrine1GUID)) { - pGO->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); } break; case 4: - if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID)) + if (GameObject* go = instance->GetGameObject(shrine1GUID)) { - pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); } break; } break; case DATA_EVENT: - uiDeathTimes = uiData; - if (uiDeathTimes == 18) - HandleGameObject(m_uiMainDoorGUID, true); + deathTimes = data; + if (deathTimes == 18) + HandleGameObject(mainDoorGUID, true); break; } } - uint32 GetData(uint32 uiType) + uint32 GetData(uint32 type) { - switch (uiType) + switch (type) { case TYPE_GELIHAST: - return m_auiEncounter[0]; + return encounter[0]; case TYPE_KELRIS: - return m_auiEncounter[1]; + return encounter[1]; case TYPE_SHRINE: - return m_auiEncounter[2]; + return encounter[2]; case TYPE_AKU_MAI: - return m_auiEncounter[3]; + return encounter[3]; case DATA_FIRE: - return m_uiCountFires; + return countFires; case DATA_EVENT: - return uiDeathTimes; + return deathTimes; } return 0; } - uint64 GetData64(uint32 uiData) + uint64 GetData64(uint32 data) { - switch (uiData) + switch (data) { case DATA_TWILIGHT_LORD_KELRIS: - return m_uiTwilightLordKelrisGUID; + return twilightLordKelrisGUID; case DATA_SHRINE1: - return m_uiShrine1GUID; + return shrine1GUID; case DATA_SHRINE2: - return m_uiShrine2GUID; + return shrine2GUID; case DATA_SHRINE3: - return m_uiShrine3GUID; + return shrine3GUID; case DATA_SHRINE4: - return m_uiShrine4GUID; + return shrine4GUID; case DATA_SHRINE_OF_GELIHAST: - return m_uiShrineOfGelihastGUID; + return shrineOfGelihastGUID; case DATA_MAINDOOR: - return m_uiMainDoorGUID; + return mainDoorGUID; } return 0; } }; - }; void AddSC_instance_blackfathom_deeps() diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index ad0a36da84e..9518abd1635 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -234,53 +234,53 @@ public: bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - npc_arthasAI* pAI = CAST_AI(npc_arthas::npc_arthasAI, creature->AI()); + npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI()); - if (!pAI) + if (!ai) return false; switch (action) { case GOSSIP_ACTION_INFO_DEF: - pAI->Start(true, true, player->GetGUID(), 0, false, false); - pAI->SetDespawnAtEnd(false); - pAI->bStepping = false; - pAI->uiStep = 1; + ai->Start(true, true, player->GetGUID(), 0, false, false); + ai->SetDespawnAtEnd(false); + ai->bStepping = false; + ai->uiStep = 1; break; case GOSSIP_ACTION_INFO_DEF+1: - pAI->bStepping = true; - pAI->uiStep = 24; + ai->bStepping = true; + ai->uiStep = 24; break; case GOSSIP_ACTION_INFO_DEF+2: - pAI->SetHoldState(false); - pAI->bStepping = false; - pAI->uiStep = 61; + ai->SetHoldState(false); + ai->bStepping = false; + ai->uiStep = 61; break; case GOSSIP_ACTION_INFO_DEF+3: - pAI->SetHoldState(false); + ai->SetHoldState(false); break; case GOSSIP_ACTION_INFO_DEF+4: - pAI->bStepping = true; - pAI->uiStep = 84; + ai->bStepping = true; + ai->uiStep = 84; break; case GOSSIP_ACTION_INFO_DEF+5: - pAI->bStepping = true; - pAI->uiStep = 85; + ai->bStepping = true; + ai->uiStep = 85; break; } player->CLOSE_GOSSIP_MENU(); - pAI->SetDespawnAtFar(true); + ai->SetDespawnAtFar(true); creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); return true; } bool OnGossipHello(Player* player, Creature* creature) { - npc_arthasAI* pAI = CAST_AI(npc_arthas::npc_arthasAI, creature->AI()); + npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI()); - if (pAI && pAI->bStepping == false) + if (ai && ai->bStepping == false) { - switch (pAI->uiGossipStep) + switch (ai->uiGossipStep) { case 0: //This one is a workaround since the very beggining of the script is wrong. { @@ -414,7 +414,7 @@ public: if (Creature* temp = me->SummonCreature((uint32)RiftAndSpawnsLocations[i][0], RiftAndSpawnsLocations[timeRiftID][1], RiftAndSpawnsLocations[timeRiftID][2], RiftAndSpawnsLocations[timeRiftID][3], RiftAndSpawnsLocations[timeRiftID][4], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000)) { guidVector[i-timeRiftID-1] = temp->GetGUID(); - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); + temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); temp->SetReactState(REACT_PASSIVE); temp->GetMotionMaster()->MovePoint(0, RiftAndSpawnsLocations[i][1], RiftAndSpawnsLocations[i][2], RiftAndSpawnsLocations[i][3]); if ((uint32)RiftAndSpawnsLocations[i][0] == NPC_EPOCH) @@ -1003,7 +1003,7 @@ public: { pDisguised2->UpdateEntry(NPC_INFINITE_HUNTER, 0); //Make them unattackable - pDisguised2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); + pDisguised2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); pDisguised2->SetReactState(REACT_PASSIVE); } JumpToNextStep(2000); @@ -1013,7 +1013,7 @@ public: { pDisguised1->UpdateEntry(NPC_INFINITE_AGENT, 0); //Make them unattackable - pDisguised1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); + pDisguised1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); pDisguised1->SetReactState(REACT_PASSIVE); } JumpToNextStep(2000); @@ -1023,7 +1023,7 @@ public: { pDisguised0->UpdateEntry(NPC_INFINITE_ADVERSARY, 0); //Make them unattackable - pDisguised0->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); + pDisguised0->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); pDisguised0->SetReactState(REACT_PASSIVE); } JumpToNextStep(2000); @@ -1037,7 +1037,7 @@ public: for (uint32 i = 0; i< ENCOUNTER_DRACONIAN_NUMBER; ++i) if (Creature* temp = Unit::GetCreature(*me, uiInfiniteDraconianGUID[i])) { - temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); + temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); temp->SetReactState(REACT_AGGRESSIVE); } JumpToNextStep(5000); @@ -1095,7 +1095,7 @@ public: if (Creature* pEpoch = Unit::GetCreature(*me, uiEpochGUID)) { //Make Epoch attackable - pEpoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); + pEpoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); pEpoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pEpoch->SetReactState(REACT_AGGRESSIVE); } @@ -1150,7 +1150,7 @@ public: case 87: if (Creature* pMalganis = Unit::GetCreature(*me, uiMalganisGUID)) { - pMalganis->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_6 | UNIT_FLAG_PASSIVE | UNIT_FLAG_UNK_15); + pMalganis->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_UNK_6 | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_UNK_15); pMalganis->SetReactState(REACT_AGGRESSIVE); } JumpToNextStep(1000); diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp index 0010db68673..74e7a919263 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -25,9 +25,12 @@ EndScriptData */ #include "ScriptPCH.h" -#define SPELL_WRATH 21807 -#define SPELL_ENTANGLINGROOTS 12747 -#define SPELL_CORRUPT_FORCES 21968 +enum Spells +{ + SPELL_WRATH = 21807, + SPELL_ENTANGLINGROOTS = 12747, + SPELL_CORRUPT_FORCES = 21968 +}; class celebras_the_cursed : public CreatureScript { @@ -41,7 +44,7 @@ public: struct celebras_the_cursedAI : public ScriptedAI { - celebras_the_cursedAI(Creature* c) : ScriptedAI(c) {} + celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature) {} uint32 Wrath_Timer; uint32 EntanglingRoots_Timer; @@ -74,14 +77,16 @@ public: if (target) DoCast(target, SPELL_WRATH); Wrath_Timer = 8000; - } else Wrath_Timer -= diff; + } + else Wrath_Timer -= diff; //EntanglingRoots if (EntanglingRoots_Timer <= diff) { DoCast(me->getVictim(), SPELL_ENTANGLINGROOTS); EntanglingRoots_Timer = 20000; - } else EntanglingRoots_Timer -= diff; + } + else EntanglingRoots_Timer -= diff; //CorruptForces if (CorruptForces_Timer <= diff) @@ -89,12 +94,12 @@ public: me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_CORRUPT_FORCES); CorruptForces_Timer = 20000; - } else CorruptForces_Timer -= diff; + } + else CorruptForces_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_celebras_the_cursed() diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp index fdb5207acd5..418bf3a09ce 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp @@ -25,9 +25,12 @@ EndScriptData */ #include "ScriptPCH.h" -#define SPELL_KNOCKAWAY 18670 -#define SPELL_TRAMPLE 5568 -#define SPELL_LANDSLIDE 21808 +enum Spells +{ + SPELL_KNOCKAWAY = 18670, + SPELL_TRAMPLE = 5568, + SPELL_LANDSLIDE = 21808 +}; class boss_landslide : public CreatureScript { @@ -41,7 +44,7 @@ public: struct boss_landslideAI : public ScriptedAI { - boss_landslideAI(Creature* c) : ScriptedAI(c) {} + boss_landslideAI(Creature* creature) : ScriptedAI(creature) {} uint32 KnockAway_Timer; uint32 Trample_Timer; @@ -68,14 +71,16 @@ public: { DoCast(me->getVictim(), SPELL_KNOCKAWAY); KnockAway_Timer = 15000; - } else KnockAway_Timer -= diff; + } + else KnockAway_Timer -= diff; //Trample_Timer if (Trample_Timer <= diff) { DoCast(me, SPELL_TRAMPLE); Trample_Timer = 8000; - } else Trample_Timer -= diff; + } + else Trample_Timer -= diff; //Landslide if (HealthBelowPct(50)) @@ -85,13 +90,13 @@ public: me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_LANDSLIDE); Landslide_Timer = 60000; - } else Landslide_Timer -= diff; + } + else Landslide_Timer -= diff; } DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_landslide() diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp index 2d4c817ffe2..0e3ee5dc52b 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp @@ -24,9 +24,11 @@ SDCategory: Maraudon EndScriptData */ #include "ScriptPCH.h" - -#define SPELL_TOXICVOLLEY 21687 -#define SPELL_UPPERCUT 22916 +enum Spells +{ + SPELL_TOXICVOLLEY = 21687, + SPELL_UPPERCUT = 22916 +}; class boss_noxxion : public CreatureScript { @@ -40,7 +42,7 @@ public: struct boss_noxxionAI : public ScriptedAI { - boss_noxxionAI(Creature* c) : ScriptedAI(c) {} + boss_noxxionAI(Creature* creature) : ScriptedAI(creature) {} uint32 ToxicVolley_Timer; uint32 Uppercut_Timer; @@ -78,7 +80,8 @@ public: me->SetDisplayId(11172); Invisible = false; //me->m_canMove = true; - } else if (Invisible) + } + else if (Invisible) { Invisible_Timer -= diff; //Do nothing while invisible @@ -94,14 +97,16 @@ public: { DoCast(me->getVictim(), SPELL_TOXICVOLLEY); ToxicVolley_Timer = 9000; - } else ToxicVolley_Timer -= diff; + } + else ToxicVolley_Timer -= diff; //Uppercut_Timer if (Uppercut_Timer <= diff) { DoCast(me->getVictim(), SPELL_UPPERCUT); Uppercut_Timer = 12000; - } else Uppercut_Timer -= diff; + } + else Uppercut_Timer -= diff; //Adds_Timer if (!Invisible && Adds_Timer <= diff) @@ -122,12 +127,12 @@ public: Invisible_Timer = 15000; Adds_Timer = 40000; - } else Adds_Timer -= diff; + } + else Adds_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_noxxion() diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp index cb2c7b320e0..bade5655f36 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp @@ -25,10 +25,13 @@ EndScriptData */ #include "ScriptPCH.h" -#define SPELL_DUSTFIELD 21909 -#define SPELL_BOULDER 21832 -#define SPELL_THRASH 3391 -#define SPELL_REPULSIVEGAZE 21869 +enum Spells +{ + SPELL_DUSTFIELD = 21909, + SPELL_BOULDER = 21832, + SPELL_THRASH = 3391, + SPELL_REPULSIVEGAZE = 21869 +}; class boss_princess_theradras : public CreatureScript { @@ -42,7 +45,7 @@ public: struct boss_ptheradrasAI : public ScriptedAI { - boss_ptheradrasAI(Creature* c) : ScriptedAI(c) {} + boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature) {} uint32 Dustfield_Timer; uint32 Boulder_Timer; @@ -57,9 +60,7 @@ public: RepulsiveGaze_Timer = 23000; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void JustDied(Unit* /*killer*/) { @@ -76,7 +77,8 @@ public: { DoCast(me, SPELL_DUSTFIELD); Dustfield_Timer = 14000; - } else Dustfield_Timer -= diff; + } + else Dustfield_Timer -= diff; //Boulder_Timer if (Boulder_Timer <= diff) @@ -86,26 +88,28 @@ public: if (target) DoCast(target, SPELL_BOULDER); Boulder_Timer = 10000; - } else Boulder_Timer -= diff; + } + else Boulder_Timer -= diff; //RepulsiveGaze_Timer if (RepulsiveGaze_Timer <= diff) { DoCast(me->getVictim(), SPELL_REPULSIVEGAZE); RepulsiveGaze_Timer = 20000; - } else RepulsiveGaze_Timer -= diff; + } + else RepulsiveGaze_Timer -= diff; //Thrash_Timer if (Thrash_Timer <= diff) { DoCast(me, SPELL_THRASH); Thrash_Timer = 18000; - } else Thrash_Timer -= diff; + } + else Thrash_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_ptheradras() diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp index b295780cfc9..36a1ff1bade 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp @@ -75,7 +75,7 @@ class boss_kurinnaxx : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index 3dc7660985f..a290b07e60f 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -127,7 +127,7 @@ class boss_moam : public CreatureScript } // Messing up mana-drain channel - //if (me->HasUnitState(UNIT_STAT_CASTING)) + //if (me->HasUnitState(UNIT_STATE_CASTING)) // return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index ea137026ec2..afa8eff5823 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -93,7 +93,7 @@ class boss_rajaxx : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index a60c33a4feb..b03d2dc3a4a 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -90,7 +90,7 @@ struct boss_twinemperorsAI : public ScriptedAI AfterTeleportTimer = 0; Abuse_Bug_Timer = urand(10000, 17000); BugsTimer = 2000; - me->ClearUnitState(UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_STUNNED); DontYellWhenDead = false; EnrageTimer = 15*60000; } @@ -234,7 +234,7 @@ struct boss_twinemperorsAI : public ScriptedAI DoStopAttack(); DoResetThreat(); DoCast(me, SPELL_TWIN_TELEPORT_VISUAL); - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); AfterTeleport = true; AfterTeleportTimer = 2000; tspellcasted = false; @@ -246,9 +246,9 @@ struct boss_twinemperorsAI : public ScriptedAI { if (!tspellcasted) { - me->ClearUnitState(UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_STUNNED); DoCast(me, SPELL_TWIN_TELEPORT); - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); } tspellcasted = true; @@ -256,7 +256,7 @@ struct boss_twinemperorsAI : public ScriptedAI if (AfterTeleportTimer <= diff) { AfterTeleport = false; - me->ClearUnitState(UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_STUNNED); if (Unit* nearu = me->SelectNearestTarget(100)) { //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0); diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index 1155d353371..8eb3d20d528 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -98,7 +98,7 @@ public: DoScriptText(SAY_MAKE_PREPARATIONS, creature); creature->setFaction(250); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->SetDespawnAtFar(false); @@ -143,7 +143,7 @@ public: currentEvent = 0; eventProgress = 0; me->setActive(true); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } uint32 eventTimer; diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 0ead5d95447..eede1aa069a 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -176,7 +176,7 @@ public: creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); creature->SetSpeed(MOVE_RUN, creature->GetSpeedRate(MOVE_RUN), true); creature->setFaction(35); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NON_ATTACKABLE); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE); creature->SetReactState(REACT_PASSIVE); creature->GetMotionMaster()->MovePoint(1, DeserterDisappearPos); break; @@ -198,7 +198,7 @@ public: void Reset() { me->RestoreFaction(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE); me->SetReactState(REACT_AGGRESSIVE); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } @@ -531,7 +531,7 @@ public: return; me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); SetCombatMovement(true); if (me->isInCombat()) diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 595a72ec2bf..2d6e34ab9ee 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -573,9 +573,151 @@ public: }; /*#### -# +# npc_omen ####*/ +enum Omen +{ + NPC_OMEN = 15467, + + SPELL_OMEN_CLEAVE = 15284, + SPELL_OMEN_STARFALL = 26540, + SPELL_OMEN_SUMMON_SPOTLIGHT = 26392, + SPELL_ELUNE_CANDLE = 26374, + + GO_ELUNE_TRAP_1 = 180876, + GO_ELUNE_TRAP_2 = 180877, + + EVENT_CAST_CLEAVE = 1, + EVENT_CAST_STARFALL = 2, + EVENT_DESPAWN = 3, +}; + +class npc_omen : public CreatureScript +{ +public: + npc_omen() : CreatureScript("npc_omen") { } + + struct npc_omenAI : public ScriptedAI + { + npc_omenAI(Creature* creature) : ScriptedAI(creature) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->GetMotionMaster()->MovePoint(1, 7549.977f, -2855.137f, 456.9678f); + } + + EventMap events; + + void MovementInform(uint32 type, uint32 pointId) + { + if (type != POINT_MOTION_TYPE) + return; + + if (pointId == 1) + { + me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + if (Player* player = me->SelectNearestPlayer(40.0f)) + AttackStart(player); + } + } + + void EnterCombat(Unit* /*attacker*/) + { + events.Reset(); + events.ScheduleEvent(EVENT_CAST_CLEAVE, urand(3000, 5000)); + events.ScheduleEvent(EVENT_CAST_STARFALL, urand(8000, 10000)); + } + + void JustDied(Unit* /*killer*/) + { + DoCast(SPELL_OMEN_SUMMON_SPOTLIGHT); + } + + void SpellHit(Unit* /*caster*/, const SpellInfo* spell) + { + if (spell->Id == SPELL_ELUNE_CANDLE) + { + if (me->HasAura(SPELL_OMEN_STARFALL)) + me->RemoveAurasDueToSpell(SPELL_OMEN_STARFALL); + + events.RescheduleEvent(EVENT_CAST_STARFALL, urand(14000, 16000)); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + switch (events.ExecuteEvent()) + { + case EVENT_CAST_CLEAVE: + DoCastVictim(SPELL_OMEN_CLEAVE); + events.ScheduleEvent(EVENT_CAST_CLEAVE, urand(8000, 10000)); + break; + case EVENT_CAST_STARFALL: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_OMEN_STARFALL); + events.ScheduleEvent(EVENT_CAST_STARFALL, urand(14000, 16000)); + break; + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_omenAI(creature); + } +}; + +class npc_giant_spotlight : public CreatureScript +{ +public: + npc_giant_spotlight() : CreatureScript("npc_giant_spotlight") { } + + struct npc_giant_spotlightAI : public ScriptedAI + { + npc_giant_spotlightAI(Creature* creature) : ScriptedAI(creature) {} + + EventMap events; + + void Reset() + { + events.Reset(); + events.ScheduleEvent(EVENT_DESPAWN, 5*MINUTE*IN_MILLISECONDS); + } + + void UpdateAI(const uint32 diff) + { + events.Update(diff); + + if (events.ExecuteEvent() == EVENT_DESPAWN) + { + if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_1, 5.0f)) + trap->RemoveFromWorld(); + + if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_2, 5.0f)) + trap->RemoveFromWorld(); + + if (Creature* omen = me->FindNearestCreature(NPC_OMEN, 5.0f, false)) + omen->DespawnOrUnsummon(); + + me->DespawnOrUnsummon(); + } + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_giant_spotlightAI(creature); + } +}; + void AddSC_moonglade() { new npc_bunthen_plainswind(); @@ -583,4 +725,6 @@ void AddSC_moonglade() new npc_silva_filnaveth(); new npc_clintar_dreamwalker(); new npc_clintar_spirit(); + new npc_omen(); + new npc_giant_spotlight(); } diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index 3dd0d1cbf02..c31a7731865 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -154,7 +154,7 @@ public: DoScriptText(SAY_START, creature); creature->setFaction(113); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } return true; } diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index 394a32e5cb6..ff6cdccb66a 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -410,7 +410,7 @@ public: creature->setFaction(113); creature->SetFullHealth(); creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); DoScriptText(SAY_OOX_START, creature); if (npc_escortAI* pEscortAI = CAST_AI(npc_OOX17::npc_OOX17AI, creature->AI())) diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index bf22c7a5d30..f1eaa0c87c5 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -115,7 +115,7 @@ public: DoCast(me, INSANITY_VISUAL, true); // Unattackable me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetControlled(true, UNIT_STAT_STUNNED); + me->SetControlled(true, UNIT_STATE_STUNNED); } // phase mask target->CastSpell(target, SPELL_INSANITY_TARGET+insanityHandled, true); @@ -171,7 +171,7 @@ public: // Cleanup Summons.DespawnAll(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetControlled(false, UNIT_STAT_STUNNED); + me->SetControlled(false, UNIT_STATE_STUNNED); } void EnterCombat(Unit* /*who*/) @@ -271,7 +271,7 @@ public: insanityHandled = 0; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetControlled(false, UNIT_STAT_STUNNED); + me->SetControlled(false, UNIT_STATE_STUNNED); me->RemoveAurasDueToSpell(INSANITY_VISUAL); } diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 1e3a9a7a177..0f4b046f7d5 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -82,7 +82,7 @@ public: boss_taldaramAI(Creature* c) : ScriptedAI(c) { instance = c->GetInstanceScript(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -314,7 +314,7 @@ public: { if (!instance) return; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveAurasDueToSpell(SPELL_BEAM_VISUAL); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index cf9c7fd0f3d..79a102c803f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -283,7 +283,7 @@ public: if (((UndergroundPhase == 0 && HealthBelowPct(75)) || (UndergroundPhase == 1 && HealthBelowPct(50)) || (UndergroundPhase == 2 && HealthBelowPct(25))) - && !me->HasUnitState(UNIT_STAT_CASTING)) + && !me->HasUnitState(UNIT_STATE_CASTING)) { GuardianSummoned = false; VenomancerSummoned = false; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index 61d74c431fe..e848c29c466 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -174,7 +174,7 @@ class boss_baltharus_the_warborn : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK)) + if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -268,7 +268,7 @@ class npc_baltharus_the_warborn_clone : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) 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 3b3b1fb9f47..f41522f844d 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp @@ -97,7 +97,7 @@ class boss_general_zarithrian : public CreatureScript { _Reset(); if (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } void EnterCombat(Unit* /*who*/) @@ -148,7 +148,7 @@ class boss_general_zarithrian : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -257,7 +257,7 @@ class npc_onyx_flamecaller : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 724fd4ef011..78810e27b05 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -137,7 +137,7 @@ class boss_saviana_ragefire : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp index 0fb51df7ed9..f9e302d7634 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp @@ -189,7 +189,7 @@ class instance_ruby_sanctum : public InstanceMapScript { HandleGameObject(FlameWallsGUID, true); if (Creature* zarithrian = instance->GetCreature(GeneralZarithrianGUID)) - zarithrian->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + zarithrian->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); } break; } @@ -199,7 +199,7 @@ class instance_ruby_sanctum : public InstanceMapScript { HandleGameObject(FlameWallsGUID, true); if (Creature* zarithrian = instance->GetCreature(GeneralZarithrianGUID)) - zarithrian->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + zarithrian->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); } break; } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index 153e128e58d..0848d1e9524 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -111,7 +111,7 @@ public: { RemoveSummons(); me->SetDisplayId(me->GetNativeDisplayId()); - me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); bEventInProgress = false; bEvent = false; @@ -167,7 +167,7 @@ public: uiPhase++; uiResurrectTimer = 4000; bEventInProgress = false; - me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); } else uiResurrectTimer -= uiDiff; } @@ -211,14 +211,14 @@ public: if (!bSummonArmy) { bSummonArmy = true; - me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); DoCast(me, SPELL_ARMY_DEAD); } if (!bDeathArmyDone) { if (uiDeathArmyCheckTimer <= uiDiff) { - me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); uiDeathArmyCheckTimer = 0; bDeathArmyDone = true; } else uiDeathArmyCheckTimer -= uiDiff; @@ -263,7 +263,7 @@ public: } } - if (!me->HasUnitState(UNIT_STAT_ROOT) && !me->HealthBelowPct(1)) + if (!me->HasUnitState(UNIT_STATE_ROOT) && !me->HealthBelowPct(1)) DoMeleeAttackIfReady(); } @@ -273,7 +273,7 @@ public: { uiDamage = 0; me->SetHealth(0); - me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); RemoveSummons(); switch (uiPhase) { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index ebdc55c51b7..9fcfcfa47e5 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -107,7 +107,7 @@ void AggroAllPlayers(Creature* temp) if (player->isAlive()) { - temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); temp->SetReactState(REACT_AGGRESSIVE); temp->SetInCombatWith(player); player->SetInCombatWith(temp); @@ -320,7 +320,7 @@ public: me->SetReactState(REACT_PASSIVE); // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } InstanceScript* instance; @@ -453,7 +453,7 @@ public: me->SetReactState(REACT_PASSIVE); // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } InstanceScript* instance; @@ -592,7 +592,7 @@ public: me->SetReactState(REACT_PASSIVE); // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } InstanceScript* instance; @@ -739,7 +739,7 @@ public: me->SetReactState(REACT_PASSIVE); // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } InstanceScript* instance; @@ -895,7 +895,7 @@ public: me->SetReactState(REACT_PASSIVE); // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 8e34a318d6c..a9e41d90899 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -122,6 +122,11 @@ const Position SphereSpawn[6] = { 706.6383f, 161.5266f, 155.6701f, 0 }, }; +enum MovementPoints +{ + POINT_FALL_GROUND = 1 +}; + class boss_anubarak_trial : public CreatureScript { public: @@ -530,7 +535,7 @@ public: { me->RemoveAurasDueToSpell(SPELL_SUBMERGE_EFFECT); DoCast(me, SPELL_EMERGE_EFFECT); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->CombatStart(me->SelectNearestTarget()); } else @@ -538,7 +543,7 @@ public: if (!me->HasAura(SPELL_PERMAFROST_HELPER)) { DoCast(me, SPELL_SUBMERGE_EFFECT); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->CombatStop(); } } @@ -553,68 +558,68 @@ public: class mob_frost_sphere : public CreatureScript { -public: - mob_frost_sphere() : CreatureScript("mob_frost_sphere") { } + public: + mob_frost_sphere() : CreatureScript("mob_frost_sphere") { } - CreatureAI* GetAI(Creature* creature) const - { - return new mob_frost_sphereAI(creature); - }; - - struct mob_frost_sphereAI : public ScriptedAI - { - mob_frost_sphereAI(Creature* creature) : ScriptedAI(creature) + struct mob_frost_sphereAI : public ScriptedAI { - } - - bool m_bFall; - float x, y, z; + mob_frost_sphereAI(Creature* creature) : ScriptedAI(creature) + { + } - void Reset() - { - m_bFall = false; - me->SetReactState(REACT_PASSIVE); - me->SetFlying(true); - me->SetDisplayId(25144); - me->SetSpeed(MOVE_RUN, 0.5f, false); - me->GetMotionMaster()->MoveRandom(20.0f); - DoCast(SPELL_FROST_SPHERE); - } + void Reset() + { + _isFalling = false; + me->SetReactState(REACT_PASSIVE); + me->SetFlying(true); + me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetSpeed(MOVE_RUN, 0.5f, false); + me->GetMotionMaster()->MoveRandom(20.0f); + DoCast(SPELL_FROST_SPHERE); + } - void DamageTaken(Unit* /*who*/, uint32& uiDamage) - { - if (me->GetHealth() < uiDamage) + void DamageTaken(Unit* /*who*/, uint32& damage) { - uiDamage = 0; - if (!m_bFall) + if (me->GetHealth() <= damage) { - m_bFall = true; - me->GetMotionMaster()->MoveIdle(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //At hit the ground - me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); - me->GetMotionMaster()->MoveFall(); + damage = 0; + if (!_isFalling) + { + _isFalling = true; + me->GetMotionMaster()->MoveIdle(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //At hit the ground + me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); + me->GetMotionMaster()->MoveFall(POINT_FALL_GROUND); + } } } - } - - void MovementInform(uint32 uiType, uint32 uiId) - { - if (uiType != POINT_MOTION_TYPE) return; - switch (uiId) + void MovementInform(uint32 type, uint32 pointId) { - case 0: - me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE); - me->SetDisplayId(11686); - DoCast(SPELL_PERMAFROST_VISUAL); - DoCast(SPELL_PERMAFROST); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); - break; + if (type != EFFECT_MOTION_TYPE) + return; + + switch (pointId) + { + case POINT_FALL_GROUND: + me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE); + me->SetDisplayId(me->GetCreatureInfo()->Modelid1); + DoCast(SPELL_PERMAFROST_VISUAL); + DoCast(SPELL_PERMAFROST); + me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); + break; + } } - } - }; + private: + bool _isFalling; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new mob_frost_sphereAI(creature); + }; }; class mob_anubarak_spike : public CreatureScript @@ -642,7 +647,7 @@ public: void Reset() { // For an unknown reason this npc isn't recognize the Aura of Permafrost with this flags =/ - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); m_uiTargetGUID = 0; } 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 45fdbdd5616..2fe0bd3f397 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -172,7 +172,7 @@ public: { Summons.Summon(temp); temp->SetReactState(REACT_PASSIVE); - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); if (playerTeam == ALLIANCE) { temp->SetHomePosition(vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 0); @@ -203,7 +203,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, *i)) { temp->SetReactState(REACT_AGGRESSIVE); - temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } } break; 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 029a7c3c351..1eca7edb590 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -155,15 +155,16 @@ public: ScriptedAI::EnterEvadeMode(); } - void MovementInform(uint32 uiType, uint32 uiId) + void MovementInform(uint32 type, uint32 pointId) { - if (uiType != POINT_MOTION_TYPE) return; + if (type != POINT_MOTION_TYPE) + return; - switch (uiId) + switch (pointId) { case 0: m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWithZone(); break; @@ -215,24 +216,24 @@ public: Summons.Despawn(summon); } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; - if (m_uiImpaleTimer <= uiDiff) + if (m_uiImpaleTimer <= diff) { DoCastVictim(SPELL_IMPALE); m_uiImpaleTimer = urand(8*IN_MILLISECONDS, 10*IN_MILLISECONDS); - } else m_uiImpaleTimer -= uiDiff; + } else m_uiImpaleTimer -= diff; - if (m_uiStaggeringStompTimer <= uiDiff) + if (m_uiStaggeringStompTimer <= diff) { DoCastVictim(SPELL_STAGGERING_STOMP); m_uiStaggeringStompTimer = urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS); - } else m_uiStaggeringStompTimer -= uiDiff; + } else m_uiStaggeringStompTimer -= diff; - if (m_uiSummonTimer <= uiDiff) + if (m_uiSummonTimer <= diff) { if (m_uiSummonCount > 0) { @@ -240,7 +241,7 @@ public: DoScriptText(SAY_SNOBOLLED, me); } m_uiSummonTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); - } else m_uiSummonTimer -= uiDiff; + } else m_uiSummonTimer -= diff; DoMeleeAttackIfReady(); } @@ -286,7 +287,7 @@ public: if (m_instance) m_uiBossGUID = m_instance->GetData64(NPC_GORMOK); //Workaround for Snobold - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); } void EnterEvadeMode() @@ -308,11 +309,12 @@ public: uiDamage = 0; } - void MovementInform(uint32 uiType, uint32 uiId) + void MovementInform(uint32 type, uint32 pointId) { - if (uiType != POINT_MOTION_TYPE) return; + if (type != POINT_MOTION_TYPE) + return; - switch (uiId) + switch (pointId) { case 0: if (m_bTargetDied) @@ -330,7 +332,7 @@ public: m_instance->SetData(DATA_SNOBOLD_COUNT, DECREASE); } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(uint32 const diff) { if (m_bTargetDied || !UpdateVictim()) return; @@ -357,29 +359,29 @@ public: } } - if (m_uiFireBombTimer < uiDiff) + if (m_uiFireBombTimer < diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_FIRE_BOMB); m_uiFireBombTimer = 20000; } - else m_uiFireBombTimer -= uiDiff; + else m_uiFireBombTimer -= diff; - if (m_uiBatterTimer < uiDiff) + if (m_uiBatterTimer < diff) { if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID)) DoCast(target, SPELL_BATTER); m_uiBatterTimer = 10000; } - else m_uiBatterTimer -= uiDiff; + else m_uiBatterTimer -= diff; - if (m_uiHeadCrackTimer < uiDiff) + if (m_uiHeadCrackTimer < diff) { if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID)) DoCast(target, SPELL_HEAD_CRACK); m_uiHeadCrackTimer = 35000; } - else m_uiHeadCrackTimer -= uiDiff; + else m_uiHeadCrackTimer -= diff; DoMeleeAttackIfReady(); } @@ -450,7 +452,7 @@ struct boss_jormungarAI : public ScriptedAI instanceScript->SetData(TYPE_NORTHREND_BEASTS, SNAKES_IN_PROGRESS); } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; @@ -458,7 +460,7 @@ struct boss_jormungarAI : public ScriptedAI { DoScriptText(SAY_EMERGE, me); me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); DoCast(SPELL_ENRAGE); enraged = true; DoScriptText(SAY_BERSERK, me); @@ -478,98 +480,98 @@ struct boss_jormungarAI : public ScriptedAI switch (stage) { case 0: // Mobile - if (biteTimer <= uiDiff) + if (biteTimer <= diff) { DoCastVictim(biteSpell); biteTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); - } else biteTimer -= uiDiff; + } else biteTimer -= diff; - if (spewTimer <= uiDiff) + if (spewTimer <= diff) { DoCastAOE(spewSpell); spewTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); - } else spewTimer -= uiDiff; + } else spewTimer -= diff; - if (slimePoolTimer <= uiDiff) + if (slimePoolTimer <= diff) { /* Spell summon has only 30s duration */ DoCast(me, SUMMON_SLIME_POOL); slimePoolTimer = 30*IN_MILLISECONDS; - } else slimePoolTimer -= uiDiff; + } else slimePoolTimer -= diff; - if (submergeTimer <= uiDiff && !enraged) + if (submergeTimer <= diff && !enraged) { stage = 1; submergeTimer = 5*IN_MILLISECONDS; - } else submergeTimer -= uiDiff; + } else submergeTimer -= diff; DoMeleeAttackIfReady(); break; case 1: // Submerge - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); DoCast(me, SPELL_SUBMERGE_0); DoScriptText(SAY_SUBMERGE, me); - me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX()+urand(0, 80)-40, ToCCommonLoc[1].GetPositionY()+urand(0, 80)-40, ToCCommonLoc[1].GetPositionZ()); + me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX()+ frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionY() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionZ()); stage = 2; case 2: // Wait til emerge - if (submergeTimer <= uiDiff) + if (submergeTimer <= diff) { stage = 3; submergeTimer = 50*IN_MILLISECONDS; - } else submergeTimer -= uiDiff; + } else submergeTimer -= diff; break; case 3: // Emerge me->SetDisplayId(modelStationary); DoScriptText(SAY_EMERGE, me); me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0); DoCast(me, SPELL_EMERGE_0); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); SetCombatMovement(false); me->GetMotionMaster()->MoveIdle(); stage = 4; break; case 4: // Stationary - if (sprayTimer <= uiDiff) + if (sprayTimer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, spraySpell); sprayTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); - } else sprayTimer -= uiDiff; + } else sprayTimer -= diff; - if (sweepTimer <= uiDiff) + if (sweepTimer <= diff) { DoCastAOE(SPELL_SWEEP_0); sweepTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); - } else sweepTimer -= uiDiff; + } else sweepTimer -= diff; - if (submergeTimer <= uiDiff) + if (submergeTimer <= diff) { stage = 5; submergeTimer = 10*IN_MILLISECONDS; - } else submergeTimer -= uiDiff; + } else submergeTimer -= diff; DoSpellAttackIfReady(spitSpell); break; case 5: // Submerge - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); DoCast(me, SPELL_SUBMERGE_0); DoScriptText(SAY_SUBMERGE, me); - me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX()+urand(0, 80)-40, ToCCommonLoc[1].GetPositionY()+urand(0, 80)-40, ToCCommonLoc[1].GetPositionZ()); + me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionY() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionZ()); stage = 6; case 6: // Wait til emerge - if (submergeTimer <= uiDiff) + if (submergeTimer <= diff) { stage = 7; submergeTimer = 45*IN_MILLISECONDS; - } else submergeTimer -= uiDiff; + } else submergeTimer -= diff; break; case 7: // Emerge me->SetDisplayId(modelMobile); DoScriptText(SAY_EMERGE, me); me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0); DoCast(me, SPELL_EMERGE_0); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); SetCombatMovement(true); me->GetMotionMaster()->MoveChase(me->getVictim()); @@ -662,20 +664,21 @@ public: stage = 0; } - void MovementInform(uint32 uiType, uint32 uiId) + void MovementInform(uint32 type, uint32 pointId) { - if (uiType != POINT_MOTION_TYPE) return; + if (type != POINT_MOTION_TYPE) + return; - switch (uiId) + switch (pointId) { case 0: instanceScript->DoUseDoorOrButton(instanceScript->GetData64(GO_MAIN_GATE_DOOR)); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWithZone(); if (Creature* otherWorm = Unit::GetCreature(*me, instanceScript->GetData64(otherWormEntry))) { - otherWorm->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + otherWorm->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); otherWorm->SetReactState(REACT_AGGRESSIVE); otherWorm->SetVisible(true); otherWorm->SetInCombatWithZone(); @@ -728,7 +731,7 @@ public: me->SetReactState(REACT_PASSIVE); } - void UpdateAI(const uint32 /*uiDiff*/) + void UpdateAI(uint32 const /*diff*/) { if (!casted) { @@ -795,11 +798,12 @@ public: m_instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_DONE); } - void MovementInform(uint32 uiType, uint32 uiId) + void MovementInform(uint32 type, uint32 pointId) { - if (uiType != POINT_MOTION_TYPE) return; + if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE) + return; - switch (uiId) + switch (pointId) { case 0: if (me->GetDistance2d(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY()) < 6.0f) @@ -813,7 +817,9 @@ public: if (Unit::GetPlayer(*me, m_uiTrampleTargetGUID)) { m_uiStage = 4; - } else m_uiStage = 6; + } + else + m_uiStage = 6; } break; case 1: // Finish trample @@ -821,7 +827,7 @@ public: break; case 2: m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWithZone(); break; @@ -860,7 +866,7 @@ public: me->SetInCombatWithZone(); } - void SpellHitTarget(Unit* target, const SpellInfo* spell) + void SpellHitTarget(Unit* target, SpellInfo const* spell) { if (spell->Id == SPELL_TRAMPLE && target->GetTypeId() == TYPEID_PLAYER) { @@ -872,7 +878,7 @@ public: } } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; @@ -880,31 +886,31 @@ public: switch (m_uiStage) { case 0: - if (m_uiFerociousButtTimer <= uiDiff) + if (m_uiFerociousButtTimer <= diff) { DoCastVictim(SPELL_FEROCIOUS_BUTT); m_uiFerociousButtTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); - } else m_uiFerociousButtTimer -= uiDiff; + } else m_uiFerociousButtTimer -= diff; - if (m_uiArticBreathTimer <= uiDiff) + if (m_uiArticBreathTimer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_ARCTIC_BREATH); m_uiArticBreathTimer = urand(25*IN_MILLISECONDS, 40*IN_MILLISECONDS); - } else m_uiArticBreathTimer -= uiDiff; + } else m_uiArticBreathTimer -= diff; - if (m_uiWhirlTimer <= uiDiff) + if (m_uiWhirlTimer <= diff) { DoCastAOE(SPELL_WHIRL); m_uiWhirlTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); - } else m_uiWhirlTimer -= uiDiff; + } else m_uiWhirlTimer -= diff; - if (m_uiMassiveCrashTimer <= uiDiff) + if (m_uiMassiveCrashTimer <= diff) { me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 10.0f, 20.0f); // 1: Middle of the room m_uiStage = 7; //Invalid (Do nothing more than move) m_uiMassiveCrashTimer = 30*IN_MILLISECONDS; - } else m_uiMassiveCrashTimer -= uiDiff; + } else m_uiMassiveCrashTimer -= diff; DoMeleeAttackIfReady(); break; @@ -927,7 +933,7 @@ public: } else m_uiStage = 6; break; case 3: - if (m_uiTrampleTimer <= uiDiff) + if (m_uiTrampleTimer <= diff) { if (Unit* target = Unit::GetPlayer(*me, m_uiTrampleTargetGUID)) { @@ -942,7 +948,7 @@ public: 10.0f, 20.0f); // 2: Hop Backwards m_uiStage = 7; //Invalid (Do nothing more than move) } else m_uiStage = 6; - } else m_uiTrampleTimer -= uiDiff; + } else m_uiTrampleTimer -= diff; break; case 4: DoScriptText(SAY_TRAMPLE_START, me); @@ -953,12 +959,12 @@ public: case 5: if (m_bMovementFinish) { - if (m_uiTrampleTimer <= uiDiff) DoCastAOE(SPELL_TRAMPLE); + if (m_uiTrampleTimer <= diff) DoCastAOE(SPELL_TRAMPLE); m_bMovementFinish = false; m_uiStage = 6; return; } - if (m_uiTrampleTimer <= uiDiff) + if (m_uiTrampleTimer <= diff) { Map::PlayerList const &lPlayers = me->GetMap()->GetPlayers(); for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr) @@ -971,7 +977,7 @@ public: break; } } - } else m_uiTrampleTimer -= uiDiff; + } else m_uiTrampleTimer -= diff; break; case 6: if (!m_bTrampleCasted) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 960b685f700..c1009963df0 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -172,7 +172,7 @@ struct boss_twin_baseAI : public ScriptedAI uint32 m_uiTouchSpellId; void Reset() { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); me->ModifyAuraState(m_uiAuraState, true); /* Uncomment this once that they are flying above the ground @@ -205,7 +205,7 @@ struct boss_twin_baseAI : public ScriptedAI { case 1: m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); break; } @@ -572,7 +572,7 @@ struct mob_unleashed_ballAI : public ScriptedAI void Reset() { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SetFlying(true); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 7412d75c97b..b17b6f1286b 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -563,7 +563,7 @@ class npc_tirion_toc : public CreatureScript if (Creature* temp = me->SummonCreature(NPC_GORMOK, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30*IN_MILLISECONDS)) { temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); temp->SetReactState(REACT_PASSIVE); } } @@ -591,13 +591,13 @@ class npc_tirion_toc : public CreatureScript if (Creature* temp = me->SummonCreature(NPC_DREADSCALE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN)) { temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ()); - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); temp->SetReactState(REACT_PASSIVE); } if (Creature* temp = me->SummonCreature(NPC_ACIDMAW, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN)) { temp->SetVisible(true); - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); temp->SetReactState(REACT_PASSIVE); } } @@ -623,7 +623,7 @@ class npc_tirion_toc : public CreatureScript if (Creature* temp = me->SummonCreature(NPC_ICEHOWL, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_DEAD_DESPAWN)) { temp->GetMotionMaster()->MovePoint(2, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); } diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp index 54e234a6d87..5418cf8c4d0 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp @@ -100,8 +100,8 @@ public: lSummons.DespawnAll(); crystalHandlerAmount = 0; - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE)) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) @@ -136,7 +136,7 @@ public: } instance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS); } - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } @@ -227,7 +227,7 @@ public: if (luiCrystals.empty()) { me->CastStop(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Phase = PHASE_2; diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index d444160b8f2..4a28ebe6495 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -67,6 +67,7 @@ class boss_bronjahm : public CreatureScript { boss_bronjahmAI(Creature* creature) : BossAI(creature, DATA_BRONJAHM) { + DoCast(me, SPELL_SOULSTORM_CHANNEL, true); } void InitializeAI() @@ -82,14 +83,17 @@ class boss_bronjahm : public CreatureScript events.Reset(); events.SetPhase(PHASE_1); events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000); - events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 15000)); + events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 20000)); events.ScheduleEvent(EVENT_CORRUPT_SOUL, urand(25000, 35000), 0, PHASE_1); - me->CastSpell(me, SPELL_SOULSTORM_CHANNEL, true); - instance->SetBossState(DATA_BRONJAHM, NOT_STARTED); } + void JustReachedHome() + { + DoCast(me, SPELL_SOULSTORM_CHANNEL, true); + } + void EnterCombat(Unit* /*who*/) { DoScriptText(SAY_AGGRO, me); @@ -118,7 +122,7 @@ class boss_bronjahm : public CreatureScript events.SetPhase(PHASE_2); DoCast(me, SPELL_TELEPORT); events.ScheduleEvent(EVENT_FEAR, urand(12000, 16000), 0, PHASE_2); - events.ScheduleEvent(EVENT_SOULSTORM, 700, 0, PHASE_2); + events.ScheduleEvent(EVENT_SOULSTORM, 100, 0, PHASE_2); } } @@ -138,7 +142,7 @@ class boss_bronjahm : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -147,7 +151,7 @@ class boss_bronjahm : public CreatureScript { case EVENT_MAGIC_BANE: DoCastVictim(SPELL_MAGIC_S_BANE); - events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 15000)); + events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 20000)); break; case EVENT_SHADOW_BOLT: if (!me->IsWithinMeleeRange(me->getVictim())) diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index 8180a686e0e..ad49f6cbce8 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -260,7 +260,7 @@ class boss_devourer_of_souls : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -306,6 +306,7 @@ class boss_devourer_of_souls : public CreatureScript if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { me->SetOrientation(me->GetAngle(target)); + me->SendMovementFlagUpdate(); DoCast(me, SPELL_WAILING_SOULS_BEAM); } @@ -332,6 +333,7 @@ class boss_devourer_of_souls : public CreatureScript case EVENT_WAILING_SOULS_TICK: beamAngle += beamAngleDiff; me->SetOrientation(beamAngle); + me->SendMovementFlagUpdate(); me->StopMoving(); DoCast(me, SPELL_WAILING_SOULS); diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp index c6d00a95de3..c8f18dba1d0 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -441,7 +441,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -497,7 +497,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -555,7 +555,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -612,7 +612,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -672,7 +672,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -738,7 +738,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -811,7 +811,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -878,7 +878,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp index 673362f59a0..9cfcb78f6f1 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp @@ -103,7 +103,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; switch (events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp index b074c309cb3..a9bfb603794 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp @@ -100,7 +100,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; switch (events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index e1ae8374278..1583bdbdcd4 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -659,7 +659,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -742,7 +742,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -842,7 +842,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -912,7 +912,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -978,7 +978,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index 26ece7db662..0f9495d4928 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -190,7 +190,7 @@ class boss_garfrost : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 8bcd0b8b8e2..8e211cbd2cb 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -215,7 +215,7 @@ class boss_ick : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index 91be62a33e7..25cd292d390 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -72,7 +72,7 @@ class mob_ymirjar_flamebearer : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -187,7 +187,7 @@ class mob_wrathbone_laborer : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index 9abcc669f09..b66c3d795f3 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -97,7 +97,7 @@ class boss_drakkari_colossus : public CreatureScript if (GetData(DATA_INTRO_DONE)) { me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveAura(SPELL_FREEZE_ANIM); } @@ -149,7 +149,7 @@ class boss_drakkari_colossus : public CreatureScript me->GetMotionMaster()->MoveIdle(); me->SetReactState(REACT_PASSIVE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); DoCast(me, SPELL_FREEZE_ANIM); break; case ACTION_UNFREEZE_COLOSSUS: @@ -158,7 +158,7 @@ class boss_drakkari_colossus : public CreatureScript return; me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveAura(SPELL_FREEZE_ANIM); me->SetInCombatWithZone(); @@ -172,7 +172,7 @@ class boss_drakkari_colossus : public CreatureScript void DamageTaken(Unit* /*attacker*/, uint32& damage) { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE)) + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) damage = 0; if (phase == COLOSSUS_PHASE_NORMAL || @@ -212,7 +212,7 @@ class boss_drakkari_colossus : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -289,7 +289,7 @@ class boss_drakkari_elemental : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -335,7 +335,7 @@ class boss_drakkari_elemental : public CreatureScript damage = 0; // to prevent spell spaming - if (me->HasUnitState(UNIT_STAT_CHARGING)) + if (me->HasUnitState(UNIT_STATE_CHARGING)) return; // not sure about this, the idea of this code is to prevent bug the elemental diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index 46070090063..daa5ee86483 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -148,7 +148,7 @@ public: DoScriptText(SAY_TRANSFORM_1, me); uiTransformationTimer = 5*IN_MILLISECONDS; bStartOfTransformation = true; - me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); + me->ClearUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT); me->SetReactState(REACT_AGGRESSIVE); } else @@ -158,7 +158,7 @@ public: if (bStartOfTransformation) { bStartOfTransformation = false; - me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); + me->AddUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT); me->SetReactState(REACT_PASSIVE); } } @@ -191,7 +191,7 @@ public: DoScriptText(SAY_TRANSFORM_2, me); uiTransformationTimer = 9*IN_MILLISECONDS; bStartOfTransformation = true; - me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); + me->ClearUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT); me->SetReactState(REACT_AGGRESSIVE); } else @@ -201,7 +201,7 @@ public: if (bStartOfTransformation) { bStartOfTransformation = false; - me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); + me->AddUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT); me->SetReactState(REACT_PASSIVE); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 94a3da2672b..f5e207a9442 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -287,7 +287,7 @@ class boss_blood_council_controller : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -383,7 +383,7 @@ class boss_prince_keleseth_icc : public CreatureScript events.Reset(); summons.DespawnAll(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); _isEmpowered = false; me->SetHealth(_spawnHealth); instance->SetData(DATA_ORB_WHISPERER_ACHIEVEMENT, uint32(true)); @@ -489,7 +489,7 @@ class boss_prince_keleseth_icc : public CreatureScript { case ACTION_STAND_UP: me->RemoveAurasDueToSpell(SPELL_FEIGN_DEATH); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why @@ -535,7 +535,7 @@ class boss_prince_keleseth_icc : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -607,7 +607,7 @@ class boss_prince_taldaram_icc : public CreatureScript events.Reset(); summons.DespawnAll(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); _isEmpowered = false; me->SetHealth(_spawnHealth); instance->SetData(DATA_ORB_WHISPERER_ACHIEVEMENT, uint32(true)); @@ -707,7 +707,7 @@ class boss_prince_taldaram_icc : public CreatureScript { case ACTION_STAND_UP: me->RemoveAurasDueToSpell(SPELL_FEIGN_DEATH); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why @@ -753,7 +753,7 @@ class boss_prince_taldaram_icc : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -830,7 +830,7 @@ class boss_prince_valanar_icc : public CreatureScript events.Reset(); summons.DespawnAll(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); _isEmpowered = false; me->SetHealth(me->GetMaxHealth()); instance->SetData(DATA_ORB_WHISPERER_ACHIEVEMENT, uint32(true)); @@ -944,7 +944,7 @@ class boss_prince_valanar_icc : public CreatureScript { case ACTION_STAND_UP: me->RemoveAurasDueToSpell(SPELL_FEIGN_DEATH); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why @@ -990,7 +990,7 @@ class boss_prince_valanar_icc : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -1179,7 +1179,7 @@ class npc_ball_of_flame : public CreatureScript if (Player* target = ObjectAccessor::GetPlayer(*me, _chaseGUID)) { // need to clear states now because this call is before AuraEffect is fully removed - me->ClearUnitState(UNIT_STAT_CASTING | UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED); if (target && me->Attack(target, true)) me->GetMotionMaster()->MoveChase(target, 1.0f); } @@ -1316,7 +1316,7 @@ class npc_dark_nucleus : public CreatureScript } DoCast(who, SPELL_SHADOW_RESONANCE_RESIST); - me->ClearUnitState(UNIT_STAT_CASTING); + me->ClearUnitState(UNIT_STATE_CASTING); } void MoveInLineOfSight(Unit* who) @@ -1350,7 +1350,7 @@ class npc_dark_nucleus : public CreatureScript !victim->HasAura(SPELL_SHADOW_RESONANCE_RESIST, me->GetGUID())) { DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST); - me->ClearUnitState(UNIT_STAT_CASTING); + me->ClearUnitState(UNIT_STATE_CASTING); } } else @@ -1369,7 +1369,7 @@ class npc_dark_nucleus : public CreatureScript _lockedTarget = true; AttackStart(victim); DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST); - me->ClearUnitState(UNIT_STAT_CASTING); + me->ClearUnitState(UNIT_STATE_CASTING); } } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index d775e5778f7..79a577f6591 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -321,7 +321,7 @@ class boss_blood_queen_lana_thel : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 31b3786a360..3c795187f43 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -279,7 +279,7 @@ class boss_deathbringer_saurfang : public CreatureScript events.Reset(); events.SetPhase(PHASE_COMBAT); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); if (!_introDone) { DoCast(me, SPELL_GRIP_OF_AGONY); @@ -314,7 +314,7 @@ class boss_deathbringer_saurfang : public CreatureScript void AttackStart(Unit* victim) { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE)) + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) return; ScriptedAI::AttackStart(victim); @@ -324,7 +324,7 @@ class boss_deathbringer_saurfang : public CreatureScript { ScriptedAI::EnterEvadeMode(); if (_introDone) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } void JustReachedHome() @@ -403,7 +403,7 @@ class boss_deathbringer_saurfang : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -434,7 +434,7 @@ class boss_deathbringer_saurfang : public CreatureScript case EVENT_INTRO_FINISH: events.SetPhase(PHASE_COMBAT); _introDone = true; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case EVENT_SUMMON_BLOOD_BEAST: for (uint32 i10 = 0; i10 < 2; ++i10) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index f90bc5d445e..a97c6f7d138 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -169,7 +169,7 @@ class boss_festergut : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -305,7 +305,7 @@ class npc_stinky_icc : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index af9bc3f43a3..ea2f73e788f 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -410,7 +410,7 @@ class boss_lady_deathwhisper : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK)) + if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -665,7 +665,7 @@ class npc_cult_fanatic : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -743,7 +743,7 @@ class npc_cult_adherent : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -888,7 +888,7 @@ class npc_darnavan : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (_canShatter && me->getVictim() && me->getVictim()->IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL)) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 04ae6f933d8..1672d8b2d87 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -106,6 +106,7 @@ class boss_lord_marrowgar : public CreatureScript events.ScheduleEvent(EVENT_COLDFLAME, 5000, EVENT_GROUP_SPECIAL); events.ScheduleEvent(EVENT_WARN_BONE_STORM, urand(45000, 50000)); events.ScheduleEvent(EVENT_ENRAGE, 600000); + _boneSlice = false; } void EnterCombat(Unit* /*who*/) @@ -153,7 +154,7 @@ class boss_lord_marrowgar : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 0d3640504c1..28964a28d78 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -75,6 +75,7 @@ enum Spells SPELL_PLAGUE_SICKNESS = 70953, SPELL_UNBOUND_PLAGUE_PROTECTION = 70955, SPELL_MUTATED_PLAGUE = 72451, + SPELL_MUTATED_PLAGUE_CLEAR = 72618, // Slime Puddle SPELL_GROW_STACKER = 70345, @@ -195,7 +196,7 @@ class boss_professor_putricide : public CreatureScript me->GetMotionMaster()->MovementExpired(); if (instance->GetBossState(DATA_ROTFACE) == DONE && instance->GetBossState(DATA_FESTERGUT) == DONE) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); } void EnterCombat(Unit* who) @@ -244,6 +245,7 @@ class boss_professor_putricide : public CreatureScript { _JustDied(); Talk(SAY_DEATH); + DoCast(SPELL_MUTATED_PLAGUE_CLEAR); } void JustSummoned(Creature* summon) @@ -517,7 +519,7 @@ class boss_professor_putricide : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -794,7 +796,7 @@ class spell_putricide_ooze_channel : public SpellScriptLoader void StartAttack() { - GetCaster()->ClearUnitState(UNIT_STAT_CASTING); + GetCaster()->ClearUnitState(UNIT_STATE_CASTING); GetCaster()->ToCreature()->AI()->AttackStart(GetHitUnit()); } @@ -1427,6 +1429,34 @@ class spell_putricide_regurgitated_ooze : public SpellScriptLoader } }; +class spell_putricide_clear_mutated_plague : public SpellScriptLoader +{ + public: + spell_putricide_clear_mutated_plague() : SpellScriptLoader("spell_putricide_clear_mutated_plague") { } + + class spell_putricide_clear_mutated_plague_SpellScript : public SpellScript + { + PrepareSpellScript(spell_putricide_clear_mutated_plague_SpellScript); + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + uint32 auraId = sSpellMgr->GetSpellIdForDifficulty(uint32(GetEffectValue()), GetCaster()); + GetHitUnit()->RemoveAurasDueToSpell(auraId); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_putricide_clear_mutated_plague_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_putricide_clear_mutated_plague_SpellScript(); + } +}; + // Stinky and Precious spell, it's here because its used for both (Festergut and Rotface "pets") class spell_stinky_precious_decimate : public SpellScriptLoader { @@ -1478,5 +1508,6 @@ void AddSC_boss_professor_putricide() new spell_putricide_mutated_transformation(); new spell_putricide_mutated_transformation_dmg(); new spell_putricide_regurgitated_ooze(); + new spell_putricide_clear_mutated_plague(); new spell_stinky_precious_decimate(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index a4cd96aa9f6..9649b6c8ef8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -169,7 +169,7 @@ class boss_rotface : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -384,7 +384,7 @@ class npc_precious_icc : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 46c1cf425ed..fb04d9ce7a4 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -268,7 +268,7 @@ class boss_sindragosa : public CreatureScript void MovementInform(uint32 type, uint32 point) { - if (type != POINT_MOTION_TYPE) + if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE) return; switch (point) @@ -379,7 +379,7 @@ class boss_sindragosa : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -646,7 +646,7 @@ class npc_spinestalker : public CreatureScript void MovementInform(uint32 type, uint32 point) { - if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND) + if (type != EFFECT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND) return; me->setActive(false); @@ -663,7 +663,7 @@ class npc_spinestalker : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -749,7 +749,7 @@ class npc_rimefang : public CreatureScript me->setActive(true); me->SetSpeed(MOVE_FLIGHT, 2.0f); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); float moveTime = me->GetExactDist(&RimefangFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f); me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, RimefangLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250)); me->SetDefaultMovementType(IDLE_MOTION_TYPE); @@ -761,14 +761,14 @@ class npc_rimefang : public CreatureScript void MovementInform(uint32 type, uint32 point) { - if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND) + if (type != EFFECT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND) return; me->setActive(false); me->SetFlying(false); me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SetHomePosition(RimefangLandPos); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } void EnterCombat(Unit* /*victim*/) @@ -783,7 +783,7 @@ class npc_rimefang : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -911,7 +911,7 @@ class npc_sindragosa_trash : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) 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 5029dbcceee..9866d2aace0 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -701,7 +701,7 @@ class boss_the_lich_king : public CreatureScript summon->CastSpell(summon, SPELL_ICE_SPHERE, false); summon->CastSpell(summon, SPELL_ICE_BURST_TARGET_SEARCH, false); summon->CastSpell(target, SPELL_ICE_PULSE, false); - summon->ClearUnitState(UNIT_STAT_CASTING); + summon->ClearUnitState(UNIT_STATE_CASTING); summon->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f); } else @@ -861,7 +861,7 @@ class boss_the_lich_king : public CreatureScript events.Update(diff); // during Remorseless Winter phases The Lich King is channeling a spell, but we must continue casting other spells - if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_MASK_NO_CAST_CHECK)) + if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_MASK_NO_CAST_CHECK)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -902,7 +902,7 @@ class boss_the_lich_king : public CreatureScript break; case EVENT_FINISH_INTRO: me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); events.SetPhase(PHASE_ONE); break; @@ -966,14 +966,14 @@ class boss_the_lich_king : public CreatureScript break; case EVENT_QUAKE: events.SetPhase(PHASE_TWO); - me->ClearUnitState(UNIT_STAT_CASTING); // clear state to ensure check in DoCastAOE passes + me->ClearUnitState(UNIT_STATE_CASTING); // clear state to ensure check in DoCastAOE passes DoCastAOE(SPELL_QUAKE); SendMusicToPlayers(MUSIC_SPECIAL); Talk(SAY_LK_QUAKE); break; case EVENT_QUAKE_2: events.SetPhase(PHASE_THREE); - me->ClearUnitState(UNIT_STAT_CASTING); // clear state to ensure check in DoCastAOE passes + me->ClearUnitState(UNIT_STATE_CASTING); // clear state to ensure check in DoCastAOE passes DoCastAOE(SPELL_QUAKE); SendMusicToPlayers(MUSIC_SPECIAL); Talk(SAY_LK_QUAKE); @@ -1059,7 +1059,7 @@ class boss_the_lich_king : public CreatureScript break; case EVENT_OUTRO_RAISE_DEAD: DoCastAOE(SPELL_RAISE_DEAD); - me->ClearUnitState(UNIT_STAT_CASTING); + me->ClearUnitState(UNIT_STATE_CASTING); SendMusicToPlayers(MUSIC_FINAL); break; case EVENT_OUTRO_TALK_5: @@ -1071,7 +1071,7 @@ class boss_the_lich_king : public CreatureScript Talk(SAY_LK_OUTRO_6); if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING))) tirion->SetFacingToObject(me); - me->ClearUnitState(UNIT_STAT_CASTING); + me->ClearUnitState(UNIT_STATE_CASTING); DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_3); SetEquipmentSlots(false, EQUIP_UNEQUIP); break; @@ -1255,7 +1255,7 @@ class npc_tirion_fordring_tft : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -1349,7 +1349,7 @@ class npc_shambling_horror_icc : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -1429,7 +1429,7 @@ class npc_raging_spirit : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -1498,7 +1498,7 @@ class npc_valkyr_shadowguard : public CreatureScript _events.Reset(); DoCastAOE(SPELL_EJECT_ALL_PASSENGERS); me->GetMotionMaster()->MoveTargetedHome(); - me->ClearUnitState(UNIT_STAT_EVADE); + me->ClearUnitState(UNIT_STATE_EVADE); } } @@ -1564,7 +1564,7 @@ class npc_valkyr_shadowguard : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -1825,7 +1825,7 @@ class npc_terenas_menethil : public CreatureScript if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING))) { lichKing->AI()->DoAction(ACTION_FINISH_OUTRO); - lichKing->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + lichKing->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); if (Creature* tirion = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING))) tirion->AI()->AttackStart(lichKing); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 96072ad0e83..e0993178890 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -426,7 +426,7 @@ class boss_valithria_dreamwalker : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -626,7 +626,7 @@ class npc_the_lich_king_controller : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -741,7 +741,7 @@ class npc_risen_archmage : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -807,7 +807,7 @@ class npc_blazing_skeleton : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -873,7 +873,7 @@ class npc_suppresser : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; // this code will never be reached while channeling @@ -967,7 +967,7 @@ class npc_gluttonous_abomination : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 6bd8f3cba7d..d02d8f3f316 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -611,7 +611,7 @@ class npc_rotting_frost_giant : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -809,7 +809,7 @@ class boss_sister_svalna : public CreatureScript case ACTION_START_GAUNTLET: me->setActive(true); _isEventInProgress = true; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); events.ScheduleEvent(EVENT_SVALNA_START, 25000); break; case ACTION_RESURRECT_CAPTAINS: @@ -843,7 +843,7 @@ class boss_sister_svalna : public CreatureScript _isEventInProgress = false; me->setActive(false); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); me->SetFlying(false); } @@ -874,7 +874,7 @@ class boss_sister_svalna : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -1130,7 +1130,7 @@ class npc_crok_scourgebane : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -1353,7 +1353,7 @@ class npc_captain_arnath : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -1434,7 +1434,7 @@ class npc_captain_brandon : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -1502,7 +1502,7 @@ class npc_captain_grondel : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -1567,7 +1567,7 @@ class npc_captain_rupert : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -1680,7 +1680,7 @@ class spell_icc_stoneform : public SpellScriptLoader if (Creature* target = GetTarget()->ToCreature()) { target->SetReactState(REACT_PASSIVE); - target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); target->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_CUSTOM_SPELL_02); } } @@ -1690,7 +1690,7 @@ class spell_icc_stoneform : public SpellScriptLoader if (Creature* target = GetTarget()->ToCreature()) { target->SetReactState(REACT_AGGRESSIVE); - target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); target->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); } } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp index 95f07ac212a..058c5b35e3a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp @@ -137,7 +137,7 @@ class boss_faerlina : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 2964cb5a699..47151ef6d80 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -342,7 +342,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 4c0efc4ac98..26e4b33ad8a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -400,7 +400,7 @@ class boss_gothik : public CreatureScript instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); } - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index f70f36e77a3..161c9160293 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -486,7 +486,7 @@ public: else uiGuardiansOfIcecrownTimer -= diff; } - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (uint32 eventId = events.GetEvent()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index be9168c6fd4..7977fa4df8a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -132,12 +132,12 @@ public: if (!checkFeugenAlive && !checkStalaggAlive) { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); me->SetReactState(REACT_AGGRESSIVE); } else { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); me->SetReactState(REACT_PASSIVE); } } @@ -179,13 +179,13 @@ public: if (!checkFeugenAlive && !checkStalaggAlive) { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); // REACT_AGGRESSIVE only reset when he takes damage. DoZoneInCombat(); } else { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); me->SetReactState(REACT_PASSIVE); } } @@ -248,7 +248,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 052fa3ba4a5..6dfa62df2d1 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -523,7 +523,7 @@ public: return; // We can't cast if we are casting already. - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index 6a57444893f..44c6c25fa3e 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -144,14 +144,14 @@ public: { if (remove) { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); if (me->HasAura(SPELL_FROZEN_PRISON)) me->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON); } else { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); DoCast(me, SPELL_FROZEN_PRISON, false); } diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp index fe00f5b97d8..bb75b789fff 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp @@ -95,7 +95,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp index b86e04f55bb..ab814a2ca22 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp @@ -200,7 +200,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 28b606c19e1..8852338c362 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -101,7 +101,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -256,10 +256,10 @@ class spell_varos_centrifuge_shield : public SpellScriptLoader { // flags taken from sniffs // UNIT_FLAG_UNK_9 -> means passive but it is not yet implemented in core - if (caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_PASSIVE|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6)) + if (caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_UNK_6)) { caster->ToCreature()->SetReactState(REACT_PASSIVE); - caster->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_PASSIVE|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6); + caster->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_UNK_6); } } } @@ -269,7 +269,7 @@ class spell_varos_centrifuge_shield : public SpellScriptLoader if (Unit* caster = GetCaster()) { caster->ToCreature()->SetReactState(REACT_AGGRESSIVE); - caster->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_PASSIVE|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6); + caster->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_UNK_6); } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index 2c7532fcf70..eadc524348b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -283,7 +283,7 @@ class boss_steelbreaker : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -404,7 +404,7 @@ class boss_runemaster_molgeim : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -649,7 +649,7 @@ class boss_stormcaller_brundir : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 10ff3db96c7..1c478cd83e9 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -217,7 +217,7 @@ class boss_auriaya : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -348,7 +348,7 @@ class npc_sanctum_sentry : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -418,7 +418,7 @@ class npc_feral_defender : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) 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 d96790c3e37..47f74b1ddba 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -384,7 +384,7 @@ class boss_flame_leviathan : public CreatureScript return; } - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -425,7 +425,7 @@ class boss_flame_leviathan : public CreatureScript break; case EVENT_REPAIR: me->MonsterTextEmote(EMOTE_REPAIR, 0, true); - me->ClearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT); + me->ClearUnitState(UNIT_STATE_STUNNED | UNIT_STATE_ROOT); events.ScheduleEvent(EVENT_SHUTDOWN, 150*IN_MILLISECONDS); events.CancelEvent(EVENT_REPAIR); break; @@ -1576,7 +1576,7 @@ class spell_systems_shutdown : public SpellScriptLoader return; //! This could probably in the SPELL_EFFECT_SEND_EVENT handler too: - owner->AddUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT); + owner->AddUnitState(UNIT_STATE_STUNNED | UNIT_STATE_ROOT); owner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); owner->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index f62c2d6c596..12d953a07b4 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -401,7 +401,7 @@ class boss_freya : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -739,7 +739,7 @@ class boss_elder_brightleaf : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -872,7 +872,7 @@ class boss_elder_stonebark : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -985,7 +985,7 @@ class boss_elder_ironbranch : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -1372,7 +1372,7 @@ class npc_healthy_spore : public CreatureScript { npc_healthy_sporeAI(Creature* creature) : Scripted_NoMovementAI(creature) { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_PASSIVE); DoCast(me, SPELL_HEALTHY_SPORE_VISUAL); DoCast(me, SPELL_POTENT_PHEROMONES); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index 0013a970380..c7918f85245 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -138,7 +138,7 @@ class boss_general_vezax : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -336,7 +336,7 @@ class boss_saronite_animus : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 918a401143a..33f50d0b3de 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -370,7 +370,7 @@ class boss_hodir : public CreatureScript me->StopMoving(); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); - me->SetControlled(true, UNIT_STAT_STUNNED); + me->SetControlled(true, UNIT_STATE_STUNNED); me->CombatStop(true); me->setFaction(35); @@ -387,7 +387,7 @@ class boss_hodir : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -612,12 +612,12 @@ class npc_hodir_priest : public CreatureScript void UpdateAI(uint32 const diff) { - if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) + if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) return; events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (HealthBelowPct(30)) @@ -688,12 +688,12 @@ class npc_hodir_shaman : public CreatureScript void UpdateAI(uint32 const diff) { - if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) + if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) return; events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -750,12 +750,12 @@ class npc_hodir_druid : public CreatureScript void UpdateAI(uint32 const diff) { - if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) + if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) return; events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -825,12 +825,12 @@ class npc_hodir_mage : public CreatureScript void UpdateAI(uint32 const diff) { - if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) + if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) return; events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index e72cf395a0d..d8a3ef0b8df 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -202,7 +202,7 @@ class boss_ignis : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 1fd8430abd8..a156e6ef08b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -224,7 +224,7 @@ class boss_kologarn : public CreatureScript summon->CastSpell(summon, SPELL_FOCUSED_EYEBEAM_VISUAL, true); summon->SetReactState(REACT_PASSIVE); // One of the above spells is a channeled spell, we need to clear this unit state for MoveChase to work - summon->ClearUnitState(UNIT_STAT_CASTING); + summon->ClearUnitState(UNIT_STATE_CASTING); // Victim gets 67351 if (eyebeamTarget) @@ -244,7 +244,7 @@ class boss_kologarn : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 8f09ab26a0a..724eb45d586 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -263,7 +263,7 @@ class boss_xt002 : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index ea84502c16d..a11f88fc6af 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -18,7 +18,7 @@ /* ScriptData SDName: Boss_Ingvar_The_Plunderer SD%Complete: 95 -SDComment: Some Problems with Annhylde Movement, Blizzlike Timers +SDComment: Some Problems with Annhylde Movement, Blizzlike Timers (just shadow axe summon needs a new timer) SDCategory: Udgarde Keep EndScriptData */ @@ -45,16 +45,32 @@ enum Creatures MOB_INGVAR_UNDEAD = 23980, }; +enum Events +{ + EVENT_CLEAVE = 1, + EVENT_SMASH, + EVENT_STAGGERING_ROAR, + EVENT_ENRAGE, + + EVENT_DARK_SMASH, + EVENT_DREADFUL_ROAR, + EVENT_WOE_STRIKE, + EVENT_SHADOW_AXE +}; + +enum Phases +{ + PHASE_HUMAN = 1, + PHASE_UNDEAD, +}; + enum Spells { //Ingvar Spells human form SPELL_CLEAVE = 42724, SPELL_SMASH = 42669, - H_SPELL_SMASH = 59706, SPELL_STAGGERING_ROAR = 42708, - H_SPELL_STAGGERING_ROAR = 59708, SPELL_ENRAGE = 42705, - H_SPELL_ENRAGE = 59707, SPELL_INGVAR_FEIGN_DEATH = 42795, SPELL_SUMMON_BANSHEE = 42912, @@ -63,9 +79,7 @@ enum Spells //Ingvar Spells undead form SPELL_DARK_SMASH = 42723, SPELL_DREADFUL_ROAR = 42729, - H_SPELL_DREADFUL_ROAR = 59734, SPELL_WOE_STRIKE = 42730, - H_SPELL_WOE_STRIKE = 59735, ENTRY_THROW_TARGET = 23996, SPELL_SHADOW_AXE_SUMMON = 42749 @@ -83,9 +97,9 @@ public: struct boss_ingvar_the_plundererAI : public ScriptedAI { - boss_ingvar_the_plundererAI(Creature* c) : ScriptedAI(c) + boss_ingvar_the_plundererAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -93,10 +107,6 @@ public: bool bIsUndead; bool bEventInProgress; - uint32 uiCleaveTimer; - uint32 uiSmashTimer; - uint32 uiEnrageTimer; - uint32 uiRoarTimer; uint32 uiSpawnResTimer; void Reset() @@ -107,13 +117,21 @@ public: bIsUndead = false; bEventInProgress = false; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetStandState(UNIT_STAND_STATE_STAND); - uiCleaveTimer = 2000; - uiSmashTimer = 5000; - uiEnrageTimer = 10000; - uiRoarTimer = 15000; + events.Reset(); + events.SetPhase(PHASE_HUMAN); + + events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN); + + events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD); uiSpawnResTimer = 3000; @@ -138,6 +156,7 @@ public: bEventInProgress = true; bIsUndead = true; + events.SetPhase(PHASE_UNDEAD); DoScriptText(YELL_DEAD_1, me); } @@ -208,70 +227,60 @@ public: return; } - if (uiCleaveTimer <= diff) - { - if (!me->HasUnitState(UNIT_STAT_CASTING)) - { - if (bIsUndead) - DoCast(me->getVictim(), SPELL_WOE_STRIKE); - else - DoCast(me->getVictim(), SPELL_CLEAVE); - uiCleaveTimer = rand()%5000 + 2000; - } - } else uiCleaveTimer -= diff; + events.Update(diff); - if (uiSmashTimer <= diff) - { - if (!me->HasUnitState(UNIT_STAT_CASTING)) - { - if (bIsUndead) - DoCast(me->getVictim(), SPELL_DARK_SMASH); - else - DoCast(me->getVictim(), SPELL_SMASH); - uiSmashTimer = 10000; - } - } else uiSmashTimer -= diff; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - if (!bIsUndead) - { - if (uiEnrageTimer <= diff) - { - DoCast(me, SPELL_ENRAGE); - uiEnrageTimer = 10000; - } else uiEnrageTimer -= diff; - } else // In Undead form used to summon weapon + while (uint32 eventId = events.ExecuteEvent()) { - if (uiEnrageTimer <= diff) + switch (eventId) { - if (!me->HasUnitState(UNIT_STAT_CASTING)) - { - // Spawn target for Axe - Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); - if (target) + // PHASE ONE + case EVENT_CLEAVE: + DoCastVictim(SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN); + break; + case EVENT_STAGGERING_ROAR: + DoCast(me, SPELL_STAGGERING_ROAR); + events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN); + break; + case EVENT_ENRAGE: + DoCast(me, SPELL_ENRAGE); + events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN); + break; + case EVENT_SMASH: + DoCastVictim(SPELL_SMASH); + events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN); + break; + // PHASE TWO + case EVENT_DARK_SMASH: + DoCastVictim(SPELL_DARK_SMASH); + events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + break; + case EVENT_DREADFUL_ROAR: + DoCast(me, SPELL_DREADFUL_ROAR); + events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + break; + case EVENT_WOE_STRIKE: + DoCastVictim(SPELL_WOE_STRIKE); + events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + break; + case EVENT_SHADOW_AXE: + if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1)) { me->SummonCreature(ENTRY_THROW_TARGET, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2000); - DoCast(me, SPELL_SHADOW_AXE_SUMMON); } - uiEnrageTimer = 30000; - } - } else uiEnrageTimer -= diff; - } - - if (uiRoarTimer <= diff) - { - if (!me->HasUnitState(UNIT_STAT_CASTING)) - { - if (bIsUndead) - DoCast(me, SPELL_DREADFUL_ROAR); - else - DoCast(me, SPELL_STAGGERING_ROAR); - uiRoarTimer = 10000; + events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD); + break; } - } else uiRoarTimer -= diff; + } DoMeleeAttackIfReady(); } + private: + EventMap events; }; }; @@ -381,8 +390,9 @@ public: { ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY); - if (boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI* pAI = CAST_AI(boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI, ingvar->AI())) - pAI->StartZombiePhase(); + if (ingvar->getVictim()) + if (boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI* ai = CAST_AI(boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI, ingvar->AI())) + ai->StartZombiePhase(); me->GetMotionMaster()->MovePoint(2, x+1, y, z+30); ++uiResurectPhase; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index dc93917f2e5..8a6d7f80818 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -17,354 +17,323 @@ /* ScriptData SDName: Boss_Prince_Keleseth -SD%Complete: 90 -SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells +SD%Complete: 100 +SDComment: SDCategory: Utgarde Keep EndScriptData */ #include "ScriptPCH.h" #include "utgarde_keep.h" -enum eEnums +enum KelsethEncounter { - ACHIEVEMENT_ON_THE_ROCKS = 1919, - SPELL_SHADOWBOLT = 43667, - SPELL_SHADOWBOLT_HEROIC = 59389, SPELL_FROST_TOMB = 48400, + SPELL_FROST_TOMB_STUN = 42672, SPELL_FROST_TOMB_SUMMON = 42714, + + SPELL_SHADOW_FISSURE = 50657, + SPELL_FULL_HEAL = 17683, SPELL_DECREPIFY = 42702, - SPELL_SCOURGE_RESSURRECTION = 42704, - CREATURE_FROSTTOMB = 23965, - CREATURE_SKELETON = 23970, - - SAY_AGGRO = -1574000, - SAY_FROST_TOMB = -1574001, - SAY_SKELETONS = -1574002, - SAY_KILL = -1574003, - SAY_DEATH = -1574004 + SPELL_BONE_ARMOR = 59386, + + NPC_FROSTTOMB = 23965, + NPC_SKELETON = 23970, + + SAY_START_COMBAT = 1, + SAY_SUMMON_SKELETONS, + SAY_FROST_TOMB, + SAY_FROST_TOMB_EMOTE, + SAY_DEATH, + + EVENT_SHADOWBOLT = 1, + EVENT_FROST_TOMB, + EVENT_SUMMON_SKELETONS, + + EVENT_DECREPIFY, + EVENT_FULL_HEAL, + EVENT_SHADOW_FISSURE, + EVENT_RESURRECT, + + DATA_ON_THE_ROCKS }; #define SKELETONSPAWN_Z 42.8668f -float SkeletonSpawnPoint[5][5]= +float const SkeletonSpawnPoint[1][2] = { {156.2559f, 259.2093f}, - {156.2559f, 259.2093f}, - {156.2559f, 259.2093f}, - {156.2559f, 259.2093f}, - {156.2559f, 259.2093f}, }; -float AttackLoc[3]={197.636f, 194.046f, 40.8164f}; +float AttackLoc[3]= {197.636f, 194.046f, 40.8164f}; -bool ShatterFrostTomb; // needed for achievement: On The Rocks(1919) - -class mob_frost_tomb : public CreatureScript +class npc_frost_tomb : public CreatureScript { public: - mob_frost_tomb() : CreatureScript("mob_frost_tomb") { } + npc_frost_tomb() : CreatureScript("npc_frost_tomb") {} CreatureAI* GetAI(Creature* creature) const { - return new mob_frost_tombAI(creature); + return new npc_frost_tombAI(creature); } - struct mob_frost_tombAI : public ScriptedAI + struct npc_frost_tombAI : public ScriptedAI { - mob_frost_tombAI(Creature* c) : ScriptedAI(c) + npc_frost_tombAI(Creature* creature) : ScriptedAI(creature) { - FrostTombGUID = 0; - } - - uint64 FrostTombGUID; + if (me->isSummon()) + if (Unit* summon = me->ToTempSummon()->GetSummoner()) + DoCast(summon, SPELL_FROST_TOMB, true); - void SetPrisoner(Unit* uPrisoner) - { - FrostTombGUID = uPrisoner->GetGUID(); + instance = creature->GetInstanceScript(); } - void Reset(){ FrostTombGUID = 0; } - void EnterCombat(Unit* /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) {} - void JustDied(Unit* killer) + void JustDied(Unit* /*killer*/) { - if (killer->GetGUID() != me->GetGUID()) - ShatterFrostTomb = true; - - if (FrostTombGUID) - { - Unit* FrostTomb = Unit::GetUnit((*me), FrostTombGUID); - if (FrostTomb) - FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB); - } + if (instance) + if (Unit* boss = me->GetUnit(*me, instance->GetData64(DATA_PRINCEKELESETH))) + if (boss->ToCreature() && boss->ToCreature()->AI()) + boss->ToCreature()->AI()->SetData(DATA_ON_THE_ROCKS, false); } - void UpdateAI(const uint32 /*diff*/) - { - Unit* temp = Unit::GetUnit((*me), FrostTombGUID); - if ((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp) - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } + private: + InstanceScript* instance; }; - }; class boss_keleseth : public CreatureScript { public: - boss_keleseth() : CreatureScript("boss_keleseth") { } + boss_keleseth() : CreatureScript("boss_keleseth") {} CreatureAI* GetAI(Creature* creature) const { return new boss_kelesethAI (creature); } - struct boss_kelesethAI : public ScriptedAI + struct boss_kelesethAI : public BossAI { - boss_kelesethAI(Creature* c) : ScriptedAI(c) + boss_kelesethAI(Creature* creature) : BossAI(creature, DATA_PRINCEKELESETH_EVENT) { - instance = c->GetInstanceScript(); + creature->SetReactState(REACT_DEFENSIVE); } - InstanceScript* instance; - - uint32 FrostTombTimer; - uint32 SummonSkeletonsTimer; - uint32 RespawnSkeletonsTimer; - uint32 ShadowboltTimer; - uint64 SkeletonGUID[5]; - bool Skeletons; - bool RespawnSkeletons; - void Reset() { - ShadowboltTimer = 0; - Skeletons = false; + instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED); - ShatterFrostTomb = false; + events.Reset(); + events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SUMMON_SKELETONS, 6*IN_MILLISECONDS); - ResetTimer(); + summons.DespawnAll(); - if (instance) - instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED); + onTheRocks = true; } - void KilledUnit(Unit* victim) + void EnterCombat(Unit* /*who*/) { - if (victim == me) - return; - - DoScriptText(SAY_KILL, me); + me->SetInCombatWithZone(); + instance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS); + Talk(SAY_START_COMBAT); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); - - if (IsHeroic() && !ShatterFrostTomb) - { - AchievementEntry const* AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS); - if (AchievOnTheRocks) - { - Map* map = me->GetMap(); - if (map && map->IsDungeon()) - { - Map::PlayerList const &players = map->GetPlayers(); - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievOnTheRocks); - } - } - } - - if (instance) - instance->SetData(DATA_PRINCEKELESETH_EVENT, DONE); + instance->SetData(DATA_PRINCEKELESETH_EVENT, DONE); + summons.DespawnAll(); + Talk(SAY_DEATH); } - void EnterCombat(Unit* /*who*/) + void SetData(uint32 data, uint32 value) { - DoScriptText(SAY_AGGRO, me); - DoZoneInCombat(); - - if (instance) - instance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS); + if (data == DATA_ON_THE_ROCKS) + onTheRocks = value; } - void ResetTimer(uint32 inc = 0) + uint32 GetData(uint32 data) { - SummonSkeletonsTimer = 5000 + inc; - FrostTombTimer = 28000 + inc; + if (data == DATA_ON_THE_ROCKS) + return onTheRocks; + + return 0; } - void UpdateAI(const uint32 diff) + void ExecuteEvent(uint32 const eventId) { - if (!UpdateVictim()) - return; - - if (ShadowboltTimer <= diff) + switch (eventId) { - Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0); - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - me->CastSpell(target, DUNGEON_MODE(SPELL_SHADOWBOLT, SPELL_SHADOWBOLT_HEROIC), true); - ShadowboltTimer = 10000; - } else ShadowboltTimer -= diff; - - if (!Skeletons) - { - if ((SummonSkeletonsTimer <= diff)) - { - Creature* Skeleton; - DoScriptText(SAY_SKELETONS, me); - for (uint8 i = 0; i < 5; ++i) + case EVENT_SUMMON_SKELETONS: + Talk(SAY_SUMMON_SKELETONS); + SummonSkeletons(); + break; + case EVENT_SHADOWBOLT: + DoCastVictim(SPELL_SHADOWBOLT); + events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS); + break; + case EVENT_FROST_TOMB: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_FROST_TOMB)) { - Skeleton = me->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1], SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); - if (Skeleton) - { - Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - Skeleton->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); - Skeleton->AddThreat(me->getVictim(), 0.0f); - DoZoneInCombat(Skeleton); - } - } - Skeletons = true; - } else SummonSkeletonsTimer -= diff; - } + Talk(SAY_FROST_TOMB); + Talk(SAY_FROST_TOMB_EMOTE, target->GetGUID()); - if (FrostTombTimer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - if (target->isAlive()) - { - //DoCast(target, SPELL_FROST_TOMB_SUMMON, true); - if (Creature* pChains = me->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000)) - { - CAST_AI(mob_frost_tomb::mob_frost_tombAI, pChains->AI())->SetPrisoner(target); - pChains->CastSpell(target, SPELL_FROST_TOMB, true); - - DoScriptText(SAY_FROST_TOMB, me); - } + DoCast(target, SPELL_FROST_TOMB_STUN, true); + // checked from sniffs - the player casts the spell + target->CastSpell(target, SPELL_FROST_TOMB_SUMMON, true); } - FrostTombTimer = 15000; - } else FrostTombTimer -= diff; + events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS); + break; + } + } - DoMeleeAttackIfReady(); + void SummonSkeletons() + { + // I could not found any spell casted for this + for (uint8 i = 0; i < 4; ++i) + me->SummonCreature(NPC_SKELETON, SkeletonSpawnPoint[0][0], SkeletonSpawnPoint[0][1], SKELETONSPAWN_Z, 0); } + private: + bool onTheRocks; }; - }; -class mob_vrykul_skeleton : public CreatureScript +class npc_vrykul_skeleton : public CreatureScript { public: - mob_vrykul_skeleton() : CreatureScript("mob_vrykul_skeleton") { } + npc_vrykul_skeleton() : CreatureScript("npc_vrykul_skeleton") {} CreatureAI* GetAI(Creature* creature) const { - return new mob_vrykul_skeletonAI (creature); + return new npc_vrykul_skeletonAI (creature); } - struct mob_vrykul_skeletonAI : public ScriptedAI + struct npc_vrykul_skeletonAI : public ScriptedAI { - mob_vrykul_skeletonAI(Creature* c) : ScriptedAI(c) - { - instance = c->GetInstanceScript(); - } - - InstanceScript* instance; - uint32 Respawn_Time; - uint64 Target_Guid; - uint32 Decrepify_Timer; - - bool isDead; + npc_vrykul_skeletonAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { - Respawn_Time = 12000; - Decrepify_Timer = urand(10000, 20000); - isDead = false; + events.Reset(); + events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS); + + DoCast(SPELL_BONE_ARMOR); } - void EnterCombat(Unit* /*who*/){} - void DamageTaken(Unit* done_by, uint32 &damage) + void DamageTaken(Unit* /*done_by*/, uint32 &damage) { - if (done_by->GetGUID() == me->GetGUID()) - return; - if (damage >= me->GetHealth()) { - PretendToDie(); damage = 0; - } - } - void PretendToDie() - { - isDead = true; - me->InterruptNonMeleeSpells(true); - me->RemoveAllAuras(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->GetMotionMaster()->MovementExpired(false); - me->GetMotionMaster()->MoveIdle(); - me->SetStandState(UNIT_STAND_STATE_DEAD); - }; + // There are some issues with pets + // they will still attack. I would say it is a PetAI bug + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + { + // from sniffs + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); - void Resurrect() - { - isDead = false; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetStandState(UNIT_STAND_STATE_STAND); - DoCast(me, SPELL_SCOURGE_RESSURRECTION, true); + events.Reset(); + events.ScheduleEvent(EVENT_RESURRECT, urand(18,22)*IN_MILLISECONDS); - if (me->getVictim()) - { - me->GetMotionMaster()->MoveChase(me->getVictim()); - me->AI()->AttackStart(me->getVictim()); + me->GetMotionMaster()->MovementExpired(false); + me->GetMotionMaster()->MoveIdle(); + } } - else - me->GetMotionMaster()->Initialize(); - }; + } void UpdateAI(const uint32 diff) { - if (instance && instance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS) + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) { - if (isDead) + switch (eventId) { - if (Respawn_Time <= diff) - { - Resurrect(); - Respawn_Time = 12000; - } else Respawn_Time -= diff; + case EVENT_DECREPIFY: + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_DECREPIFY), SPELL_DECREPIFY); + events.ScheduleEvent(EVENT_DECREPIFY, urand(1,5)*IN_MILLISECONDS); + break; + case EVENT_RESURRECT: + events.ScheduleEvent(EVENT_FULL_HEAL, 1*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SHADOW_FISSURE, 1*IN_MILLISECONDS); + break; + case EVENT_FULL_HEAL: + DoCast(me, SPELL_FULL_HEAL, true); + break; + case EVENT_SHADOW_FISSURE: + DoCast(me, SPELL_SHADOW_FISSURE, true); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); + me->GetMotionMaster()->MoveChase(me->getVictim()); + events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS); + break; } - else - { - if (!UpdateVictim()) - return; + } - if (Decrepify_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DECREPIFY); - Decrepify_Timer = 30000; - } else Decrepify_Timer -= diff; + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + DoMeleeAttackIfReady(); + } - DoMeleeAttackIfReady(); - } - }else + private: + EventMap events; + }; +}; + +class spell_frost_tomb : public SpellScriptLoader +{ + public: + spell_frost_tomb() : SpellScriptLoader("spell_frost_tomb") {} + + class spell_frost_tomb_AuraScript : public AuraScript + { + PrepareAuraScript(spell_frost_tomb_AuraScript); + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (me->isAlive()) - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH) + if (Unit* caster = GetCaster()) + if (caster->ToCreature() && caster->isAlive()) + caster->ToCreature()->DespawnOrUnsummon(1000); } + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_frost_tomb_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_frost_tomb_AuraScript(); } - }; +}; + + +class achievement_on_the_rocks : public AchievementCriteriaScript +{ + public: + achievement_on_the_rocks() : AchievementCriteriaScript("achievement_on_the_rocks") {} + bool OnCheck(Player* /*source*/, Unit* target) + { + return target && target->IsAIEnabled && target->GetAI()->GetData(DATA_ON_THE_ROCKS); + } }; void AddSC_boss_keleseth() { new boss_keleseth(); - new mob_frost_tomb(); - new mob_vrykul_skeleton(); + new npc_frost_tomb(); + new npc_vrykul_skeleton(); + new spell_frost_tomb(); + new achievement_on_the_rocks(); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 0a778f852a0..656b2931abb 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -268,7 +268,7 @@ public: void JustReachedHome() { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_IMMUNE_TO_PC); me->SetStandState(UNIT_STAND_STATE_STAND); DoCast(me, SPELL_FREEZE); } @@ -381,7 +381,7 @@ public: void JustReachedHome() { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC); me->SetStandState(UNIT_STAND_STATE_STAND); DoCast(me, SPELL_FREEZE); } @@ -496,7 +496,7 @@ public: void JustReachedHome() { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC); me->SetStandState(UNIT_STAND_STATE_STAND); DoCast(me, SPELL_FREEZE); } @@ -611,7 +611,7 @@ public: void JustReachedHome() { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC); me->SetStandState(UNIT_STAND_STATE_STAND); DoCast(me, SPELL_FREEZE); } @@ -732,7 +732,7 @@ public: void JustReachedHome() { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC); me->SetStandState(UNIT_STAND_STATE_STAND); DoCast(me, SPELL_FREEZE); } @@ -793,7 +793,7 @@ public: if (pNext) { pNext->RemoveAurasDueToSpell(SPELL_FREEZE); - pNext->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_OOC_NOT_ATTACKABLE); + pNext->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC); pNext->SetStandState(UNIT_STAND_STATE_STAND); pNext->SetInCombatWithZone(); pNext->Attack(pNext->SelectNearestTarget(100), true); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 436336ec5b8..989e1e57453 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -94,6 +94,11 @@ enum SvalaPhase SVALADEAD }; +enum SvalaPoint +{ + POINT_FALL_GROUND = 1, +}; + #define DATA_INCREDIBLE_HULK 2043 static const float spectatorWP[2][3] = @@ -258,20 +263,20 @@ public: SetCombatMovement(false); me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); - me->GetMotionMaster()->MoveFall(); + me->GetMotionMaster()->MoveFall(POINT_FALL_GROUND); } } void MovementInform(uint32 motionType, uint32 pointId) { - if (motionType != POINT_MOTION_TYPE) + if (motionType != EFFECT_MOTION_TYPE) return; - if (pointId == 1) + if (pointId == POINT_FALL_GROUND) me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } - void JustDied(Unit* killer) + void JustDied(Unit* /*killer*/) { summons.DespawnAll(); @@ -280,15 +285,15 @@ public: Talk(SAY_DEATH); } - - void SpellHitTarget(Unit* target, const SpellInfo* spell) + + void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) { if (spell->Id == SPELL_RITUAL_STRIKE_EFF_1 && Phase != NORMAL && Phase != SVALADEAD) { Phase = NORMAL; SetCombatMovement(true); - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300, true)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f, true)) me->GetMotionMaster()->MoveChase(target); } } @@ -330,7 +335,7 @@ public: { std::list<Creature*> lspectatorList; GetCreatureListWithEntryInGrid(lspectatorList, me, CREATURE_SPECTATOR, 100.0f); - for(std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr) + for (std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr) { if ((*itr)->isAlive()) { @@ -397,7 +402,8 @@ public: Phase = NORMAL; break; } - } else introTimer -= diff; + } + else introTimer -= diff; return; } @@ -529,7 +535,7 @@ public: void UpdateAI(const uint32 diff) { - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (paralyzeTimer <= diff) @@ -657,7 +663,7 @@ class npc_scourge_hulk : public CreatureScript if (mightyBlow <= diff) { if (Unit* victim = me->getVictim()) - if (!victim->HasUnitState(UNIT_STAT_STUNNED)) // Prevent knocking back a ritual player + if (!victim->HasUnitState(UNIT_STATE_STUNNED)) // Prevent knocking back a ritual player DoCast(victim, SPELL_MIGHTY_BLOW); mightyBlow = urand(12000, 17000); } diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp index 1cc681b0133..bffc6af2a3a 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp @@ -81,7 +81,7 @@ class boss_archavon : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -161,7 +161,7 @@ class mob_archavon_warder : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp index 973e7a2844c..2f4079d4e3c 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp @@ -120,7 +120,7 @@ class boss_emalon : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -221,7 +221,7 @@ class mob_tempest_minion : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (Aura const* overchargedAura = me->GetAura(SPELL_OVERCHARGED)) diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp index a545a6ae14c..dd9db1c0a99 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp @@ -79,7 +79,7 @@ class boss_koralon : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index 4b92b54b0d3..162f59fa5b7 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -80,7 +80,7 @@ class boss_toravon : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -148,7 +148,7 @@ class mob_frost_warder : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (events.ExecuteEvent() == EVENT_FROST_BLAST) diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp index 148ae2b6c4b..63f0cd39893 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -97,7 +97,7 @@ public: void AttackStart(Unit* who) { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; if (me->Attack(who, true)) @@ -109,13 +109,13 @@ public: if (Creature* pGuard1 = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_EREKEM_GUARD_1) : 0)) { - pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); if (!pGuard1->getVictim() && pGuard1->AI()) pGuard1->AI()->AttackStart(who); } if (Creature* pGuard2 = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_EREKEM_GUARD_2) : 0)) { - pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); if (!pGuard2->getVictim() && pGuard2->AI()) pGuard2->AI()->AttackStart(who); } @@ -290,7 +290,7 @@ public: void AttackStart(Unit* who) { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; if (me->Attack(who, true)) diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp index 5b36481eca8..a191d9349f2 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp @@ -140,7 +140,7 @@ public: void AttackStart(Unit* who) { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; if (me->Attack(who, true)) diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp index 21e4df37d8e..c5b2cb3c327 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp @@ -87,7 +87,7 @@ public: void AttackStart(Unit* who) { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; if (me->Attack(who, true)) diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp index 08bc24329ca..84b04579681 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp @@ -80,7 +80,7 @@ public: void AttackStart(Unit* who) { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; if (me->Attack(who, true)) diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp index 095d63f2dff..ac165ac39ef 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp @@ -123,7 +123,7 @@ public: void AttackStart(Unit* who) { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; if (me->Attack(who, true)) diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index dc477855ff8..ff2009c2a17 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -91,7 +91,7 @@ public: void AttackStart(Unit* who) { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; if (me->Attack(who, true)) diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 3db63e5057b..5980c534595 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -249,7 +249,7 @@ public: if (uiCountErekemGuards < 2) { uiErekemGuard[uiCountErekemGuards++] = creature->GetGUID(); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); } break; case CREATURE_MORAGG: @@ -257,7 +257,7 @@ public: break; case CREATURE_CYANIGOSA: uiCyanigosa = creature->GetGUID(); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); break; case CREATURE_SINCLARI: uiSinclari = creature->GetGUID(); @@ -499,18 +499,18 @@ public: if (Creature* pGuard1 = instance->GetCreature(uiErekemGuard[0])) { if (bForceRespawn) - pGuard1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pGuard1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); else - pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); pGuard1->GetMotionMaster()->MovePoint(0, BossStartMove21); } if (Creature* pGuard2 = instance->GetCreature(uiErekemGuard[1])) { if (bForceRespawn) - pGuard2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pGuard2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); else - pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); pGuard2->GetMotionMaster()->MovePoint(0, BossStartMove22); } break; @@ -543,7 +543,7 @@ public: // generic boss state changes if (pBoss) { - pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); pBoss->SetReactState(REACT_AGGRESSIVE); if (!bForceRespawn) @@ -554,7 +554,7 @@ public: pBoss->Respawn(); pBoss->RemoveLootMode(1); } - pBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); uiWaveCount = 0; } } @@ -750,7 +750,7 @@ public: case 3: pCyanigosa->RemoveAurasDueToSpell(CYANIGOSA_BLUE_AURA); pCyanigosa->CastSpell(pCyanigosa, CYANIGOSA_SPELL_TRANSFORM, 0); - pCyanigosa->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pCyanigosa->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); pCyanigosa->SetReactState(REACT_AGGRESSIVE); uiCyanigosaEventTimer = 2*IN_MILLISECONDS; ++uiCyanigosaEventPhase; diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 617ce9655a7..8b77cb250da 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -443,7 +443,7 @@ public: if (instance && !uiBoss) uiBoss = instance->GetData(DATA_WAVE_COUNT) == 6 ? instance->GetData(DATA_FIRST_BOSS) : instance->GetData(DATA_SECOND_BOSS); me->SetReactState(REACT_PASSIVE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index b6e01d3188e..11fb0933b9b 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -1328,7 +1328,7 @@ public: if (uiType != POINT_MOTION_TYPE) return; - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); me->CastSpell(me, SPELL_STUN, true); if (me->isSummon()) if (Unit* summoner = me->ToTempSummon()->GetSummoner()) @@ -1445,7 +1445,7 @@ public: DoScriptText(SAY_LERYSSA_1, pLeryssa); pArlos->Kill(pArlos, false); pLeryssa->RemoveAura(SPELL_STUN); - pLeryssa->ClearUnitState(UNIT_STAT_STUNNED); + pLeryssa->ClearUnitState(UNIT_STATE_STUNNED); pLeryssa->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); pLeryssa->GetMotionMaster()->MovePoint(0, 3722.114502f, 3564.201660f, 477.441437f); @@ -1495,7 +1495,7 @@ public: if (Creature* pTalbot = me->FindNearestCreature(NPC_PRINCE_VALANAR, 50.0f, true)) CAST_AI(npc_counselor_talbot::npc_counselor_talbotAI, pTalbot->GetAI())->bCheck = true; - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); me->CastSpell(me, SPELL_STUN, true); if (me->isSummon()) diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/dalaran.cpp index 57007a93fa7..cd3cbf29d0d 100644 --- a/src/server/scripts/Northrend/dalaran.cpp +++ b/src/server/scripts/Northrend/dalaran.cpp @@ -32,7 +32,12 @@ Script Data End */ enum Spells { SPELL_TRESPASSER_A = 54028, - SPELL_TRESPASSER_H = 54029 + SPELL_TRESPASSER_H = 54029, + + SPELL_SUNREAVER_DISGUISE_FEMALE = 70973, + SPELL_SUNREAVER_DISGUISE_MALE = 70974, + SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971, + SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972, }; enum NPCs // All outdoor guards are within 35.0f of these NPCs @@ -71,8 +76,10 @@ public: Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself(); - // If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass - if (!player || player->isGameMaster() || player->IsBeingTeleported() || player->HasAura(70973) || player->HasAura(70971)) + if (!player || player->isGameMaster() || player->IsBeingTeleported() || + // If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass + player->HasAura(SPELL_SUNREAVER_DISGUISE_FEMALE) || player->HasAura(SPELL_SUNREAVER_DISGUISE_MALE) || + player->HasAura(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) || player->HasAura(SPELL_SILVER_COVENANT_DISGUISE_MALE)) return; switch (me->GetEntry()) diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index 9eb73463795..c0fad2374bc 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -370,7 +370,7 @@ public: if (me->FindNearestGameObject(OBJECT_HAUNCH, 2.0f)) { me->SetStandState(UNIT_STAND_STATE_DEAD); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); } m_uiPhase = 0; @@ -624,7 +624,7 @@ public: uiPlayerGUID = 0; uiTimer = 0; uiChopTimer = urand(10000, 12500); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); } @@ -683,7 +683,7 @@ public: { if (pCaster && pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_SMOKE_BOMB) { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_PASSIVE); me->CombatStop(false); uiPlayerGUID = pCaster->GetGUID(); diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp index 28384455616..91522503d65 100644 --- a/src/server/scripts/Northrend/icecrown.cpp +++ b/src/server/scripts/Northrend/icecrown.cpp @@ -115,38 +115,6 @@ public: }; /*###### -## npc_dame_evniki_kapsalis -######*/ - -enum eDameEnvikiKapsalis -{ - TITLE_CRUSADER = 123 -}; - -class npc_dame_evniki_kapsalis : public CreatureScript -{ -public: - npc_dame_evniki_kapsalis() : CreatureScript("npc_dame_evniki_kapsalis") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->HasTitle(TITLE_CRUSADER)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - return true; - } -}; - -/*###### ## npc_squire_david ######*/ @@ -276,65 +244,6 @@ public: }; /*###### -## npc_alorah_and_grimmin -######*/ - -enum ealorah_and_grimmin -{ - SPELL_CHAIN = 68341, - NPC_FJOLA_LIGHTBANE = 36065, - NPC_EYDIS_DARKBANE = 36066, - NPC_PRIESTESS_ALORAH = 36101, - NPC_PRIEST_GRIMMIN = 36102 -}; - -class npc_alorah_and_grimmin : public CreatureScript -{ -public: - npc_alorah_and_grimmin() : CreatureScript("npc_alorah_and_grimmin") { } - - struct npc_alorah_and_grimminAI : public ScriptedAI - { - npc_alorah_and_grimminAI(Creature* creature) : ScriptedAI(creature) {} - - bool uiCast; - - void Reset() - { - uiCast = false; - } - - void UpdateAI(const uint32 /*uiDiff*/) - { - if (uiCast) - return; - uiCast = true; - Creature* target = NULL; - - switch (me->GetEntry()) - { - case NPC_PRIESTESS_ALORAH: - target = me->FindNearestCreature(NPC_EYDIS_DARKBANE, 10.0f); - break; - case NPC_PRIEST_GRIMMIN: - target = me->FindNearestCreature(NPC_FJOLA_LIGHTBANE, 10.0f); - break; - } - if (target) - DoCast(target, SPELL_CHAIN); - - if (!UpdateVictim()) - return; - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_alorah_and_grimminAI(creature); - } -}; - -/*###### ## npc_guardian_pavilion ######*/ @@ -429,10 +338,8 @@ public: void AddSC_icecrown() { new npc_arete; - new npc_dame_evniki_kapsalis; new npc_squire_david; new npc_argent_valiant; - new npc_alorah_and_grimmin; new npc_guardian_pavilion; new npc_vereth_the_cunning; } diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index 2b73d57365a..0af82345dce 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -586,7 +586,7 @@ public: { npc_orinoko_tuskbreakerAI(Creature* creature) : ScriptedAI(creature) { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_PASSIVE); } @@ -622,7 +622,7 @@ public: if (uiType != POINT_MOTION_TYPE) return; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); uiBattleShoutTimer = 7000; @@ -734,7 +734,7 @@ public: void Reset() { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_PASSIVE); uiChargeTimer = 15000; uiUppercutTimer = 12000; @@ -747,7 +747,7 @@ public: { case 6: me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); break; } @@ -914,7 +914,7 @@ public: { npc_stinkbeardAI(Creature* creature) : npc_escortAI(creature) { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_PASSIVE); Start(true, true, 0, NULL); SetDespawnAtEnd(false); @@ -940,7 +940,7 @@ public: switch (uiI) { case 7: - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); break; diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index a8d1f22bd00..d359917ab28 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -82,7 +82,7 @@ public: summoned->CastSpell(summoned, SPELL_FOCUS_FIRE_VISUAL, false); summoned->setFaction(me->getFaction()); summoned->SetLevel(me->getLevel()); - summoned->AddUnitState(UNIT_STAT_ROOT); + summoned->AddUnitState(UNIT_STATE_ROOT); if (Unit* pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID)) summoned->AI()->AttackStart(pFocusedTarget); diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index c17b6d5baf3..58f0e10c950 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1865,7 +1865,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset() TransformCount = 0; me->SetDisplayId(21135); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index 3c06efefb08..0ed9d8e7833 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -136,7 +136,7 @@ public: DoCast(me, SPELL_SUBMERGE);//submerge anim me->SetVisible(false);//we start invis under water, submerged me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } void JustDied(Unit* /*Killer*/) @@ -205,7 +205,7 @@ public: { WaitTimer = 3000; CanStartEvent = true;//fresh fished from pool - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } else @@ -325,7 +325,7 @@ public: Submerged = false; me->InterruptNonMeleeSpells(false);//shouldn't be any me->RemoveAllAuras(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); DoCast(me, SPELL_EMERGE, true); Spawned = false; @@ -344,7 +344,7 @@ public: if (!Spawned) { - me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); //spawn adds for (uint8 i = 0; i < 9; ++i) { diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 71e773042b7..ecea5e6abb4 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -337,7 +337,7 @@ class boss_vazruden_the_herald : public CreatureScript VazrudenGUID = 0; } summoned = false; - me->ClearUnitState(UNIT_STAT_ROOT); + me->ClearUnitState(UNIT_STATE_ROOT); me->SetVisible(true); } } @@ -352,7 +352,7 @@ class boss_vazruden_the_herald : public CreatureScript NazanGUID = Nazan->GetGUID(); summoned = true; me->SetVisible(false); - me->AddUnitState(UNIT_STAT_ROOT); + me->AddUnitState(UNIT_STATE_ROOT); } } diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index 1679efb5525..c355079e0e8 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -252,8 +252,8 @@ class boss_magtheridon : public CreatureScript me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - me->AddUnitState(UNIT_STAT_STUNNED); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->AddUnitState(UNIT_STATE_STUNNED); DoCast(me, SPELL_SHADOW_CAGE_C, true); } @@ -334,7 +334,7 @@ class boss_magtheridon : public CreatureScript void AttackStart(Unit* who) { - if (!me->HasUnitState(UNIT_STAT_STUNNED)) + if (!me->HasUnitState(UNIT_STATE_STUNNED)) ScriptedAI::AttackStart(who); } @@ -388,7 +388,7 @@ class boss_magtheridon : public CreatureScript if (BlastNova_Timer <= diff) { // to avoid earthquake interruption - if (!me->HasUnitState(UNIT_STAT_STUNNED)) + if (!me->HasUnitState(UNIT_STATE_STUNNED)) { DoScriptText(EMOTE_BLASTNOVA, me); DoCast(me, SPELL_BLASTNOVA); @@ -431,7 +431,7 @@ class boss_magtheridon : public CreatureScript if (!Phase3 && HealthBelowPct(30) && !me->IsNonMeleeSpellCasted(false) // blast nova - && !me->HasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake + && !me->HasUnitState(UNIT_STATE_STUNNED)) // shadow cage and earthquake { Phase3 = true; DoScriptText(SAY_CHAMBER_DESTROY, me); diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp index 9d52a0a3e87..caaedc4c51b 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp @@ -223,7 +223,7 @@ class instance_magtheridons_lair : public InstanceMapScript Creature* Magtheridon = instance->GetCreature(MagtheridonGUID); if (Magtheridon && Magtheridon->isAlive()) { - Magtheridon->ClearUnitState(UNIT_STAT_STUNNED); + Magtheridon->ClearUnitState(UNIT_STATE_STUNNED); Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999)); } CageTimer = 0; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index a45576f8884..904b2851816 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -397,7 +397,7 @@ class boss_kaelthas : public CreatureScript void MoveInLineOfSight(Unit* who) { - if (!me->HasUnitState(UNIT_STAT_STUNNED) && me->canCreatureAttack(who)) + if (!me->HasUnitState(UNIT_STATE_STUNNED) && me->canCreatureAttack(who)) { if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp index 070c107e61d..ed818fb13be 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp @@ -17,6 +17,9 @@ //! TODO - Boss not scripted, just ported required spellscript from core +#include "ScriptMgr.h" +#include "SpellScript.h" + enum Spells { SPELL_POSITIVE_CHARGE = 39090, diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp index 327ca289553..de86ec8672c 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp @@ -89,7 +89,7 @@ class boss_harbinger_skyriss : public CreatureScript void Reset() { if (!Intro) - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); IsImage33 = false; IsImage66 = false; @@ -184,7 +184,7 @@ class boss_harbinger_skyriss : public CreatureScript Intro_Timer = 3000; break; case 3: - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); Intro = true; break; } diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 4a83181159c..2f6e0823da1 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -110,7 +110,7 @@ class boss_doomlord_kazzak : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp index 883601632b8..c4bd232cc85 100644 --- a/src/server/scripts/Outland/boss_doomwalker.cpp +++ b/src/server/scripts/Outland/boss_doomwalker.cpp @@ -103,7 +103,7 @@ class boss_doomwalker : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index c27ad8e7948..668db2efcbb 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -632,7 +632,7 @@ public: if (!UpdateVictim()) return; - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (ChainLightningTimer <= diff) diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index efebf7dfe94..79811069402 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -796,7 +796,7 @@ public: Materialize = true; } - if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->HasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it + if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->HasUnitState(UNIT_STATE_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it DoCast(me, SPELL_PHASE_SLIP); if (!UpdateVictim()) diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index e4c4e020b0f..07de7fe4786 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -1195,7 +1195,7 @@ public: AggroTargetGUID = 0; Timers = false; - me->AddUnitState(UNIT_STAT_ROOT); + me->AddUnitState(UNIT_STATE_ROOT); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetTarget(0); } @@ -1239,7 +1239,7 @@ public: if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID))) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->ClearUnitState(UNIT_STAT_ROOT); + me->ClearUnitState(UNIT_STATE_ROOT); float x, y, z; AggroTarget->GetPosition(x, y, z); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 3fb2c4f3319..3d552901295 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -342,11 +342,8 @@ class spell_gen_remove_flight_auras : public SpellScriptLoader PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript); void HandleScript(SpellEffIndex /*effIndex*/) { - Unit* target = GetHitUnit(); - if (!target) - return; - target->RemoveAurasByType(SPELL_AURA_FLY); - target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); + GetHitUnit()->RemoveAurasByType(SPELL_AURA_FLY); + GetHitUnit()->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); } void Register() @@ -412,6 +409,72 @@ class spell_gen_leeching_swarm : public SpellScriptLoader } }; +enum EluneCandle +{ + NPC_OMEN = 15467, + + SPELL_ELUNE_CANDLE_OMEN_HEAD = 26622, + SPELL_ELUNE_CANDLE_OMEN_CHEST = 26624, + SPELL_ELUNE_CANDLE_OMEN_HAND_R = 26625, + SPELL_ELUNE_CANDLE_OMEN_HAND_L = 26649, + SPELL_ELUNE_CANDLE_NORMAL = 26636, +}; + +class spell_gen_elune_candle : public SpellScriptLoader +{ + public: + spell_gen_elune_candle() : SpellScriptLoader("spell_gen_elune_candle") {} + + class spell_gen_elune_candle_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_elune_candle_SpellScript); + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HEAD)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_CHEST)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_R)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_L)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_NORMAL)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + uint32 spellId = 0; + + if (GetHitUnit()->GetEntry() == NPC_OMEN) + { + switch (urand(0, 3)) + { + case 0: spellId = SPELL_ELUNE_CANDLE_OMEN_HEAD; break; + case 1: spellId = SPELL_ELUNE_CANDLE_OMEN_CHEST; break; + case 2: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_R; break; + case 3: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_L; break; + } + } + else + spellId = SPELL_ELUNE_CANDLE_NORMAL; + + GetCaster()->CastSpell(GetHitUnit(), spellId, true, NULL); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_elune_candle_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_elune_candle_SpellScript(); + } +}; + // 24750 Trick enum eTrickSpells { @@ -878,11 +941,8 @@ class spell_generic_clone : public SpellScriptLoader void HandleScriptEffect(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - Unit* caster = GetCaster(); uint32 spellId = uint32(GetSpellInfo()->Effects[effIndex].CalcValue()); - - if (Unit* target = GetHitUnit()) - target->CastSpell(caster, spellId, true); + GetHitUnit()->CastSpell(GetCaster(), spellId, true); } void Register() @@ -1481,6 +1541,819 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader } }; +enum DalaranDisguiseSpells +{ + SPELL_SUNREAVER_DISGUISE_TRIGGER = 69672, + SPELL_SUNREAVER_DISGUISE_FEMALE = 70973, + SPELL_SUNREAVER_DISGUISE_MALE = 70974, + + SPELL_SILVER_COVENANT_DISGUISE_TRIGGER = 69673, + SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971, + SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972, +}; + +class spell_gen_dalaran_disguise : public SpellScriptLoader +{ + public: + spell_gen_dalaran_disguise(const char* name) : SpellScriptLoader(name) {} + + class spell_gen_dalaran_disguise_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_dalaran_disguise_SpellScript); + bool Validate(SpellInfo const* spellEntry) + { + switch (spellEntry->Id) + { + case SPELL_SUNREAVER_DISGUISE_TRIGGER: + if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE)) + return false; + break; + case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER: + if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE)) + return false; + break; + } + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Player* player = GetHitPlayer()) + { + uint8 gender = player->getGender(); + + uint32 spellId = GetSpellInfo()->Id; + + switch (spellId) + { + case SPELL_SUNREAVER_DISGUISE_TRIGGER: + spellId = gender ? SPELL_SUNREAVER_DISGUISE_FEMALE : SPELL_SUNREAVER_DISGUISE_MALE; + break; + case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER: + spellId = gender ? SPELL_SILVER_COVENANT_DISGUISE_FEMALE : SPELL_SILVER_COVENANT_DISGUISE_MALE; + break; + default: + break; + } + + GetCaster()->CastSpell(player, spellId, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_dalaran_disguise_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_dalaran_disguise_SpellScript(); + } +}; + +/* DOCUMENTATION: Break-Shield spells + Break-Shield spells can be classified in three groups: + + - Spells on vehicle bar used by players: + + EFFECT_0: SCRIPT_EFFECT + + EFFECT_1: NONE + + EFFECT_2: NONE + - Spells casted by players triggered by script: + + EFFECT_0: SCHOOL_DAMAGE + + EFFECT_1: SCRIPT_EFFECT + + EFFECT_2: FORCE_CAST + - Spells casted by NPCs on players: + + EFFECT_0: SCHOOL_DAMAGE + + EFFECT_1: SCRIPT_EFFECT + + EFFECT_2: NONE + + In the following script we handle the SCRIPT_EFFECT for effIndex EFFECT_0 and EFFECT_1. + - When handling EFFECT_0 we're in the "Spells on vehicle bar used by players" case + and we'll trigger "Spells casted by players triggered by script" + - When handling EFFECT_1 we're in the "Spells casted by players triggered by script" + or "Spells casted by NPCs on players" so we'll search for the first defend layer and drop it. +*/ + +enum BreakShieldSpells +{ + SPELL_BREAK_SHIELD_DAMAGE_2K = 62626, + SPELL_BREAK_SHIELD_DAMAGE_10K = 64590, + + SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS = 62575, // Also on ToC5 mounts + SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE = 64595, + SPELL_BREAK_SHIELD_TRIGGER_UNK = 66480, +}; + +class spell_gen_break_shield: public SpellScriptLoader +{ + public: + spell_gen_break_shield() : SpellScriptLoader("spell_gen_break_shield") { } + + class spell_gen_break_shield_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_break_shield_SpellScript) + + void HandleScriptEffect(SpellEffIndex effIndex) + { + Unit* target = GetHitUnit(); + + switch (effIndex) + { + case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual) + { + uint32 spellId; + + switch (GetSpellInfo()->Id) + { + case SPELL_BREAK_SHIELD_TRIGGER_UNK: + case SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE: + spellId = SPELL_BREAK_SHIELD_DAMAGE_10K; + break; + case SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS: + spellId = SPELL_BREAK_SHIELD_DAMAGE_2K; + break; + default: + return; + } + + if (Unit* rider = GetCaster()->GetCharmer()) + rider->CastSpell(target, spellId, false); + else + GetCaster()->CastSpell(target, spellId, false); + break; + } + case EFFECT_1: // On damaging spells, for removing a defend layer + { + Unit::AuraApplicationMap const& auras = target->GetAppliedAuras(); + for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + { + Aura* aura = itr->second->GetBase(); + SpellInfo const* auraInfo = aura->GetSpellInfo(); + if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)) + { + aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL); + // Remove dummys from rider (Necessary for updating visual shields) + if (Unit* rider = target->GetCharmer()) + if (Aura* defend = rider->GetAura(aura->GetId())) + defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL); + break; + } + } + break; + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_break_shield_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_break_shield_SpellScript(); + } +}; + +/* DOCUMENTATION: Charge spells + Charge spells can be classified in four groups: + + - Spells on vehicle bar used by players: + + EFFECT_0: SCRIPT_EFFECT + + EFFECT_1: TRIGGER_SPELL + + EFFECT_2: NONE + - Spells casted by player's mounts triggered by script: + + EFFECT_0: CHARGE + + EFFECT_1: TRIGGER_SPELL + + EFFECT_2: APPLY_AURA + - Spells casted by players on the target triggered by script: + + EFFECT_0: SCHOOL_DAMAGE + + EFFECT_1: SCRIPT_EFFECT + + EFFECT_2: NONE + - Spells casted by NPCs on players: + + EFFECT_0: SCHOOL_DAMAGE + + EFFECT_1: CHARGE + + EFFECT_2: SCRIPT_EFFECT + + In the following script we handle the SCRIPT_EFFECT and CHARGE + - When handling SCRIPT_EFFECT: + + EFFECT_0: Corresponds to "Spells on vehicle bar used by players" and we make player's mount cast + the charge effect on the current target ("Spells casted by player's mounts triggered by script"). + + EFFECT_1 and EFFECT_2: Triggered when "Spells casted by player's mounts triggered by script" hits target, + corresponding to "Spells casted by players on the target triggered by script" and "Spells casted by + NPCs on players" and we check Defend layers and drop a charge of the first found. + - When handling CHARGE: + + Only launched for "Spells casted by player's mounts triggered by script", makes the player cast the + damaging spell on target with a small chance of failing it. +*/ + +enum ChargeSpells +{ + SPELL_CHARGE_DAMAGE_8K5 = 62874, + SPELL_CHARGE_DAMAGE_20K = 68498, + SPELL_CHARGE_DAMAGE_45K = 64591, + + SPELL_CHARGE_CHARGING_EFFECT_8K5 = 63661, + SPELL_CHARGE_CHARGING_EFFECT_20K_1 = 68284, + SPELL_CHARGE_CHARGING_EFFECT_20K_2 = 68501, + SPELL_CHARGE_CHARGING_EFFECT_45K_1 = 62563, + SPELL_CHARGE_CHARGING_EFFECT_45K_2 = 66481, + + SPELL_CHARGE_TRIGGER_FACTION_MOUNTS = 62960, + SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION = 68282, + + SPELL_CHARGE_MISS_EFFECT = 62977, +}; + +class spell_gen_mounted_charge: public SpellScriptLoader +{ + public: + spell_gen_mounted_charge() : SpellScriptLoader("spell_gen_mounted_charge") { } + + class spell_gen_mounted_charge_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_mounted_charge_SpellScript) + + void HandleScriptEffect(SpellEffIndex effIndex) + { + Unit* target = GetHitUnit(); + + switch (effIndex) + { + case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual) + { + uint32 spellId; + + switch (GetSpellInfo()->Id) + { + case SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION: + spellId = SPELL_CHARGE_CHARGING_EFFECT_20K_1; + case SPELL_CHARGE_TRIGGER_FACTION_MOUNTS: + spellId = SPELL_CHARGE_CHARGING_EFFECT_8K5; + break; + default: + return; + } + + // If target isn't a training dummy there's a chance of failing the charge + if (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE) && roll_chance_f(12.5f)) + spellId = SPELL_CHARGE_MISS_EFFECT; + + if (Unit* vehicle = GetCaster()->GetVehicleBase()) + vehicle->CastSpell(target, spellId, false); + else + GetCaster()->CastSpell(target, spellId, false); + break; + } + case EFFECT_1: // On damaging spells, for removing a defend layer + case EFFECT_2: + { + Unit::AuraApplicationMap const& auras = target->GetAppliedAuras(); + for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + { + Aura* aura = itr->second->GetBase(); + SpellInfo const* auraInfo = aura->GetSpellInfo(); + if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)) + { + aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL); + // Remove dummys from rider (Necessary for updating visual shields) + if (Unit* rider = target->GetCharmer()) + if (Aura* defend = rider->GetAura(aura->GetId())) + defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL); + break; + } + } + break; + } + } + } + + void HandleChargeEffect(SpellEffIndex effIndex) + { + uint32 spellId; + + switch (GetSpellInfo()->Id) + { + case SPELL_CHARGE_CHARGING_EFFECT_8K5: + spellId = SPELL_CHARGE_DAMAGE_8K5; + break; + case SPELL_CHARGE_CHARGING_EFFECT_20K_1: + case SPELL_CHARGE_CHARGING_EFFECT_20K_2: + spellId = SPELL_CHARGE_DAMAGE_20K; + break; + case SPELL_CHARGE_CHARGING_EFFECT_45K_1: + case SPELL_CHARGE_CHARGING_EFFECT_45K_2: + spellId = SPELL_CHARGE_DAMAGE_45K; + break; + default: + return; + } + + if (Unit* rider = GetCaster()->GetCharmer()) + rider->CastSpell(GetHitUnit(), spellId, false); + else + GetCaster()->CastSpell(GetHitUnit(), spellId, false); + } + + void Register() + { + SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId); + + if (spell->HasEffect(SPELL_EFFECT_SCRIPT_EFFECT)) + OnEffectHitTarget += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT); + + if (spell->Effects[EFFECT_0].Effect == SPELL_EFFECT_CHARGE) + OnEffectHitTarget += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleChargeEffect, EFFECT_0, SPELL_EFFECT_CHARGE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_mounted_charge_SpellScript(); + } +}; + +enum DefendVisuals +{ + SPELL_VISUAL_SHIELD_1 = 63130, + SPELL_VISUAL_SHIELD_2 = 63131, + SPELL_VISUAL_SHIELD_3 = 63132, +}; + +class spell_gen_defend : public SpellScriptLoader +{ + public: + spell_gen_defend() : SpellScriptLoader("spell_gen_defend") { } + + class spell_gen_defendAuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_defendAuraScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3)) + return false; + return true; + } + + void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + Unit* target = GetTarget(); + + for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i) + target->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i); + + target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, true, NULL, aurEff); + } + else + GetTarget()->RemoveAurasDueToSpell(GetId()); + } + + void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i) + GetTarget()->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i); + } + + void RemoveDummyFromDriver(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + if (TempSummon* vehicle = caster->ToTempSummon()) + if (Unit* rider = vehicle->GetSummoner()) + rider->RemoveAurasDueToSpell(GetId()); + } + + void Register() + { + SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId); + + // Defend spells casted by NPCs (add visuals) + if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) + { + AfterEffectApply += AuraEffectApplyFn(spell_gen_defendAuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + } + + // Remove Defend spell from player when he dismounts + if (spell->Effects[EFFECT_2].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) + OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL); + + // Defend spells casted by players (add/remove visuals) + if (spell->Effects[EFFECT_1].ApplyAuraName == SPELL_AURA_DUMMY) + { + AfterEffectApply += AuraEffectApplyFn(spell_gen_defendAuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + } + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_defendAuraScript(); + } +}; + +enum MountedDuelSpells +{ + SPELL_ON_TOURNAMENT_MOUNT = 63034, + SPELL_MOUNTED_DUEL = 62875, +}; + +class spell_gen_tournament_duel : public SpellScriptLoader +{ + public: + spell_gen_tournament_duel() : SpellScriptLoader("spell_gen_tournament_duel") { } + + class spell_gen_tournament_duel_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_tournament_duel_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ON_TOURNAMENT_MOUNT)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTED_DUEL)) + return false; + return true; + } + + void HandleScriptEffect(SpellEffIndex effIndex) + { + if (Unit* rider = GetCaster()->GetCharmer()) + { + if (Player* plrTarget = GetHitPlayer()) + { + if (plrTarget->HasAura(SPELL_ON_TOURNAMENT_MOUNT) && plrTarget->GetVehicleBase()) + rider->CastSpell(plrTarget, SPELL_MOUNTED_DUEL, true); + } + else if (Unit* unitTarget = GetHitUnit()) + { + if (unitTarget->GetCharmer() && unitTarget->GetCharmer()->GetTypeId() == TYPEID_PLAYER && unitTarget->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT)) + rider->CastSpell(unitTarget->GetCharmer(), SPELL_MOUNTED_DUEL, true); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_tournament_duel_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_tournament_duel_SpellScript(); + } +}; + +enum TournamentMountsSpells +{ + SPELL_LANCE_EQUIPPED = 62853, +}; + +class spell_gen_summon_tournament_mount : public SpellScriptLoader +{ + public: + spell_gen_summon_tournament_mount() : SpellScriptLoader("spell_gen_summon_tournament_mount") { } + + class spell_gen_summon_tournament_mount_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_summon_tournament_mount_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_LANCE_EQUIPPED)) + return false; + return true; + } + + SpellCastResult CheckIfLanceEquiped() + { + if (GetCaster()->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_MOUNT_WITH_SHAPESHIFT); + return SPELL_FAILED_CUSTOM_ERROR; + } + + if (!GetCaster()->HasAura(SPELL_LANCE_EQUIPPED)) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_summon_tournament_mount_SpellScript::CheckIfLanceEquiped); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_summon_tournament_mount_SpellScript(); + } +}; + +enum TournamentPennantSpells +{ + SPELL_PENNANT_STORMWIND_ASPIRANT = 62595, + SPELL_PENNANT_STORMWIND_VALIANT = 62596, + SPELL_PENNANT_STORMWIND_CHAMPION = 62594, + SPELL_PENNANT_GNOMEREGAN_ASPIRANT = 63394, + SPELL_PENNANT_GNOMEREGAN_VALIANT = 63395, + SPELL_PENNANT_GNOMEREGAN_CHAMPION = 63396, + SPELL_PENNANT_SEN_JIN_ASPIRANT = 63397, + SPELL_PENNANT_SEN_JIN_VALIANT = 63398, + SPELL_PENNANT_SEN_JIN_CHAMPION = 63399, + SPELL_PENNANT_SILVERMOON_ASPIRANT = 63401, + SPELL_PENNANT_SILVERMOON_VALIANT = 63402, + SPELL_PENNANT_SILVERMOON_CHAMPION = 63403, + SPELL_PENNANT_DARNASSUS_ASPIRANT = 63404, + SPELL_PENNANT_DARNASSUS_VALIANT = 63405, + SPELL_PENNANT_DARNASSUS_CHAMPION = 63406, + SPELL_PENNANT_EXODAR_ASPIRANT = 63421, + SPELL_PENNANT_EXODAR_VALIANT = 63422, + SPELL_PENNANT_EXODAR_CHAMPION = 63423, + SPELL_PENNANT_IRONFORGE_ASPIRANT = 63425, + SPELL_PENNANT_IRONFORGE_VALIANT = 63426, + SPELL_PENNANT_IRONFORGE_CHAMPION = 63427, + SPELL_PENNANT_UNDERCITY_ASPIRANT = 63428, + SPELL_PENNANT_UNDERCITY_VALIANT = 63429, + SPELL_PENNANT_UNDERCITY_CHAMPION = 63430, + SPELL_PENNANT_ORGRIMMAR_ASPIRANT = 63431, + SPELL_PENNANT_ORGRIMMAR_VALIANT = 63432, + SPELL_PENNANT_ORGRIMMAR_CHAMPION = 63433, + SPELL_PENNANT_THUNDER_BLUFF_ASPIRANT = 63434, + SPELL_PENNANT_THUNDER_BLUFF_VALIANT = 63435, + SPELL_PENNANT_THUNDER_BLUFF_CHAMPION = 63436, + SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT = 63606, + SPELL_PENNANT_ARGENT_CRUSADE_VALIANT = 63500, + SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION = 63501, + SPELL_PENNANT_EBON_BLADE_ASPIRANT = 63607, + SPELL_PENNANT_EBON_BLADE_VALIANT = 63608, + SPELL_PENNANT_EBON_BLADE_CHAMPION = 63609, +}; + +enum TournamentMounts +{ + NPC_STORMWIND_STEED = 33217, + NPC_IRONFORGE_RAM = 33316, + NPC_GNOMEREGAN_MECHANOSTRIDER = 33317, + NPC_EXODAR_ELEKK = 33318, + NPC_DARNASSIAN_NIGHTSABER = 33319, + NPC_ORGRIMMAR_WOLF = 33320, + NPC_DARK_SPEAR_RAPTOR = 33321, + NPC_THUNDER_BLUFF_KODO = 33322, + NPC_SILVERMOON_HAWKSTRIDER = 33323, + NPC_FORSAKEN_WARHORSE = 33324, + NPC_ARGENT_WARHORSE = 33782, + NPC_ARGENT_STEED_ASPIRANT = 33845, + NPC_ARGENT_HAWKSTRIDER_ASPIRANT = 33844, +}; + +enum TournamentQuestsAchievements +{ + ACHIEVEMENT_CHAMPION_STORMWIND = 2781, + ACHIEVEMENT_CHAMPION_DARNASSUS = 2777, + ACHIEVEMENT_CHAMPION_IRONFORGE = 2780, + ACHIEVEMENT_CHAMPION_GNOMEREGAN = 2779, + ACHIEVEMENT_CHAMPION_THE_EXODAR = 2778, + ACHIEVEMENT_CHAMPION_ORGRIMMAR = 2783, + ACHIEVEMENT_CHAMPION_SEN_JIN = 2784, + ACHIEVEMENT_CHAMPION_THUNDER_BLUFF = 2786, + ACHIEVEMENT_CHAMPION_UNDERCITY = 2787, + ACHIEVEMENT_CHAMPION_SILVERMOON = 2785, + ACHIEVEMENT_ARGENT_VALOR = 2758, + ACHIEVEMENT_CHAMPION_ALLIANCE = 2782, + ACHIEVEMENT_CHAMPION_HORDE = 2788, + + QUEST_VALIANT_OF_STORMWIND = 13593, + QUEST_A_VALIANT_OF_STORMWIND = 13684, + QUEST_VALIANT_OF_DARNASSUS = 13706, + QUEST_A_VALIANT_OF_DARNASSUS = 13689, + QUEST_VALIANT_OF_IRONFORGE = 13703, + QUEST_A_VALIANT_OF_IRONFORGE = 13685, + QUEST_VALIANT_OF_GNOMEREGAN = 13704, + QUEST_A_VALIANT_OF_GNOMEREGAN = 13688, + QUEST_VALIANT_OF_THE_EXODAR = 13705, + QUEST_A_VALIANT_OF_THE_EXODAR = 13690, + QUEST_VALIANT_OF_ORGRIMMAR = 13707, + QUEST_A_VALIANT_OF_ORGRIMMAR = 13691, + QUEST_VALIANT_OF_SEN_JIN = 13708, + QUEST_A_VALIANT_OF_SEN_JIN = 13693, + QUEST_VALIANT_OF_THUNDER_BLUFF = 13709, + QUEST_A_VALIANT_OF_THUNDER_BLUFF = 13694, + QUEST_VALIANT_OF_UNDERCITY = 13710, + QUEST_A_VALIANT_OF_UNDERCITY = 13695, + QUEST_VALIANT_OF_SILVERMOON = 13711, + QUEST_A_VALIANT_OF_SILVERMOON = 13696, +}; + +class spell_gen_on_tournament_mount : public SpellScriptLoader +{ + public: + spell_gen_on_tournament_mount() : SpellScriptLoader("spell_gen_on_tournament_mount") { } + + class spell_gen_on_tournament_mountAuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_on_tournament_mountAuraScript); + + uint32 _pennantSpellId; + + bool Load() + { + _pennantSpellId = 0; + return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + if (Unit* vehicle = caster->GetVehicleBase()) + { + _pennantSpellId = GetPennatSpellId(caster->ToPlayer(), vehicle); + caster->CastSpell(caster, _pennantSpellId, true); + } + } + } + + void HandleRemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + caster->RemoveAurasDueToSpell(_pennantSpellId); + } + + uint32 GetPennatSpellId(Player* player, Unit* mount) + { + switch (mount->GetEntry()) + { + case NPC_ARGENT_STEED_ASPIRANT: + case NPC_STORMWIND_STEED: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_STORMWIND)) + return SPELL_PENNANT_STORMWIND_CHAMPION; + else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_STORMWIND) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_STORMWIND)) + return SPELL_PENNANT_STORMWIND_VALIANT; + else + return SPELL_PENNANT_STORMWIND_ASPIRANT; + } + case NPC_GNOMEREGAN_MECHANOSTRIDER: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_GNOMEREGAN)) + return SPELL_PENNANT_GNOMEREGAN_CHAMPION; + else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_GNOMEREGAN) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_GNOMEREGAN)) + return SPELL_PENNANT_GNOMEREGAN_VALIANT; + else + return SPELL_PENNANT_GNOMEREGAN_ASPIRANT; + } + case NPC_DARK_SPEAR_RAPTOR: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_SEN_JIN)) + return SPELL_PENNANT_SEN_JIN_CHAMPION; + else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_SEN_JIN) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_SEN_JIN)) + return SPELL_PENNANT_SEN_JIN_VALIANT; + else + return SPELL_PENNANT_SEN_JIN_ASPIRANT; + } + case NPC_ARGENT_HAWKSTRIDER_ASPIRANT: + case NPC_SILVERMOON_HAWKSTRIDER: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_SILVERMOON)) + return SPELL_PENNANT_SILVERMOON_CHAMPION; + else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_SILVERMOON) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_SILVERMOON)) + return SPELL_PENNANT_SILVERMOON_VALIANT; + else + return SPELL_PENNANT_SILVERMOON_ASPIRANT; + } + case NPC_DARNASSIAN_NIGHTSABER: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_DARNASSUS)) + return SPELL_PENNANT_DARNASSUS_CHAMPION; + else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_DARNASSUS) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_DARNASSUS)) + return SPELL_PENNANT_DARNASSUS_VALIANT; + else + return SPELL_PENNANT_DARNASSUS_ASPIRANT; + } + case NPC_EXODAR_ELEKK: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_THE_EXODAR)) + return SPELL_PENNANT_EXODAR_CHAMPION; + else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_THE_EXODAR) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_THE_EXODAR)) + return SPELL_PENNANT_EXODAR_VALIANT; + else + return SPELL_PENNANT_EXODAR_ASPIRANT; + } + case NPC_IRONFORGE_RAM: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_IRONFORGE)) + return SPELL_PENNANT_IRONFORGE_CHAMPION; + else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_IRONFORGE) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_IRONFORGE)) + return SPELL_PENNANT_IRONFORGE_VALIANT; + else + return SPELL_PENNANT_IRONFORGE_ASPIRANT; + } + case NPC_FORSAKEN_WARHORSE: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_UNDERCITY)) + return SPELL_PENNANT_UNDERCITY_CHAMPION; + else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_UNDERCITY) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_UNDERCITY)) + return SPELL_PENNANT_UNDERCITY_VALIANT; + else + return SPELL_PENNANT_UNDERCITY_ASPIRANT; + } + case NPC_ORGRIMMAR_WOLF: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_ORGRIMMAR)) + return SPELL_PENNANT_ORGRIMMAR_CHAMPION; + else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_ORGRIMMAR) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_ORGRIMMAR)) + return SPELL_PENNANT_ORGRIMMAR_VALIANT; + else + return SPELL_PENNANT_ORGRIMMAR_ASPIRANT; + } + case NPC_THUNDER_BLUFF_KODO: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_THUNDER_BLUFF)) + return SPELL_PENNANT_THUNDER_BLUFF_CHAMPION; + else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_THUNDER_BLUFF) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_THUNDER_BLUFF)) + return SPELL_PENNANT_THUNDER_BLUFF_VALIANT; + else + return SPELL_PENNANT_THUNDER_BLUFF_ASPIRANT; + } + case NPC_ARGENT_WARHORSE: + { + if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_ALLIANCE) || player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_HORDE)) + return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_CHAMPION : SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION; + else if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_ARGENT_VALOR)) + return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_VALIANT : SPELL_PENNANT_ARGENT_CRUSADE_VALIANT; + else + return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_ASPIRANT : SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT; + } + default: + return 0; + } + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_gen_on_tournament_mountAuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_on_tournament_mountAuraScript::HandleRemoveEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_on_tournament_mountAuraScript(); + } +}; + +class spell_gen_tournament_pennant : public SpellScriptLoader +{ + public: + spell_gen_tournament_pennant() : SpellScriptLoader("spell_gen_tournament_pennant") { } + + class spell_gen_tournament_pennantAuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_tournament_pennantAuraScript); + + bool Load() + { + return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + if (!caster->GetVehicleBase()) + caster->RemoveAurasDueToSpell(GetId()); + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_gen_tournament_pennantAuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_tournament_pennantAuraScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -1514,4 +2387,14 @@ void AddSC_generic_spell_scripts() new spell_gen_oracle_wolvar_reputation(); new spell_gen_damage_reduction_aura(); new spell_gen_luck_of_the_draw(); + new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise"); + new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise"); + new spell_gen_elune_candle(); + new spell_gen_break_shield(); + new spell_gen_mounted_charge(); + new spell_gen_defend(); + new spell_gen_tournament_duel(); + new spell_gen_summon_tournament_mount(); + new spell_gen_on_tournament_mount(); + new spell_gen_tournament_pennant(); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 5a0ffbd2c90..b40879d500e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1128,6 +1128,51 @@ class spell_magic_eater_food : public SpellScriptLoader } }; +enum Refocus +{ + SPELL_AIMED_SHOT = 19434, + SPELL_MULTISHOT = 2643, + SPELL_VOLLEY = 42243, +}; + +class spell_item_refocus : public SpellScriptLoader +{ + public: + spell_item_refocus() : SpellScriptLoader("spell_item_refocus") { } + + class spell_item_refocus_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_refocus_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + + if (!caster || caster->getClass() != CLASS_HUNTER) + return; + + if (caster->HasSpellCooldown(SPELL_AIMED_SHOT)) + caster->RemoveSpellCooldown(SPELL_AIMED_SHOT, true); + + if (caster->HasSpellCooldown(SPELL_MULTISHOT)) + caster->RemoveSpellCooldown(SPELL_MULTISHOT, true); + + if (caster->HasSpellCooldown(SPELL_VOLLEY)) + caster->RemoveSpellCooldown(SPELL_VOLLEY, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_refocus_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_refocus_SpellScript(); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -1160,4 +1205,5 @@ void AddSC_item_spell_scripts() new spell_item_ashbringer(); new spell_magic_eater_food(); + new spell_item_refocus(); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index d266b42f50a..940e494f18f 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -223,13 +223,13 @@ public: void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); - target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - target->AddUnitState(UNIT_STAT_ROOT); + target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + target->AddUnitState(UNIT_STATE_ROOT); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } void Register() diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp index 8ce06685893..9bcf450b3aa 100755 --- a/src/server/scripts/World/achievement_scripts.cpp +++ b/src/server/scripts/World/achievement_scripts.cpp @@ -285,6 +285,34 @@ class achievement_bg_sa_defense_of_ancients : public AchievementCriteriaScript } }; +enum ArgentTournamentAreas +{ + AREA_ARGENT_TOURNAMENT_FIELDS = 4658, + AREA_RING_OF_ASPIRANTS = 4670, + AREA_RING_OF_ARGENT_VALIANTS = 4671, + AREA_RING_OF_ALLIANCE_VALIANTS = 4672, + AREA_RING_OF_HORDE_VALIANTS = 4673, + AREA_RING_OF_CHAMPIONS = 4669, +}; + +class achievement_tilted : public AchievementCriteriaScript +{ + public: + achievement_tilted() : AchievementCriteriaScript("achievement_tilted") {} + + bool OnCheck(Player* player, Unit* /*target*/) + { + bool checkArea = player->GetAreaId() == AREA_ARGENT_TOURNAMENT_FIELDS || + player->GetAreaId() == AREA_RING_OF_ASPIRANTS || + player->GetAreaId() == AREA_RING_OF_ARGENT_VALIANTS || + player->GetAreaId() == AREA_RING_OF_ALLIANCE_VALIANTS || + player->GetAreaId() == AREA_RING_OF_HORDE_VALIANTS || + player->GetAreaId() == AREA_RING_OF_CHAMPIONS; + + return player && checkArea && player->duel && player->duel->isMounted; + } +}; + void AddSC_achievement_scripts() { new achievement_resilient_victory(); @@ -302,4 +330,5 @@ void AddSC_achievement_scripts() new achievement_arena_kills("achievement_arena_3v3_kills", ARENA_TYPE_3v3); new achievement_arena_kills("achievement_arena_5v5_kills", ARENA_TYPE_5v5); new achievement_bg_sa_defense_of_ancients(); + new achievement_tilted(); } diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 9deecea01ba..9f652e7a859 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -144,7 +144,7 @@ struct emerald_dragonAI : public WorldBossAI events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 521e38a7061..165ef9f18b1 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -242,7 +242,7 @@ public: { summon->SetVisible(false); summon->SetReactState(REACT_PASSIVE); - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } return false; } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 21e4fe6a3a0..fcf5f56c539 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -40,6 +40,7 @@ npc_sayge 100% Darkmoon event fortune teller, buff player based npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap npc_shadowfiend 100% restore 5% of owner's mana when shadowfiend die from damage 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 EndContentData */ #include "ScriptPCH.h" @@ -1909,7 +1910,7 @@ public: Unit* owner = me->GetCharmerOrOwner(); me->CombatStop(true); - if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) + if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) { me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE); @@ -2068,7 +2069,7 @@ public: void Reset() { - me->SetControlled(true, UNIT_STAT_STUNNED);//disable rotate + me->SetControlled(true, UNIT_STATE_STUNNED);//disable rotate me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);//imune to knock aways like blast wave ResetTimer = 5000; @@ -2100,8 +2101,8 @@ public: if (!UpdateVictim()) return; - if (!me->HasUnitState(UNIT_STAT_STUNNED)) - me->SetControlled(true, UNIT_STAT_STUNNED);//disable rotate + if (!me->HasUnitState(UNIT_STATE_STUNNED)) + me->SetControlled(true, UNIT_STATE_STUNNED);//disable rotate if (Entry != NPC_ADVANCED_TARGET_DUMMY && Entry != NPC_TARGET_DUMMY) { @@ -2202,7 +2203,7 @@ public: if (!UpdateVictim()) return; - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (FireShield_Timer <= diff) @@ -2764,6 +2765,285 @@ public: } }; +enum Fireworks +{ + NPC_OMEN = 15467, + NPC_MINION_OF_OMEN = 15466, + NPC_FIREWORK_BLUE = 15879, + NPC_FIREWORK_GREEN = 15880, + NPC_FIREWORK_PURPLE = 15881, + NPC_FIREWORK_RED = 15882, + NPC_FIREWORK_YELLOW = 15883, + NPC_FIREWORK_WHITE = 15884, + NPC_FIREWORK_BIG_BLUE = 15885, + NPC_FIREWORK_BIG_GREEN = 15886, + NPC_FIREWORK_BIG_PURPLE = 15887, + NPC_FIREWORK_BIG_RED = 15888, + NPC_FIREWORK_BIG_YELLOW = 15889, + NPC_FIREWORK_BIG_WHITE = 15890, + + NPC_CLUSTER_BLUE = 15872, + NPC_CLUSTER_RED = 15873, + NPC_CLUSTER_GREEN = 15874, + NPC_CLUSTER_PURPLE = 15875, + NPC_CLUSTER_WHITE = 15876, + NPC_CLUSTER_YELLOW = 15877, + NPC_CLUSTER_BIG_BLUE = 15911, + NPC_CLUSTER_BIG_GREEN = 15912, + NPC_CLUSTER_BIG_PURPLE = 15913, + NPC_CLUSTER_BIG_RED = 15914, + NPC_CLUSTER_BIG_WHITE = 15915, + NPC_CLUSTER_BIG_YELLOW = 15916, + NPC_CLUSTER_ELUNE = 15918, + + GO_FIREWORK_LAUNCHER_1 = 180771, + GO_FIREWORK_LAUNCHER_2 = 180868, + GO_FIREWORK_LAUNCHER_3 = 180850, + GO_CLUSTER_LAUNCHER_1 = 180772, + GO_CLUSTER_LAUNCHER_2 = 180859, + GO_CLUSTER_LAUNCHER_3 = 180869, + GO_CLUSTER_LAUNCHER_4 = 180874, + + SPELL_ROCKET_BLUE = 26344, + SPELL_ROCKET_GREEN = 26345, + SPELL_ROCKET_PURPLE = 26346, + SPELL_ROCKET_RED = 26347, + SPELL_ROCKET_WHITE = 26348, + SPELL_ROCKET_YELLOW = 26349, + SPELL_ROCKET_BIG_BLUE = 26351, + SPELL_ROCKET_BIG_GREEN = 26352, + SPELL_ROCKET_BIG_PURPLE = 26353, + SPELL_ROCKET_BIG_RED = 26354, + SPELL_ROCKET_BIG_WHITE = 26355, + SPELL_ROCKET_BIG_YELLOW = 26356, + SPELL_LUNAR_FORTUNE = 26522, + + ANIM_GO_LAUNCH_FIREWORK = 3, + ZONE_MOONGLADE = 493, +}; + +Position omenSummonPos = {7558.993f, -2839.999f, 450.0214f, 4.46f}; + +class npc_firework : public CreatureScript +{ +public: + npc_firework() : CreatureScript("npc_firework") { } + + struct npc_fireworkAI : public ScriptedAI + { + npc_fireworkAI(Creature* creature) : ScriptedAI(creature) {} + + bool isCluster() + { + switch (me->GetEntry()) + { + case NPC_FIREWORK_BLUE: + case NPC_FIREWORK_GREEN: + case NPC_FIREWORK_PURPLE: + case NPC_FIREWORK_RED: + case NPC_FIREWORK_YELLOW: + case NPC_FIREWORK_WHITE: + case NPC_FIREWORK_BIG_BLUE: + case NPC_FIREWORK_BIG_GREEN: + case NPC_FIREWORK_BIG_PURPLE: + case NPC_FIREWORK_BIG_RED: + case NPC_FIREWORK_BIG_YELLOW: + case NPC_FIREWORK_BIG_WHITE: + return false; + case NPC_CLUSTER_BLUE: + case NPC_CLUSTER_GREEN: + case NPC_CLUSTER_PURPLE: + case NPC_CLUSTER_RED: + case NPC_CLUSTER_YELLOW: + case NPC_CLUSTER_WHITE: + case NPC_CLUSTER_BIG_BLUE: + case NPC_CLUSTER_BIG_GREEN: + case NPC_CLUSTER_BIG_PURPLE: + case NPC_CLUSTER_BIG_RED: + case NPC_CLUSTER_BIG_YELLOW: + case NPC_CLUSTER_BIG_WHITE: + case NPC_CLUSTER_ELUNE: + default: + return true; + } + } + + GameObject* FindNearestLauncher() + { + GameObject* launcher = NULL; + + if (isCluster()) + { + GameObject* launcher1 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_1, 0.5f); + GameObject* launcher2 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_2, 0.5f); + GameObject* launcher3 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_3, 0.5f); + GameObject* launcher4 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_4, 0.5f); + + if (launcher1) + launcher = launcher1; + else if (launcher2) + launcher = launcher2; + else if (launcher3) + launcher = launcher3; + else if (launcher4) + launcher = launcher4; + } + else + { + GameObject* launcher1 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_1, 0.5f); + GameObject* launcher2 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_2, 0.5f); + GameObject* launcher3 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_3, 0.5f); + + if (launcher1) + launcher = launcher1; + else if (launcher2) + launcher = launcher2; + else if (launcher3) + launcher = launcher3; + } + + return launcher; + } + + uint32 GetFireworkSpell(uint32 entry) + { + switch (entry) + { + case NPC_FIREWORK_BLUE: + return SPELL_ROCKET_BLUE; + case NPC_FIREWORK_GREEN: + return SPELL_ROCKET_GREEN; + case NPC_FIREWORK_PURPLE: + return SPELL_ROCKET_PURPLE; + case NPC_FIREWORK_RED: + return SPELL_ROCKET_RED; + case NPC_FIREWORK_YELLOW: + return SPELL_ROCKET_YELLOW; + case NPC_FIREWORK_WHITE: + return SPELL_ROCKET_WHITE; + case NPC_FIREWORK_BIG_BLUE: + return SPELL_ROCKET_BIG_BLUE; + case NPC_FIREWORK_BIG_GREEN: + return SPELL_ROCKET_BIG_GREEN; + case NPC_FIREWORK_BIG_PURPLE: + return SPELL_ROCKET_BIG_PURPLE; + case NPC_FIREWORK_BIG_RED: + return SPELL_ROCKET_BIG_RED; + case NPC_FIREWORK_BIG_YELLOW: + return SPELL_ROCKET_BIG_YELLOW; + case NPC_FIREWORK_BIG_WHITE: + return SPELL_ROCKET_BIG_WHITE; + default: + return 0; + } + } + + uint32 GetFireworkGameObjectId() + { + uint32 spellId = 0; + + switch (me->GetEntry()) + { + case NPC_CLUSTER_BLUE: + spellId = GetFireworkSpell(NPC_FIREWORK_BLUE); + break; + case NPC_CLUSTER_GREEN: + spellId = GetFireworkSpell(NPC_FIREWORK_GREEN); + break; + case NPC_CLUSTER_PURPLE: + spellId = GetFireworkSpell(NPC_FIREWORK_PURPLE); + break; + case NPC_CLUSTER_RED: + spellId = GetFireworkSpell(NPC_FIREWORK_RED); + break; + case NPC_CLUSTER_YELLOW: + spellId = GetFireworkSpell(NPC_FIREWORK_YELLOW); + break; + case NPC_CLUSTER_WHITE: + spellId = GetFireworkSpell(NPC_FIREWORK_WHITE); + break; + case NPC_CLUSTER_BIG_BLUE: + spellId = GetFireworkSpell(NPC_FIREWORK_BIG_BLUE); + break; + case NPC_CLUSTER_BIG_GREEN: + spellId = GetFireworkSpell(NPC_FIREWORK_BIG_GREEN); + break; + case NPC_CLUSTER_BIG_PURPLE: + spellId = GetFireworkSpell(NPC_FIREWORK_BIG_PURPLE); + break; + case NPC_CLUSTER_BIG_RED: + spellId = GetFireworkSpell(NPC_FIREWORK_BIG_RED); + break; + case NPC_CLUSTER_BIG_YELLOW: + spellId = GetFireworkSpell(NPC_FIREWORK_BIG_YELLOW); + break; + case NPC_CLUSTER_BIG_WHITE: + spellId = GetFireworkSpell(NPC_FIREWORK_BIG_WHITE); + break; + case NPC_CLUSTER_ELUNE: + spellId = GetFireworkSpell(urand(NPC_FIREWORK_BLUE, NPC_FIREWORK_WHITE)); + break; + } + + const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId); + + if (spellInfo && spellInfo->Effects[0].Effect == SPELL_EFFECT_SUMMON_OBJECT_WILD) + return spellInfo->Effects[0].MiscValue; + + return 0; + } + + void Reset() + { + if (GameObject* launcher = FindNearestLauncher()) + { + launcher->SendCustomAnim(ANIM_GO_LAUNCH_FIREWORK); + me->SetOrientation(launcher->GetOrientation() + M_PI/2); + } + else + return; + + if (isCluster()) + { + // 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) + { + switch (urand(0,9)) + { + case 0: + case 1: + case 2: + case 3: + if (Creature* minion = me->SummonCreature(NPC_MINION_OF_OMEN, me->GetPositionX()+frand(-5.0f, 5.0f), me->GetPositionY()+frand(-5.0f, 5.0f), me->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) + minion->AI()->AttackStart(me->SelectNearestPlayer(20.0f)); + break; + case 9: + me->SummonCreature(NPC_OMEN, omenSummonPos); + break; + } + } + } + if (me->GetEntry() == NPC_CLUSTER_ELUNE) + DoCast(SPELL_LUNAR_FORTUNE); + + float displacement = 0.7f; + for (uint8 i = 0; i < 4; i++) + me->SummonGameObject(GetFireworkGameObjectId(), me->GetPositionX() + (i%2 == 0 ? displacement : -displacement), me->GetPositionY() + (i > 1 ? displacement : -displacement), me->GetPositionZ() + 4.0f, me->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 1); + } + else + //me->CastSpell(me, GetFireworkSpell(me->GetEntry()), true); + me->CastSpell(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), GetFireworkSpell(me->GetEntry()), true); + } + }; + + CreatureAI *GetAI(Creature* creature) const + { + return new npc_fireworkAI(creature); + } +}; + void AddSC_npcs_special() { new npc_air_force_bots; @@ -2796,5 +3076,6 @@ void AddSC_npcs_special() new npc_experience; new npc_fire_elemental; new npc_earth_elemental; + new npc_firework; } diff --git a/src/server/shared/Cryptography/HMACSHA1.cpp b/src/server/shared/Cryptography/HMACSHA1.cpp index 3f21aa4582d..447d0b58efc 100755 --- a/src/server/shared/Cryptography/HMACSHA1.cpp +++ b/src/server/shared/Cryptography/HMACSHA1.cpp @@ -18,6 +18,7 @@ #include "HMACSHA1.h" #include "BigNumber.h" +#include "Common.h" HmacHash::HmacHash(uint32 len, uint8 *seed) { diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 24b99219f46..fe276b26738 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -302,7 +302,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_GUID, "DELETE FROM creature_respawn WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, "DELETE FROM creature_respawn WHERE instanceId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_MAX_CREATURE_RESPAWNS, "SELECT MAX(respawnTime), instanceId FROM creature_respawn WHERE instanceId > 0 GROUP BY instanceId", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS, "DELETE FROM creature_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT instanceId FROM instance)", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS, "DELETE FROM creature_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH) // Gameobject respawn PREPARE_STATEMENT(CHAR_SEL_GO_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM gameobject_respawn", CONNECTION_SYNCH) @@ -310,7 +310,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN, "DELETE FROM gameobject_respawn WHERE guid = ? AND instanceId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN_BY_INSTANCE, "DELETE FROM gameobject_respawn WHERE instanceId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_EXPIRED_GO_RESPAWNS, "DELETE FROM gameobject_respawn WHERE respawnTime <= UNIX_TIMESTAMP(NOW())", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS, "DELETE FROM gameobject_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT instanceId FROM instance)", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS, "DELETE FROM gameobject_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH) // GM Tickets PREPARE_STATEMENT(CHAR_SEL_GM_TICKETS, "SELECT ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed FROM gm_tickets", CONNECTION_SYNCH) @@ -325,7 +325,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() // For loading and deleting expired auctions at startup PREPARE_STATEMENT(CHAR_SEL_EXPIRED_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ah.time <= ?", CONNECTION_SYNCH) - + // LFG Data PREPARE_STATEMENT(CHAR_INS_LFG_DATA, "INSERT INTO lfg_data (guid, dungeon, state) VALUES (?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_LFG_DATA, "DELETE FROM lfg_data WHERE guid = ?", CONNECTION_ASYNC) diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index 60adce41326..191bbbf35b4 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -57,12 +57,10 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/shared/Database ${CMAKE_SOURCE_DIR}/src/server/shared/DataStores ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging - ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic ${CMAKE_SOURCE_DIR}/src/server/shared/Logging ${CMAKE_SOURCE_DIR}/src/server/shared/Packets - ${CMAKE_SOURCE_DIR}/src/server/shared/Policies ${CMAKE_SOURCE_DIR}/src/server/shared/Threading ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities ${CMAKE_SOURCE_DIR}/src/server/game @@ -108,6 +106,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Grids ${CMAKE_SOURCE_DIR}/src/server/game/Groups ${CMAKE_SOURCE_DIR}/src/server/game/Guilds + ${CMAKE_SOURCE_DIR}/src/server/game/Handlers ${CMAKE_SOURCE_DIR}/src/server/game/Instances ${CMAKE_SOURCE_DIR}/src/server/game/Loot ${CMAKE_SOURCE_DIR}/src/server/game/Mails @@ -123,7 +122,6 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Reputation ${CMAKE_SOURCE_DIR}/src/server/game/Scripting ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol - ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol/Handlers ${CMAKE_SOURCE_DIR}/src/server/game/Server ${CMAKE_SOURCE_DIR}/src/server/game/Skills ${CMAKE_SOURCE_DIR}/src/server/game/Spells |