diff --git a/data/sql/updates/db_world/2022_06_18_00.sql b/data/sql/updates/db_world/2022_06_18_00.sql new file mode 100644 index 000000000..f1c8f51ba --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_00.sql @@ -0,0 +1,11 @@ +-- DB update 2022_06_16_07 -> 2022_06_18_00 +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` IN (6748, 17359); + +DELETE FROM `smart_scripts` WHERE ((`entryorguid` = 6748) AND (`source_type` = 0) AND (`id` IN (0, 1))) OR (`entryorguid` = 17359) AND (`source_type` = 0) AND (`id` IN (5, 7, 8, 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`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(6748, 0, 0, 0, 54, 0, 100, 513, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Water Spirit - On Just Summoned - Set Event Phase 1 (No Repeat)'), +(6748, 0, 1, 0, 75, 1, 100, 1, 0, 17359, 30, 500, 0, 1, 0, 1500, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Water Spirit - On Distance To Creature - Say Line 0 (Phase 1) (No Repeat)'), +(17359, 0, 5, 0, 0, 1, 100, 512, 5000, 5000, 5000, 5000, 0, 11, 9672, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Tel\'athion the Impure - In Combat - Cast \'Frostbolt\' (Phase 1)'), +(17359, 0, 7, 0, 0, 1, 100, 512, 6200, 6200, 5000, 5000, 0, 11, 13339, 64, 0, 0, 0, 0, 5, 6748, 1, 0, 0, 0, 0, 0, 0, 'Tel\'athion the Impure - In Combat - Cast \'Fire Blast\' (Phase 1)'), +(17359, 0, 8, 0, 9, 1, 100, 512, 0, 10, 13000, 13000, 0, 11, 11831, 64, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Tel\'athion the Impure - Within 0-10 Range - Cast \'Frost Nova\' (Phase 1)'), +(17359, 0, 9, 0, 0, 1, 100, 512, 8000, 8000, 10000, 10000, 0, 11, 15735, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Tel\'athion the Impure - In Combat - Cast \'Arcane Missiles\' (Phase 1)'); diff --git a/data/sql/updates/db_world/2022_06_18_01.sql b/data/sql/updates/db_world/2022_06_18_01.sql new file mode 100644 index 000000000..e1498bb68 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_01.sql @@ -0,0 +1,2 @@ +-- DB update 2022_06_18_00 -> 2022_06_18_01 +UPDATE `quest_template_addon` SET `PrevQuestID` = 1701 WHERE `ID` IN (1705, 1708, 1710); diff --git a/data/sql/updates/db_world/2022_06_18_02.sql b/data/sql/updates/db_world/2022_06_18_02.sql new file mode 100644 index 000000000..8edaa9a17 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_02.sql @@ -0,0 +1,3 @@ +-- DB update 2022_06_18_01 -> 2022_06_18_02 +-- +DELETE FROM `smart_scripts` WHERE `entryorguid`=9447 AND `source_type`=0 AND `id`=2; diff --git a/data/sql/updates/db_world/2022_06_18_03.sql b/data/sql/updates/db_world/2022_06_18_03.sql new file mode 100644 index 000000000..cae89f6f5 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_03.sql @@ -0,0 +1,2 @@ +-- DB update 2022_06_18_02 -> 2022_06_18_03 +UPDATE `creature_template` SET `npcflag` = 1, `gossip_menu_id` = '21208', `AIName` = 'SmartAI' WHERE (`entry` = 6669); diff --git a/data/sql/updates/db_world/2022_06_18_04.sql b/data/sql/updates/db_world/2022_06_18_04.sql new file mode 100644 index 000000000..bed6a9381 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_04.sql @@ -0,0 +1,186 @@ +-- DB update 2022_06_18_03 -> 2022_06_18_04 +-- +DELETE FROM `pool_template` WHERE `entry` IN (391, 392, 393); +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES (391, 4, 'Brontus Kodo Pack Combo 1 -- 4 Barrens Kodo Pack'); +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES (392, 4, 'Brontus Kodo Pack Combo 2 -- Mixed Kodo Pack'); +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES (393, 4, 'Brontus Kodo Pack Combo 3 -- Brontus Pack'); +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES (394, 1, 'Brontus Kodo Pack Pool of Pools'); + +DELETE FROM `creature` WHERE `guid` IN (51815); +/* Combo 1 */ +INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +(45809, 3236, 0, 0, 1, 0, 0, 1, 1, 0, -3787.7153, -1848.3755, 93.918015, 2.55345463752746582, 600, 0, 0, 1, 0, 2, 0, 0, 0, '', 0), -- .go xyz -3787.7153 -1848.3755 93.918015 Leader +(45810, 3236, 0, 0, 1, 0, 0, 1, 1, 0, -3814.7678, -1845.9219, 93.61283, 0.949117600917816162, 600, 0, 0, 1, 0, 0, 0, 0, 0, '', 0), +(45811, 3236, 0, 0, 1, 0, 0, 1, 1, 0, -3798.8208, -1829.7017, 94.17238, 4.366050243377685546, 600, 0, 0, 1, 0, 0, 0, 0, 0, '', 0), +(45812, 3236, 0, 0, 1, 0, 0, 1, 1, 0, -3807.5981, -1865.3707, 92.56358, 1.319851279258728027, 600, 0, 0, 1, 0, 0, 0, 0, 0, '', 0), +/* Combo 2 */ +(45813, 3235, 3236, 0, 1, 0, 0, 1, 1, 0, -3787.7153, -1848.3755, 93.918015, 2.55345463752746582, 900, 0, 0, 1, 0, 2, 0, 0, 0, '', 0), -- .go xyz -3787.7153 -1848.3755 93.918015 Leader +(45814, 3237, 3236, 0, 1, 0, 0, 1, 1, 0, -3814.7678, -1845.9219, 93.61283, 0.949117600917816162, 900, 0, 0, 1, 0, 0, 0, 0, 0, '', 0), +(45815, 3237, 3236, 0, 1, 0, 0, 1, 1, 0, -3798.8208, -1829.7017, 94.17238, 4.366050243377685546, 900, 0, 0, 1, 0, 0, 0, 0, 0, '', 0), +(45816, 3235, 3236, 0, 1, 0, 0, 1, 1, 0, -3807.5981, -1865.3707, 92.56358, 1.319851279258728027, 900, 0, 0, 1, 0, 0, 0, 0, 0, '', 0), +/* Combo 3 */ +(45817, 3237, 0, 0, 1, 0, 0, 1, 1, 0, -3787.7153, -1848.3755, 93.918015, 2.55345463752746582, 1800, 0, 0, 1, 0, 2, 0, 0, 0, '', 0), -- .go xyz -3787.7153 -1848.3755 93.918015 Leader +(45818, 5827, 0, 0, 1, 0, 0, 1, 1, 0, -3814.7678, -1845.9219, 93.61283, 0.949117600917816162, 1800, 0, 0, 1, 0, 0, 0, 0, 0, '', 0), +(45819, 3235, 0, 0, 1, 0, 0, 1, 1, 0, -3798.8208, -1829.7017, 94.17238, 4.366050243377685546, 1800, 0, 0, 1, 0, 0, 0, 0, 0, '', 0), +(45820, 3236, 0, 0, 1, 0, 0, 1, 1, 0, -3807.5981, -1865.3707, 92.56358, 1.319851279258728027, 1800, 0, 0, 1, 0, 0, 0, 0, 0, '', 0); + +DELETE FROM `pool_creature` WHERE `guid` IN (45809, 45810, 45811, 45812, 45813, 45814, 45815, 45816, 45817, 45818, 45819, 45820); +INSERT INTO `pool_creature` (`guid`, `pool_entry`, `description`) VALUES +(45809, 391, 'Brontus Kodo Pack Combo 1 -- 4 Barrens Kodo Pack Leader Mob'), +(45810, 391, 'Brontus Kodo Pack Combo 1 -- 4 Barrens Kodo Pack'), +(45811, 391, 'Brontus Kodo Pack Combo 1 -- 4 Barrens Kodo Pack'), +(45812, 391, 'Brontus Kodo Pack Combo 1 -- 4 Barrens Kodo Pack'), +(45813, 392, 'Brontus Kodo Pack Combo 2 -- Mixed Kodo Pack Leader Mob'), +(45814, 392, 'Brontus Kodo Pack Combo 2 -- Mixed Kodo Pack'), +(45815, 392, 'Brontus Kodo Pack Combo 2 -- Mixed Kodo Pack'), +(45816, 392, 'Brontus Kodo Pack Combo 2 -- Mixed Kodo Pack'), +(45817, 393, 'Brontus Kodo Pack Combo 3 -- Brontus Pack Leader Mob'), +(45818, 393, 'Brontus Kodo Pack Combo 3 -- Brontus Pack'), +(45819, 393, 'Brontus Kodo Pack Combo 3 -- Brontus Pack'), +(45820, 393, 'Brontus Kodo Pack Combo 3 -- Brontus Pack'); + +DELETE FROM `pool_pool` WHERE `pool_id` IN (391, 392, 393); +INSERT INTO `pool_pool` (`pool_id`, `mother_pool`, `chance`, `description`) VALUES +(391, 394, 55, 'Brontus Kodo Pack Combo 1 -- 4 Barrens Kodo Pack'), +(392, 394, 30, 'Brontus Kodo Pack Combo 2 -- Mixed Kodo Pack'), +(393, 394, 15, 'Brontus Kodo Pack Combo 3 -- Brontus Pack'); + +-- Pathing for Kodos with Brontus +SET @NPC := 45809; +SET @path := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid` IN (@NPC, @NPC+4, @NPC+8); +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`visibilityDistanceType`,`auras`) VALUES +(@NPC,@path,0,0,1,0,0, ''), +(@NPC+4,@path,0,0,1,0,0, ''), +(@NPC+8,@path,0,0,1,0,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@path; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@path,1,-3780.6667,-1879.9966,94.51902,0,0,0,0,100,0), +(@path,2,-3765.317,-1912.2642,92.659584,0,0,0,0,100,0), +(@path,3,-3743.7683,-1944.3379,93.25019,0,0,0,0,100,0), +(@path,4,-3718.9587,-1949.9241,94.24338,0,0,0,0,100,0), +(@path,5,-3674.7666,-1972.0784,92.34276,0,0,0,0,100,0), +(@path,6,-3633.491,-1962.7506,91.96043,0,0,0,0,100,0), +(@path,7,-3604.3447,-1934.8683,93.6461,0,0,0,0,100,0), +(@path,8,-3574.0989,-1917.8884,94.641045,0,0,0,0,100,0), +(@path,9,-3543.6143,-1922.9417,93.78076,0,0,0,0,100,0), +(@path,10,-3514.391,-1891.8881,96.05839,0,0,0,0,100,0), +(@path,11,-3482.7354,-1879.4718,95.54532,0,0,0,0,100,0), +(@path,12,-3447.3694,-1879.2826,94.04059,0,0,0,0,100,0), +(@path,13,-3419.4883,-1883.6552,93.07612,0,0,0,0,100,0), +(@path,14,-3401.6602,-1915.7799,93.66566,0,0,0,0,100,0), +(@path,15,-3377.1729,-1946.9575,91.91544,0,0,0,0,100,0), +(@path,16,-3359.4075,-1987.9889,93.354164,0,0,0,0,100,0), +(@path,17,-3351.847,-2020.0239,93.34684,0,0,0,0,100,0), +(@path,18,-3347.3481,-2061.3584,96.55564,0,0,0,0,100,0), +(@path,19,-3337.5916,-2084.593,91.86515,0,0,0,0,100,0), +(@path,20,-3305.2717,-2097.2861,91.791664,0,0,0,0,100,0), +(@path,21,-3264.5898,-2110.5752,93.58816,0,0,0,0,100,0), +(@path,22,-3221.6958,-2091.54,92.918495,0,0,0,0,100,0), +(@path,23,-3175.735,-2081.8813,91.791664,0,0,0,0,100,0), +(@path,24,-3131.3293,-2093.495,91.81647,0,0,0,0,100,0), +(@path,25,-3093.5208,-2117.2578,93.19572,0,0,0,0,100,0), +(@path,26,-3050.1245,-2119.8708,93.09464,0,0,0,0,100,0), +(@path,27,-3005.5127,-2109.9685,92.291664,0,0,0,0,100,0), +(@path,28,-2967.4277,-2095.7334,91.791664,0,0,0,0,100,0), +(@path,29,-2936.955,-2117.254,91.791664,0,0,0,0,100,0), +(@path,30,-2908.1777,-2144.7766,93.2714,0,0,0,0,100,0), +(@path,31,-2871.219,-2160.007,92.05509,0,0,0,0,100,0), +(@path,32,-2853.049,-2161.5356,91.791664,0,0,0,0,100,0), +(@path,33,-2835.0942,-2182.703,95.2443,0,0,0,0,100,0), +(@path,34,-2795.9773,-2209.954,95.784584,0,0,0,0,100,0), +(@path,35,-2758.5547,-2238.7458,92.954506,0,0,0,0,100,0), +(@path,36,-2721.4429,-2257.816,91.791664,0,0,0,0,100,0), +(@path,37,-2681.0037,-2258.5547,91.95255,0,0,0,0,100,0), +(@path,38,-2673.5525,-2282.2383,91.791664,0,0,0,0,100,0), +(@path,39,-2647.4885,-2312.194,92.01603,0,0,0,0,100,0), +(@path,40,-2624.1008,-2319.0713,92.736,0,0,0,0,100,0), +(@path,41,-2583.4438,-2317.825,91.791664,0,0,0,0,100,0), +(@path,42,-2553.0298,-2291.6404,93.56666,0,0,0,0,100,0), +(@path,43,-2522.4128,-2288.3354,95.39027,0,0,0,0,100,0), +(@path,44,-2480.3079,-2292.0088,94.91757,0,0,0,0,100,0), +(@path,45,-2440.1282,-2314.39,94.61803,0,0,0,0,100,0), +(@path,46,-2414.875,-2342.5525,91.83561,0,0,0,0,100,0), +(@path,47,-2396.1902,-2380.3955,91.791664,0,0,0,0,100,0), +(@path,48,-2380.417,-2413.0195,92.82902,0,0,0,0,100,0), +(@path,49,-2353.339,-2423.769,95.19796,0,0,0,0,100,0), +(@path,50,-2310.5186,-2422.7778,95.587776,0,0,0,0,100,0), +(@path,51,-2293.4502,-2402.058,93.38322,0,0,0,0,100,0), +(@path,52,-2295.2888,-2370.951,92.66499,0,0,0,0,100,0), +(@path,53,-2286.9407,-2341.9426,93.4555,0,0,0,0,100,0), +(@path,54,-2252.9795,-2320.2158,93.7934,0,0,0,0,100,0), +(@path,55,-2207.6965,-2319.8152,93.1684,0,0,0,0,100,0), +(@path,56,-2185.574,-2344.3398,94.98741,0,0,0,0,100,0), +(@path,57,-2207.6965,-2319.8152,93.1684,0,0,0,0,100,0), +(@path,58,-2252.9795,-2320.2158,93.7934,0,0,0,0,100,0), +(@path,59,-2286.9407,-2341.9426,93.4555,0,0,0,0,100,0), +(@path,60,-2295.2888,-2370.951,92.66499,0,0,0,0,100,0), +(@path,61,-2293.4502,-2402.058,93.38322,0,0,0,0,100,0), +(@path,62,-2310.5186,-2422.7778,95.587776,0,0,0,0,100,0), +(@path,63,-2353.339,-2423.769,95.19796,0,0,0,0,100,0), +(@path,64,-2380.417,-2413.0195,92.82902,0,0,0,0,100,0), +(@path,65,-2396.1902,-2380.3955,91.791664,0,0,0,0,100,0), +(@path,66,-2414.875,-2342.5525,91.83561,0,0,0,0,100,0), +(@path,67,-2440.1282,-2314.39,94.61803,0,0,0,0,100,0), +(@path,68,-2480.3079,-2292.0088,94.91757,0,0,0,0,100,0), +(@path,69,-2522.4128,-2288.3354,95.39027,0,0,0,0,100,0), +(@path,70,-2553.0298,-2291.6404,93.56666,0,0,0,0,100,0), +(@path,71,-2583.4438,-2317.825,91.791664,0,0,0,0,100,0), +(@path,72,-2624.1008,-2319.0713,92.736,0,0,0,0,100,0), +(@path,73,-2647.4885,-2312.194,92.01603,0,0,0,0,100,0), +(@path,74,-2673.5525,-2282.2383,91.791664,0,0,0,0,100,0), +(@path,75,-2681.0037,-2258.5547,91.95255,0,0,0,0,100,0), +(@path,76,-2721.4429,-2257.816,91.791664,0,0,0,0,100,0), +(@path,77,-2758.5547,-2238.7458,92.954506,0,0,0,0,100,0), +(@path,78,-2795.9773,-2209.954,95.784584,0,0,0,0,100,0), +(@path,79,-2835.0942,-2182.703,95.2443,0,0,0,0,100,0), +(@path,80,-2853.049,-2161.5356,91.791664,0,0,0,0,100,0), +(@path,81,-2871.219,-2160.007,92.05509,0,0,0,0,100,0), +(@path,82,-2908.1777,-2144.7766,93.2714,0,0,0,0,100,0), +(@path,83,-2936.955,-2117.254,91.791664,0,0,0,0,100,0), +(@path,84,-2967.4277,-2095.7334,91.791664,0,0,0,0,100,0), +(@path,85,-3005.5127,-2109.9685,92.291664,0,0,0,0,100,0), +(@path,86,-3050.1245,-2119.8708,93.09464,0,0,0,0,100,0), +(@path,87,-3093.5208,-2117.2578,93.19572,0,0,0,0,100,0), +(@path,88,-3131.3293,-2093.495,91.81647,0,0,0,0,100,0), +(@path,89,-3175.735,-2081.8813,91.791664,0,0,0,0,100,0), +(@path,90,-3221.6958,-2091.54,92.918495,0,0,0,0,100,0), +(@path,91,-3264.5898,-2110.5752,93.58816,0,0,0,0,100,0), +(@path,92,-3305.2717,-2097.2861,91.791664,0,0,0,0,100,0), +(@path,93,-3337.5916,-2084.593,91.86515,0,0,0,0,100,0), +(@path,94,-3347.3481,-2061.3584,96.55564,0,0,0,0,100,0), +(@path,95,-3351.847,-2020.0239,93.34684,0,0,0,0,100,0), +(@path,96,-3359.4075,-1987.9889,93.354164,0,0,0,0,100,0), +(@path,97,-3377.1729,-1946.9575,91.91544,0,0,0,0,100,0), +(@path,98,-3401.6602,-1915.7799,93.66566,0,0,0,0,100,0), +(@path,99,-3419.4883,-1883.6552,93.07612,0,0,0,0,100,0), +(@path,100,-3447.3694,-1879.2826,94.04059,0,0,0,0,100,0), +(@path,101,-3482.7354,-1879.4718,95.54532,0,0,0,0,100,0), +(@path,102,-3514.391,-1891.8881,96.05839,0,0,0,0,100,0), +(@path,103,-3543.6143,-1922.9417,93.78076,0,0,0,0,100,0), +(@path,104,-3574.0989,-1917.8884,94.641045,0,0,0,0,100,0), +(@path,105,-3604.3447,-1934.8683,93.6461,0,0,0,0,100,0), +(@path,106,-3633.491,-1962.7506,91.96043,0,0,0,0,100,0), +(@path,107,-3674.7666,-1972.0784,92.34276,0,0,0,0,100,0), +(@path,108,-3718.9587,-1949.9241,94.24338,0,0,0,0,100,0), +(@path,109,-3743.7683,-1944.3379,93.25019,0,0,0,0,100,0), +(@path,110,-3765.317,-1912.2642,92.659584,0,0,0,0,100,0), +(@path,111,-3780.6667,-1879.9966,94.51902,0,0,0,0,100,0), +(@path,112,-3802.9849,-1847.3167,94.4449,0,0,0,0,100,0); +-- 0x204CB0002003294000001C00001E1E9F .go xyz -3780.6667 -1879.9966 94.51902 + +DELETE FROM `creature_formations` WHERE `leaderGUID` IN (45809, 45813, 45817); +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(45809, 45809, 0, 0, 512, 0, 0), -- Leader +(45809, 45810, 5, 190, 512, 0, 0), -- A +(45809, 45811, 5, 170, 512, 0, 0), -- B +(45809, 45812, 6, 180, 512, 0, 0), -- C +(45813, 45813, 0, 0, 512, 0, 0), -- Leader +(45813, 45814, 5, 190, 512, 0, 0), -- A +(45813, 45815, 5, 170, 512, 0, 0), -- B +(45813, 45816, 6, 180, 512, 0, 0), -- C +(45817, 45817, 0, 0, 512, 0, 0), -- Leader +(45817, 45818, 5, 170, 512, 0, 0), -- A +(45817, 45819, 5, 190, 512, 0, 0), -- B +(45817, 45820, 6, 180, 512, 0, 0); -- C diff --git a/data/sql/updates/db_world/2022_06_18_05.sql b/data/sql/updates/db_world/2022_06_18_05.sql new file mode 100644 index 000000000..b05cc8ea5 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_05.sql @@ -0,0 +1,2 @@ +-- DB update 2022_06_18_04 -> 2022_06_18_05 +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 1940) AND (`source_type` = 0) AND (`id` IN (1, 2, 3, 4)); diff --git a/data/sql/updates/db_world/2022_06_18_06.sql b/data/sql/updates/db_world/2022_06_18_06.sql new file mode 100644 index 000000000..c3e7a047c --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_06.sql @@ -0,0 +1,4 @@ +-- DB update 2022_06_18_05 -> 2022_06_18_06 +DELETE FROM `gameobject_loot_template` WHERE (`Entry` = 5000); +INSERT INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(5000, 13172, 0, 0.0001, 1, 1, 0, 1, 1, 'Premium Siabi Tobacco - Siabi\'s Premium Tobacco'); diff --git a/data/sql/updates/db_world/2022_06_18_07.sql b/data/sql/updates/db_world/2022_06_18_07.sql new file mode 100644 index 000000000..1fcd9d46e --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_07.sql @@ -0,0 +1,4 @@ +-- DB update 2022_06_18_06 -> 2022_06_18_07 +-- Update Domesticated Felboar - they should not provide XP, Loot, or be Skinnable as of an exploit fix in 2.4 +UPDATE `creature_template` SET `lootid` = 0, `skinloot` = 0, `ExperienceModifier` = 0 WHERE `entry` = 21195; +DELETE FROM `creature_loot_template` WHERE `entry` = 21195; diff --git a/data/sql/updates/db_world/2022_06_18_08.sql b/data/sql/updates/db_world/2022_06_18_08.sql new file mode 100644 index 000000000..220a2bf2d --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_08.sql @@ -0,0 +1,57 @@ +-- DB update 2022_06_18_07 -> 2022_06_18_08 +DELETE FROM `creature_summon_groups` WHERE `summonerId` = 15589; +INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`) VALUES +-- Group 1 +(15589, 0, 0, 15726, -8603.775391, 1974.709351, 100.220718, 0.0, 2, 300000), +(15589, 0, 0, 15726, -8605.348633, 1994.268188, 100.221367, 0.0, 2, 300000), +(15589, 0, 0, 15726, -8589.451172, 2012.543823, 100.220688, 0.0, 2, 300000), +(15589, 0, 0, 15726, -8563.065430, 2010.912842, 100.220688, 0.0, 2, 300000), +(15589, 0, 0, 15726, -8550.451172, 1992.396851, 100.171875, 0.0, 2, 300000), +(15589, 0, 0, 15726, -8554.344727, 1972.097046, 100.221184, 0.0, 2, 300000), +(15589, 0, 0, 15726, -8565.425781, 1961.392578, 100.220581, 0.0, 2, 300000), +(15589, 0, 0, 15726, -8588.680664, 1957.962646, 100.498169, 0.0, 2, 300000), +-- Group 2 +(15589, 0, 1, 15726, -8604.788086, 1977.721191, 100.220673, 0.0, 2, 300000), +(15589, 0, 1, 15726, -8604.773438, 1997.835571, 100.220657, 0.0, 2, 300000), +(15589, 0, 1, 15726, -8586.697266, 2014.359497, 100.221024, 0.0, 2, 300000), +(15589, 0, 1, 15726, -8560.730469, 2009.243042, 100.312027, 0.0, 2, 300000), +(15589, 0, 1, 15726, -8549.125977, 1989.693115, 100.218964, 0.0, 2, 300000), +(15589, 0, 1, 15726, -8555.000977, 1969.066040, 100.220825, 0.0, 2, 300000), +(15589, 0, 1, 15726, -8567.546875, 1959.600464, 100.340576, 0.0, 2, 300000), +(15589, 0, 1, 15726, -8591.760742, 1960.183838, 100.220749, 0.0, 2, 300000), +-- Group 3 +(15589, 0, 2, 15726, -8584.177734, 2015.206665, 100.220627, 0.0, 2, 300000), +(15589, 0, 2, 15726, -8558.459961, 2007.343140, 100.500259, 0.0, 2, 300000), +(15589, 0, 2, 15726, -8548.819336, 1987.051270, 100.219139, 0.0, 2, 300000), +(15589, 0, 2, 15726, -8557.414063, 1967.254272, 100.220711, 0.0, 2, 300000), +(15589, 0, 2, 15726, -8570.909180, 1958.947632, 100.220642, 0.0, 2, 300000), +(15589, 0, 2, 15726, -8594.705078, 1962.332764, 100.220726, 0.0, 2, 300000), +(15589, 0, 2, 15726, -8605.216797, 1981.862793, 100.220512, 0.0, 2, 300000), +(15589, 0, 2, 15726, -8602.661133, 2000.301636, 100.300171, 0.0, 2, 300000), +-- Group 4 +(15589, 0, 3, 15726, -8574.696289, 1958.381958, 100.220482, 0.0, 2, 300000), +(15589, 0, 3, 15726, -8597.281250, 1964.753052, 100.220665, 0.0, 2, 300000), +(15589, 0, 3, 15726, -8605.613281, 1984.794800, 100.220833, 0.0, 2, 300000), +(15589, 0, 3, 15726, -8601.550781, 2002.827759, 100.411690, 0.0, 2, 300000), +(15589, 0, 3, 15726, -8580.916016, 2015.309814, 100.220802, 0.0, 2, 300000), +(15589, 0, 3, 15726, -8556.536133, 2004.968018, 100.220840, 0.0, 2, 300000), +(15589, 0, 3, 15726, -8549.049805, 1984.366577, 100.220390, 0.0, 2, 300000), +(15589, 0, 3, 15726, -8559.099609, 1965.337646, 100.220795, 0.0, 2, 300000), +-- Group 5 +(15589, 0, 4, 15726, -8606.484375, 1987.263062, 100.220650, 0.0, 2, 300000), +(15589, 0, 4, 15726, -8598.741211, 2005.753418, 100.220520, 0.0, 2, 300000), +(15589, 0, 4, 15726, -8577.381836, 2015.370239, 100.220665, 0.0, 2, 300000), +(15589, 0, 4, 15726, -8554.274414, 2001.834106, 100.167274, 0.0, 2, 300000), +(15589, 0, 4, 15726, -8550.043945, 1980.844604, 100.218864, 0.0, 2, 300000), +(15589, 0, 4, 15726, -8560.641602, 1963.641602, 100.218864, 0.0, 2, 300000), +(15589, 0, 4, 15726, -8578.719727, 1957.526001, 100.403954, 0.0, 2, 300000), +(15589, 0, 4, 15726, -8599.988281, 1968.158936, 100.220963, 0.0, 2, 300000), +-- Group 6 +(15589, 0, 5, 15726, -8562.926758, 1962.273071, 100.220818, 0.0, 2, 300000), +(15589, 0, 5, 15726, -8583.307617, 1956.971558, 100.498611, 0.0, 2, 300000), +(15589, 0, 5, 15726, -8601.906250, 1970.630859, 100.263298, 0.0, 2, 300000), +(15589, 0, 5, 15726, -8606.078125, 1990.227051, 100.220634, 0.0, 2, 300000), +(15589, 0, 5, 15726, -8595.287109, 2009.543457, 100.220711, 0.0, 2, 300000), +(15589, 0, 5, 15726, -8573.629883, 2014.623413, 100.220512, 0.0, 2, 300000), +(15589, 0, 5, 15726, -8552.320313, 1998.953735, 100.130707, 0.0, 2, 300000), +(15589, 0, 5, 15726, -8550.862305, 1978.124878, 100.219307, 0.0, 2, 300000); diff --git a/data/sql/updates/db_world/2022_06_18_09.sql b/data/sql/updates/db_world/2022_06_18_09.sql new file mode 100644 index 000000000..1efba8e63 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_09.sql @@ -0,0 +1,10 @@ +-- DB update 2022_06_18_08 -> 2022_06_18_09 +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 11350; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 11350); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(11350, 0, 0, 0, 4, 0, 30, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Gurubashi Axe Thrower - On Aggro - Say Line 1'), +(11350, 0, 1, 0, 9, 0, 100, 1, 5, 30, 1500, 2000, 0, 11, 22887, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Gurubashi Axe Thrower - Within 5-30 Range - Cast \'Throw\' (No Repeat)'), +(11350, 0, 2, 0, 2, 0, 100, 1, 0, 30, 0, 0, 0, 11, 8269, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Gurubashi Axe Thrower - Between 0-30% Health - Cast \'Frenzy\' (No Repeat)'), +(11350, 0, 3, 0, 2, 0, 100, 1, 0, 30, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Gurubashi Axe Thrower - Between 0-30% Health - Say Line 0 (No Repeat)'), +(11350, 0, 4, 0, 0, 0, 100, 0, 15000, 15000, 25000, 28000, 0, 11, 24018, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gurubashi Axe Thrower - In Combat - Cast \'Axe Flurry\''); diff --git a/data/sql/updates/db_world/2022_06_18_10.sql b/data/sql/updates/db_world/2022_06_18_10.sql new file mode 100644 index 000000000..20b8ed9e1 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_10.sql @@ -0,0 +1,2 @@ +-- DB update 2022_06_18_09 -> 2022_06_18_10 +UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`&~(16384) WHERE `entry` IN (12265, 12101, 12100, 12076, 11665, 11667, 11669, 11666, 11668, 12099); diff --git a/data/sql/updates/db_world/2022_06_18_11.sql b/data/sql/updates/db_world/2022_06_18_11.sql new file mode 100644 index 000000000..adca54452 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_11.sql @@ -0,0 +1,25 @@ +-- DB update 2022_06_18_10 -> 2022_06_18_11 + +UPDATE `quest_template` SET `LogDescription` = 'Talin Keeneye would like you to kill 12 Small Crag Boars.' WHERE `ID` = 183; +UPDATE `quest_template` SET `QuestCompletionLog` = 'Return to Orgnil Soulscar in Durotar.' WHERE `ID` = 806; +UPDATE `quest_template` SET `RewardNextQuest` = 6610 WHERE `ID` = 6611; +UPDATE `quest_template` SET `RewardNextQuest` = 6610 WHERE `ID` = 6612; +UPDATE `quest_template` SET `RewardNextQuest` = 8347 WHERE `ID` = 8335; +UPDATE `quest_template` SET `RewardNextQuest` = 9409 WHERE `ID` = 9280; +UPDATE `quest_template` SET `RewardNextQuest` = 9294 WHERE `ID` = 9293; +UPDATE `quest_template` SET `RewardNextQuest` = 8350 WHERE `ID` = 9705; +UPDATE `quest_template` SET `RewardNextQuest` = 0 WHERE `ID` = 11160; +UPDATE `quest_template` SET `RewardNextQuest` = 11559 WHERE `ID` = 11571; +UPDATE `quest_template` SET `RewardNextQuest` = 0 WHERE `ID` = 11662; +UPDATE `quest_template` SET `RewardNextQuest` = 12070 WHERE `ID` = 12249; +UPDATE `quest_template` SET `RewardNextQuest` = 12555 WHERE `ID` = 12598; +UPDATE `quest_template` SET `RewardNextQuest` = 0 WHERE `ID` = 12606; +UPDATE `quest_template` SET `RewardNextQuest` = 0 WHERE `ID` = 12880; +UPDATE `quest_template` SET `RewardNextQuest` = 12932 WHERE `ID` = 12974; +UPDATE `quest_template` SET `RewardNextQuest` = 0 WHERE `ID` = 13005; +UPDATE `quest_template` SET `RewardNextQuest` = 13718 WHERE `ID` = 13593; +UPDATE `quest_template` SET `RewardMoney` = -20000 WHERE `ID` IN(3644,3645,3646,3647); +UPDATE `quest_template` SET `RewardItem1` = 23846 WHERE `ID` = 9561; +UPDATE `quest_template` SET `RewardAmount1` = 1 WHERE `ID` = 9561; +UPDATE `quest_template` SET `RewardItem1` = 28168 WHERE `ID` = 10172; +UPDATE `quest_template` SET `RewardAmount1` = 1 WHERE `ID` = 10172; diff --git a/data/sql/updates/db_world/2022_06_18_12.sql b/data/sql/updates/db_world/2022_06_18_12.sql new file mode 100644 index 000000000..4bb147675 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_12.sql @@ -0,0 +1,10 @@ +-- DB update 2022_06_18_11 -> 2022_06_18_12 +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 2624; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 2624); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2624, 0, 0, 0, 0, 0, 100, 0, 6000, 12000, 7000, 15000, 0, 11, 5403, 64, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gazban - In Combat - Cast \'Crash of Waves\''), +(2624, 0, 1, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gazban - On Just Summoned - Say Line 0'), +(2624, 0, 2, 0, 0, 0, 100, 1, 4000, 4000, 4000, 4000, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gazban - In Combat - Say Line 1 (No Repeat)'), +(2624, 0, 3, 4, 0, 0, 100, 1, 4000, 4000, 4000, 4000, 0, 11, 5402, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gazban - In Combat - Cast \'Serverside - Gazban Transform\' (No Repeat)'), +(2624, 0, 4, 0, 61, 0, 100, 1, 0, 0, 0, 0, 0, 11, 5404, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gazban - In Combat - Cast \'Gazban Water Form\' (No Repeat)'); diff --git a/data/sql/updates/db_world/2022_06_18_13.sql b/data/sql/updates/db_world/2022_06_18_13.sql new file mode 100644 index 000000000..d74e9516d --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_13.sql @@ -0,0 +1,2 @@ +-- DB update 2022_06_18_12 -> 2022_06_18_13 +UPDATE `creature_template` SET `flags_extra` = `flags_extra`|4194304 WHERE (`entry` = 15163); diff --git a/data/sql/updates/db_world/2022_06_18_14.sql b/data/sql/updates/db_world/2022_06_18_14.sql new file mode 100644 index 000000000..0b5f7a846 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_14.sql @@ -0,0 +1,17 @@ +-- DB update 2022_06_18_13 -> 2022_06_18_14 +-- +DELETE FROM `creature_loot_template` WHERE item=6838; +INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(1111, 6838, 0, 100, 1, 1, 2, 1, 1, 'Leech Stalker - Scorched Spider Fang'), +(1111, 6838, 0, 50, 1, 1, 3, 1, 1, 'Leech Stalker - Scorched Spider Fang'), +(4040, 6838, 0, 100, 1, 1, 2, 1, 1, 'Cave Stalker - Scorched Spider Fang'), +(4040, 6838, 0, 50, 1, 1, 3, 1, 1, 'Cave Stalker - Scorched Spider Fang'); + +DELETE FROM `creature_loot_template` WHERE item=6839; +INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(4031, 6839, 0, 100, 1, 1, 2, 1, 1, 'Fledgling Chimaera - Charred Horn'), +(4031, 6839, 0, 34, 1, 1, 3, 1, 1, 'Fledgling Chimaera - Charred Horn'), +(4031, 6839, 0, 34, 1, 1, 4, 1, 1, 'Fledgling Chimaera - Charred Horn'), +(4032, 6839, 0, 100, 1, 1, 2, 1, 1, 'Young Chimaera - Charred Horn'), +(4032, 6839, 0, 34, 1, 1, 3, 1, 1, 'Young Chimaera - Charred Horn'), +(4032, 6839, 0, 34, 1, 1, 4, 1, 1, 'Young Chimaera - Charred Horn'); diff --git a/data/sql/updates/db_world/2022_06_18_15.sql b/data/sql/updates/db_world/2022_06_18_15.sql new file mode 100644 index 000000000..1072b2350 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_18_15.sql @@ -0,0 +1,167 @@ +-- DB update 2022_06_18_14 -> 2022_06_18_15 +-- +-- Mulgore 10618 Gameobjects that need removed before Mulgore can be rebuilt +DELETE FROM `gameobject` WHERE `guid` IN (18442, 18443, 18444, 18445, 18446, 18447, 18448, 18449, 18450, 18451, 18452, 18453, 18454, 18455, 85767, 85772, 85882, 85883); + +-- This includes the pools, but there are none + +-- All Mulgore Battered Chest Gameobjects (106318) that exist +SET @OGUID := 9838; + +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+40; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES +-- 0-3 +(@OGUID+0, 106318, 1, 215, 0, 1, 1, -1057.6275634765625, 465.5982666015625, 23.50528907775878906, 2.024578809738159179, 0, 0, 0.848047256469726562, 0.529920578002929687, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+1, 106318, 1, 215, 0, 1, 1, -1075.2293701171875, 542.53753662109375, 49.8483428955078125, 4.031712055206298828, 0, 0, -0.90258502960205078, 0.430511653423309326, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+2, 106318, 1, 215, 0, 1, 1, -1161.16845703125, 529.53985595703125, 28.19378280639648437, 5.235987663269042968, 0, 0, -0.5, 0.866025388240814208, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+3, 106318, 1, 215, 0, 1, 1, -998.08270263671875, 589.4744873046875, 81.93946075439453125, 2.530723094940185546, 0, 0, 0.953716278076171875, 0.300707906484603881, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +-- 4-7 +(@OGUID+4, 106318, 1, 215, 0, 1, 1, -546.70684814453125, 72.729278564453125, 52.28420257568359375, 0.802850961685180664, 0, 0, 0.390730857849121093, 0.920504987239837646, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+5, 106318, 1, 215, 0, 1, 1, -657.78033447265625, 193.8148956298828125, 46.80418014526367187, 0.506144583225250244, 0, 0, 0.250379562377929687, 0.968147754669189453, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+6, 106318, 1, 215, 0, 1, 1, -715.582275390625, 163.0640716552734375, 43.65098953247070312, 1.256635904312133789, 0, 0, 0.587784767150878906, 0.809017360210418701, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+7, 106318, 1, 215, 215, 1, 1, -631.74151611328125, 111.4527664184570312, 17.11371040344238281, 1.082102894783020019, 0, 0, 0.51503753662109375, 0.857167601585388183, 360, 255, 1, 0), -- 106318 (Area: 215 - Difficulty: 0) +-- 8-9 +(@OGUID+8, 106318, 1, 215, 0, 1, 1, -826.25250244140625, -36.7276496887207031, -13.1952342987060546, 3.926995515823364257, 0, 0, -0.92387866973876953, 0.38268551230430603, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+9, 106318, 1, 215, 215, 1, 1, -798.07769775390625, -9.66634082794189453, -13.128173828125, 4.136432647705078125, 0, 0, -0.87881660461425781, 0.477159708738327026, 360, 255, 1, 0), -- 106318 (Area: 215 - Difficulty: 0) +-- 10-13 +(@OGUID+10, 106318, 1, 215, 819, 1, 1, -591.3314208984375, -681.55999755859375, 27.44317245483398437, 5.427974700927734375, 0, 0, -0.41469287872314453, 0.909961462020874023, 360, 255, 1, 0), -- 106318 (Area: 819 - Difficulty: 0) +(@OGUID+11, 106318, 1, 215, 819, 1, 1, -665.03692626953125, -787.12469482421875, 43.61326980590820312, 1.431168079376220703, 0, 0, 0.656058311462402343, 0.754710197448730468, 360, 255, 1, 0), -- 106318 (Area: 819 - Difficulty: 0) +(@OGUID+12, 106318, 1, 215, 819, 1, 1, -779.68829345703125, -866.58966064453125, 25.97847366333007812, 3.9793548583984375, 0, 0, -0.9135446548461914, 0.406738430261611938, 360, 255, 1, 0), -- 106318 (Area: 819 - Difficulty: 0) +(@OGUID+13, 106318, 1, 215, 819, 1, 1, -824.10137939453125, -780.58660888671875, -2.71320295333862304, 4.276057243347167968, 0, 0, -0.84339141845703125, 0.537299633026123046, 360, 255, 1, 0), -- 106318 (Area: 819 - Difficulty: 0) +-- 14-17 +(@OGUID+14, 106318, 1, 215, 360, 1, 1, -1568.312255859375, -1081.0145263671875, 103.8672866821289062, 3.857182979583740234, 0, 0, -0.93667125701904296, 0.350209832191467285, 360, 255, 1, 0), -- 106318 (Area: 360 - Difficulty: 0) +(@OGUID+15, 106318, 1, 215, 360, 1, 1, -1585.0709228515625, -1151.2315673828125, 104.118377685546875, 0.122172988951206207, 0, 0, 0.061048507690429687, 0.998134791851043701, 360, 255, 1, 0), -- 106318 (Area: 360 - Difficulty: 0) +(@OGUID+16, 106318, 1, 215, 360, 1, 1, -1672.001708984375, -1324.0699462890625, 132.7880859375, 1.343901276588439941, 0, 0, 0.622513771057128906, 0.78260880708694458, 360, 255, 1, 0), -- 106318 (Area: 360 - Difficulty: 0) +(@OGUID+17, 106318, 1, 215, 360, 1, 1, -1681.0875244140625, -1218.5963134765625, 127.4188613891601562, 0.453785061836242675, 0, 0, 0.224950790405273437, 0.974370121955871582, 360, 255, 1, 0), -- 106318 (Area: 360 - Difficulty: 0) +-- 18-19 +(@OGUID+18, 106318, 1, 215, 0, 1, 1, -1889.326416015625, -1096.98095703125, 90.32932281494140625, 2.809975385665893554, 0, 0, 0.986285209655761718, 0.165049895644187927, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+19, 106318, 1, 215, 360, 1, 1, -1925.3721923828125, -1050.7725830078125, 44.04982376098632812, 5.462882041931152343, 0, 0, -0.39874839782714843, 0.917060375213623046, 360, 255, 1, 0), -- 106318 (Area: 360 - Difficulty: 0) +-- 20-23 +(@OGUID+20, 106318, 1, 215, 821, 1, 1, -2625.284423828125, -1390.2613525390625, 24.50350379943847656, 5.724681377410888671, 0, 0, -0.27563667297363281, 0.961261868476867675, 360, 255, 1, 0), -- 106318 (Area: 821 - Difficulty: 0) +(@OGUID+21, 106318, 1, 215, 821, 1, 1, -2635.93505859375, -1249.2003173828125, 13.64171695709228515, 2.251473426818847656, 0, 0, 0.902585029602050781, 0.430511653423309326, 360, 255, 1, 0), -- 106318 (Area: 821 - Difficulty: 0) +(@OGUID+22, 106318, 1, 215, 821, 1, 1, -2643.494873046875, -1320.986328125, 12.12032413482666015, 0.907570242881774902, 0, 0, 0.438370704650878906, 0.898794233798980712, 360, 255, 1, 0), -- 106318 (Area: 821 - Difficulty: 0) +(@OGUID+23, 106318, 1, 215, 821, 1, 1, -2716.833740234375, -1188.42822265625, 16.78433990478515625, 5.078907966613769531, 0, 0, -0.56640625, 0.824126183986663818, 360, 255, 1, 0), -- 106318 (Area: 821 - Difficulty: 0) +-- 24-25 +(@OGUID+24, 106318, 1, 215, 0, 1, 1, -2777.55859375, -691.963134765625, 7.008191108703613281, 3.385940074920654296, 0, 0, -0.99254608154296875, 0.121869951486587524, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+25, 106318, 1, 215, 0, 1, 1, -2782.115478515625, -707.653564453125, 6.424570083618164062, 2.687806606292724609, 0, 0, 0.974370002746582031, 0.224951311945915222, 180, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +-- 26-27 +(@OGUID+26, 106318, 1, 215, 0, 1, 1, -2742.504150390625, -445.18304443359375, -3.45379900932312011, 0.122172988951206207, 0, 0, 0.061048507690429687, 0.998134791851043701, 180, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+27, 106318, 1, 215, 0, 1, 1, -2750.028564453125, -430.93402099609375, -2.93078994750976562, 2.949595451354980468, 0, 0, 0.995395660400390625, 0.095851235091686248, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +-- 28-29 +(@OGUID+28, 106318, 1, 215, 0, 1, 1, -2402.0634765625, 233.6727142333984375, 49.24333953857421875, 2.809975385665893554, 0, 0, 0.986285209655761718, 0.165049895644187927, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+29, 106318, 1, 215, 0, 1, 1, -2413.068359375, 221.974609375, 48.83074951171875, 4.956737518310546875, 0, 0, -0.61566066741943359, 0.788011372089385986, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +-- 30-33 +(@OGUID+30, 106318, 1, 215, 818, 1, 1, -2352.908447265625, 457.480377197265625, 57.6083984375, 3.630291461944580078, 0, 0, -0.97029495239257812, 0.241925001144409179, 360, 255, 1, 0), -- 106318 (Area: 818 - Difficulty: 0) +(@OGUID+31, 106318, 1, 215, 818, 1, 1, -2358.603271484375, 379.66888427734375, 64.85495758056640625, 3.43830275535583496, 0, 0, -0.98901557922363281, 0.147811368107795715, 360, 255, 1, 0), -- 106318 (Area: 818 - Difficulty: 0) +(@OGUID+32, 106318, 1, 215, 818, 1, 1, -2388.364990234375, 444.8865966796875, 75.9410400390625, 1.151916384696960449, 0, 0, 0.544638633728027343, 0.838670849800109863, 360, 255, 1, 0), -- 106318 (Area: 818 - Difficulty: 0) +(@OGUID+33, 106318, 1, 215, 818, 1, 1, -2445.70751953125, 438.708526611328125, 61.7602691650390625, 0.541050612926483154, 0, 0, 0.267237663269042968, 0.96363067626953125, 360, 255, 1, 0), -- 106318 (Area: 818 - Difficulty: 0) +-- 34-35 +(@OGUID+34, 106318, 1, 215, 404, 1, 1, -1893.6497802734375, 353.875457763671875, 107.3605728149414062, 5.672322273254394531, 0, 0, -0.3007049560546875, 0.953717231750488281, 360, 255, 1, 0), -- 106318 (Area: 404 - Difficulty: 0) +(@OGUID+35, 106318, 1, 215, 404, 1, 1, -1896.4586181640625, 340.1953125, 105.6117172241210937, 1.291541695594787597, 0, 0, 0.60181427001953125, 0.798636078834533691, 360, 255, 1, 0), -- 106318 (Area: 404 - Difficulty: 0) +-- 36-37 +(@OGUID+36, 106318, 1, 215, 0, 1, 1, -1708.905517578125, 433.57623291015625, 96.52761077880859375, 2.967041015625, 0, 0, 0.996193885803222656, 0.087165042757987976, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +(@OGUID+37, 106318, 1, 215, 0, 1, 1, -1734.919189453125, 420.683441162109375, 97.20781707763671875, 0.27925160527229309, 0, 0, 0.139172554016113281, 0.990268170833587646, 360, 255, 1, 0), -- 106318 (Area: 0 - Difficulty: 0) +-- 38-40 +(@OGUID+38, 106318, 1, 215, 224, 1, 1, -1912.48876953125, -712.5831298828125, 3.573940992355346679, 0.174532130360603332, 0, 0, 0.087155342102050781, 0.996194720268249511, 360, 255, 1, 0), -- 106318 (Area: 224 - Difficulty: 0) +(@OGUID+39, 106318, 1, 215, 224, 1, 1, -1922.71533203125, -692.86309814453125, 2.616070032119750976, 6.195919513702392578, 0, 0, -0.04361915588378906, 0.999048233032226562, 360, 255, 1, 0), -- 106318 (Area: 224 - Difficulty: 0) +(@OGUID+40, 106318, 1, 215, 224, 1, 1, -1931.8563232421875, -715.7557373046875, 3.48775792121887207, 6.073746204376220703, 0, 0, -0.10452842712402343, 0.994521915912628173, 360, 255, 1, 0); -- 106318 (Area: 224 - Difficulty: 0) + +DELETE FROM `pool_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+40; +DELETE FROM `pool_template` WHERE `entry` BETWEEN 433 AND 446; + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(433, 1, 'Mulgore NW Harpies, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+0, 433, 0, 'Mulgore NW Harpies Chest 1 of 4'), +(@OGUID+1, 433, 0, 'Mulgore NW Harpies Chest 2 of 4'), +(@OGUID+2, 433, 0, 'Mulgore NW Harpies Chest 3 of 4'), +(@OGUID+3, 433, 0, 'Mulgore NW Harpies Chest 4 of 4'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(434, 1, 'Mulgore N Harpies, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+4, 434, 0, 'Mulgore N Harpies Chest 1 of 4'), +(@OGUID+5, 434, 0, 'Mulgore N Harpies Chest 2 of 4'), +(@OGUID+6, 434, 0, 'Mulgore N Harpies Chest 3 of 4'), +(@OGUID+7, 434, 0, 'Mulgore N Harpies Chest 4 of 4'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(435, 1, 'Wildmane Water Well, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+8, 435, 0, 'Mulgore Wildmane Water Well Chest 1 of 2'), +(@OGUID+9, 435, 0, 'Mulgore Wildmane Water Well Chest 2 of 2'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(436, 1, 'Mulgore NE Harpies, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+10, 436, 0, 'Mulgore NE Harpies Chest 1 of 4'), +(@OGUID+11, 436, 0, 'Mulgore NE Harpies Chest 2 of 4'), +(@OGUID+12, 436, 0, 'Mulgore NE Harpies Chest 3 of 4'), +(@OGUID+13, 436, 0, 'Mulgore NE Harpies Chest 4 of 4'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(437, 1, 'Mulgore Venture Co Cave Inside, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+14, 437, 0, 'Mulgore Venture Co Cave Inside Chest 1 of 4'), +(@OGUID+15, 437, 0, 'Mulgore Venture Co Cave Inside Chest 2 of 4'), +(@OGUID+16, 437, 0, 'Mulgore Venture Co Cave Inside Chest 3 of 4'), +(@OGUID+17, 437, 0, 'Mulgore Venture Co Cave Inside Chest 4 of 4'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(438, 1, 'Mulgore Venture Co Cave Outside, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+18, 438, 0, 'Mulgore Venture Co Cave Outside Chest 1 of 2'), +(@OGUID+19, 438, 0, 'Mulgore Venture Co Cave Outside Chest 2 of 2'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(439, 1, 'Mulgore SE Harpies, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+20, 439, 0, 'Mulgore SE Harpies Chest 1 of 4'), +(@OGUID+21, 439, 0, 'Mulgore SE Harpies Chest 2 of 4'), +(@OGUID+22, 439, 0, 'Mulgore SE Harpies Chest 3 of 4'), +(@OGUID+23, 439, 0, 'Mulgore SE Harpies Chest 4 of 4'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(440, 1, 'Mulgore East Palemane Gnoll Camp, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+24, 440, 0, 'Mulgore East Palemane Gnoll Camp Chest 1 of 2'), +(@OGUID+25, 440, 0, 'Mulgore East Palemane Gnoll Camp Chest 2 of 2'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(441, 1, 'Mulgore West Palemane Gnoll Camp, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+26, 441, 0, 'Mulgore West Palemane Gnoll Camp Chest 1 of 2'), +(@OGUID+27, 441, 0, 'Mulgore West Palemane Gnoll Camp Chest 2 of 2'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(442, 1, 'Mulgore Gnolls Outside Cave Camp, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+28, 442, 0, 'Mulgore Gnolls Outside Cave Camp Chest 1 of 2'), +(@OGUID+29, 442, 0, 'Mulgore Gnolls Outside Cave Camp Chest 2 of 2'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(443, 1, 'Mulgore Gnoll Cave, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+30, 443, 0, 'Mulgore Gnoll Cave Chest 1 of 4'), +(@OGUID+31, 443, 0, 'Mulgore Gnoll Cave Chest 2 of 4'), +(@OGUID+32, 443, 0, 'Mulgore Gnoll Cave Chest 3 of 4'), +(@OGUID+33, 443, 0, 'Mulgore Gnoll Cave Chest 4 of 4'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(444, 1, 'Mulgore Dwarven Camp, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+34, 444, 0, 'Mulgore Dwarven Camp Chest 1 of 2'), +(@OGUID+35, 444, 0, 'Mulgore Dwarven Camp Chest 2 of 2'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(445, 1, 'Mulgore Western Harpies, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+36, 445, 0, 'Mulgore Western Harpies Chest 1 of 2'), +(@OGUID+37, 445, 0, 'Mulgore Western Harpies Chest 2 of 2'); + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(446, 1, 'Mulgore Venture Co Caravan, Battered Chest 106318'); +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+38, 446, 0, 'Mulgore Venture Co Caravan Chest 1 of 3'), +(@OGUID+39, 446, 0, 'Mulgore Venture Co Caravan Chest 2 of 3'), +(@OGUID+40, 446, 0, 'Mulgore Venture Co Caravan Chest 3 of 3'); diff --git a/data/sql/updates/db_world/2022_06_19_00.sql b/data/sql/updates/db_world/2022_06_19_00.sql new file mode 100644 index 000000000..201c90589 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_19_00.sql @@ -0,0 +1,5 @@ +-- DB update 2022_06_18_15 -> 2022_06_19_00 +-- +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_mandokir_charge'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(24408, 'spell_mandokir_charge'); diff --git a/data/sql/updates/db_world/2022_06_21_00.sql b/data/sql/updates/db_world/2022_06_21_00.sql new file mode 100644 index 000000000..bc1a40262 --- /dev/null +++ b/data/sql/updates/db_world/2022_06_21_00.sql @@ -0,0 +1,7 @@ +-- DB update 2022_06_19_00 -> 2022_06_21_00 +-- +DELETE FROM `creature_formations` WHERE `leaderGUID` = 49310; +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(49310, 49310, 0, 0, 27, 0, 0), +(49310, 49311, 0, 0, 27, 0, 0), +(49310, 49312, 0, 0, 27, 0, 0); diff --git a/deps/g3dlite/source/CollisionDetection.cpp b/deps/g3dlite/source/CollisionDetection.cpp index ef48a5bb9..f00fb3bfc 100644 --- a/deps/g3dlite/source/CollisionDetection.cpp +++ b/deps/g3dlite/source/CollisionDetection.cpp @@ -33,15 +33,12 @@ #pragma float_control( precise, off ) #endif - namespace G3D { bool CollisionDetection::ignoreBool; Vector3 CollisionDetection::ignore; Array CollisionDetection::ignoreArray; - - Vector3 CollisionDetection::separatingAxisForSolidBoxSolidBox( const int separatingAxisIndex, const Box & box1, @@ -179,7 +176,6 @@ float CollisionDetection::projectedDistanceForSolidBoxSolidBox( return (R - (R0 + R1)); } - bool CollisionDetection::parallelAxisForSolidBoxSolidBox( const double* ca, const double epsilon, @@ -196,9 +192,6 @@ bool CollisionDetection::parallelAxisForSolidBoxSolidBox( return false; } - - - void CollisionDetection::fillSolidBoxSolidBoxInfo( const Box & box1, const Box & box2, @@ -234,8 +227,6 @@ void CollisionDetection::fillSolidBoxSolidBoxInfo( } } - - bool CollisionDetection::conservativeBoxBoxTest( const Vector3 & a, const Vector3 & b, const Vector3 & D) { // do a quick bounding sphere test because it is relatively @@ -245,9 +236,6 @@ bool CollisionDetection::conservativeBoxBoxTest( return (D.squaredMagnitude() < square(boxRadius1 + boxRadius2)); } - - - bool CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox( const Box& box1, const Box& box2, @@ -304,8 +292,6 @@ bool CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox( return true; } - - void CollisionDetection::closestPointsBetweenLineAndLine( const Line & line1, const Line & line2, @@ -342,8 +328,6 @@ void CollisionDetection::closestPointsBetweenLineAndLine( closest2 = Q0 + (tc * v); } - - float CollisionDetection::penetrationDepthForFixedBoxFixedBox( const Box& box1, const Box& box2, @@ -548,9 +532,6 @@ float CollisionDetection::penetrationDepthForFixedBoxFixedBox( } - - - float CollisionDetection::penetrationDepthForFixedSphereFixedBox( const Sphere& sphere, const Box& box, @@ -573,7 +554,6 @@ float CollisionDetection::penetrationDepthForFixedSphereFixedBox( // Find the square of the distance from the sphere to the box - // Distance along each axis from the closest side of the box // to the sphere center. Negative values are *inside* the box. Vector3 distOutsideBox; @@ -760,7 +740,6 @@ ZAXIS: return depth; } - float CollisionDetection::penetrationDepthForFixedSphereFixedSphere( const Sphere& sphereA, const Sphere& sphereB, @@ -784,7 +763,6 @@ float CollisionDetection::penetrationDepthForFixedSphereFixedSphere( return depth; } - float CollisionDetection::penetrationDepthForFixedSphereFixedPlane( const Sphere& sphereA, const Plane& planeB, @@ -809,7 +787,6 @@ float CollisionDetection::penetrationDepthForFixedSphereFixedPlane( return depth; } - float CollisionDetection::penetrationDepthForFixedBoxFixedPlane( const Box& box, const Plane& plane, @@ -843,7 +820,6 @@ float CollisionDetection::penetrationDepthForFixedBoxFixedPlane( return -lowest; } - float CollisionDetection::collisionTimeForMovingPointFixedPlane( const Vector3& point, const Vector3& velocity, @@ -1028,7 +1004,6 @@ float CollisionDetection::collisionTimeForMovingPointFixedSphere( return time; } - float CollisionDetection::collisionTimeForMovingSphereFixedSphere( const Sphere& movingSphere, const Vector3& velocity, @@ -1060,7 +1035,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedSphere( return time; } - /* float CollisionDetection::collisionTimeForMovingPointFixedTriangle( const Vector3& point, @@ -1206,7 +1180,6 @@ float CollisionDetection::collisionTimeForMovingPointFixedBox( return bestTime; } - float CollisionDetection::collisionTimeForMovingPointFixedAABox( const Vector3& origin, const Vector3& dir, @@ -1222,7 +1195,6 @@ float CollisionDetection::collisionTimeForMovingPointFixedAABox( } } - bool CollisionDetection::collisionLocationForMovingPointFixedAABox( const Vector3& origin, const Vector3& dir, @@ -1303,8 +1275,6 @@ bool CollisionDetection::collisionLocationForMovingPointFixedAABox( #undef IR } - - float CollisionDetection::collisionTimeForMovingPointFixedRectangle( const Vector3& point, const Vector3& velocity, @@ -1506,7 +1476,6 @@ static int findRayCapsuleIntersectionAux( return iQuantity; } - /** Used by collisionTimeForMovingPointFixedCapsule. @cite From magic software http://www.magic-software.com/Source/Intersection3D/MgcIntr3DLinCap.cpp @@ -1585,7 +1554,6 @@ float CollisionDetection::collisionTimeForMovingPointFixedCapsule( } } - float CollisionDetection::collisionTimeForMovingSphereFixedPlane( const Sphere& sphere, const Vector3& velocity, @@ -1631,7 +1599,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedPlane( } - float CollisionDetection::collisionTimeForMovingSphereFixedTriangle (const Sphere& sphere, const Vector3& velocity, @@ -1746,7 +1713,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedTriangle return t; } - float CollisionDetection::collisionTimeForMovingSphereFixedRectangle( const Sphere& sphere, const Vector3& velocity, @@ -1786,7 +1752,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedRectangle( return t; } - float CollisionDetection::collisionTimeForMovingSphereFixedBox( const Sphere& sphere, const Vector3& velocity, @@ -1822,7 +1787,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedBox( return bestTime; } - float CollisionDetection::collisionTimeForMovingSphereFixedCapsule( const Sphere& sphere, const Vector3& velocity, @@ -1846,7 +1810,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedCapsule( return time; } - Vector3 CollisionDetection::bounceDirection( const Sphere& sphere, const Vector3& velocity, @@ -1870,7 +1833,6 @@ Vector3 CollisionDetection::bounceDirection( return direction - 2.0 * normal * normal.dot(direction); } - Vector3 CollisionDetection::slideDirection( const Sphere& sphere, const Vector3& velocity, @@ -1885,7 +1847,6 @@ Vector3 CollisionDetection::slideDirection( return direction - normal * normal.dot(direction); } - Vector3 CollisionDetection::closestPointOnLineSegment( const Vector3& v0, const Vector3& v1, @@ -1931,7 +1892,6 @@ Vector3 CollisionDetection::closestPointOnLineSegment( } } - Vector3 CollisionDetection::closestPointOnTrianglePerimeter( const Vector3& v0, const Vector3& v1, @@ -1951,7 +1911,6 @@ Vector3 CollisionDetection::closestPointOnTrianglePerimeter( return closestPointOnTrianglePerimeter(v, edgeDirection, edgeLength, point, edgeIndex); } - Vector3 CollisionDetection::closestPointOnTrianglePerimeter( const Vector3 v[3], const Vector3 edgeDirection[3], @@ -2005,7 +1964,6 @@ Vector3 CollisionDetection::closestPointOnTrianglePerimeter( return r[edgeIndex]; } - bool CollisionDetection::isPointInsideTriangle( const Vector3& v0, const Vector3& v1, @@ -2082,7 +2040,6 @@ bool CollisionDetection::isPointInsideTriangle( return (b[2] >= 0.0f) && (b[2] <= 1.0f); } - bool CollisionDetection::isPointInsideRectangle( const Vector3& v0, const Vector3& v1, @@ -2095,7 +2052,6 @@ bool CollisionDetection::isPointInsideRectangle( isPointInsideTriangle(v2, v3, v0, normal, point); } - Vector3 CollisionDetection::closestPointToRectanglePerimeter( const Vector3& v0, const Vector3& v1, @@ -2144,7 +2100,6 @@ Vector3 CollisionDetection::closestPointToRectanglePerimeter( } } - Vector3 CollisionDetection::closestPointToRectangle( const Vector3& v0, const Vector3& v1, @@ -2168,7 +2123,6 @@ Vector3 CollisionDetection::closestPointToRectangle( } } - bool CollisionDetection::fixedSolidSphereIntersectsFixedSolidSphere( const Sphere& sphere1, const Sphere& sphere2) { @@ -2176,7 +2130,6 @@ bool CollisionDetection::fixedSolidSphereIntersectsFixedSolidSphere( return (sphere1.center - sphere2.center).squaredMagnitude() < square(sphere1.radius + sphere2.radius); } - bool CollisionDetection::fixedSolidSphereIntersectsFixedSolidBox( const Sphere& sphere, const Box& box) { @@ -2203,7 +2156,6 @@ bool CollisionDetection::fixedSolidSphereIntersectsFixedSolidBox( return false; } - bool CollisionDetection::movingSpherePassesThroughFixedBox( const Sphere& sphere, const Vector3& velocity, @@ -2221,7 +2173,6 @@ bool CollisionDetection::movingSpherePassesThroughFixedBox( return (collisionTimeForMovingSphereFixedBox(sphere, velocity, box, dummy1, dummy2) < timeLimit); } - bool CollisionDetection::movingSpherePassesThroughFixedSphere( const Sphere& sphere, const Vector3& velocity, @@ -2240,8 +2191,6 @@ bool CollisionDetection::movingSpherePassesThroughFixedSphere( return (collisionTimeForMovingPointFixedSphere(sphere.center, velocity, bigFixed, dummy1, dummy2) < timeLimit); } - - bool CollisionDetection::fixedSolidSphereIntersectsFixedTriangle( const Sphere& sphere, const Triangle& triangle) { @@ -2272,9 +2221,8 @@ bool CollisionDetection::fixedSolidSphereIntersectsFixedTriangle( return ((v - sphere.center).squaredLength() <= square(sphere.radius)); } - //////////////////////////////////////////////////////////////////////////////// -// AABB-triangle overlap test code based on Tomas Akenine-Möller's +// AABB-triangle overlap test code based on Tomas Akenine-MÂöller's // http://www.cs.lth.se/home/Tomas_Akenine_Moller/code/tribox3.txt // Ported 2008-12-28 @@ -2452,7 +2400,6 @@ bool CollisionDetection::fixedSolidBoxIntersectsFixedTriangle( //////////////////////////////////////////////////////////////////////////////// - } // namespace #ifdef _MSC_VER diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 648c46d83..584f5515c 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -215,7 +215,7 @@ void npc_escortAI::EnterEvadeMode(EvadeReason /*why*/) { me->GetMotionMaster()->MoveTargetedHome(); if (HasImmuneToNPCFlags) - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(true); Reset(); } } @@ -497,10 +497,10 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false //disable npcflags me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); - if (me->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC)) + if (me->IsImmuneToNPC()) { HasImmuneToNPCFlags = true; - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(false); } LOG_DEBUG("scripts.ai", "EscortAI started with {} waypoints. ActiveAttacker = {}, Run = {}, PlayerGUID = {}", diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h index 6a5054d60..103647309 100644 --- a/src/server/game/Battlegrounds/ArenaTeam.h +++ b/src/server/game/Battlegrounds/ArenaTeam.h @@ -132,7 +132,7 @@ struct ArenaTeamStats uint32 Rank; }; -#define MAX_ARENA_SLOT 3 // 0..2 slots +#define MAX_ARENA_SLOT 4 // 0..2 slots class ArenaTeam { diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 1b320b9f7..b2304cb18 100644 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -197,3 +197,65 @@ void Corpse::ResetGhostTime() { m_time = GameTime::GetGameTime().count(); } + +void Corpse::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) const +{ + if (!target) + return; + + ByteBuffer fieldBuffer; + UpdateMask updateMask; + updateMask.SetCount(m_valuesCount); + + uint32* flags = nullptr; + uint32 visibleFlag = GetUpdateFieldData(target, flags); + + for (uint16 index = 0; index < m_valuesCount; ++index) + { + if (_fieldNotifyFlags & flags[index] || ((updateType == UPDATETYPE_VALUES ? _changesMask.GetBit(index) : m_uint32Values[index]) && (flags[index] & visibleFlag))) + { + updateMask.SetBit(index); + + if (index == CORPSE_FIELD_BYTES_1 || index == CORPSE_FIELD_BYTES_2) + { + Player* owner = ObjectAccessor::GetPlayer(*this, GetOwnerGUID()); + if (owner && owner != target && sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && owner->IsInRaidWith(target) && owner->GetTeamId() != target->GetTeamId()) + { + uint32 playerBytes = target->GetUInt32Value(PLAYER_BYTES); + uint32 playerBytes2 = target->GetUInt32Value(PLAYER_BYTES_2); + + uint8 race = target->getRace(); + uint8 skin = (uint8)(playerBytes); + uint8 face = (uint8)(playerBytes >> 8); + uint8 hairstyle = (uint8)(playerBytes >> 16); + uint8 haircolor = (uint8)(playerBytes >> 24); + uint8 facialhair = (uint8)(playerBytes2); + + uint32 corpseBytes1 = ((0x00) | (race << 8) | (target->GetByteValue(PLAYER_BYTES_3, 0) << 16) | (skin << 24)); + uint32 corpseBytes2 = ((face) | (hairstyle << 8) | (haircolor << 16) | (facialhair << 24)); + + if (index == CORPSE_FIELD_BYTES_1) + { + fieldBuffer << corpseBytes1; + } + else + { + fieldBuffer << corpseBytes2; + } + } + else + { + fieldBuffer << m_uint32Values[index]; + } + } + else + { + fieldBuffer << m_uint32Values[index]; + } + } + } + + *data << uint8(updateMask.GetBlockCount()); + updateMask.AppendToPacket(data); + data->append(fieldBuffer); +} diff --git a/src/server/game/Entities/Corpse/Corpse.h b/src/server/game/Entities/Corpse/Corpse.h index acd852d2b..6d1dedcf0 100644 --- a/src/server/game/Entities/Corpse/Corpse.h +++ b/src/server/game/Entities/Corpse/Corpse.h @@ -54,6 +54,8 @@ public: void AddToWorld() override; void RemoveFromWorld() override; + void BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) const override; + bool Create(ObjectGuid::LowType guidlow); bool Create(ObjectGuid::LowType guidlow, Player* owner); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index a81a28418..21643ac2b 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -215,13 +215,13 @@ bool TemporaryThreatModifierEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) return true; } -Creature::Creature(bool isWorldObject): Unit(isWorldObject), MovableMapObject(), m_groupLootTimer(0), lootingGroupLowGUID(0), m_PlayerDamageReq(0), m_lootRecipientGroup(0), +Creature::Creature(bool isWorldObject): Unit(isWorldObject), MovableMapObject(), m_groupLootTimer(0), lootingGroupLowGUID(0), m_lootRecipientGroup(0), m_corpseRemoveTime(0), m_respawnTime(0), m_respawnDelay(300), m_corpseDelay(60), m_wanderDistance(0.0f), m_boundaryCheckTime(2500), m_transportCheckTimer(1000), lootPickPocketRestoreTime(0), m_reactState(REACT_AGGRESSIVE), m_defaultMovementType(IDLE_MOTION_TYPE), m_spawnId(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), m_originalEntry(0), m_moveInLineOfSightDisabled(false), m_moveInLineOfSightStrictlyDisabled(false), - m_homePosition(), m_transportHomePosition(), m_creatureInfo(nullptr), m_creatureData(nullptr), m_detectionDistance(20.0f), m_waypointID(0), m_path_id(0), m_formation(nullptr), _lastDamagedTime(nullptr), m_cannotReachTimer(0), - _isMissingSwimmingFlagOutOfCombat(false), m_assistanceTimer(0) + m_homePosition(), m_transportHomePosition(), m_creatureInfo(nullptr), m_creatureData(nullptr), m_detectionDistance(20.0f), m_waypointID(0), m_path_id(0), m_formation(nullptr), _lastDamagedTime(nullptr), m_cannotReachTarget(false), m_cannotReachTimer(0), + _isMissingSwimmingFlagOutOfCombat(false), m_assistanceTimer(0), _playerDamageReq(0), _damagedByPlayer(false) { m_regenTimer = CREATURE_REGEN_INTERVAL; m_valuesCount = UNIT_END; @@ -526,7 +526,7 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele uint32 previousHealth = GetHealth(); uint32 previousMaxHealth = GetMaxHealth(); - uint32 previousPlayerDamageReq = m_PlayerDamageReq; + uint32 previousPlayerDamageReq = _playerDamageReq; SelectLevel(changelevel); if (previousHealth > 0) @@ -535,11 +535,11 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele if (previousMaxHealth && previousMaxHealth > GetMaxHealth()) { - m_PlayerDamageReq = (uint32)(previousPlayerDamageReq * GetMaxHealth() / previousMaxHealth); + _playerDamageReq = (uint32)(previousPlayerDamageReq * GetMaxHealth() / previousMaxHealth); } else { - m_PlayerDamageReq = previousPlayerDamageReq; + _playerDamageReq = previousPlayerDamageReq; } } @@ -1831,14 +1831,14 @@ bool Creature::CanStartAttack(Unit const* who) const return false; // This set of checks is should be done only for creatures - if ((HasUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC) && who->GetTypeId() != TYPEID_PLAYER) || // flag is valid only for non player characters - (HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC) && who->GetTypeId() == TYPEID_PLAYER)) // immune to PC and target is a player, return false + if ((IsImmuneToNPC() && who->GetTypeId() != TYPEID_PLAYER) || // flag is valid only for non player characters + (IsImmuneToPC() && who->GetTypeId() == TYPEID_PLAYER)) // immune to PC and target is a player, return false { return false; } if (Unit* owner = who->GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER && HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC)) // immune to PC and target has player owner + if (owner->GetTypeId() == TYPEID_PLAYER && IsImmuneToPC()) // immune to PC and target has player owner return false; // Do not attack non-combat pets @@ -2369,7 +2369,7 @@ bool Creature::CanAssistTo(Unit const* u, Unit const* enemy, bool checkfaction / if (IsCivilian()) return false; - if (HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC)) + if (HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE) || IsImmuneToNPC()) return false; // skip fighting creature @@ -3578,3 +3578,30 @@ void Creature::ModifyThreatPercentTemp(Unit* victim, int32 percent, Milliseconds m_Events.AddEvent(pEvent, m_Events.CalculateTime(duration.count())); } } + +bool Creature::IsDamageEnoughForLootingAndReward() const +{ + return (m_creatureInfo->flags_extra & CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ) || (_playerDamageReq == 0 && _damagedByPlayer); +} + +void Creature::LowerPlayerDamageReq(uint32 unDamage, bool damagedByPlayer /*= true*/) +{ + if (_playerDamageReq) + _playerDamageReq > unDamage ? _playerDamageReq -= unDamage : _playerDamageReq = 0; + + if (!_damagedByPlayer) + { + _damagedByPlayer = damagedByPlayer; + } +} + +void Creature::ResetPlayerDamageReq() +{ + _playerDamageReq = GetHealth() / 2; + _damagedByPlayer = false; +} + +uint32 Creature::GetPlayerDamageReq() const +{ + return _playerDamageReq; +} diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index fea174f99..e940e63ba 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -340,14 +340,10 @@ public: void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; } [[nodiscard]] bool IsReputationGainDisabled() const { return DisableReputationGain; } - [[nodiscard]] bool IsDamageEnoughForLootingAndReward() const { return (m_creatureInfo->flags_extra & CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ) || (m_PlayerDamageReq == 0); } - void LowerPlayerDamageReq(uint32 unDamage) - { - if (m_PlayerDamageReq) - m_PlayerDamageReq > unDamage ? m_PlayerDamageReq -= unDamage : m_PlayerDamageReq = 0; - } - void ResetPlayerDamageReq() { m_PlayerDamageReq = GetHealth() / 2; } - uint32 m_PlayerDamageReq; + [[nodiscard]] bool IsDamageEnoughForLootingAndReward() const; + void LowerPlayerDamageReq(uint32 unDamage, bool damagedByPlayer = true); + void ResetPlayerDamageReq(); + [[nodiscard]] uint32 GetPlayerDamageReq() const; [[nodiscard]] uint32 GetOriginalEntry() const { return m_originalEntry; } void SetOriginalEntry(uint32 entry) { m_originalEntry = entry; } @@ -468,6 +464,8 @@ private: uint32 m_assistanceTimer; + uint32 _playerDamageReq; + bool _damagedByPlayer; }; class AssistDelayEvent : public BasicEvent diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index daaf52be0..030134f26 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -270,6 +270,11 @@ void CreatureGroup::MemberEvaded(Creature* member) continue; } + if (itr.second.HasGroupFlag(std::underlying_type_t(GroupAIFlags::GROUP_AI_FLAG_DONT_RESPAWN_LEADER_ON_EVADE)) && pMember == m_leader) + { + continue; + } + pMember->Respawn(); } } diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h index 6cc3157b8..9a4db6736 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.h +++ b/src/server/game/Entities/Creature/CreatureGroups.h @@ -28,10 +28,11 @@ class CreatureGroup; enum class GroupAIFlags : uint16 { - GROUP_AI_FLAG_MEMBER_ASSIST_LEADER = 0x001, - GROUP_AI_FLAG_LEADER_ASSIST_MEMBER = 0x002, - GROUP_AI_FLAG_EVADE_TOGETHER = 0x004, - GROUP_AI_FLAG_RESPAWN_ON_EVADE = 0x008, + GROUP_AI_FLAG_MEMBER_ASSIST_LEADER = 0x001, + GROUP_AI_FLAG_LEADER_ASSIST_MEMBER = 0x002, + GROUP_AI_FLAG_EVADE_TOGETHER = 0x004, + GROUP_AI_FLAG_RESPAWN_ON_EVADE = 0x008, + GROUP_AI_FLAG_DONT_RESPAWN_LEADER_ON_EVADE = 0x010, //GROUP_AI_FLAG_UNK3 = 0x010, //GROUP_AI_FLAG_UNK4 = 0x020, //GROUP_AI_FLAG_UNK5 = 0x040, diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 513b3789e..1bf477652 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -2089,7 +2089,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId) trigger->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); // xinef: Remove Immunity flags - trigger->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + trigger->SetImmuneToNPC(false); // xinef: set proper orientation, fixes cast against stealthed targets if (target) trigger->SetInFront(target); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 1b9f167d4..01149086f 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -183,46 +183,64 @@ bool ItemCanGoIntoBag(ItemTemplate const* pProto, ItemTemplate const* pBagProto) switch (pBagProto->Class) { case ITEM_CLASS_CONTAINER: - switch (pBagProto->SubClass) + { + if (pBagProto->SubClass == ITEM_SUBCLASS_CONTAINER) { - case ITEM_SUBCLASS_CONTAINER: - return true; - case ITEM_SUBCLASS_SOUL_CONTAINER: - if (!(pProto->BagFamily & BAG_FAMILY_MASK_SOUL_SHARDS)) - return false; - return true; - case ITEM_SUBCLASS_HERB_CONTAINER: - if (!(pProto->BagFamily & BAG_FAMILY_MASK_HERBS)) - return false; - return true; - case ITEM_SUBCLASS_ENCHANTING_CONTAINER: - if (!(pProto->BagFamily & BAG_FAMILY_MASK_ENCHANTING_SUPP)) - return false; - return true; - case ITEM_SUBCLASS_MINING_CONTAINER: - if (!(pProto->BagFamily & BAG_FAMILY_MASK_MINING_SUPP)) - return false; - return true; - case ITEM_SUBCLASS_ENGINEERING_CONTAINER: - if (!(pProto->BagFamily & BAG_FAMILY_MASK_ENGINEERING_SUPP)) - return false; - return true; - case ITEM_SUBCLASS_GEM_CONTAINER: - if (!(pProto->BagFamily & BAG_FAMILY_MASK_GEMS)) - return false; - return true; - case ITEM_SUBCLASS_LEATHERWORKING_CONTAINER: - if (!(pProto->BagFamily & BAG_FAMILY_MASK_LEATHERWORKING_SUPP)) - return false; - return true; - case ITEM_SUBCLASS_INSCRIPTION_CONTAINER: - if (!(pProto->BagFamily & BAG_FAMILY_MASK_INSCRIPTION_SUPP)) - return false; - return true; - default: - return false; + return true; } + else + { + if (pProto->Class == ITEM_CLASS_CONTAINER) + { + return false; + } + + switch (pBagProto->SubClass) + { + case ITEM_SUBCLASS_SOUL_CONTAINER: + if (!(pProto->BagFamily & BAG_FAMILY_MASK_SOUL_SHARDS)) + return false; + return true; + case ITEM_SUBCLASS_HERB_CONTAINER: + if (!(pProto->BagFamily & BAG_FAMILY_MASK_HERBS)) + return false; + return true; + case ITEM_SUBCLASS_ENCHANTING_CONTAINER: + if (!(pProto->BagFamily & BAG_FAMILY_MASK_ENCHANTING_SUPP)) + return false; + return true; + case ITEM_SUBCLASS_MINING_CONTAINER: + if (!(pProto->BagFamily & BAG_FAMILY_MASK_MINING_SUPP)) + return false; + return true; + case ITEM_SUBCLASS_ENGINEERING_CONTAINER: + if (!(pProto->BagFamily & BAG_FAMILY_MASK_ENGINEERING_SUPP)) + return false; + return true; + case ITEM_SUBCLASS_GEM_CONTAINER: + if (!(pProto->BagFamily & BAG_FAMILY_MASK_GEMS)) + return false; + return true; + case ITEM_SUBCLASS_LEATHERWORKING_CONTAINER: + if (!(pProto->BagFamily & BAG_FAMILY_MASK_LEATHERWORKING_SUPP)) + return false; + return true; + case ITEM_SUBCLASS_INSCRIPTION_CONTAINER: + if (!(pProto->BagFamily & BAG_FAMILY_MASK_INSCRIPTION_SUPP)) + return false; + return true; + default: + return false; + } + } + } case ITEM_CLASS_QUIVER: + { + if (pProto->Class == ITEM_CLASS_QUIVER) + { + return false; + } + switch (pBagProto->SubClass) { case ITEM_SUBCLASS_QUIVER: @@ -236,7 +254,9 @@ bool ItemCanGoIntoBag(ItemTemplate const* pProto, ItemTemplate const* pBagProto) default: return false; } + } } + return false; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9a333e337..77f285220 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2643,12 +2643,13 @@ 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_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 | - UNIT_FLAG_SKINNABLE | UNIT_FLAG_MOUNT | UNIT_FLAG_TAXI_FLIGHT ); + UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_ATTACKABLE_1 | + 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 | UNIT_FLAG_SKINNABLE | UNIT_FLAG_MOUNT | + UNIT_FLAG_TAXI_FLIGHT); + SetImmuneToAll(false); SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED); // must be set SetUnitFlag2(UNIT_FLAG2_REGENERATE_POWER);// must be set diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bbc83ebc0..250118625 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1000,7 +1000,11 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage victim->ToCreature()->SetLootRecipient(attacker); if (!attacker || attacker->IsControlledByPlayer() || attacker->IsCreatedByPlayer()) - victim->ToCreature()->LowerPlayerDamageReq(health < damage ? health : damage); + { + uint32 unDamage = health < damage ? health : damage; + bool damagedByPlayer = unDamage && attacker && attacker->m_movedByPlayer != nullptr; + victim->ToCreature()->LowerPlayerDamageReq(unDamage, damagedByPlayer); + } } if (health <= damage) @@ -3867,7 +3871,11 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const return false; } - if (IsInWater()) + LiquidStatus liquidStatus = GetLiquidData().Status; + bool isInWater = (liquidStatus & MAP_LIQUID_STATUS_SWIMMING) != 0; + + // In water or jumping in water + if (isInWater || (liquidStatus == LIQUID_MAP_ABOVE_WATER && (IsFalling() || (ToPlayer() && ToPlayer()->IsFalling())))) { return c->CanEnterWater(); } @@ -13045,6 +13053,24 @@ void Unit::SetInCombatWith(Unit* enemy, uint32 duration) SetInCombatState(false, enemy, duration); } +void Unit::SetImmuneToPC(bool apply, bool keepCombat) +{ + (void)keepCombat; + if (apply) + SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + else + RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); +} + +void Unit::SetImmuneToNPC(bool apply, bool keepCombat) +{ + (void)keepCombat; + if (apply) + SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + else + RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); +} + void Unit::CombatStart(Unit* victim, bool initialAggro) { // Xinef: Dont allow to start combat with triggers @@ -13158,8 +13184,8 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy, uint32 duration) return; // xinef: if we somehow engage in combat (scripts, dunno) with player, remove this flag so he can fight back - if (GetTypeId() == TYPEID_UNIT && enemy && HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC) && enemy->GetCharmerOrOwnerPlayerOrPlayerItself()) - RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); // unit has engaged in combat, remove immunity so players can fight back + if (GetTypeId() == TYPEID_UNIT && enemy && IsImmuneToPC() && enemy->GetCharmerOrOwnerPlayerOrPlayerItself()) + SetImmuneToPC(true); // unit has engaged in combat, remove immunity so players can fight back if (IsInCombat()) return; @@ -13225,7 +13251,7 @@ void Unit::ClearInCombat() if (Creature* creature = ToCreature()) { if (creature->GetCreatureTemplate() && creature->GetCreatureTemplate()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC) - SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); // set immunity state to the one from db on evade + SetImmuneToPC(true); // set immunity state to the one from db on evade ClearUnitState(UNIT_STATE_ATTACK_PLAYER); if (HasDynamicFlag(UNIT_DYNFLAG_TAPPED)) @@ -13269,7 +13295,7 @@ bool Unit::isTargetableForAttack(bool checkFakeDeath, Unit const* byWho) const if (HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE)) return false; - if (HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC) && byWho && byWho->GetCharmerOrOwnerPlayerOrPlayerItself()) + if (IsImmuneToPC() && byWho && byWho->GetCharmerOrOwnerPlayerOrPlayerItself()) return false; if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->IsGameMaster()) @@ -13324,11 +13350,11 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo } // check flags if (target->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_TAXI_FLIGHT | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NON_ATTACKABLE_2) - || (!HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && target->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC)) - || (!target->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && HasUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC)) - || (HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && target->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC)) + || (!HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && target->IsImmuneToNPC()) + || (!target->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && IsImmuneToNPC()) + || (HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && target->IsImmuneToPC()) // 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 && (!obj || !obj->isType(TYPEMASK_GAMEOBJECT | TYPEMASK_DYNAMICOBJECT))) && target->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC))) + || ((GetEntry() != WORLD_TRIGGER && (!obj || !obj->isType(TYPEMASK_GAMEOBJECT | TYPEMASK_DYNAMICOBJECT))) && target->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && IsImmuneToPC())) return false; // CvC case - can attack each other only when one of them is hostile @@ -13443,12 +13469,12 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co if (HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) { - if (target->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC)) + if (target->IsImmuneToPC()) return false; } else { - if (target->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC)) + if (target->IsImmuneToNPC()) return false; } } @@ -15737,9 +15763,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u else // For attacker { // Overpower on victim dodge - if (procExtra & PROC_EX_DODGE ) + if (procExtra & PROC_EX_DODGE) { - if (GetTypeId() == TYPEID_PLAYER && getClass() == CLASS_WARRIOR) + if (getClass() == CLASS_WARRIOR) { AddComboPoints(target, 1); StartReactiveTimer(REACTIVE_OVERPOWER); @@ -16530,8 +16556,10 @@ void Unit::UpdateReactives(uint32 p_time) ModifyAuraState(AURA_STATE_HUNTER_PARRY, false); break; case REACTIVE_OVERPOWER: - if (getClass() == CLASS_WARRIOR && GetTypeId() == TYPEID_PLAYER) + if (getClass() == CLASS_WARRIOR) + { ClearComboPoints(); + } break; case REACTIVE_WOLVERINE_BITE: if (IsHunterPet()) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 7af6d71e4..8bdc2d8e1 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1648,6 +1648,13 @@ public: [[nodiscard]] bool IsInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); } + void SetImmuneToAll(bool apply, bool keepCombat = false) { SetImmuneToPC(apply, keepCombat); SetImmuneToNPC(apply, keepCombat); } + bool IsImmuneToAll() const { return IsImmuneToPC() && IsImmuneToNPC(); } + void SetImmuneToPC(bool apply, bool keepCombat = false); + bool IsImmuneToPC() const { return HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); } + void SetImmuneToNPC(bool apply, bool keepCombat = false); + bool IsImmuneToNPC() const { return HasUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); } + bool IsEngaged() const { return IsInCombat(); } bool IsEngagedBy(Unit const* who) const { return IsInCombatWith(who); } diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index eba4476d7..3d5eff4b1 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1113,7 +1113,7 @@ namespace Acore {} bool operator()(Unit* u) { - if (!u->IsAlive() || u->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE) || (u->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC) && !u->IsInCombat())) + if (!u->IsAlive() || u->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE) || (u->IsImmuneToPC() && !u->IsInCombat())) return false; if (u->GetGUID() == i_funit->GetGUID()) return false; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index b05986825..b7e4f8193 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -3635,7 +3635,7 @@ Corpse* Map::ConvertCorpseToBones(ObjectGuid const ownerGuid, bool insignia /*= bones->SetPhaseMask(corpse->GetPhaseMask(), false); bones->SetUInt32Value(CORPSE_FIELD_FLAGS, CORPSE_FLAG_UNK2 | CORPSE_FLAG_BONES); - bones->SetGuidValue(CORPSE_FIELD_OWNER, ObjectGuid::Empty); + bones->SetGuidValue(CORPSE_FIELD_OWNER, corpse->GetOwnerGUID()); for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i) if (corpse->GetUInt32Value(CORPSE_FIELD_ITEM + i)) diff --git a/src/server/game/Miscellaneous/Formulas.cpp b/src/server/game/Miscellaneous/Formulas.cpp index 3ffb2c3dd..788fc5967 100644 --- a/src/server/game/Miscellaneous/Formulas.cpp +++ b/src/server/game/Miscellaneous/Formulas.cpp @@ -124,9 +124,9 @@ uint32 Acore::XP::Gain(Player* player, Unit* unit, bool isBattleGround /*= false } // if players dealt less than 50% of the damage and were credited anyway (due to CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ), scale XP gained appropriately (linear scaling) - if (creature && creature->m_PlayerDamageReq) + if (creature && creature->GetPlayerDamageReq()) { - xpMod *= 1.0f - 2.0f * creature->m_PlayerDamageReq / creature->GetMaxHealth(); + xpMod *= 1.0f - 2.0f * creature->GetPlayerDamageReq() / creature->GetMaxHealth(); } gain = uint32(gain * xpMod); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index e24899bf2..28c979e86 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2868,10 +2868,15 @@ void DynObjAura::FillTargetMap(std::map& targets, Unit* /*caster*/ for (UnitList::iterator itr = targetList.begin(); itr != targetList.end(); ++itr) { + // xinef: check z level and los dependence Unit* target = *itr; - if (!spellInfo->HasAttribute(SPELL_ATTR2_IGNORE_LINE_OF_SIGHT) && !spellInfo->HasAttribute(SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT) && !target->IsWithinLOSInMap(GetDynobjOwner())) + float zLevel = GetDynobjOwner()->GetPositionZ(); + if (target->GetPositionZ() + 3.0f < zLevel || target->GetPositionZ() - 5.0f > zLevel) { - continue; + if (!spellInfo->HasAttribute(SPELL_ATTR2_IGNORE_LINE_OF_SIGHT) && !spellInfo->HasAttribute(SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT) && !target->IsWithinLOSInMap(GetDynobjOwner())) + { + continue; + } } std::map::iterator existing = targets.find(*itr); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 44df83ab6..8bcb30778 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5851,31 +5851,27 @@ SpellCastResult Spell::CheckCast(bool strict) if ((!m_caster->IsTotem() || !m_spellInfo->IsPositive()) && !m_spellInfo->HasAttribute(SPELL_ATTR2_IGNORE_LINE_OF_SIGHT) && !m_spellInfo->HasAttribute(SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT) && !(m_spellFlags & SPELL_FLAG_REDIRECTED)) { - WorldObject* losCenter = nullptr; + bool castedByGameobject = false; uint32 losChecks = LINEOFSIGHT_ALL_CHECKS; if (m_originalCasterGUID.IsGameObject()) { - losCenter = m_caster->GetMap()->GetGameObject(m_originalCasterGUID); + castedByGameobject = m_caster->GetMap()->GetGameObject(m_originalCasterGUID) != nullptr; } else if (m_caster->GetEntry() == WORLD_TRIGGER) { if (TempSummon* tempSummon = m_caster->ToTempSummon()) { - losCenter = tempSummon->GetSummonerGameObject(); + castedByGameobject = tempSummon->GetSummonerGameObject() != nullptr; } } - if (losCenter) + if (castedByGameobject) { // If spell casted by gameobject then ignore M2 models losChecks &= ~LINEOFSIGHT_CHECK_GOBJECT_M2; } - else - { - losCenter = m_caster; - } - if (!losCenter->IsWithinLOSInMap(target, VMAP::ModelIgnoreFlags::M2, LineOfSightChecks(losChecks))) + if (!m_caster->IsWithinLOSInMap(target, VMAP::ModelIgnoreFlags::M2, LineOfSightChecks(losChecks))) { return SPELL_FAILED_LINE_OF_SIGHT; } @@ -7968,7 +7964,6 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff) const } } - WorldObject* caster = nullptr; if (gobCaster) { if (gobCaster->GetGOInfo()->IsIgnoringLOSChecks()) @@ -7976,15 +7971,9 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff) const return true; } - caster = gobCaster; - // If spell casted by gameobject then ignore M2 models losChecks &= ~LINEOFSIGHT_CHECK_GOBJECT_M2; } - else - { - caster = m_caster; - } if (target != m_caster) { @@ -7999,7 +7988,7 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff) const return false; } } - else if (!target->IsWithinLOSInMap(caster, VMAP::ModelIgnoreFlags::M2, LineOfSightChecks(losChecks))) + else if (!m_caster->IsWithinLOSInMap(target, VMAP::ModelIgnoreFlags::M2, LineOfSightChecks(losChecks))) { return false; } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c329395ec..1097e49b5 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2172,8 +2172,12 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) if (gameObjTarget) { // Allow one skill-up until respawned - if (!gameObjTarget->IsInSkillupList(player->GetGUID()) && player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue)) + if (!gameObjTarget->IsInSkillupList(player->GetGUID())) + { gameObjTarget->AddToSkillupList(player->GetGUID()); + player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue); + } + } else if (itemTarget) { @@ -2424,7 +2428,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) summon->SelectLevel(); // some summoned creaters have different from 1 DB data for level/hp summon->ReplaceAllNpcFlags(NPCFlags(summon->GetCreatureTemplate()->npcflag)); - summon->ReplaceAllUnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + summon->SetImmuneToAll(true); summon->SetReactState(REACT_PASSIVE); // Xinef: Pet can have some auras in creature_addon or in scripts, do not remove them instantly diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 9e85278f4..9039961d5 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -1369,6 +1369,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST; }); + // Frightening Shout + ApplySpellFix({ 19134 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY; + }); + // Isle of Conquest ApplySpellFix({ 66551 }, [](SpellInfo* spellInfo) { diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 7fbf37780..b538494a0 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -496,7 +496,7 @@ public: } //show info of gameobject - static bool HandleGameObjectInfoCommand(ChatHandler* handler, Optional> objectId) + static bool HandleGameObjectInfoCommand(ChatHandler* handler, Optional isGuid, Variant, Hyperlink, uint32> data) { uint32 entry = 0; uint32 type = 0; @@ -505,17 +505,24 @@ public: uint32 lootId = 0; GameObject* gameObject = nullptr; - if (!objectId) + ObjectGuid::LowType spawnId = 0; + if (isGuid || data.holds_alternative>()) { - if (WorldObject* object = handler->getSelectedObject()) + spawnId = *data; + GameObjectData const* spawnData = sObjectMgr->GetGOData(spawnId); + if (!spawnData) { - entry = object->GetEntry(); - if (object->GetTypeId() == TYPEID_GAMEOBJECT) - gameObject = object->ToGameObject(); + handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, spawnId); + handler->SetSentErrorMessage(true); + return false; } + entry = spawnData->id; + gameObject = handler->GetObjectFromPlayerMapByDbGuid(spawnId); } else - entry = static_cast(objectId->get()); + { + entry = *data; + } GameObjectTemplate const* gameObjectInfo = sObjectMgr->GetGameObjectTemplate(entry); if (!gameObjectInfo) diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp index 329b36a9d..e80feaaba 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp @@ -179,7 +179,7 @@ public: me->SetFaction(FACTION_FRIENDLY); // was set before event start, so set again - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); if (instance->GetData(TYPE_TOMB_OF_SEVEN) == DONE) // what is this trying to do? Probably some kind of crash recovery { diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp index 9b483673a..4470a091b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp @@ -752,7 +752,7 @@ public: { ++TombEventCounter; boss->SetFaction(FACTION_DARK_IRON_DWARVES); - boss->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + boss->SetImmuneToPC(false); // find suitable target here. Player* target = boss->SelectNearestPlayer(130); @@ -786,7 +786,7 @@ public: boss->SetLootRecipient(nullptr); } boss->SetFaction(FACTION_FRIENDLY); - boss->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); // think this is useless + boss->SetImmuneToPC(true); // think this is useless if (i == 6) // doomrel needs explicit reset { boss->AI()->Reset(); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp index 174c6a510..766a19b7d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -79,7 +79,8 @@ public: void Reset() override { - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToPC(true); events.Reset(); // Apply auras on spawn and reset // DoCast(me, SPELL_FIRE_SHIELD_TRIGGER); // Need to find this in old DBC if possible @@ -157,7 +158,8 @@ public: me->CastSpell(me, SPELL_EMBERSEER_FULL_STRENGTH); Talk(EMOTE_FREE_OF_BONDS); Talk(YELL_FREE_OF_BONDS); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToPC(false); events.ScheduleEvent(EVENT_ENTER_COMBAT, 2000); } } @@ -338,7 +340,7 @@ public: void Reset() override { - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); if (Creature* Emberseer = me->FindNearestCreature(NPC_PYROGAURD_EMBERSEER, 30.0f, true)) Emberseer->AI()->SetData(1, 3); @@ -364,7 +366,7 @@ public: { if (data == 1 && value == 1) { - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->InterruptSpell(CURRENT_CHANNELED_SPELL); DoZoneInCombat(); _events.CancelEvent(EVENT_ENCAGED_EMBERSEER); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp index 1fa033d7f..b646571b0 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp @@ -114,11 +114,13 @@ public: if (instance->GetBossState(DATA_GYTH) == IN_PROGRESS) { - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_PREPARATION); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PREPARATION); + me->SetImmuneToAll(false); return; } - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_PREPARATION); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PREPARATION); + me->SetImmuneToAll(true); gythEvent = false; victorGUID.Clear(); waveDoorGUID.Clear(); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index f396a1b17..cfb502d59 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -358,6 +358,7 @@ public: DoCast(me, SPELL_NEFARIANS_BARRIER); SetCombatMovement(false); + me->SetImmuneToPC(false); AttackStart(SelectTarget(SelectTargetMethod::Random, 0, 200.f, true)); events.ScheduleEvent(EVENT_SHADOWBLINK, 500); events.ScheduleEvent(EVENT_SHADOW_BOLT, 3000); @@ -499,7 +500,8 @@ public: me->SetFaction(FACTION_DRAGONFLIGHT_BLACK); me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP); me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToPC(true); } } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp index fd676fc5c..d7f840320 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp @@ -151,7 +151,8 @@ public: { summon->CastSpell(summon, SPELL_RAGNAROS_FADE); summon->CastSpell(summon, SPELL_RAGNAROS_SUBMERGE_EFFECT, true); - summon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE); + summon->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + summon->SetImmuneToAll(true); summon->SetReactState(REACT_PASSIVE); } } @@ -180,7 +181,7 @@ public: else { events.SetPhase(PHASE_NONE); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); me->SetFaction(FACTION_MAJORDOMO_FRIENDLY); } @@ -282,7 +283,7 @@ public: instance->SetBossState(DATA_MAJORDOMO_EXECUTUS, DONE); events.CancelEventGroup(PHASE_COMBAT); me->GetMap()->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetFaction(FACTION_MAJORDOMO_FRIENDLY); EnterEvadeMode(); Talk(SAY_DEFEAT); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp index 3b4be5ae5..1dba8396c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp @@ -137,7 +137,8 @@ public: extraEvents.Reset(); extraEvents.SetPhase(PHASE_EMERGED); me->SetReactState(REACT_AGGRESSIVE); - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_NOT_SELECTABLE); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); } @@ -276,7 +277,8 @@ public: _isIntroDone = true; extraEvents.SetPhase(PHASE_EMERGED); me->RemoveAurasDueToSpell(SPELL_RAGNAROS_SUBMERGE_EFFECT); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); me->SetReactState(REACT_AGGRESSIVE); DoZoneInCombat(); break; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index 194f67610..8de6e59ce 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -107,7 +107,7 @@ void SummonCroneIfReady(InstanceScript* instance, Creature* creature) if (creature->GetVictim()) pCrone->AI()->AttackStart(creature->GetVictim()); pCrone->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); - pCrone->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + pCrone->SetImmuneToPC(false); } } } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 530b77dd7..3434fc8e8 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -106,7 +106,7 @@ public: summons.DespawnAll(); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); instance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); } void JustSummoned(Creature* summon) override @@ -120,7 +120,7 @@ public: void InitializeAI() override { ScriptedAI::InitializeAI(); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); } void JustDied(Unit*) override @@ -162,7 +162,8 @@ public: if (me->isRegeneratingHealth()) { me->SetRegeneratingHealth(false); - me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE); + me->SetImmuneToAll(true); me->CombatStop(); me->SetReactState(REACT_PASSIVE); LapseAction(ACTION_REMOVE_FLY); @@ -200,7 +201,7 @@ public: switch (events2.ExecuteEvent()) { case EVENT_INIT_COMBAT: - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); if (Unit* target = SelectTargetFromPlayerList(50.0f)) AttackStart(target); return; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 95920a0d5..31e2b9749 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -219,7 +219,7 @@ public: if (creature->AI()->GetData(DATA_IN_PROGRESS)) return true; - creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + creature->SetImmuneToPC(false); creature->RemoveUnitFlag(UNIT_FLAG_SWIMMING); player->CastSpell(creature, SPELL_DUEL, false); @@ -584,7 +584,7 @@ public: { ScriptedAI::MoveInLineOfSight(who); - if (!who->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC) && who->GetEntry() == NPC_GHOUL && me->IsWithinDistInMap(who, 10.0f)) + if (!who->IsImmuneToNPC() && who->GetEntry() == NPC_GHOUL && me->IsWithinDistInMap(who, 10.0f)) if (Unit* owner = who->GetOwner()) if (Player* player = owner->ToPlayer()) { @@ -593,7 +593,7 @@ public: creature->CastSpell(owner, 52517, true); creature->AI()->SetGUID(me->GetGUID()); - creature->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + creature->SetImmuneToAll(true); } } @@ -743,7 +743,7 @@ public: phase = PHASE_CHAINED; events.Reset(); me->SetFaction(FACTION_CREATURE); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); me->LoadEquipment(0, true); } @@ -844,7 +844,7 @@ public: else { me->SetFaction(FACTION_MONSTER); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); phase = PHASE_ATTACKING; if (Player* target = ObjectAccessor::GetPlayer(*me, playerGUID)) @@ -964,7 +964,7 @@ public: { npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature) { - me->ReplaceAllUnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetFaction(FACTION_FRIENDLY); me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse. } @@ -987,7 +987,8 @@ public: me->SetSpeed(MOVE_RUN, 1.25f); me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0); - me->ReplaceAllUnitFlags(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->ReplaceAllUnitFlags(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); me->SetFaction(FACTION_FRIENDLY); } } @@ -1097,7 +1098,8 @@ public: { me->SetFacingToObject(car); // xinef: add some flags - car->ReplaceAllUnitFlags(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + car->ReplaceAllUnitFlags(UNIT_FLAG_NON_ATTACKABLE); + car->SetImmuneToAll(true); car->SetFaction(FACTION_FRIENDLY); } Talk(SAY_SCARLET_MINER_0); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 9c15adbdc..dc6a899d0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -255,7 +255,7 @@ public: else { me->GetMotionMaster()->MoveTargetedHome(); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(true); Reset(); } } @@ -313,7 +313,7 @@ public: m_uiValrothGUID = summoned->GetGUID(); summoned->AddThreat(me, 0.0f); - summoned->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + summoned->SetImmuneToPC(false); summons.Summon(summoned); } @@ -666,7 +666,7 @@ public: ExecuteSpeech_Counter = 0; PlayerGUID.Clear(); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); } bool MeetQuestCondition(Player* player) @@ -780,7 +780,7 @@ public: case 9: Talk(SAY_EXEC_TIME_6, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); @@ -826,7 +826,7 @@ public: case 9: Talk(SAY_EXEC_TIME_8, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); @@ -872,7 +872,7 @@ public: case 9: Talk(SAY_EXEC_TIME_3, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); @@ -918,7 +918,7 @@ public: case 9: Talk(SAY_EXEC_TIME_7, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); @@ -964,7 +964,7 @@ public: case 9: Talk(SAY_EXEC_TIME_4, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); @@ -1010,7 +1010,7 @@ public: case 9: Talk(SAY_EXEC_TIME_9, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); @@ -1056,7 +1056,7 @@ public: case 9: Talk(SAY_EXEC_TIME_5, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); @@ -1102,7 +1102,7 @@ public: case 9: Talk(SAY_EXEC_TIME_10, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); @@ -1146,7 +1146,7 @@ public: case 9: Talk(SAY_EXEC_TIME_1, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); @@ -1192,7 +1192,7 @@ public: case 9: Talk(SAY_EXEC_TIME_2, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 408aa1923..6289c5c00 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -465,7 +465,7 @@ public: if (battleStarted == ENCOUNTER_STATE_OUTRO && cr->GetEntry() == NPC_DEFENDER_OF_THE_LIGHT) { cr->SetReactState(REACT_PASSIVE); - cr->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + cr->SetImmuneToAll(true); cr->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY1H); cr->HandleEmoteCommand(EMOTE_STATE_READY1H); } @@ -546,7 +546,7 @@ public: events.Reset(); summons.DespawnAll(); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); me->SetStandState(UNIT_STAND_STATE_STAND); me->SetVisible(true); @@ -670,7 +670,7 @@ public: break; } case EVENT_START_COUNTDOWN_14: - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->SummonCreatureGroup(5); return; case EVENT_FINISH_FIGHT_1: @@ -698,13 +698,13 @@ public: { summon->CombatStop(true); summon->GetThreatMgr().ClearAllThreat(); - summon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + summon->SetImmuneToAll(true); summon->SetReactState(REACT_PASSIVE); summon->GetMotionMaster()->Clear(false); } me->CombatStop(true); me->GetThreatMgr().ClearAllThreat(); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->Clear(false); @@ -1027,7 +1027,7 @@ public: { tirion->CastSpell(tirion, SPELL_TIRION_CHARGE, true); tirion->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); - tirion->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + tirion->SetImmuneToAll(true); } break; case EVENT_OUTRO_SCENE_44: diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp index 615545ab1..2e496097f 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp @@ -113,8 +113,7 @@ public: me->SetDisableGravity(true); me->SetReactState(REACT_PASSIVE); me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); // for some reason he aggroes if we don't have this. - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); // might not be needed, but guardians and stuff like that could mess up. + me->SetImmuneToAll(true); // for some reason he aggroes if we don't have this. } void MovementInform(uint32 type, uint32 id) override @@ -154,8 +153,7 @@ public: me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF)); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->SetReactState(REACT_AGGRESSIVE); break; case INTRO_6: diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp index 07b19f003..547d06a8e 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp @@ -139,7 +139,7 @@ public: }) .Schedule(12s, [this](TaskContext context) { - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); _phase = PHASE_COMBAT; DoZoneInCombat(); @@ -185,7 +185,7 @@ public: } }); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->SetFaction(FACTION_MONSTER); summons.DoAction(ACTION_START_EVENT); } @@ -293,13 +293,13 @@ struct npc_apothecary_genericAI : public ScriptedAI { if (action == ACTION_START_EVENT) { - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->SetFaction(FACTION_MONSTER); me->GetMotionMaster()->MovePoint(1, _movePos); } else if (action == ACTION_START_FIGHT) { - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); DoZoneInCombat(); } } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_jarien_and_sothos.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_jarien_and_sothos.cpp index ded1208cc..8f0856421 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_jarien_and_sothos.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_jarien_and_sothos.cpp @@ -111,7 +111,8 @@ struct boss_jarien : public BossAI }); me->SetReactState(REACT_PASSIVE); - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToNPC(true); _talked = false; _phase = PHASE_TALK; } @@ -145,7 +146,8 @@ struct boss_jarien : public BossAI _talked = true; _phase = PHASE_FIGHT; me->SetReactState(REACT_AGGRESSIVE); - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToNPC(false); }); } @@ -234,7 +236,8 @@ struct boss_sothos : public BossAI }); me->SetReactState(REACT_PASSIVE); - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToNPC(true); _talked = false; _phase = PHASE_TALK; } @@ -261,7 +264,8 @@ struct boss_sothos : public BossAI _talked = true; _phase = PHASE_FIGHT; me->SetReactState(REACT_AGGRESSIVE); - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToNPC(false); }) .Schedule(3s, [this](TaskContext /*context*/) { diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index 499e2f566..aec0b170e 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -201,14 +201,14 @@ public: { Creature* target = GetUnitOwner()->ToCreature(); target->SetReactState(REACT_PASSIVE); - target->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + target->SetImmuneToAll(true); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Creature* target = GetUnitOwner()->ToCreature(); target->SetReactState(REACT_AGGRESSIVE); - target->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + target->SetImmuneToAll(false); } void Register() override diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index bd02ff14a..8cd10ea96 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -724,13 +724,13 @@ public: if (ptarget->GetPositionX() > 120) { ptarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_SPEAR)); - ptarget->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + ptarget->SetImmuneToPC(true); ptarget->SetReactState(REACT_PASSIVE); ptarget->AI()->SetData(0, 1); } else { - ptarget->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + ptarget->SetImmuneToPC(true); ptarget->SetReactState(REACT_PASSIVE); ptarget->AI()->SetData(0, 2); } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 4f04748b8..6959632e2 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -47,6 +47,7 @@ enum Spells SPELL_LEVEL_UP = 24312, SPELL_EXECUTE = 7160, SPELL_MANDOKIR_CLEAVE = 20691, + SPELL_SUMMON_PLAYER = 25104, SPELL_REVIVE = 24341 // chained spirit }; @@ -63,8 +64,7 @@ enum Events EVENT_WATCH_PLAYER = 8, EVENT_CHARGE_PLAYER = 9, EVENT_EXECUTE = 10, - EVENT_FRIGHTENING_SHOUT = 11, - EVENT_CLEAVE = 12 + EVENT_CLEAVE = 11 }; enum Action @@ -113,6 +113,32 @@ Position const PosMandokir[2] = { -12197.86f, -1949.392f, 130.2745f, 0.0f } }; +void RevivePlayer(Unit* victim, ObjectGuid& reviveGUID) +{ + std::list chainedSpirits; + GetCreatureListWithEntryInGrid(chainedSpirits, victim, NPC_CHAINED_SPIRIT, 200.f); + if (chainedSpirits.empty()) + return; + + // Sort the list by distance to the victim. + chainedSpirits.sort([victim](Creature const* c1, Creature const* c2) + { + return c1->GetDistance2d(victim) < c2->GetDistance2d(victim); + }); + + // Now we have to check if the spirit is already reviving someone... + for (Creature* spirit : chainedSpirits) + { + if (!spirit->isMoving() && !spirit->HasUnitState(UNIT_STATE_CASTING)) + { + spirit->AI()->SetGUID(reviveGUID); + spirit->AI()->DoAction(ACTION_REVIVE); + reviveGUID.Clear(); + break; + } + } +} + class boss_mandokir : public CreatureScript { public: @@ -138,22 +164,20 @@ public: } } me->RemoveAurasDueToSpell(SPELL_FRENZY); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); instance->SetBossState(DATA_OHGAN, NOT_STARTED); me->Mount(MODEL_OHGAN_MOUNT); reviveGUID.Clear(); + _useExecute = false; } void JustDied(Unit* /*killer*/) override { - // Do not want to unsummon Ohgan - for (int i = 0; i < CHAINED_SPIRIT_COUNT; ++i) - { - if (Creature* unsummon = ObjectAccessor::GetCreature(*me, chainedSpiritGUIDs[i])) - { - unsummon->DespawnOrUnsummon(); - } - } + std::list chainedSpirits; + GetCreatureListWithEntryInGrid(chainedSpirits, me, NPC_CHAINED_SPIRIT, 200.f); + for (Creature* spirit : chainedSpirits) + spirit->DespawnOrUnsummon(); + instance->SetBossState(DATA_MANDOKIR, DONE); instance->SaveToDB(); } @@ -161,14 +185,13 @@ public: void EnterCombat(Unit* /*who*/) override { _EnterCombat(); - events.ScheduleEvent(EVENT_OVERPOWER, urand(6000, 8000)); + events.ScheduleEvent(EVENT_OVERPOWER, 1000); events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(14000, 28000)); events.ScheduleEvent(EVENT_WHIRLWIND, urand(24000, 30000)); events.ScheduleEvent(EVENT_CHECK_OHGAN, 1000); events.ScheduleEvent(EVENT_WATCH_PLAYER, urand(12000, 24000)); events.ScheduleEvent(EVENT_CHARGE_PLAYER, urand(30000, 40000)); - events.ScheduleEvent(EVENT_EXECUTE, urand(7000, 14000)); - events.ScheduleEvent(EVENT_CLEAVE, urand(10000, 20000)); + events.ScheduleEvent(EVENT_CLEAVE, 1000); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); Talk(SAY_AGGRO); me->Dismount(); @@ -176,8 +199,7 @@ public: me->SummonCreature(NPC_OHGAN, me->GetPositionX() - 3, me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000); for (int i = 0; i < CHAINED_SPIRIT_COUNT; ++i) { - Creature* chainedSpirit = me->SummonCreature(NPC_CHAINED_SPIRIT, PosSummonChainedSpirits[i], TEMPSUMMON_CORPSE_DESPAWN); - chainedSpiritGUIDs[i] = chainedSpirit->GetGUID(); + me->SummonCreature(NPC_CHAINED_SPIRIT, PosSummonChainedSpirits[i], TEMPSUMMON_CORPSE_DESPAWN); } DoZoneInCombat(); } @@ -188,7 +210,7 @@ public: return; reviveGUID = victim->GetGUID(); - DoAction(ACTION_START_REVIVE); + RevivePlayer(victim, reviveGUID); if (++killCount == 3) { Talk(SAY_DING_KILL); @@ -199,32 +221,11 @@ public: jindo->AI()->Talk(SAY_GRATS_JINDO); } } - DoCast(me, SPELL_LEVEL_UP, true); + DoCastSelf(SPELL_LEVEL_UP, true); killCount = 0; } } - void DoAction(int32 action) override - { - if (action == ACTION_START_REVIVE) - { - std::list creatures; - GetCreatureListWithEntryInGrid(creatures, me, NPC_CHAINED_SPIRIT, 200.0f); - if (creatures.empty()) - return; - - for (std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) - { - if (Creature* chainedSpirit = ObjectAccessor::GetCreature(*me, (*itr)->GetGUID())) - { - chainedSpirit->AI()->SetGUID(reviveGUID); - chainedSpirit->AI()->DoAction(ACTION_REVIVE); - reviveGUID.Clear(); - } - } - } - } - void SetGUID(ObjectGuid const guid, int32 /*type = 0 */) override { reviveGUID = guid; @@ -243,6 +244,26 @@ public: } } + void DamageDealt(Unit* doneTo, uint32& damage, DamageEffectType /*damagetype*/) override + { + if (doneTo && doneTo == me->GetVictim()) + { + if (doneTo->HealthBelowPctDamaged(20, damage)) + { + if (!_useExecute) + { + _useExecute = true; + events.ScheduleEvent(EVENT_EXECUTE, 1000); + } + } + else if (_useExecute) + { + _useExecute = false; + events.CancelEvent(EVENT_EXECUTE); + } + } + } + void UpdateAI(uint32 diff) override { events.Update(diff); @@ -267,7 +288,7 @@ public: } break; case EVENT_STARTED: - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); break; default: break; @@ -277,7 +298,7 @@ public: return; } - if (me->HasUnitState(UNIT_STATE_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING) || me->HasUnitState(UNIT_STATE_CHARGING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -285,8 +306,14 @@ public: switch (eventId) { case EVENT_OVERPOWER: - DoCastVictim(SPELL_OVERPOWER); - events.ScheduleEvent(EVENT_OVERPOWER, urand(6000, 8000)); + if (DoCastVictim(SPELL_OVERPOWER) == SPELL_CAST_OK) + { + events.ScheduleEvent(EVENT_OVERPOWER, urand(6000, 8000)); + } + else + { + events.ScheduleEvent(EVENT_OVERPOWER, 1000); + } break; case EVENT_MORTAL_STRIKE: DoCastVictim(SPELL_MORTAL_STRIKE); @@ -316,24 +343,28 @@ public: events.ScheduleEvent(EVENT_WATCH_PLAYER, urand(12000, 24000)); break; case EVENT_CHARGE_PLAYER: - DoCast(SelectTarget(SelectTargetMethod::Random, 0, 40, true), SPELL_CHARGE); - events.ScheduleEvent(EVENT_FRIGHTENING_SHOUT, 1500); - if (Unit* mainTarget = SelectTarget(SelectTargetMethod::MaxThreat, 0, 100.0f)) + if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, [this](Unit const* target) + { + if (!me || !target) + return false; + if (target->GetTypeId() != TYPEID_PLAYER || !me->IsWithinLOSInMap(target)) + return false; + return true; + })) { - me->GetThreatMgr().modifyThreatPercent(mainTarget, -100); + DoCast(target, SPELL_CHARGE); + events.DelayEvents(1500); + if (Unit* mainTarget = SelectTarget(SelectTargetMethod::MaxThreat, 0, 100.0f)) + { + me->GetThreatMgr().modifyThreatPercent(mainTarget, -100); + } } events.ScheduleEvent(EVENT_CHARGE_PLAYER, urand(30000, 40000)); break; case EVENT_EXECUTE: - if (me->GetVictim() && me->GetVictim()->HealthBelowPct(20)) - { - DoCastVictim(SPELL_EXECUTE, true); - } + DoCastVictim(SPELL_EXECUTE, true); events.ScheduleEvent(EVENT_EXECUTE, urand(7000, 14000)); break; - case EVENT_FRIGHTENING_SHOUT: - DoCastAOE(SPELL_FRIGHTENING_SHOUT); - break; case EVENT_CLEAVE: { std::list meleeRangeTargets; @@ -349,21 +380,26 @@ public: if (meleeRangeTargets.size() >= 5) { DoCastVictim(SPELL_MANDOKIR_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, urand(10000, 20000)); + } + else + { + events.ScheduleEvent(EVENT_CLEAVE, 1000); } - events.ScheduleEvent(EVENT_CLEAVE, urand(10000, 20000)); break; } default: break; } } + DoMeleeAttackIfReady(); } private: uint8 killCount; - ObjectGuid chainedSpiritGUIDs[CHAINED_SPIRIT_COUNT]; ObjectGuid reviveGUID; + bool _useExecute; }; CreatureAI* GetAI(Creature* creature) const override @@ -373,7 +409,6 @@ public: }; // Ohgan - enum OhganSpells { SPELL_SUNDERARMOR = 24317, @@ -394,9 +429,9 @@ public: me->AddAura(SPELL_THRASH, me); _scheduler.CancelAll(); _scheduler.SetValidator([this] - { - return !me->HasUnitState(UNIT_STATE_CASTING); - }); + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); reviveGUID.Clear(); } @@ -406,12 +441,10 @@ public: if (victim->GetTypeId() != TYPEID_PLAYER) return; - reviveGUID = victim->GetGUID(); - DoAction(ACTION_START_REVIVE); _scheduler.Schedule(6s, 12s, [this](TaskContext context) { - DoCastVictim(SPELL_SUNDERARMOR); - context.Repeat(6s, 12s); + DoCastVictim(SPELL_SUNDERARMOR); + context.Repeat(6s, 12s); }); } @@ -421,25 +454,7 @@ public: return; reviveGUID = victim->GetGUID(); - DoAction(ACTION_START_REVIVE); - } - - void DoAction(int32 action) override - { - if (action == ACTION_START_REVIVE) - { - std::list creatures; - GetCreatureListWithEntryInGrid(creatures, me, NPC_CHAINED_SPIRIT, 200.0f); - if (creatures.empty()) - return; - - for (Creature* chainedSpirit : creatures) - { - chainedSpirit->AI()->SetGUID(reviveGUID); - chainedSpirit->AI()->DoAction(ACTION_REVIVE); - reviveGUID.Clear(); - } - } + RevivePlayer(victim, reviveGUID); } void SetGUID(ObjectGuid const guid, int32 /*type = 0 */) override @@ -525,15 +540,6 @@ public: void JustDied(Unit* /*killer*/) override { - Player* target = ObjectAccessor::GetPlayer(*me, revivePlayerGUID); - if (!target || target->IsAlive()) - return; - - if (Creature* mandokir = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MANDOKIR))) - { - mandokir->GetAI()->SetGUID(target->GetGUID()); - mandokir->GetAI()->DoAction(ACTION_START_REVIVE); - } me->DespawnOrUnsummon(); } @@ -551,61 +557,50 @@ enum VilebranchSpells SPELL_CLEAVE = 15284 }; -class npc_vilebranch_speaker : public CreatureScript +struct npc_vilebranch_speaker : public ScriptedAI { -public: - npc_vilebranch_speaker() : CreatureScript("npc_vilebranch_speaker") { } + npc_vilebranch_speaker(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()) { } - struct npc_vilebranch_speakerAI : public ScriptedAI + void Reset() override { - npc_vilebranch_speakerAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()) { } + _scheduler.CancelAll(); + } - void Reset() override - { - demoralizing_Shout_Timer = urand(2000, 4000); - cleave_Timer = urand(5000, 8000); - } - - void EnterCombat(Unit* /*who*/) override { } - - void JustDied(Unit* /*killer*/) override - { - instance->SetBossState(DATA_MANDOKIR, SPECIAL); - } - - void UpdateAI(uint32 diff) override - { - // Return since we have no target - if (!UpdateVictim()) - return; - - if (demoralizing_Shout_Timer <= diff) + void EnterCombat(Unit* /*who*/) override + { + _scheduler + .Schedule(2s, 4s, [this](TaskContext context) { - DoCast(me, SPELL_DEMORALIZING_SHOUT); - demoralizing_Shout_Timer = urand(22000, 30000); - } - else demoralizing_Shout_Timer -= diff; - - if (cleave_Timer <= diff) + DoCastAOE(SPELL_DEMORALIZING_SHOUT); + context.Repeat(22s, 30s); + }) + .Schedule(5s, 8s, [this](TaskContext context) { DoCastVictim(SPELL_CLEAVE, true); - cleave_Timer = urand(6000, 9000); - } - else cleave_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - private: - uint32 demoralizing_Shout_Timer; - uint32 cleave_Timer; - InstanceScript* instance; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return GetZulGurubAI(creature); + context.Repeat(6s, 9s); + }); } + + void JustDied(Unit* /*killer*/) override + { + instance->SetBossState(DATA_MANDOKIR, SPECIAL); + } + + void UpdateAI(uint32 diff) override + { + // Return since we have no target + if (!UpdateVictim()) + return; + + _scheduler.Update(diff, [this] + { + DoMeleeAttackIfReady(); + }); + } + +private: + TaskScheduler _scheduler; + InstanceScript* instance; }; class spell_threatening_gaze : public SpellScriptLoader @@ -643,11 +638,30 @@ public: } }; +class spell_mandokir_charge : public SpellScript +{ + PrepareSpellScript(spell_mandokir_charge); + + void LaunchHit(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + Unit* target = GetHitUnit(); + if (caster && target) + caster->CastSpell(target, SPELL_FRIGHTENING_SHOUT, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mandokir_charge::LaunchHit, EFFECT_0, SPELL_EFFECT_CHARGE); + } +}; + void AddSC_boss_mandokir() { new boss_mandokir(); new npc_ohgan(); RegisterZulGurubCreatureAI(npc_chained_spirit); - new npc_vilebranch_speaker(); + RegisterZulGurubCreatureAI(npc_vilebranch_speaker); new spell_threatening_gaze(); + RegisterSpellScript(spell_mandokir_charge); } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index e049edcc5..c646774b6 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -103,35 +103,6 @@ public: zealot->ResetFaction(); } - // TODO: do this in formations, once a flag is added to prevent leaders from respawning as well. - std::list creatureList; - GetCreatureListWithEntryInGrid(creatureList, me, NPC_ZULGURUB_TIGER, 15.0f); - - if (_catGuids.empty()) - { - for (Creature* creature : creatureList) - { - _catGuids.push_back(creature->GetGUID()); - if (!creature->IsAlive()) - { - creature->Respawn(true); - } - } - } - else - { - for (ObjectGuid guid : _catGuids) - { - if (Creature* creature = ObjectAccessor::GetCreature(*me, guid)) - { - if (!creature->IsAlive()) - { - creature->Respawn(true); - } - } - } - } - _scheduler.SetValidator([this] { return !me->HasUnitState(UNIT_STATE_CASTING); diff --git a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp index 8f9e6cddc..1f051e491 100644 --- a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp @@ -372,7 +372,7 @@ public: continue; else c->AI()->Talk(SAY_MORLEN_4); - c->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + c->SetImmuneToAll(false); c->AI()->AttackStart(me); } break; diff --git a/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp index a4633e1dc..0f03cee66 100644 --- a/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp @@ -53,7 +53,7 @@ public: phase = 0; mockingBlowTimer = 5000; shieldBashTimer = 8000; - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(true); } void sQuestAccept(Player* player, Quest const* quest) override @@ -62,7 +62,7 @@ public: { Talk(SAY_CORPORAL_1, player); npc_escortAI::Start(true, false, player->GetGUID(), quest); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(false); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); } } diff --git a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp index 4a6f92c0f..5ffe52770 100644 --- a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp @@ -53,7 +53,7 @@ public: if (quest->GetQuestId() == QUEST_590) { creature->SetFaction(FACTION_ENEMY); - creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + creature->SetImmuneToPC(false); CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player); } return true; @@ -80,8 +80,8 @@ public: me->RestoreFaction(); - if (!me->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC)) - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + if (!me->IsImmuneToPC()) + me->SetImmuneToPC(true); } void EnterCombat(Unit* /*who*/) override { } @@ -104,7 +104,7 @@ public: uiDamage = 0; me->RestoreFaction(); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->CombatStop(true); m_uiPhase = 1; diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index 0dd04316c..e50b63899 100644 --- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -1420,8 +1420,7 @@ public: { thrallGUID = temp->GetGUID(); temp->SetReactState(REACT_PASSIVE); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToAll(true); temp->CastSpell(temp, SPELL_THRALL_BUFF); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); } @@ -1429,8 +1428,7 @@ public: { sylvanasGUID = temp->GetGUID(); temp->SetReactState(REACT_PASSIVE); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToAll(true); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); } for (uint8 i = 0; i < HORDE_FORCE_MAXCOUNT; ++i) @@ -1439,8 +1437,7 @@ public: { hordeForcesGUID[i] = temp->GetGUID(); temp->SetReactState(REACT_PASSIVE); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToAll(true); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); } } @@ -1451,8 +1448,7 @@ public: if (Unit* temp = me->SummonCreature(NPC_SW_SOLDIER, AllianceSpawn[i + 25].x, AllianceSpawn[i + 25].y, AllianceSpawn[i + 25].z, AllianceSpawn[i + 25].o, TEMPSUMMON_MANUAL_DESPAWN)) { allianceForcesGUID[i] = temp->GetGUID(); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToAll(true); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); } } @@ -1476,7 +1472,7 @@ public: if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID)) { jaina->GetMotionMaster()->Clear(); - jaina->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + jaina->SetImmuneToNPC(false); jaina->SetReactState(REACT_AGGRESSIVE); } SetHoldState(true); @@ -1820,8 +1816,7 @@ public: case 53: if (Creature* putress = ObjectAccessor::GetCreature(*me, putressGUID)) { - putress->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - putress->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + putress->SetImmuneToAll(false); putress->AddThreat(me, 100.0f); me->AddThreat(putress, 100.0f); putress->RemoveAura(SPELL_PUTRESS_CASTING_STATE); @@ -1894,7 +1889,7 @@ public: case 66: if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID)) jaina->AI()->Talk(JAINA_SAY_THRONE_1); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(true); bStepping = false; JumpToNextStep(0); break; @@ -1907,8 +1902,7 @@ public: if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID)) { jaina->GetMotionMaster()->MovePoint(0, AllianceWP[8].x, AllianceWP[8].y, AllianceWP[8].z); - jaina->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - jaina->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + jaina->SetImmuneToAll(true); } SetEscortPaused(false); bStepping = false; @@ -1933,12 +1927,12 @@ public: break; case 73: Talk(WRYNN_SAY_THRONE_9); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToAll(false); if (Creature* thrall = ObjectAccessor::GetCreature(*me, thrallGUID)) { thrall->SetReactState(REACT_AGGRESSIVE); - thrall->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - thrall->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + thrall->SetImmuneToNPC(false); + thrall->SetImmuneToPC(true); thrall->AddThreat(me, 100.0f); me->AddThreat(thrall, 100.0f); thrall->AI()->AttackStart(me); @@ -1946,8 +1940,8 @@ public: if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasGUID)) { sylvanas->SetReactState(REACT_AGGRESSIVE); - sylvanas->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - sylvanas->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + sylvanas->SetImmuneToNPC(false); + sylvanas->SetImmuneToPC(true); sylvanas->AddThreat(me, 100.0f); sylvanas->AI()->AttackStart(me); me->AddThreat(sylvanas, 100.0f); @@ -1957,8 +1951,8 @@ public: if (Creature* temp = ObjectAccessor::GetCreature(*me, hordeForcesGUID[i])) { temp->SetReactState(REACT_AGGRESSIVE); - temp->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToNPC(false); + temp->SetImmuneToPC(true); } } for (uint8 i = 0; i < ALLIANCE_FORCE_MAXCOUNT; ++i) @@ -1969,8 +1963,8 @@ public: { temp->SetReactState(REACT_AGGRESSIVE); temp2->SetReactState(REACT_AGGRESSIVE); - temp->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); - temp2->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToAll(false); + temp2->SetImmuneToAll(false); temp->AddThreat(temp2, 100.0f); temp->AI()->AttackStart(temp2); temp2->AddThreat(temp, 100.0f); @@ -2564,7 +2558,7 @@ public: if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID)) { sylvanas->GetMotionMaster()->Clear(); - sylvanas->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + sylvanas->SetImmuneToAll(false); sylvanas->SetReactState(REACT_AGGRESSIVE); sylvanas->SetFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); sylvanas->GetMotionMaster()->MoveFollow(me, 1, M_PI * 0.1f); @@ -2606,7 +2600,7 @@ public: if (Unit* temp = me->SummonCreature(NPC_VARIMATHRAS, ThrallSpawn[23].x, ThrallSpawn[23].y, ThrallSpawn[23].z, ThrallSpawn[23].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900 * IN_MILLISECONDS)) { ValimathrasGUID = temp->GetGUID(); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToAll(true); } break; case 3: @@ -2729,7 +2723,7 @@ public: if (Unit* temp = me->SummonCreature(NPC_VARIMATHRAS, ThrallSpawn[63].x, ThrallSpawn[63].y, ThrallSpawn[63].z, ThrallSpawn[63].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300 * IN_MILLISECONDS)) { ValimathrasGUID = temp->GetGUID(); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToAll(true); } break; case 13: @@ -2820,7 +2814,7 @@ public: if (Creature* temp = me->SummonCreature(NPC_VARIMATHRAS, ThrallSpawn[73].x, ThrallSpawn[73].y, ThrallSpawn[73].z, ThrallSpawn[73].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1200 * IN_MILLISECONDS)) { ValimathrasGUID = temp->GetGUID(); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToAll(true); temp->CastSpell(me, SPELL_AURA_OF_VARIMATHRAS); temp->CastSpell(me, SPELL_OPENING_LEGION_PORTALS); temp->AI()->Talk(SAY_CLOSE_DOOR); @@ -3671,7 +3665,7 @@ public: case 137: if (Creature* valimathras = ObjectAccessor::GetCreature(*me, ValimathrasGUID)) { - valimathras->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + valimathras->SetImmuneToAll(false); valimathras->RemoveAura(SPELL_AURA_OF_VARIMATHRAS); valimathras->RemoveAura(SPELL_OPENING_LEGION_PORTALS); valimathras->AI()->Talk(SAY_VALIMATHRAS_ATTACK); @@ -3740,8 +3734,7 @@ public: if (Creature* temp = me->SummonCreature(NPC_SW_SOLDIER, AllianceSpawn[i + 25].x, AllianceSpawn[i + 25].y, AllianceSpawn[i + 25].z, AllianceSpawn[i + 25].o, TEMPSUMMON_MANUAL_DESPAWN)) { allianceForcesGUID[i] = temp->GetGUID(); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - temp->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToAll(true); temp->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SYLVANAS_BUFF, true); temp->SetReactState(REACT_PASSIVE); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); @@ -3750,8 +3743,7 @@ public: if (Creature* wrynn = me->SummonCreature(NPC_WRYNN, 1308.862f, 381.809f, -66.044243f, TEMPSUMMON_MANUAL_DESPAWN)) { WrynnGUID = wrynn->GetGUID(); - wrynn->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - wrynn->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + wrynn->SetImmuneToAll(true); wrynn->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); wrynn->SetReactState(REACT_PASSIVE); wrynn->GetMotionMaster()->MovePoint(0, 1302.543f, 359.472f, -67.295f, true); @@ -3759,8 +3751,7 @@ public: if (Creature* jaina = me->SummonCreature(NPC_JAINA, 1308.862f, 381.809f, -66.044243f, TEMPSUMMON_MANUAL_DESPAWN)) { JainaGUID = jaina->GetGUID(); - jaina->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - jaina->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + jaina->SetImmuneToAll(true); jaina->SetReactState(REACT_PASSIVE); } JumpToNextStep(6 * IN_MILLISECONDS); @@ -3788,11 +3779,11 @@ public: break; // Wrynn Fight case 152: - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToAll(false); if (Creature* wrynn = ObjectAccessor::GetCreature(*me, WrynnGUID)) { - wrynn->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - wrynn->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + wrynn->SetImmuneToNPC(false); + wrynn->SetImmuneToPC(true); wrynn->SetReactState(REACT_AGGRESSIVE); wrynn->AddThreat(me, 100.0f); me->AddThreat(wrynn, 100.0f); @@ -3803,7 +3794,7 @@ public: { if (Creature* temp = ObjectAccessor::GetCreature(*me, allianceForcesGUID[i])) { - temp->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + temp->SetImmuneToAll(false); temp->SetReactState(REACT_AGGRESSIVE); temp->AddThreat(me, 100.0f); temp->AI()->AttackStart(me); diff --git a/src/server/scripts/Events/brewfest.cpp b/src/server/scripts/Events/brewfest.cpp index 4b42847d5..1c62dd4ea 100644 --- a/src/server/scripts/Events/brewfest.cpp +++ b/src/server/scripts/Events/brewfest.cpp @@ -1557,7 +1557,7 @@ struct npc_coren_direbrew : public ScriptedAI { _events.Reset(); _summons.DespawnAll(); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->SetFaction(FACTION_FRIENDLY); _events.SetPhase(PHASE_ALL); @@ -1596,7 +1596,7 @@ struct npc_coren_direbrew : public ScriptedAI if (action == ACTION_START_FIGHT) { _events.SetPhase(PHASE_ONE); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); DoZoneInCombat(); @@ -1830,7 +1830,7 @@ struct npc_direbrew_antagonist : public ScriptedAI Talk(SAY_ANTAGONIST_2); break; case ACTION_ANTAGONIST_HOSTILE: - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); DoZoneInCombat(); break; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp index 46f70d27c..ec401dd18 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp @@ -112,7 +112,7 @@ public: damage = 0; finished = true; me->SetRegeneratingHealth(false); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->SetReactState(REACT_PASSIVE); if (InstanceScript* pInstance = me->GetInstanceScript()) 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 ac96a22ae..bfeb96aec 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -472,7 +472,7 @@ public: { summons.Despawn(cr); summons.Summon(cr); - cr->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + cr->SetImmuneToAll(true); cr->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); } Talk(SAY_PHASE501); @@ -972,7 +972,7 @@ public: if (Creature* cr = GetEventNpc(NPC_CITY_MAN)) { cr->UpdateEntry(NPC_INFINITE_HUNTER, nullptr, false); - cr->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + cr->SetImmuneToAll(true); cr->SetReactState(REACT_PASSIVE); } ScheduleNextEvent(currentEvent, 2000); @@ -981,7 +981,7 @@ public: if (Creature* cr = GetEventNpc(NPC_CITY_MAN4)) { cr->UpdateEntry(NPC_INFINITE_AGENT, nullptr, false); - cr->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + cr->SetImmuneToAll(true); cr->SetReactState(REACT_PASSIVE); } ScheduleNextEvent(currentEvent, 2000); @@ -996,14 +996,14 @@ public: } if (Creature* cr = GetEventNpc(NPC_INFINITE_AGENT)) // it is infinite agent now :) { - cr->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + cr->SetImmuneToAll(false); cr->SetReactState(REACT_AGGRESSIVE); cr->SetInCombatWithZone(); cr->AddThreat(me, 0.0f); } if (Creature* cr = GetEventNpc(NPC_INFINITE_HUNTER)) // it is infinite hunter now :) { - cr->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + cr->SetImmuneToAll(false); cr->SetReactState(REACT_AGGRESSIVE); cr->SetInCombatWithZone(); cr->AddThreat(me, 0.0f); @@ -1076,7 +1076,7 @@ public: me->SummonCreature(NPC_TIME_RIFT, EventPos[EVENT_SRC_EPOCH], TEMPSUMMON_TIMED_DESPAWN, 20000); if (Creature* cr = me->SummonCreature(NPC_EPOCH, EventPos[EVENT_SRC_EPOCH])) { - cr->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + cr->SetImmuneToAll(true); cr->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->SetTarget(cr->GetGUID()); cr->GetMotionMaster()->MovePoint(0, EventPos[EVENT_DST_EPOCH]); @@ -1097,7 +1097,7 @@ public: case EVENT_ACTION_PHASE3+18: if (Creature* cr = GetEventNpc(NPC_EPOCH)) { - cr->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + cr->SetImmuneToAll(false); cr->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); cr->SetReactState(REACT_AGGRESSIVE); cr->AddThreat(me, 0.0f); @@ -1122,7 +1122,7 @@ public: case EVENT_ACTION_PHASE5: if (Creature* cr = GetEventNpc(NPC_MAL_GANIS)) { - cr->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + cr->SetImmuneToAll(false); cr->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); cr->SetInCombatWithZone(); cr->AddThreat(me, 0.0f); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index a62d37f5d..e994c7d5b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -82,7 +82,7 @@ public: summons.Summon(summon); if (Creature* thrall = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(DATA_THRALL_GUID))) thrall->AI()->JustSummoned(summon); - summon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + summon->SetImmuneToAll(true); if (summon->GetEntry() == NPC_SKARLOC_MOUNT) return; @@ -103,7 +103,7 @@ public: path.push_back(G3D::Vector3(startPath[i].GetPositionX(), startPath[i].GetPositionY(), startPath[i].GetPositionZ())); me->GetMotionMaster()->MoveSplinePath(&path); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->Mount(SKARLOC_MOUNT_MODEL); } @@ -168,13 +168,13 @@ public: Talk(SAY_ENTER); break; case EVENT_START_FIGHT: - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->SetInCombatWithZone(); for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr) if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr)) if (summon->GetEntry() != NPC_SKARLOC_MOUNT) { - summon->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + summon->SetImmuneToAll(false); summon->SetInCombatWithZone(); } break; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index f56e34b1d..9a1a751c9 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -620,7 +620,7 @@ public: case EVENT_SUMMON_CHRONO: if (Creature* epoch = me->SummonCreature(NPC_EPOCH_HUNTER, 2640.49f, 696.15f, 64.31f, 4.51f, TEMPSUMMON_MANUAL_DESPAWN)) { - epoch->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + epoch->SetImmuneToAll(true); epoch->AI()->Talk(SAY_EPOCH_ENTER1); } break; @@ -703,7 +703,7 @@ public: case EVENT_CALL_EPOCH: if (Creature* epoch = summons.GetCreatureWithEntry(NPC_EPOCH_HUNTER)) { - epoch->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + epoch->SetImmuneToAll(false); epoch->GetMotionMaster()->MovePoint(0, *me, false, true); } break; @@ -759,7 +759,7 @@ public: Talk(SAY_EVENT_COMPLETE); break; case EVENT_THRALL_RUN_AWAY: - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetReactState(REACT_PASSIVE); SetEscortPaused(false); break; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 8001bfd63..cffb86012 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -91,6 +91,14 @@ enum Spells enum Actions { ACTION_FLESH_TENTACLE_KILLED = 1, + + ACTION_SPAWN_EYE_TENTACLES = 1, +}; + +enum Misc +{ + MAX_TENTACLE_GROUPS = 5, + GROUP_BEAM_PHASE = 1 }; enum Yells @@ -146,45 +154,22 @@ public: struct eye_of_cthunAI : public ScriptedAI { - eye_of_cthunAI(Creature* creature) : ScriptedAI(creature) + eye_of_cthunAI(Creature* creature) : ScriptedAI(creature), _summons(creature) { instance = creature->GetInstanceScript(); SetCombatMovement(false); } - InstanceScript* instance; - - //Global variables - uint32 PhaseTimer; - - //Eye beam phase - uint32 BeamTimer; - uint32 EyeTentacleTimer; - uint32 ClawTentacleTimer; - - //Dark Glare phase - uint32 DarkGlareTick; - uint32 DarkGlareTickTimer; - float DarkGlareAngle; - bool ClockWise; - void Reset() override { - //Phase information - PhaseTimer = 50000; //First dark glare in 50 seconds - - //Eye beam phase 50 seconds - BeamTimer = 3000; - EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam - ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn during Dark beam) - //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks) DarkGlareTick = 0; - DarkGlareTickTimer = 1000; DarkGlareAngle = 0; ClockWise = false; + _eyeTentacleCounter = 0; + //Reset flags me->RemoveAurasDueToSpell(SPELL_RED_COLORATION); me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM); @@ -198,20 +183,128 @@ public: Creature* pPortal = me->FindNearestCreature(NPC_CTHUN_PORTAL, 10); if (pPortal) pPortal->SetReactState(REACT_PASSIVE); + + _summons.DespawnAll(); + _scheduler.CancelAll(); } void EnterCombat(Unit* /*who*/) override { DoZoneInCombat(); + ScheduleTasks(); instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM); } - void SpawnEyeTentacle(float x, float y) + void DoAction(int32 action) override { - if (Creature* Spawned = DoSpawnCreature(NPC_EYE_TENTACLE, x, y, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 500)) - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - if (Spawned->AI()) - Spawned->AI()->AttackStart(target); + if (action == ACTION_SPAWN_EYE_TENTACLES) + { + me->SummonCreatureGroup(_eyeTentacleCounter); + _eyeTentacleCounter++; + + if (_eyeTentacleCounter >= MAX_TENTACLE_GROUPS) + { + _eyeTentacleCounter = 0; + } + } + } + + void ScheduleTasks() + { + _scheduler.Schedule(3s, [this](TaskContext task) + { + DoCastRandomTarget(SPELL_GREEN_BEAM); + task.SetGroup(GROUP_BEAM_PHASE); + task.Repeat(); + }).Schedule(12s, [this](TaskContext task) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true)) + { + if (Creature* tentacle = me->SummonCreature(NPC_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 1000)) + { + tentacle->AI()->AttackStart(target); + } + } + + task.SetGroup(GROUP_BEAM_PHASE); + task.Repeat(); + }).Schedule(45s, [this](TaskContext task) + { + DoAction(ACTION_SPAWN_EYE_TENTACLES); + task.SetGroup(GROUP_BEAM_PHASE); + task.Repeat(); + }).Schedule(50s, [this](TaskContext /*task*/) + { + _scheduler.CancelGroup(GROUP_BEAM_PHASE); + + me->StopMoving(); + me->SetReactState(REACT_PASSIVE); + me->InterruptNonMeleeSpells(false); + me->SetTarget(ObjectGuid::Empty); + + _scheduler.Schedule(1s, [this](TaskContext /*task*/) + { + //Select random target for dark beam to start on + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true)) + { + //Face our target + DarkGlareAngle = me->GetAngle(target); + DarkGlareTick = 0; + ClockWise = RAND(true, false); + + me->SetTarget(target->GetGUID()); + + //Add red coloration to C'thun + DoCast(me, SPELL_RED_COLORATION, true); + + //Freeze animation + DoCast(me, SPELL_FREEZE_ANIM, true); + + me->StopMoving(); + me->SetFacingToObject(target); + me->SetOrientation(DarkGlareAngle); + } + + _scheduler.Schedule(3s, [this](TaskContext tasker) + { + me->SetTarget(ObjectGuid::Empty); + me->StopMoving(); + + if (ClockWise) + { + me->SetFacingTo(DarkGlareAngle + DarkGlareTick * float(M_PI) / 35); + me->SetOrientation(DarkGlareAngle + DarkGlareTick * float(M_PI) / 35); + + } + else + { + me->SetFacingTo(DarkGlareAngle - DarkGlareTick * float(M_PI) / 35); + me->SetOrientation(DarkGlareAngle - DarkGlareTick * float(M_PI) / 35); + } + + DoCastSelf(SPELL_DARK_GLARE); + ++DarkGlareTick; + + if (tasker.GetRepeatCounter() >= 35) + { + _scheduler.CancelAll(); + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM); + me->InterruptNonMeleeSpells(false); + ScheduleTasks(); + } + else + tasker.Repeat(1s); + }); + }); + }); + } + + void JustSummoned(Creature* summon) override + { + _summons.Summon(summon); + summon->SetInCombatWithZone(); } void UpdateAI(uint32 diff) override @@ -220,162 +313,8 @@ public: if (!UpdateVictim()) return; - uint32 currentPhase = instance->GetData(DATA_CTHUN_PHASE); - if (currentPhase == PHASE_EYE_GREEN_BEAM || currentPhase == PHASE_EYE_RED_BEAM) + switch (instance->GetData(DATA_CTHUN_PHASE)) { - // EyeTentacleTimer - if (EyeTentacleTimer <= diff) - { - //Spawn the 8 Eye Tentacles in the corret spots - SpawnEyeTentacle(0, 20); //south - SpawnEyeTentacle(10, 10); //south west - SpawnEyeTentacle(20, 0); //west - SpawnEyeTentacle(10, -10); //north west - - SpawnEyeTentacle(0, -20); //north - SpawnEyeTentacle(-10, -10); //north east - SpawnEyeTentacle(-20, 0); // east - SpawnEyeTentacle(-10, 10); // south east - - EyeTentacleTimer = 45000; - } - else EyeTentacleTimer -= diff; - } - - switch (currentPhase) - { - case PHASE_EYE_GREEN_BEAM: - //BeamTimer - if (BeamTimer <= diff) - { - //SPELL_GREEN_BEAM - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - { - me->InterruptNonMeleeSpells(false); - DoCast(target, SPELL_GREEN_BEAM); - - //Correctly update our target - me->SetTarget(target->GetGUID()); - } - - //Beam every 3 seconds - BeamTimer = 3000; - } - else BeamTimer -= diff; - - //ClawTentacleTimer - if (ClawTentacleTimer <= diff) - { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - { - //Spawn claw tentacle on the random target - Creature* spawned = me->SummonCreature(NPC_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500); - - if (spawned && spawned->AI()) - { - spawned->AI()->AttackStart(target); - } - } - - //One claw tentacle every 12.5 seconds - ClawTentacleTimer = 12500; - } - else ClawTentacleTimer -= diff; - - //PhaseTimer - if (PhaseTimer <= diff) - { - //Switch to Dark Beam - instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_RED_BEAM); - - me->InterruptNonMeleeSpells(false); - me->SetReactState(REACT_PASSIVE); - - //Remove any target - me->SetTarget(); - - //Select random target for dark beam to start on - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - { - //Face our target - DarkGlareAngle = me->GetAngle(target); - DarkGlareTickTimer = 4000; - DarkGlareTick = 0; - ClockWise = RAND(true, false); - } - - //Add red coloration to C'thun - DoCast(me, SPELL_RED_COLORATION, true); - - //Freeze animation - DoCast(me, SPELL_FREEZE_ANIM); - me->StopMoving(); - me->SetFacingTo(DarkGlareAngle); - me->SetOrientation(DarkGlareAngle); - - //Darkbeam for 35 seconds - PhaseTimer = 35000; - } - else PhaseTimer -= diff; - - break; - - case PHASE_EYE_RED_BEAM: - if (DarkGlareTick < 35) - { - if (DarkGlareTickTimer <= diff) - { - me->StopMoving(); - - //Set angle and cast - if (ClockWise) - { - me->SetFacingTo(DarkGlareAngle + DarkGlareTick * M_PI / 35); - me->SetOrientation(DarkGlareAngle + DarkGlareTick * M_PI / 35); - } - else - { - me->SetFacingTo(DarkGlareAngle - DarkGlareTick * M_PI / 35); - me->SetOrientation(DarkGlareAngle - DarkGlareTick * M_PI / 35); - } - - //Actual dark glare cast, maybe something missing here? - DoCast(me, SPELL_DARK_GLARE, false); - - //Increase tick - ++DarkGlareTick; - - //1 second per tick - DarkGlareTickTimer = 1000; - } - else DarkGlareTickTimer -= diff; - } - - //PhaseTimer - if (PhaseTimer <= diff) - { - //Switch to Eye Beam - instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM); - - BeamTimer = 3000; - ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn during Dark beam) - - me->InterruptNonMeleeSpells(false); - - //Remove Red coloration from c'thun - me->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM); - - //set it back to aggressive - me->SetReactState(REACT_AGGRESSIVE); - - //Eye Beam for 50 seconds - PhaseTimer = 50000; - } - else PhaseTimer -= diff; - - break; - //Transition phase case PHASE_CTHUN_TRANSITION: //Remove any target @@ -386,13 +325,16 @@ public: //Dead phase case PHASE_CTHUN_DONE: - Creature* pPortal = me->FindNearestCreature(NPC_CTHUN_PORTAL, 10); - if (pPortal) + if (Creature* pPortal = me->FindNearestCreature(NPC_CTHUN_PORTAL, 10)) + { pPortal->DespawnOrUnsummon(); + } me->DespawnOrUnsummon(); break; } + + _scheduler.Update(diff); } void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override @@ -437,6 +379,18 @@ public: return; } } + + private: + InstanceScript* instance; + + //Dark Glare phase + uint32 DarkGlareTick; + float DarkGlareAngle; + bool ClockWise; + + uint32 _eyeTentacleCounter; + TaskScheduler _scheduler; + SummonList _summons; }; }; @@ -522,15 +476,6 @@ public: DoZoneInCombat(); } - void SpawnEyeTentacle(float x, float y) - { - Creature* Spawned; - Spawned = DoSpawnCreature(NPC_EYE_TENTACLE, x, y, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 500); - if (Spawned && Spawned->AI()) - if (Unit* target = SelectRandomNotStomach()) - Spawned->AI()->AttackStart(target); - } - Unit* SelectRandomNotStomach() { if (Stomach_Map.empty()) @@ -607,16 +552,10 @@ public: // EyeTentacleTimer if (EyeTentacleTimer <= diff) { - //Spawn the 8 Eye Tentacles in the corret spots - SpawnEyeTentacle(0, 20); //south - SpawnEyeTentacle(10, 10); //south west - SpawnEyeTentacle(20, 0); //west - SpawnEyeTentacle(10, -10); //north west - - SpawnEyeTentacle(0, -20); //north - SpawnEyeTentacle(-10, -10); //north east - SpawnEyeTentacle(-20, 0); // east - SpawnEyeTentacle(-10, 10); // south east + if (Creature* eye = instance->GetCreature(DATA_EYE_OF_CTHUN)) + { + eye->AI()->DoAction(ACTION_SPAWN_EYE_TENTACLES); + } EyeTentacleTimer = 30000; // every 30sec in phase 2 } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp index d05e3687d..3056a305f 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp @@ -30,6 +30,7 @@ EndScriptData */ ObjectData const creatureData[] = { { NPC_SARTURA, DATA_SARTURA }, + { NPC_EYE_OF_CTHUN, DATA_EYE_OF_CTHUN } }; class instance_temple_of_ahnqiraj : public InstanceMapScript diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h index a41d38da0..d32f6dbd9 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h @@ -38,12 +38,14 @@ enum DataTypes DATA_BUG_TRIO_DEATH = 14, DATA_CTHUN_PHASE = 20, DATA_VISCIDUS = 21, - DATA_SARTURA = 22 + DATA_SARTURA = 22, + + DATA_EYE_OF_CTHUN = 23 }; enum Creatures { - BOSS_EYE_OF_CTHUN = 15589, + NPC_EYE_OF_CTHUN = 15589, NPC_CTHUN_PORTAL = 15896, NPC_CLAW_TENTACLE = 15725, NPC_EYE_TENTACLE = 15726, diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp index 12aa9be60..4a84c2f28 100644 --- a/src/server/scripts/Kalimdor/zone_desolace.cpp +++ b/src/server/scripts/Kalimdor/zone_desolace.cpp @@ -258,14 +258,14 @@ public: { summon->SetFaction(faction); if (remove) - summon->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + summon->SetImmuneToNPC(false); else - summon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + summon->SetImmuneToNPC(true); } if (remove) - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(false); else - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(true); me->SetFaction(faction); } diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp index f2aa0a762..3f1e891b7 100644 --- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp @@ -83,7 +83,7 @@ public: return; me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); SetCombatMovement(true); if (me->IsInCombat()) diff --git a/src/server/scripts/Kalimdor/zone_feralas.cpp b/src/server/scripts/Kalimdor/zone_feralas.cpp index 068fa4d30..1b5b2a56a 100644 --- a/src/server/scripts/Kalimdor/zone_feralas.cpp +++ b/src/server/scripts/Kalimdor/zone_feralas.cpp @@ -99,7 +99,7 @@ public: void InitializeAI() override { me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->RestoreFaction(); _events.Reset(); @@ -203,7 +203,7 @@ public: Talk(TALK_0, player); me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->SetFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); me->GetMotionMaster()->MoveFollow(player, 3.f, M_PI); diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp index dfff979e2..9601750dc 100644 --- a/src/server/scripts/Kalimdor/zone_moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -584,7 +584,7 @@ public: { npc_omenAI(Creature* creature) : ScriptedAI(creature) { - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->GetMotionMaster()->MovePoint(1, 7549.977f, -2855.137f, 456.9678f); } @@ -598,7 +598,7 @@ public: if (pointId == 1) { me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); if (Player* player = me->SelectNearestPlayer(40.0f)) AttackStart(player); } diff --git a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp index 8d816209a..94fa002b9 100644 --- a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp @@ -153,7 +153,7 @@ public: creature->AI()->Talk(SAY_START); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); - creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + creature->SetImmuneToPC(false); } return true; } diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp index 87a000950..c01e31247 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp @@ -165,7 +165,8 @@ struct boss_jedoga_shadowseeker : public BossAI void Reset() override { me->SetReactState(REACT_PASSIVE); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD); me->SetDisableGravity(true); me->SetHover(true); @@ -254,7 +255,8 @@ struct boss_jedoga_shadowseeker : public BossAI { summon->GetMotionMaster()->MovePoint(POINT_INITIAL, VolunteerSpotPositions[i][1]); summon->SetReactState(REACT_PASSIVE); - summon->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC ); + summon->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + summon->SetImmuneToAll(true); summons.Summon(summon); } } @@ -357,6 +359,7 @@ struct boss_jedoga_shadowseeker : public BossAI me->ClearUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD); ReschedulleCombatEvents(); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); me->SetReactState(REACT_AGGRESSIVE); me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL); @@ -583,7 +586,8 @@ struct npc_twilight_volunteer : public ScriptedAI DoCastSelf(SPELL_ACTIVATE_INITIATE, true); me->RemoveAurasDueToSpell(SPELL_WHITE_SPHERE); me->SetControlled(false, UNIT_STATE_STUNNED); - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); Talk(SAY_CHOSEN); me->SetStandState(UNIT_STAND_STATE_STAND); 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 787b43c1b..f4bf7e5b4 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp @@ -214,7 +214,7 @@ struct boss_taldaram : public BossAI // Event not started if (instance->GetData(DATA_TELDRAM_SPHERE1) != DONE || instance->GetData(DATA_TELDRAM_SPHERE2) != DONE) { - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetDisableGravity(true); me->SetHover(true); if (!me->HasAura(SPELL_BEAM_VISUAL)) @@ -260,7 +260,8 @@ struct boss_taldaram : public BossAI me->SetDisableGravity(false); me->SetHover(false); me->RemoveAllAuras(); - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE| UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); me->UpdatePosition(me->GetHomePosition(), true); } summons.DespawnEntry(NPC_JEDOGA_CONTROLLER); @@ -274,7 +275,8 @@ struct boss_taldaram : public BossAI me->SetDisableGravity(false); me->SetHover(false); me->RemoveAllAuras(); - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE| UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); } } diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 9b592da53..ec1c23b89 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -310,7 +310,7 @@ public: continue; } - dragon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + dragon->SetImmuneToNPC(true); dragon->SetFullHealth(); ++dragonsCount; @@ -729,7 +729,7 @@ struct boss_sartharion_dragonAI : public BossAI events.Reset(); ClearInstance(); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(false); me->SetSpeed(MOVE_FLIGHT, 1.0f); me->SetCanFly(false); me->ResetLootMode(); @@ -790,7 +790,7 @@ struct boss_sartharion_dragonAI : public BossAI } } - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(false); me->SetInCombatWithZone(); } 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 61d9691a9..d1de208f2 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp @@ -105,7 +105,10 @@ public: { BossAI::Reset(); if (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE) - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); + { + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToPC(false); + } } void EnterCombat(Unit* who) override 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 e26c29eeb..43b161bbf 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp @@ -187,7 +187,10 @@ public: case DATA_BALTHARUS_THE_WARBORN: if (GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE && GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE) if (Creature* zarithrian = instance->GetCreature(GeneralZarithrianGUID)) - zarithrian->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); + { + zarithrian->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + zarithrian->SetImmuneToPC(false); + } break; case DATA_GENERAL_ZARITHRIAN: if (state == DONE) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index 2faee8558..89b0266e1 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -158,7 +158,8 @@ public: me->GetThreatMgr().clearReferences(); me->SetRegeneratingHealth(false); _EnterEvadeMode(); - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); if( pInstance ) pInstance->SetData(BOSS_ARGENT_CHALLENGE, DONE); } @@ -305,7 +306,8 @@ public: me->GetThreatMgr().clearReferences(); me->SetRegeneratingHealth(false); _EnterEvadeMode(); - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); if( pInstance ) { pInstance->SetData(BOSS_ARGENT_CHALLENGE, DONE); @@ -404,7 +406,8 @@ public: events.Reset(); me->SetReactState(REACT_PASSIVE); me->SetObjectScale(0.01f); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); events.ScheduleEvent(EVENT_MEMORY_SCALE, 500); } @@ -440,7 +443,8 @@ public: break; case EVENT_MEMORY_START_ATTACK: - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); if( Unit* target = me->SelectNearestTarget(200.0f) ) { AttackStart(target); 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 ffbd5a3d9..669b1f74a 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -120,7 +120,8 @@ public: summons.DespawnAll(); Phase = 1; me->SetDisplayId(me->GetNativeDisplayId()); - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); me->SetReactState(REACT_PASSIVE); if( pInstance ) pInstance->SetData(BOSS_BLACK_KNIGHT, NOT_STARTED); @@ -193,7 +194,8 @@ public: { case SPELL_BLACK_KNIGHT_RES: me->SetHealth(me->GetMaxHealth()); - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); me->SetControlled(false, UNIT_STATE_STUNNED); me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); @@ -342,7 +344,8 @@ public: { Start(false, true, ObjectGuid::Empty, nullptr); SetDespawnAtEnd(true); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); } void DoAction(int32 param) override 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 096d8cf27..fa2c3f503 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -400,7 +400,8 @@ public: { DoAction(1); DoAction(2); - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0); me->SetReactState(REACT_AGGRESSIVE); } @@ -488,7 +489,8 @@ public: me->SetRegeneratingHealth(true); me->RemoveUnitFlag(UNIT_FLAG_PACIFIED); me->SetSpeed(MOVE_RUN, 1.0f, false); - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->RemoveAllAuras(); AddCreatureAddonAuras(); @@ -556,7 +558,8 @@ public: me->StopMoving(); me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0); me->SetRegeneratingHealth(false); - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); if( pInstance ) { @@ -584,7 +587,8 @@ public: me->CombatStop(true); me->GetMotionMaster()->Clear(); me->SetRegeneratingHealth(false); - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); if( pInstance ) pInstance->SetData(DATA_GRAND_CHAMPION_DIED, BossOrder); } @@ -627,7 +631,8 @@ public: events.ScheduleEvent(EVENT_SHIELD_BREAKER, urand(5000, 8000)); events.ScheduleEvent(EVENT_THRUST, urand(3000, 5000)); me->SetReactState(REACT_AGGRESSIVE); - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); if( Unit* target = me->SelectNearestTarget(200.0f) ) AttackStart(target); DoZoneInCombat(); @@ -720,7 +725,8 @@ public: { me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); NewMountGUID = mount->GetGUID(); - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); me->GetMotionMaster()->MovePoint(7, *mount); events.RepeatEvent(200); break; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp index bbbafa9df..9b6e057f0 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp @@ -733,7 +733,8 @@ public: { NPC_GrandChampionGUID[BossOrder] = pBoss->GetGUID(); pBoss->ToCreature()->SetReactState(REACT_PASSIVE); - pBoss->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_PACIFIED); + pBoss->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED); + pBoss->SetImmuneToAll(true); pBoss->ToCreature()->SetHomePosition(748.309f, 619.448f, 411.3f, M_PI / 2); pBoss->AI()->SetData(BossOrder, (shortver ? 1 : 0)); @@ -742,7 +743,8 @@ public: { NPC_GrandChampionMinionsGUID[BossOrder][i] = pAdd->GetGUID(); pAdd->SetReactState(REACT_PASSIVE); - pAdd->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + pAdd->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + pAdd->SetImmuneToAll(true); pAdd->SetHomePosition(748.309f, 619.448f, 411.3f, M_PI / 2); pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, (i + 1)*M_PI / 2); } @@ -839,7 +841,8 @@ public: if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) ) { c->SetReactState(REACT_AGGRESSIVE); - c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + c->SetImmuneToAll(false); if( Unit* target = c->SelectNearestTarget(200.0f) ) c->AI()->AttackStart(target); c->AI()->DoZoneInCombat(); @@ -865,7 +868,8 @@ public: if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) ) { c->SetReactState(REACT_AGGRESSIVE); - c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + c->SetImmuneToAll(false); if( Unit* target = c->SelectNearestTarget(200.0f) ) c->AI()->AttackStart(target); c->AI()->DoZoneInCombat(); @@ -890,7 +894,8 @@ public: if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) ) { c->SetReactState(REACT_AGGRESSIVE); - c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + c->SetImmuneToAll(false); if( Unit* target = c->SelectNearestTarget(200.0f) ) c->AI()->AttackStart(target); c->AI()->DoZoneInCombat(); @@ -915,7 +920,8 @@ public: if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) ) { c->SetReactState(REACT_AGGRESSIVE); - c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + c->SetImmuneToAll(false); if( Unit* target = c->SelectNearestTarget(200.0f) ) c->AI()->AttackStart(target); c->AI()->DoZoneInCombat(); @@ -952,7 +958,8 @@ public: if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) ) { c->SetReactState(REACT_AGGRESSIVE); - c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + c->SetImmuneToAll(false); if( Unit* target = c->SelectNearestTarget(200.0f) ) c->AI()->AttackStart(target); c->AI()->DoZoneInCombat(); @@ -1056,7 +1063,8 @@ public: if( Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]) ) { c->SetReactState(REACT_AGGRESSIVE); - c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + c->SetImmuneToAll(false); //c->AI()->DoZoneInCombat(); } if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) ) @@ -1077,7 +1085,8 @@ public: if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) ) { boss->SetReactState(REACT_AGGRESSIVE); - boss->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + boss->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + boss->SetImmuneToAll(false); if( Unit* target = boss->SelectNearestTarget(200.0f) ) boss->AI()->AttackStart(target); boss->AI()->DoZoneInCombat(); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp index f0777a114..e27d9f669 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp @@ -66,7 +66,7 @@ public: { startFightTimer = 0; uiHopelessnessCount = 0; - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetControlled(false, UNIT_STATE_ROOT); events.Reset(); if (pInstance) @@ -75,7 +75,7 @@ public: void EnterCombat(Unit* /*who*/) override { - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); events.ScheduleEvent(EVENT_QUIVERING_STRIKE, 5000); events.ScheduleEvent(EVENT_IMPENDING_DESPAIR, 11000); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp index 4379b6281..1b67e8cc3 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp @@ -63,7 +63,7 @@ public: void Reset() override { startFightTimer = 0; - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); events.Reset(); if (pInstance) pInstance->SetData(DATA_MARWYN, NOT_STARTED); @@ -71,7 +71,7 @@ public: void EnterCombat(Unit* /*who*/) override { - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); events.ScheduleEvent(EVENT_OBLITERATE, 15000); events.ScheduleEvent(EVENT_WELL_OF_CORRUPTION, 13000); 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 1a9140ff1..024f1033f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -755,7 +755,10 @@ public: { ScriptedAI::EnterEvadeMode(why); if (me->GetInstanceScript()->GetData(DATA_WAVE_NUMBER)) - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + { + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); + } } }; }; @@ -851,7 +854,10 @@ public: { ScriptedAI::EnterEvadeMode(why); if (me->GetInstanceScript()->GetData(DATA_WAVE_NUMBER)) - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + { + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); + } } }; }; @@ -994,7 +1000,10 @@ public: { ScriptedAI::EnterEvadeMode(why); if (me->GetInstanceScript()->GetData(DATA_WAVE_NUMBER)) - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + { + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); + } } }; }; @@ -1077,7 +1086,10 @@ public: { ScriptedAI::EnterEvadeMode(why); if (me->GetInstanceScript()->GetData(DATA_WAVE_NUMBER)) - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + { + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); + } } }; }; @@ -1161,7 +1173,10 @@ public: { ScriptedAI::EnterEvadeMode(why); if (me->GetInstanceScript()->GetData(DATA_WAVE_NUMBER)) - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + { + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); + } } }; }; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp index 6ccce9d1b..4b3be91d4 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp @@ -68,7 +68,7 @@ public: break; case 8: _owner.SetReactState(REACT_AGGRESSIVE); - _owner.RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + _owner.SetImmuneToAll(false); if (InstanceScript* instance = _owner.GetInstanceScript()) instance->SetData(DATA_BATTERED_HILT, 8); break; @@ -96,7 +96,7 @@ public: { Position homePos = _owner.GetHomePosition(); _owner.SetReactState(REACT_PASSIVE); - _owner.SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + _owner.SetImmuneToAll(true); _owner.SetVisible(false); _owner.UpdatePosition(homePos.GetPositionX(), homePos.GetPositionY(), homePos.GetPositionZ(), homePos.GetOrientation(), true); _owner.StopMovingOnCurrentPos(); @@ -629,7 +629,7 @@ public: if (Creature* c = instance->GetCreature(NPC_QuelDelarGUID)) { c->SetReactState(REACT_AGGRESSIVE); - c->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + c->SetImmuneToAll(false); c->RemoveAurasDueToSpell(70300); } break; @@ -889,7 +889,8 @@ public: if (c->GetEntry() == entry) { TrashActive[j] = true; - c->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + c->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + c->SetImmuneToAll(false); c->AI()->DoAction(1); break; } @@ -918,7 +919,8 @@ public: c->GetThreatMgr().ClearAllThreat(); c->CombatStop(true); c->InterruptNonMeleeSpells(true); - c->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + c->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + c->SetImmuneToAll(true); c->Respawn(true); c->UpdatePosition(c->GetHomePosition(), true); c->StopMovingOnCurrentPos(); diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 2ed4e607c..61ae383a9 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -418,7 +418,8 @@ public: c->CastSpell(c, 69753, false); me->SetReactState(REACT_PASSIVE); - me->SetUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); + me->SetImmuneToAll(true); me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); me->SetDynamicFlag(UNIT_DYNFLAG_DEAD); me->AddUnitState(UNIT_STATE_DIED); 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 fc8354713..4f7051cfa 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -930,7 +930,7 @@ public: if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_TYRANNUS_GUID))) { c->AI()->Talk(SAY_PREFIGHT_1); - c->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + c->SetImmuneToPC(false); c->SetReactState(REACT_AGGRESSIVE); //c->ClearUnitState(UNIT_STATE_ONVEHICLE); if (Player* plr = c->SelectNearestPlayer(100.0f)) 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 785cb9386..508653c07 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -212,7 +212,7 @@ public: me->SetDynamicFlag(UNIT_DYNFLAG_DEAD); me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetReactState(REACT_PASSIVE); } } @@ -367,7 +367,8 @@ public: { case ACTION_STAND_UP: summons.DespawnEntry(WORLD_TRIGGER); - me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD); me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); me->SetReactState(REACT_AGGRESSIVE); @@ -471,7 +472,7 @@ public: me->SetDynamicFlag(UNIT_DYNFLAG_DEAD); me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetReactState(REACT_PASSIVE); } } @@ -636,7 +637,8 @@ public: { case ACTION_STAND_UP: summons.DespawnEntry(WORLD_TRIGGER); - me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD); me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); me->SetReactState(REACT_AGGRESSIVE); @@ -755,7 +757,7 @@ public: me->SetDynamicFlag(UNIT_DYNFLAG_DEAD); me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetReactState(REACT_PASSIVE); } } @@ -929,7 +931,8 @@ public: { case ACTION_STAND_UP: summons.DespawnEntry(WORLD_TRIGGER); - me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD); me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); me->SetReactState(REACT_AGGRESSIVE); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index cd35da886..86bc01d41 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -251,7 +251,7 @@ public: void Reset() override { _Reset(); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(true); me->SetReactState(REACT_DEFENSIVE); events.Reset(); _introDone = false; @@ -323,7 +323,7 @@ public: void AttackStart(Unit* victim) override { - if (!_introDone || me->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC)) + if (!_introDone || me->IsImmuneToPC()) return; ScriptedAI::AttackStart(victim); @@ -707,7 +707,7 @@ public: if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_DEATHBRINGER_SAURFANG))) { deathbringer->AI()->DoAction(ACTION_INTRO_DONE); - deathbringer->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + deathbringer->SetImmuneToPC(false); if (Player* target = deathbringer->SelectNearestPlayer(100.0f)) deathbringer->AI()->AttackStart(target); } @@ -945,7 +945,7 @@ public: if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_DEATHBRINGER_SAURFANG))) { deathbringer->AI()->DoAction(ACTION_INTRO_DONE); - deathbringer->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + deathbringer->SetImmuneToPC(false); if (Player* target = deathbringer->SelectNearestPlayer(100.0f)) deathbringer->AI()->AttackStart(target); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 2dc2feb74..e4c90d4f9 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1431,7 +1431,7 @@ public: return; me->setActive(true); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); float moveTime = me->GetExactDist(&SpinestalkerFlyPos) / (me->GetSpeed(MOVE_RUN) * 0.001f); me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, SpinestalkerLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250)); me->SetDefaultMovementType(IDLE_MOTION_TYPE); @@ -1450,7 +1450,7 @@ public: me->SetDisableGravity(false); me->SetHomePosition(SpinestalkerLandPos); me->SetFacingTo(SpinestalkerLandPos.GetOrientation()); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); } void UpdateAI(uint32 diff) override @@ -1562,7 +1562,7 @@ public: return; me->setActive(true); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); float moveTime = me->GetExactDist(&RimefangFlyPos) / (me->GetSpeed(MOVE_RUN) * 0.001f); me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, RimefangLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250)); me->SetDefaultMovementType(IDLE_MOTION_TYPE); @@ -1583,7 +1583,7 @@ public: me->SetDisableGravity(false); me->SetHomePosition(RimefangLandPos); me->SetFacingTo(RimefangLandPos.GetOrientation()); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); } else if (point == POINT_LAND_GROUND) { 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 1b611d389..1da4926b8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -631,7 +631,7 @@ public: boss_the_lich_kingAI(Creature* creature) : BossAI(creature, DATA_THE_LICH_KING) { me->AddAura(SPELL_EMOTE_SIT_NO_SHEATH, me); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->SetReactState(REACT_PASSIVE); } @@ -658,7 +658,7 @@ public: _Reset(); DoAction(ACTION_RESTORE_LIGHT); SetEquipmentSlots(true); - if (me->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC)) + if (me->IsImmuneToPC()) me->SetStandState(UNIT_STAND_STATE_SIT); } @@ -704,7 +704,7 @@ public: Cell::VisitGridObjects(me, worker, 333.0f); me->AddAura(SPELL_EMOTE_SIT_NO_SHEATH, me); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->SetReactState(REACT_PASSIVE); me->SetStandState(UNIT_STAND_STATE_SIT); } @@ -1207,7 +1207,7 @@ public: spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_1, true); // summons bombs randomly spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_2, true); // summons bombs on players spawner->m_Events.AddEvent(new TriggerWickedSpirit(spawner), spawner->m_Events.CalculateTime(3000)); - terenas->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); // to avoid being healed by player trinket procs. terenas' health doesn't matter on heroic + terenas->SetImmuneToAll(true); // to avoid being healed by player trinket procs. terenas' health doesn't matter on heroic } } break; @@ -1454,7 +1454,7 @@ public: if (Creature* theLichKing = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_THE_LICH_KING))) { theLichKing->SetWalk(false); - theLichKing->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + theLichKing->SetImmuneToPC(false); theLichKing->SetReactState(REACT_AGGRESSIVE); theLichKing->SetInCombatWithZone(); if (!theLichKing->IsInCombat()) @@ -1587,7 +1587,7 @@ public: terenas->CastSpell((Unit*)nullptr, SPELL_MASS_RESURRECTION, false); if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_THE_LICH_KING))) { - lichKing->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + lichKing->SetImmuneToNPC(false); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); me->RemoveAllAuras(); SetEquipmentSlots(true); @@ -3708,7 +3708,8 @@ public: if (!target) return; - target->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + target->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1); + target->SetImmuneToAll(false); target->ForceValuesUpdateAtIndex(UNIT_FIELD_FLAGS); VileSpiritActivateEvent(target).Execute(0, 0); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 1d07f01e6..c3f478d12 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -743,7 +743,8 @@ public: return; me->setActive(true); - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); // Load Grid with Sister Svalna me->GetMap()->LoadGrid(4356.71f, 2484.33f); if (Creature* svalna = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SISTER_SVALNA))) @@ -930,7 +931,8 @@ public: Talk(SAY_CROK_INTRO_3); break; case EVENT_START_PATHING: - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); Start(true, true); break; case EVENT_SCOURGE_STRIKE: @@ -998,7 +1000,7 @@ public: void Reset() override { _Reset(); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetReactState(REACT_PASSIVE); me->SetCanFly(true); me->SetDisableGravity(true); @@ -1007,7 +1009,7 @@ public: void AttackStart(Unit* victim) override { - if (me->HasReactState(REACT_PASSIVE) || me->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)) + if (me->HasReactState(REACT_PASSIVE) || me->IsImmuneToAll()) return; BossAI::AttackStart(victim); } @@ -1037,10 +1039,10 @@ public: void EnterCombat(Unit* /*attacker*/) override { - if (me->HasReactState(REACT_PASSIVE) || me->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)) + if (me->HasReactState(REACT_PASSIVE) || me->IsImmuneToAll()) { me->CombatStop(false); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->SetReactState(REACT_PASSIVE); return; } @@ -1121,7 +1123,7 @@ public: if (type != EFFECT_MOTION_TYPE || id != POINT_LAND) return; - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->SetCanFly(false); me->SetDisableGravity(false); me->SetReactState(REACT_AGGRESSIVE); @@ -1915,7 +1917,8 @@ public: if (Creature* target = GetTarget()->ToCreature()) { target->SetReactState(REACT_PASSIVE); - target->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); + target->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + target->SetImmuneToPC(true); target->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_CUSTOM_SPELL_02); } } @@ -1925,7 +1928,8 @@ public: if (Creature* target = GetTarget()->ToCreature()) { target->SetReactState(REACT_AGGRESSIVE); - target->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); + target->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + target->SetImmuneToPC(false); target->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); } } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 545461dab..65d745f89 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -225,7 +225,8 @@ public: BossAI::Reset(); events.Reset(); summons.DespawnAll(); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_DISABLE_MOVE); + me->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE); + me->SetImmuneToPC(false); me->SetReactState(REACT_PASSIVE); secondPhase = false; gateOpened = false; @@ -485,7 +486,8 @@ public: Talk(EMOTE_PHASE_TWO); me->CastSpell(me, SPELL_TELEPORT_LIVE, false); me->SetReactState(REACT_AGGRESSIVE); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_DISABLE_MOVE); + me->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE); + me->SetImmuneToPC(false); me->RemoveAllAuras(); summons.DoZoneInCombat(); events.ScheduleEvent(EVENT_SHADOW_BOLT, 1000); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index 678c2f69c..aace56577 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -168,7 +168,7 @@ public: cr->InterruptNonMeleeSpells(true); cr->CastSpell(cr, SPELL_FEUGEN_CHAIN, false); cr->SetDisableGravity(true); - cr->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + cr->SetImmuneToPC(false); cr->SetControlled(true, UNIT_STATE_ROOT); } if (Creature* cr = me->SummonCreature(NPC_TESLA_COIL, 3487.04f, -2911.68f, 318.75f, 0.0f)) @@ -177,7 +177,7 @@ public: cr->InterruptNonMeleeSpells(true); cr->CastSpell(cr, SPELL_STALAGG_CHAIN, false); cr->SetDisableGravity(true); - cr->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + cr->SetImmuneToPC(false); cr->SetControlled(true, UNIT_STATE_ROOT); } @@ -403,7 +403,7 @@ public: if (Creature* cr = me->FindNearestCreature(NPC_TESLA_COIL, 150.0f)) { cr->CastSpell(cr, me->GetEntry() == NPC_STALAGG ? SPELL_STALAGG_CHAIN : SPELL_FEUGEN_CHAIN, false); - cr->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + cr->SetImmuneToPC(false); myCoil = cr->GetGUID(); } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 776b948cd..c922d2c9b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -377,7 +377,7 @@ public: events.Reset(); summons.DespawnAll(); me->SetReactState(REACT_PASSIVE); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); me->SetSheath(SHEATH_STATE_UNARMED); me->SetFaction(190); me->CastSpell(me, SPELL_DUAL_WIELD, true); @@ -403,7 +403,7 @@ public: { case ACTION_START_INTRO: { - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->SetUnitFlag2(UNIT_FLAG2_DO_NOT_FADE_IN); me->SetDisableGravity(true); me->CastSpell(me, SPELL_ARRIVAL, true); @@ -446,7 +446,7 @@ public: case ACTION_INIT_ALGALON: _firstPull = false; _fedOnTears = false; - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case ACTION_ASCEND: summons.DespawnAll(); @@ -477,7 +477,8 @@ public: uint32 introDelay = 0; me->setActive(true); me->SetInCombatWithZone(); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToNPC(true); events.Reset(); events.SetPhase(PHASE_ROLE_PLAY); @@ -649,7 +650,7 @@ public: break; case EVENT_INTRO_FINISH: events.Reset(); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); if (Creature* brann = ObjectAccessor::GetCreature(*me, m_pInstance->GetGuidData(NPC_BRANN_BRONZBEARD_ALG))) brann->AI()->DoAction(ACTION_FINISH_INTRO); break; @@ -659,7 +660,8 @@ public: break; case EVENT_REMOVE_UNNATTACKABLE: me->SetSheath(SHEATH_STATE_MELEE); - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToNPC(false); break; case EVENT_INTRO_TIMER_DONE: events.SetPhase(PHASE_NORMAL); @@ -985,7 +987,8 @@ public: { case ACTION_ACTIVATE_STAR: me->SetReactState(REACT_AGGRESSIVE); - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); _isActive = true; if (Player* target = SelectTargetFromPlayerList(250.0f)) 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 376c1ec4d..3ce5ce7b9 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -770,7 +770,8 @@ public: } else { - turret->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + turret->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE); + turret->SetImmuneToAll(true); if (turret->GetTypeId() == TYPEID_UNIT) turret->ToCreature()->AI()->EnterEvadeMode(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index b6fa60fda..39054e7bf 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -185,7 +185,7 @@ public: else // if (m_algalonTimer = TIMER_ALGALON_TO_SUMMON) { m_algalonTimer = TIMER_ALGALON_SUMMONED; - algalon->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + algalon->SetImmuneToPC(false); } } } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index cae0e2e7f..0664944a8 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -142,7 +142,7 @@ public: me->SetCanFly(false); me->SetDisableGravity(false); me->SetFacingTo(0.25f); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); } } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index c8caac610..b8623afb7 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -133,10 +133,11 @@ public: events.Reset(); events2.Reset(); if (!Started) - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); else { - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); me->SetHover(true); } } @@ -152,7 +153,7 @@ public: if (data != 1 || param != 1 || Started || (instance && instance->GetData(DATA_SVALA_SORROWGRAVE) == DONE)) return; - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); Started = true; me->setActive(true); events2.ScheduleEvent(EVENT_SVALA_START, 5000); @@ -247,7 +248,7 @@ public: me->UpdateEntry(NPC_SVALA_SORROWGRAVE); me->SetCorpseDelay(sWorld->getIntConfig(CONFIG_CORPSE_DECAY_ELITE)); me->SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 6.0f); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); if (Creature* Arthas = ObjectAccessor::GetCreature(*me, ArthasGUID)) Arthas->InterruptNonMeleeSpells(false); me->RemoveAllAuras(); @@ -283,7 +284,7 @@ public: break; case EVENT_SVALA_TALK9: me->SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 3.0f); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->LoadEquipment(1, true); me->setActive(false); if (Player* target = SelectTargetFromPlayerList(100.0f)) @@ -323,7 +324,7 @@ public: break; } case EVENT_SORROWGRAVE_RITUAL: - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true)) { Talk(SAY_SACRIFICE_PLAYER); diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 169729901..644718725 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -345,13 +345,15 @@ public: if (Creature* pGuard1 = instance->GetCreature(NPC_ErekemGuardGUID[0])) { pGuard1->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pGuard1->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); + pGuard1->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + pGuard1->SetImmuneToNPC(false); pGuard1->GetMotionMaster()->MovePoint(0, BossStartMove21); } if (Creature* pGuard2 = instance->GetCreature(NPC_ErekemGuardGUID[1])) { pGuard2->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pGuard2->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); + pGuard2->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + pGuard2->SetImmuneToNPC(false); pGuard2->GetMotionMaster()->MovePoint(0, BossStartMove22); } break; @@ -384,7 +386,8 @@ public: if (pBoss) { pBoss->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pBoss->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); + pBoss->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + pBoss->SetImmuneToNPC(false); pBoss->SetReactState(REACT_AGGRESSIVE); if ((WaveCount == 6 && m_auiEncounter[0] == DONE) || (WaveCount == 12 && m_auiEncounter[1] == DONE)) pBoss->SetLootMode(0); @@ -497,7 +500,10 @@ public: break; case EVENT_CYANIGOSA_ATTACK: if (Creature* c = instance->GetCreature(NPC_CyanigosaGUID)) - c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); + { + c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + c->SetImmuneToNPC(false); + } break; } } @@ -594,15 +600,15 @@ public: HandleGameObject(GO_ZuramatCellGUID, false); // respawn bosses - if (Creature* c = instance->GetCreature(NPC_MoraggGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); } - if (Creature* c = instance->GetCreature(NPC_MoraggGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); } - if (Creature* c = instance->GetCreature(NPC_ErekemGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); } - if (Creature* c = instance->GetCreature(NPC_ErekemGuardGUID[0])) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); } - if (Creature* c = instance->GetCreature(NPC_ErekemGuardGUID[1])) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); } - if (Creature* c = instance->GetCreature(NPC_IchoronGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); } - if (Creature* c = instance->GetCreature(NPC_LavanthorGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); } - if (Creature* c = instance->GetCreature(NPC_XevozzGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); } - if (Creature* c = instance->GetCreature(NPC_ZuramatGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); } + if (Creature* c = instance->GetCreature(NPC_MoraggGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); c->SetImmuneToNPC(true); } + if (Creature* c = instance->GetCreature(NPC_MoraggGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); c->SetImmuneToNPC(true); } + if (Creature* c = instance->GetCreature(NPC_ErekemGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); c->SetImmuneToNPC(true); } + if (Creature* c = instance->GetCreature(NPC_ErekemGuardGUID[0])) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); c->SetImmuneToNPC(true); } + if (Creature* c = instance->GetCreature(NPC_ErekemGuardGUID[1])) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); c->SetImmuneToNPC(true); } + if (Creature* c = instance->GetCreature(NPC_IchoronGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); c->SetImmuneToNPC(true); } + if (Creature* c = instance->GetCreature(NPC_LavanthorGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); c->SetImmuneToNPC(true); } + if (Creature* c = instance->GetCreature(NPC_XevozzGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); c->SetImmuneToNPC(true); } + if (Creature* c = instance->GetCreature(NPC_ZuramatGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); c->SetImmuneToNPC(true); } if (Creature* c = instance->GetCreature(NPC_CyanigosaGUID)) { c->DespawnOrUnsummon(); } } diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 730c08429..2db5c1b4d 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -280,7 +280,7 @@ struct violet_hold_trashAI : public npc_escortAI if (!who->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE)) { me->InterruptNonMeleeSpells(false); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(false); } } @@ -372,7 +372,7 @@ struct violet_hold_trashAI : public npc_escortAI void CreatureStartAttackDoor() { RemoveEscortState(STATE_ESCORT_ESCORTING | STATE_ESCORT_RETURNING | STATE_ESCORT_PAUSED); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(true); me->CastSpell((Unit*)nullptr, SPELL_DESTROY_DOOR_SEAL, true); } @@ -380,7 +380,7 @@ struct violet_hold_trashAI : public npc_escortAI { if (!HasEscortState(STATE_ESCORT_ESCORTING)) { - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(false); me->SetHomePosition(1845.577759f + rand_norm() * 5 - 2.5f, 800.681152f + rand_norm() * 5 - 2.5f, 44.104248f, M_PI); } diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index b40420795..94bec6016 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -80,7 +80,7 @@ public: owner->CastSpell(owner, SPELL_SUBDUED, true); GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true); owner->SetFaction(FACTION_FRIENDLY); - owner->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + owner->SetImmuneToAll(true); owner->DespawnOrUnsummon(3 * MINUTE * IN_MILLISECONDS); } @@ -1505,7 +1505,7 @@ public: void Reset() override { - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToAll(true); _events.ScheduleEvent(EVENT_THASSARIAN_CAST, 1000); } @@ -1673,7 +1673,7 @@ public: { _arlosGUID = arlos->GetGUID(); arlos->SetWalk(true); - arlos->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + arlos->SetImmuneToAll(true); arlos->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); arlos->GetMotionMaster()->MovePath(PATH_ARLOS, false); } @@ -1681,7 +1681,7 @@ public: { _leryssaGUID = leryssa->GetGUID(); leryssa->SetWalk(true); - leryssa->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); + leryssa->SetImmuneToAll(true); leryssa->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); leryssa->GetMotionMaster()->MovePath(PATH_LERYSSA, false); } diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index 5cc0f5707..e93fb93ef 100644 --- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp @@ -416,7 +416,7 @@ public: if (me->FindNearestGameObject(OBJECT_HAUNCH, 2.0f)) { me->SetStandState(UNIT_STAND_STATE_DEAD); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->ReplaceAllDynamicFlags(UNIT_DYNFLAG_DEAD); } _phase = 0; @@ -743,7 +743,8 @@ public: { _playerGUID.Clear(); - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToPC(false); me->SetReactState(REACT_AGGRESSIVE); } @@ -793,7 +794,8 @@ public: { if (spell->Id == SPELL_SMOKE_BOMB && caster->GetTypeId() == TYPEID_PLAYER) { - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToPC(true); me->SetReactState(REACT_PASSIVE); me->CombatStop(false); _playerGUID = caster->GetGUID(); diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index 0ba807b4c..786b7b5a3 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -125,7 +125,13 @@ public: { if (HealthBelowPct(50) && !health50) { - Talk(SAY_TURMOIL_HALF_HP, me->ToTempSummon()->GetSummonerUnit()->ToPlayer()); + WorldObject* summoner = nullptr; + if (TempSummon const* tempSummon = me->ToTempSummon()) + { + summoner = tempSummon->GetSummonerUnit(); + } + + Talk(SAY_TURMOIL_HALF_HP, summoner); health50 = true; } } diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 5635b24da..bd7de0b76 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -489,7 +489,7 @@ public: events.RescheduleEvent(EVENT_START, 1000); me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); me->SetWalk(true); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); me->setActive(true); me->SetReactState(REACT_PASSIVE); } @@ -750,7 +750,7 @@ public: else if (summon->GetEntry() != NPC_INVOKER_BASALEPH) { summon->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); - summon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + summon->SetImmuneToAll(true); summon->GetMotionMaster()->MovePoint(4, 6135.97f, 2753.84f, 573.92f); } } @@ -974,7 +974,7 @@ public: for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr) if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr)) { - summon->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + summon->SetImmuneToAll(false); if (summon->GetEntry() >= NPC_TIRION_EBON_KNIGHT && summon->GetEntry() <= NPC_TIRION_MOGRAINE) { if (summon->GetEntry() == NPC_TIRION_MOGRAINE) diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index a5cf450a4..f90347a34 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -228,7 +228,7 @@ public: me->SetDisableGravity(false); me->CastSpell(me, SPELL_DUAL_WIELD, true); me->LoadEquipment(0, true); - me->ReplaceAllUnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); beamPosId = urand(0, 3); } @@ -957,7 +957,7 @@ public: case EVENT_AKAMA_SCENE_29: if (Creature* illidan = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_ILLIDAN_STORMRAGE))) { - illidan->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + illidan->SetImmuneToAll(false); illidan->SetInCombatWithZone(); AttackStart(illidan); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 413d7b1fa..55c3c83b1 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -131,7 +131,8 @@ public: { BossAI::Reset(); me->SetReactState(REACT_PASSIVE); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(true); me->SetWalk(true); } @@ -249,7 +250,8 @@ public: DoResetThreat(); me->GetVictim()->InterruptNonMeleeSpells(false); me->AddThreat(me->GetVictim(), 1000000.0f); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToAll(false); summonsGenerator.DoAction(ACTION_STOP_SPAWNING); break; } diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index a3a42b38c..0ba0e9668 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -58,7 +58,8 @@ public: events.Reset(); me->SetReactState(REACT_PASSIVE); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); canAttack = false; if (instance) @@ -130,7 +131,8 @@ public: events.ScheduleEvent(EVENT_SPELL_BOLT, 7000); me->SetReactState(REACT_AGGRESSIVE); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); canAttack = true; break; } diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index 9e0c853a4..e2191c837 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -93,7 +93,8 @@ public: ApplyImmunities(true); SummonChannelers(); me->SetReactState(REACT_PASSIVE); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE); + me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(true); if (instance) instance->SetData(DATA_KELIDAN, NOT_STARTED); } @@ -143,7 +144,8 @@ public: return; } me->SetReactState(REACT_AGGRESSIVE); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE); + me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + me->SetImmuneToAll(false); if (Unit* target = me->SelectNearestPlayer(100.0f)) AttackStart(target); } diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp index d09034f29..3fe7b4bb8 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp @@ -240,7 +240,8 @@ public: { if (!prisoner->IsAlive()) prisoner->Respawn(true); - prisoner->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE); + prisoner->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + prisoner->SetImmuneToAll(true); } void StorePrisoner(Creature* creature) @@ -316,7 +317,8 @@ public: for (ObjectGuid const& guid : prisoners) if (Creature* prisoner = instance->GetCreature(guid)) { - prisoner->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE); + prisoner->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + prisoner->SetImmuneToAll(false); prisoner->SetInCombatWithZone(); } } diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index bf5660081..dd6f74a2d 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -114,7 +114,8 @@ public: _Reset(); me->CastSpell(me, SPELL_SHADOW_CAGE, true); me->SetReactState(REACT_PASSIVE); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToPC(true); } void KilledUnit(Unit* /*victim*/) override @@ -184,7 +185,8 @@ public: Talk(SAY_FREE); break; case EVENT_ENTER_COMBAT: - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToPC(false); me->SetReactState(REACT_AGGRESSIVE); events.ScheduleEvent(EVENT_CLEAVE, 9000); events.ScheduleEvent(EVENT_BLAST_NOVA, 60000); diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index 82da67da2..e6331c8bf 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -92,7 +92,7 @@ public: ScriptedAI::InitializeAI(); me->SetReactState(REACT_PASSIVE); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); events2.Reset(); events2.ScheduleEvent(EVENT_TELEPORT_VISUAL, 0); events2.ScheduleEvent(EVENT_MILLHOUSE_INTRO1, 3000); @@ -174,7 +174,7 @@ public: case EVENT_MILLHOUSE_INTRO9: me->SetFacingTo(M_PI * 1.5f); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), M_PI * 1.5f); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->SetReactState(REACT_AGGRESSIVE); events2.ScheduleEvent(EVENT_SEARCH_FIGHT, 1000); break; @@ -365,7 +365,7 @@ public: { _Reset(); me->setActive(false); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD); me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); me->CastSpell((Unit*)nullptr, SPELL_TARGET_OMEGA, false); @@ -379,7 +379,7 @@ public: { me->setActive(true); me->InterruptNonMeleeSpells(false); - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); events.ScheduleEvent(EVENT_WARDEN_INTRO1, 1500); events.ScheduleEvent(EVENT_WARDEN_CHECK_PLAYERS, 1000); instance->SetBossState(DATA_WARDEN_MELLICHAR, IN_PROGRESS); @@ -535,7 +535,7 @@ public: case EVENT_WARDEN_INTRO25: if (Creature* cr = me->SummonCreature(NPC_HARBINGER_SKYRISS, 445.763f, -191.639f, 44.64f, 1.60f, TEMPSUMMON_MANUAL_DESPAWN)) { - cr->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + cr->SetImmuneToAll(true); cr->CastSpell(cr, SPELL_TELEPORT_VISUAL, true); } events.ScheduleEvent(EVENT_WARDEN_INTRO26, 1000); @@ -562,7 +562,7 @@ public: me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); if (Creature* creature = summons.GetCreatureWithEntry(NPC_HARBINGER_SKYRISS)) { - creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + creature->SetImmuneToAll(false); if (Player* player = SelectTargetFromPlayerList(50.0f)) AttackStart(player); } diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp index 96196b8de..92858c621 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp @@ -66,14 +66,14 @@ public: { _Reset(); events2.Reset(); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); } void InitializeAI() override { BossAI::InitializeAI(); if (instance->GetBossState(DATA_SOCCOTHRATES) != DONE) - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); } void JustDied(Unit* /*killer*/) override 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 f6ae5d8cd..d31658aa7 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp @@ -75,7 +75,7 @@ public: { events.Reset(); summons.DespawnAll(); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp index 36e981912..47c695435 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp @@ -87,14 +87,14 @@ public: _Reset(); events2.Reset(); me->CastSpell(me, SPELL_FEL_IMMOLATION, true); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); } void InitializeAI() override { BossAI::InitializeAI(); if (!preFight) - me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(true); } void JustDied(Unit* /*killer*/) override @@ -185,9 +185,9 @@ public: if (Creature* dalliah = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_DALLIAH))) { dalliah->SetFacingToObject(me); - dalliah->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + dalliah->SetImmuneToAll(false); me->SetFacingToObject(dalliah); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); dalliah->SetHomePosition(dalliah->GetPositionX(), dalliah->GetPositionY(), dalliah->GetPositionZ(), 1.51737f); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 4.725722f); } diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index a78ef56a3..8859a7e36 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -255,7 +255,8 @@ public: { if (spell->Id == SPELL_SUMMON_INFERNAL) { - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveUnitFlag(UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE); + me->SetImmuneToPC(false); me->SetDisplayId(MODEL_INFERNAL); } } diff --git a/src/server/scripts/Outland/zone_zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp index 7b242d60a..1a28c1e34 100644 --- a/src/server/scripts/Outland/zone_zangarmarsh.cpp +++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp @@ -69,7 +69,7 @@ public: } else { - creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + creature->SetImmuneToAll(false); Creature* cr; if ((cr = creature->SummonCreature(17957, -186, -790, 43.8f, 4.2f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))) cr->AI()->AttackStart(creature); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 7daaa10d4..51d16c953 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1773,7 +1773,7 @@ class spell_gen_creature_permanent_feign_death : public AuraScript Unit* target = GetTarget(); target->SetDynamicFlag(UNIT_DYNFLAG_DEAD); target->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); - target->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + target->SetImmuneToAll(true); if (target->GetTypeId() == TYPEID_UNIT) target->ToCreature()->SetReactState(REACT_PASSIVE); @@ -1784,7 +1784,7 @@ class spell_gen_creature_permanent_feign_death : public AuraScript Unit* target = GetTarget(); target->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD); target->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); - target->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + target->SetImmuneToAll(false); if (target->GetTypeId() == TYPEID_UNIT) target->ToCreature()->SetReactState(REACT_AGGRESSIVE); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 77f2156fb..969e04e7e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1100,7 +1100,7 @@ class spell_item_draenic_pale_ale : public SpellScript summon->SetOwnerGUID(GetCaster()->GetGUID()); summon->SetFaction(GetCaster()->GetFaction()); - summon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + summon->SetImmuneToAll(true); summon->SetReactState(REACT_PASSIVE); summon->GetMotionMaster()->MoveFollow(GetCaster(), PET_FOLLOW_DIST, GetCaster()->GetAngle(summon), MOTION_SLOT_CONTROLLED); GetSpell()->ExecuteLogEffectSummonObject(effIndex, summon); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index e5359d424..140731a6d 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -717,7 +717,7 @@ class spell_q11198_take_down_tethyr : public SpellScript { PreventHitDefaultEffect(effIndex); if (Unit* unit = GetHitUnit()) - if (unit->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC)) + if (unit->IsImmuneToPC()) return; GetCaster()->CastCustomSpell(42576 /*SPELL_CANNON_BLAST*/, SPELLVALUE_BASE_POINT0, GetEffectValue(), GetCaster(), true); } @@ -1002,13 +1002,13 @@ class spell_q11396_11399_force_shield_arcane_purple_x3 : public AuraScript void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); - target->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + target->SetImmuneToPC(true); target->SetControlled(true, UNIT_STATE_STUNNED); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + GetTarget()->SetImmuneToPC(false); } void Register() override diff --git a/src/server/scripts/World/npc_stave_of_ancients.cpp b/src/server/scripts/World/npc_stave_of_ancients.cpp index ee41456bf..e8d32856f 100644 --- a/src/server/scripts/World/npc_stave_of_ancients.cpp +++ b/src/server/scripts/World/npc_stave_of_ancients.cpp @@ -371,7 +371,8 @@ public: if (!ValidThreatlist()) { SetHomePosition(); - me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1); + me->SetImmuneToAll(true); me->DespawnOrUnsummon(5000); break; } @@ -751,8 +752,10 @@ public: SetHomePosition(); PreciousAI()->SetHomePosition(); - Precious()->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + Precious()->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1); + Precious()->SetImmuneToAll(true); + me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1); + me->SetImmuneToAll(true); Precious()->DespawnOrUnsummon(5000); @@ -962,7 +965,8 @@ public: { SetHomePosition(); me->RemoveAllMinionsByEntry(CREEPING_DOOM_ENTRY); - me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1); + me->SetImmuneToAll(true); me->CombatStop(true); me->Say(NELSON_DESPAWN_SAY); me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); @@ -1136,7 +1140,8 @@ public: if (!ValidThreatlist()) { SetHomePosition(); - me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1); + me->SetImmuneToAll(true); me->CombatStop(true); me->Say(FRANKLIN_DESPAWN_SAY); me->HandleEmoteCommand(EMOTE_ONESHOT_TALK);