aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2013_01_02_06_world_sai.sql9
-rw-r--r--sql/updates/world/2013_01_02_06_world_waypoints.sql283
-rw-r--r--sql/updates/world/2013_01_02_07_world_waypoints.sql157
-rw-r--r--src/server/game/AI/CoreAI/PetAI.cpp1
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.cpp22
-rw-r--r--src/server/game/AI/CreatureAI.cpp88
-rw-r--r--src/server/game/AI/CreatureAIImpl.h110
-rw-r--r--src/server/game/Entities/Object/ObjectDefines.h10
-rw-r--r--src/server/game/Spells/Spell.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp11
-rw-r--r--src/server/shared/Database/PreparedStatement.cpp8
-rw-r--r--src/server/shared/Database/PreparedStatement.h2
12 files changed, 581 insertions, 128 deletions
diff --git a/sql/updates/world/2013_01_02_06_world_sai.sql b/sql/updates/world/2013_01_02_06_world_sai.sql
new file mode 100644
index 00000000000..2ce089188d6
--- /dev/null
+++ b/sql/updates/world/2013_01_02_06_world_sai.sql
@@ -0,0 +1,9 @@
+DELETE FROM `gameobject_scripts` WHERE `id`=12148;
+UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` IN (17156,17157);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (17156,17157) AND `source_type`=1;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+-- Stonewraught Gate
+(17156,1,0,0,70,0,100,0,2,0,0,0,9,0,0,0,0,0,0,14,30084,150138,0,0,0,0,0,'Door lever - On activate - Activate Door'), -- autoclose is set to 3s, old script suggested 15s !?
+(17157,1,0,0,70,0,100,0,2,0,0,0,9,0,0,0,0,0,0,14, 6943,150137,0,0,0,0,0,'Door lever - On activate - Activate Door'); -- autoclose is set to 3s, old script suggested 15s !?
+-- uldaman shit
+DELETE FROM `gameobject_scripts` where `id` =14393; -- the keystone already has a cpp, if the door doesnt open, then add it there!
diff --git a/sql/updates/world/2013_01_02_06_world_waypoints.sql b/sql/updates/world/2013_01_02_06_world_waypoints.sql
new file mode 100644
index 00000000000..c7302a457a2
--- /dev/null
+++ b/sql/updates/world/2013_01_02_06_world_waypoints.sql
@@ -0,0 +1,283 @@
+-- Pathing for Commander Sarannis Entry: 17976
+SET @NPC := 82986;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=125.7293,`position_y`=321.185,`position_z`=-3.635947 WHERE `guid`=@NPC;
+DELETE FROM `creature_template_addon` WHERE `entry`=17976;
+INSERT INTO `creature_template_addon` (`entry`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (17976,@PATH,1,0, '19818');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,125.7293,321.185,-3.635947,1000,0,0,100,0),
+(@PATH,2,135.6253,311.316,-1.57836,0,0,0,100,0),
+(@PATH,3,150.9637,296.034,-4.566956,1000,0,0,100,0),
+(@PATH,4,135.6253,311.316,-1.57836,0,0,0,100,0);
+
+-- Pathing for High Botanist Freywinn Entry: 17975
+SET @NPC := 82987;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=116.3259,`position_y`=455.5696,`position_z`=-4.941401 WHERE `guid`=@NPC;
+DELETE FROM `creature_template_addon` WHERE `entry`=17975;
+INSERT INTO `creature_template_addon` (`entry`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (17975,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,116.3259,455.5696,-4.941401,3.385939,20000,0,0,100,0),
+(@PATH,2,120.164,450.6817,-4.894922,0,500,0,0,100,0),
+(@PATH,3,120.164,450.6817,-4.894922,4.555309,20000,0,0,100,0),
+(@PATH,4,116.3259,455.5696,-4.941401,0,500,0,0,100,0);
+
+-- Pathing for Bloodwarder Greenkeeper Entry: 18419
+SET @NPC := 82994;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4.453328,`position_y`=252.8713,`position_z`=-5.396591 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-4.453328,252.8713,-5.396591,0.06981317,10000,0,49,100,0),
+(@PATH,2,-4.453328,252.8713,-5.396591,2.146755,19000,0,476,100,0);
+
+-- Pathing for Bloodwarder Greenkeeper Entry: 18419
+SET @NPC := 82993;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3.139327,`position_y`=253.476,`position_z`=-5.392399 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3.139327,253.476,-5.392399,3.141593,10000,0,49,100,0),
+(@PATH,2,3.139327,253.476,-5.392399,0.9773844,19000,0,476,100,0);
+
+DELETE FROM `waypoint_scripts` WHERE `id`=49;
+INSERT INTO `waypoint_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`guid`) VALUES
+(49,1,1,378,1,68);
+
+-- Pathing for Bloodwarder Greenkeeper Entry: 18419
+SET @NPC := 82983;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2.213146,`position_y`=163.0322,`position_z`=-5.54038 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,2.213146,163.0322,-5.54038,2.251475,26000,0,0,100,0),
+(@PATH,2,-0.7086419,160.2672,-5.540373,0,0,0,0,100,0),
+(@PATH,3,-4.294355,161.2607,-5.540364,0,0,0,0,100,0),
+(@PATH,4,-6.205455,163.514,-5.54036,0,0,0,0,100,0),
+(@PATH,5,-6.24241,166.6921,-5.540361,0,0,0,0,100,0),
+(@PATH,6,-6.24241,166.6921,-5.540361,1.780236,18000,0,0,100,0),
+(@PATH,7,-3.464332,161.0224,-5.540366,0,0,0,0,100,0),
+(@PATH,8,0.992403,160.6039,-5.540379,0,0,0,0,100,0),
+(@PATH,9,2.213146,163.0322,-5.54038,0,0,0,0,100,0);
+
+-- Pathing for Bloodwarder Greenkeeper Entry: 18419
+SET @NPC := 82977;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=13.11812,`position_y`=198.4727,`position_z`=-5.54039 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,13.11812,198.4727,-5.54039,0,0,0,0,100,0),
+(@PATH,2,13.11812,198.4727,-5.54039,0.8552113,7000,0,0,100,0),
+(@PATH,3,13.77349,194.1652,-5.540394,0,0,0,0,100,0),
+(@PATH,4,17.34217,193.0448,-5.540406,0,0,0,0,100,0),
+(@PATH,5,17.34217,193.0448,-5.540406,0.9424778,18000,0,0,100,0),
+(@PATH,6,13.03814,196.0347,-5.540391,0,0,0,0,100,0);
+
+-- Pathing for Bloodwarder Greenkeeper Entry: 18419
+SET @NPC := 82981;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-8.21974,`position_y`=204.3309,`position_z`=-5.540359 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-8.21974,204.3309,-5.540359,3.560472,26000,0,0,100,0),
+(@PATH,2,-7.085683,202.0462,-5.540362,0,0,0,0,100,0),
+(@PATH,3,-10.7415,199.8233,-5.540348,0,0,0,0,100,0),
+(@PATH,4,-12.49067,195.6114,-5.540347,0,0,0,0,100,0),
+(@PATH,5,-16.42434,194.2959,-5.540349,0,0,0,0,100,0),
+(@PATH,6,-19.61755,196.9462,-5.540346,0,0,0,0,100,0),
+(@PATH,7,-19.61755,196.9462,-5.540346,1.361357,22000,0,0,100,0),
+(@PATH,8,-16.42434,194.2959,-5.540349,0,0,0,0,100,0),
+(@PATH,9,-10.83238,198.4772,-5.540348,0,0,0,0,100,0),
+(@PATH,10,-7.085683,202.0462,-5.540362,0,0,0,0,100,0),
+(@PATH,11,-8.21974,204.3309,-5.540359,0,0,0,0,100,0);
+
+-- Pathing for Tempest-Forge Peacekeeper Entry: 18405
+SET @NPC := 82992;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=14.39464,`position_y`=191.6226,`position_z`=-5.540398 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,14.39464,191.6226,-5.540398,0,0,0,100,0),
+(@PATH,2,14.18493,177.3456,-5.540413,0,0,0,100,0),
+(@PATH,3,14.39464,191.6226,-5.540398,0,0,0,100,0),
+(@PATH,4,9.744885,197.8509,-5.540387,0,0,0,100,0),
+(@PATH,5,-0.7083383,202.6878,-5.540373,0,0,0,100,0),
+(@PATH,6,-0.863688,242.4021,-5.575537,0,0,0,100,0),
+(@PATH,7,-0.771556,202.717,-5.540379,0,0,0,100,0),
+(@PATH,8,9.744885,197.8509,-5.540387,0,0,0,100,0);
+
+-- Pathing for Bloodfalcon Entry: 18155
+SET @NPC := 83010;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=100.8468,`position_y`=280.3725,`position_z`=-6.887547 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,100.8468,280.3725,-6.887547,0,0,0,100,0),
+(@PATH,2,77.20944,279.0805,-5.444278,0,0,0,100,0),
+(@PATH,3,84.07146,264.8167,-5.424605,0,0,0,100,0),
+(@PATH,4,92.04115,267.708,-5.393034,0,0,0,100,0),
+(@PATH,5,99.9794,272.1951,-6.974396,0,0,0,100,0);
+
+-- Pathing for Bloodfalcon Entry: 18155
+SET @NPC := 83009;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=109.3741,`position_y`=279.2442,`position_z`=-6.94078 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,109.3741,279.2442,-6.94078,0,0,0,100,0),
+(@PATH,2,106.6039,296.3932,-6.736755,0,0,0,100,0),
+(@PATH,3,114.8603,296.713,-5.403351,0,0,0,100,0),
+(@PATH,4,120.5567,289.947,-5.410193,0,0,0,100,0),
+(@PATH,5,119.7589,278.0228,-5.423053,0,0,0,100,0),
+(@PATH,6,114.742,276.3138,-6.998993,0,0,0,100,0);
+
+-- Pathing for Bloodfalcon Entry: 18155
+SET @NPC := 83008;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=101.2185,`position_y`=295.671,`position_z`=-6.719101 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,101.2185,295.671,-6.719101,0,0,0,100,0),
+(@PATH,2,101.0785,294.0834,-6.736097,0,0,0,100,0),
+(@PATH,3,99.73528,294.2418,-6.727928,0,0,0,100,0),
+(@PATH,4,99.9539,294.9124,-6.721509,0,0,0,100,0),
+(@PATH,5,101.4649,294.7929,-6.730046,0,0,0,100,0),
+(@PATH,6,97.40523,292.5155,-6.736019,0,0,0,100,0),
+(@PATH,7,99.61896,292.5375,-6.746336,0,0,0,100,0),
+(@PATH,8,99.74017,296.1521,-6.706696,0,0,0,100,0),
+(@PATH,9,98.21532,295.972,-6.701425,0,0,0,100,0),
+(@PATH,10,100.0779,295.0646,-6.720407,0,0,0,100,0),
+(@PATH,11,101.4872,291.8169,-6.763266,0,0,0,100,0),
+(@PATH,12,99.03914,291.6151,-6.753832,0,0,0,100,0),
+(@PATH,13,100.0113,293.701,-6.735262,0,0,0,100,0),
+(@PATH,14,99.75899,294.4994,-6.725174,0,0,0,100,0),
+(@PATH,15,99.56416,293.6588,-6.733598,0,0,0,100,0),
+(@PATH,16,99.97965,293.2847,-6.739742,0,0,0,100,0);
+
+-- Pathing for Bloodwarder Falconer Entry: 17994
+SET @NPC := 83007;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=102.2101,`position_y`=287.5207,`position_z`=-6.814517 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,102.2101,287.5207,-6.814517,0,0,0,0,100,0),
+(@PATH,2,102.5804,286.6708,-6.825739,0,0,0,0,100,0),
+(@PATH,3,102.1126,287.9805,-6.808935,0,0,0,0,100,0),
+(@PATH,4,103.0655,288.2263,-6.810746,0,0,0,0,100,0),
+(@PATH,5,102.2138,287.1823,-6.818299,0,0,0,0,100,0),
+(@PATH,6,100.6942,286.5314,-6.818292,0,0,0,0,100,0),
+(@PATH,7,101.7873,287.9028,-6.808247,0,0,0,0,100,0),
+(@PATH,8,101.8391,289.0352,-6.795895,0,0,0,0,100,0),
+(@PATH,9,102.7853,288.8042,-6.802979,0,0,0,0,100,0),
+(@PATH,10,102.7853,288.8042,-6.802979,0.8377581,3000,0,50,100,0),
+(@PATH,11,102.208,288.0875,-6.808199,0,0,0,0,100,0),
+(@PATH,12,103.2457,288.6324,-6.807087,0,0,0,0,100,0),
+(@PATH,13,101.3874,289.0022,-6.794107,0,0,0,0,100,0),
+(@PATH,14,102.0153,287.4591,-6.814272,0,0,0,0,100,0),
+(@PATH,15,101.6863,285.8949,-6.830106,0,0,0,0,100,0),
+(@PATH,16,103.6638,286.2337,-6.83577,0,0,0,0,100,0),
+(@PATH,17,103.6638,286.2337,-6.83577,0.8377581,3000,0,50,100,0),
+(@PATH,18,101.7167,286.4881,-6.823652,0,0,0,0,100,0),
+(@PATH,19,102.2377,286.9568,-6.820922,0,0,0,0,100,0),
+(@PATH,20,102.3838,285.2078,-6.841079,0,0,0,0,100,0),
+(@PATH,21,102.3838,285.2078,-6.841079,0.8377581,3000,0,50,100,0);
+
+DELETE FROM `waypoint_scripts` WHERE `id`=50;
+INSERT INTO `waypoint_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`guid`) VALUES
+(50,0,1,25,0,69);
+
+-- Pathing for Sunseeker Researcher Entry: 18421
+SET @NPC := 83052;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=158.1747,`position_y`=496.2738,`position_z`=-3.868253 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,158.1747,496.2738,-3.868253,0,0,0,100,0),
+(@PATH,2,156.1526,489.3673,-4.857466,0,0,0,100,0),
+(@PATH,3,150.5289,483.8496,-4.521907,0,0,0,100,0),
+(@PATH,4,138.1562,471.4412,-1.710583,0,0,0,100,0),
+(@PATH,5,125.0919,458.282,-4.002612,25000,0,0,100,0),
+(@PATH,6,136.7875,469.6367,-1.535325,0,0,0,100,0),
+(@PATH,7,143.6099,477.3061,-2.875249,0,0,0,100,0),
+(@PATH,8,151.2965,484.3168,-4.559049,0,0,0,100,0),
+(@PATH,9,157.2852,490.9466,-4.815495,0,0,0,100,0),
+(@PATH,10,159.9993,499.248,-2.327699,0,0,0,100,0),
+(@PATH,11,164.1381,501.6526,-2.169621,25000,0,0,100,0);
+
+-- Pathing for Sunseeker Botanist Entry: 18422
+SET @NPC := 83017;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=161.3267,`position_y`=377.6318,`position_z`=-5.38641 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,161.3267,377.6318,-5.38641,0,0,0,0,100,0),
+(@PATH,2,161.3267,377.6318,-5.38641,3.892084,25000,0,0,100,0),
+(@PATH,3,164.7352,383.6933,-5.386415,0,0,0,0,100,0),
+(@PATH,4,164.0884,388.1612,-5.386421,0,0,0,0,100,0),
+(@PATH,5,161.8422,392.5251,-5.386427,0,0,0,0,100,0),
+(@PATH,6,159.0437,394.9259,-5.386432,0,0,0,0,100,0),
+(@PATH,7,154.6845,398.0776,-5.386438,0,0,0,0,100,0),
+(@PATH,8,153.9412,401.8906,-5.386443,0,0,0,0,100,0),
+(@PATH,9,153.9412,401.8906,-5.386443,0.9424778,25000,0,0,100,0),
+(@PATH,10,155.4246,397.5377,-5.386436,0,0,0,0,100,0),
+(@PATH,11,157.8206,395.4006,-5.386433,0,0,0,0,100,0),
+(@PATH,12,160.7398,392.5124,-5.386428,0,0,0,0,100,0),
+(@PATH,13,163.7198,388.017,-5.386421,0,0,0,0,100,0),
+(@PATH,14,163.845,385.0679,-5.386418,0,0,0,0,100,0),
+(@PATH,15,163.1142,380.8199,-5.386413,0,0,0,0,100,0);
+-- 0xF13047F60000354E .go 161.3267 377.6318 -5.38641
+
+-- Pathing for Sunseeker Botanist Entry: 18422
+SET @NPC := 83030;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=185.3934,`position_y`=384.4199,`position_z`=-5.391479 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,185.3934,384.4199,-5.391479,0,0,0,0,100,0),
+(@PATH,2,191.3777,384.4846,-5.404879,0,0,0,0,100,0),
+(@PATH,3,191.3777,384.4846,-5.404879,0.7679449,25000,0,0,100,0),
+(@PATH,4,186.8178,385.4778,-5.394615,0,0,0,0,100,0),
+(@PATH,5,183.8889,388.4998,-5.3879,0,0,0,0,100,0),
+(@PATH,6,182.7735,392.4268,-5.386416,0,0,0,0,100,0),
+(@PATH,7,181.8264,397.8481,-5.386423,0,0,0,0,100,0),
+(@PATH,8,177.4602,402.4377,-5.386431,0,0,0,0,100,0),
+(@PATH,9,169.0016,404.7528,-5.386438,0,0,0,0,100,0),
+(@PATH,10,161.5859,402.9305,-5.38644,0,0,0,0,100,0),
+(@PATH,11,161.5859,402.9305,-5.38644,2.268928,25000,0,0,100,0),
+(@PATH,12,165.1373,399.9031,-5.386434,0,0,0,0,100,0),
+(@PATH,13,168.7618,399.839,-5.386432,0,0,0,0,100,0),
+(@PATH,14,172.8151,400.5747,-5.386431,0,0,0,0,100,0),
+(@PATH,15,177.9102,400.0075,-5.386427,0,0,0,0,100,0),
+(@PATH,16,181.755,397.4692,-5.386423,0,0,0,0,100,0),
+(@PATH,17,182.4747,393.0989,-5.386417,0,0,0,0,100,0),
+(@PATH,18,183.0329,388.3197,-5.386411,0,0,0,0,100,0);
+
+DELETE FROM `creature` WHERE `guid` IN (83022,83027,83023,83026);
diff --git a/sql/updates/world/2013_01_02_07_world_waypoints.sql b/sql/updates/world/2013_01_02_07_world_waypoints.sql
new file mode 100644
index 00000000000..b49fd0b28a6
--- /dev/null
+++ b/sql/updates/world/2013_01_02_07_world_waypoints.sql
@@ -0,0 +1,157 @@
+-- Pathing for Hath'ar Necromagus Entry: 28257
+SET @NPC := 104622;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=5019.215,`position_y`=-3688.894,`position_z`=320.5594 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,5019.215,-3688.894,320.5594,0,0,0,100,0),
+(@PATH,2,5002.956,-3658.76,323.2104,0,0,0,100,0),
+(@PATH,3,4992.721,-3643.726,324.9065,0,0,0,100,0),
+(@PATH,4,5002.956,-3658.76,323.2104,0,0,0,100,0),
+(@PATH,5,5019.215,-3688.894,320.5594,0,0,0,100,0),
+(@PATH,6,5019.668,-3703.462,320.5379,0,0,0,100,0);
+
+-- Pathing for Hath'ar Necromagus Entry: 28257
+SET @NPC := 104614;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=5025.362,`position_y`=-3604.257,`position_z`=349.464 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,5025.362,-3604.257,349.464,0,0,0,100,0),
+(@PATH,2,5041.33,-3605.005,352.8885,0,0,0,100,0),
+(@PATH,3,5052.726,-3607.239,355.7938,0,0,0,100,0),
+(@PATH,4,5066.022,-3605.421,360.1152,0,0,0,100,0),
+(@PATH,5,5080.014,-3609.861,362.831,0,0,0,100,0),
+(@PATH,6,5095.403,-3626.727,359.9017,0,0,0,100,0),
+(@PATH,7,5109.978,-3643.893,366.1679,0,0,0,100,0),
+(@PATH,8,5115.737,-3659.64,372.9412,0,0,0,100,0),
+(@PATH,9,5119.728,-3671.96,375.7362,0,0,0,100,0),
+(@PATH,10,5115.737,-3659.64,372.9412,0,0,0,100,0),
+(@PATH,11,5110.043,-3644.025,366.2568,0,0,0,100,0),
+(@PATH,12,5095.57,-3627.037,360.0706,0,0,0,100,0),
+(@PATH,13,5080.014,-3609.861,362.831,0,0,0,100,0),
+(@PATH,14,5066.022,-3605.421,360.1152,0,0,0,100,0),
+(@PATH,15,5052.726,-3607.239,355.7938,0,0,0,100,0),
+(@PATH,16,5041.33,-3605.005,352.8885,0,0,0,100,0);
+
+-- Pathing for Hath'ar Necromagus Entry: 28257
+SET @NPC := 104619;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=5071.903,`position_y`=-3665.457,`position_z`=295.4549 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,5071.903,-3665.457,295.4549,0,0,0,100,0),
+(@PATH,2,5059.392,-3682.827,295.5384,0,0,0,100,0),
+(@PATH,3,5037.78,-3681.667,299.7601,0,0,0,100,0),
+(@PATH,4,5028.569,-3670.129,300.9308,0,0,0,100,0),
+(@PATH,5,5026.874,-3657.909,301.366,0,0,0,100,0),
+(@PATH,6,5035.031,-3642.29,299.8145,0,0,0,100,0),
+(@PATH,7,5053.08,-3636.957,297.5071,0,0,0,100,0),
+(@PATH,8,5067.131,-3644.62,295.7921,0,0,0,100,0);
+
+-- Pathing for Drakuru's Guard Entry: 28803
+SET @NPC := 107821;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6114.339,`position_y`=-2034.41,`position_z`=417.6801 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6114.339,-2034.41,417.6801,0,0,0,100,0),
+(@PATH,2,6129.907,-2060.738,417.5455,0,0,0,100,0),
+(@PATH,3,6144.443,-2073.784,417.6692,0,0,0,100,0),
+(@PATH,4,6171.715,-2080.903,417.5605,0,0,0,100,0),
+(@PATH,5,6185.524,-2080.392,417.5476,0,0,0,100,0),
+(@PATH,6,6171.715,-2080.903,417.5605,0,0,0,100,0),
+(@PATH,7,6144.443,-2073.784,417.6692,0,0,0,100,0),
+(@PATH,8,6129.907,-2060.738,417.5455,0,0,0,100,0);
+
+-- Pathing for Drakuru's Guard Entry: 28803
+SET @NPC := 107817;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6194.729,`position_y`=-2078.011,`position_z`=417.6379 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6194.729,-2078.011,417.6379,0,0,0,100,0),
+(@PATH,2,6217.196,-2064.708,417.5335,0,0,0,100,0),
+(@PATH,3,6232.834,-2048.468,417.6579,0,0,0,100,0),
+(@PATH,4,6240.251,-2020.826,417.5575,0,0,0,100,0),
+(@PATH,5,6238.296,-2002.501,417.7368,0,0,0,100,0),
+(@PATH,6,6240.251,-2020.826,417.5575,0,0,0,100,0),
+(@PATH,7,6232.834,-2048.468,417.6579,0,0,0,100,0),
+(@PATH,8,6217.196,-2064.708,417.5335,0,0,0,100,0);
+
+-- Pathing for Drakuru's Guard Entry: 28803
+SET @NPC := 107836;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6236.967,`position_y`=-1995.491,`position_z`=417.6333 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6236.967,-1995.491,417.6333,0,0,0,100,0),
+(@PATH,2,6228.093,-1980.412,417.5516,0,0,0,100,0),
+(@PATH,3,6215.869,-1967.486,417.5413,0,0,0,100,0),
+(@PATH,4,6196.992,-1955.543,417.5889,0,0,0,100,0),
+(@PATH,5,6174.948,-1953.596,417.5572,0,0,0,100,0),
+(@PATH,6,6164.511,-1955.177,417.5472,0,0,0,100,0),
+(@PATH,7,6174.948,-1953.596,417.5572,0,0,0,100,0),
+(@PATH,8,6196.992,-1955.543,417.5889,0,0,0,100,0),
+(@PATH,9,6215.869,-1967.486,417.5413,0,0,0,100,0),
+(@PATH,10,6228.093,-1980.412,417.5516,0,0,0,100,0);
+
+-- Pathing for Drakuru's Guard Entry: 28803
+SET @NPC := 107821;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6119.209,`position_y`=-1985.834,`position_z`=417.6736 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6119.209,-1985.834,417.6736,0,0,0,100,0),
+(@PATH,2,6109.752,-2008.77,417.5636,0,0,0,100,0),
+(@PATH,3,6113.512,-2033.001,417.7308,0,0,0,100,0),
+(@PATH,4,6109.752,-2008.77,417.5636,0,0,0,100,0);
+
+-- Pathing for Drakuru's Guard Entry: 28803
+SET @NPC := 107837;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6194.729,`position_y`=-2078.011,`position_z`=417.6379 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6194.729,-2078.011,417.6379,0,0,0,100,0),
+(@PATH,2,6217.196,-2064.708,417.5335,0,0,0,100,0),
+(@PATH,3,6232.834,-2048.468,417.6579,0,0,0,100,0),
+(@PATH,4,6240.251,-2020.826,417.5575,0,0,0,100,0),
+(@PATH,5,6238.296,-2002.501,417.7368,0,0,0,100,0),
+(@PATH,6,6240.251,-2020.826,417.5575,0,0,0,100,0),
+(@PATH,7,6232.834,-2048.468,417.6579,0,0,0,100,0),
+(@PATH,8,6217.196,-2064.708,417.5335,0,0,0,100,0);
+
+-- Pathing for Shalewing Guard Entry: 28879
+SET @NPC := 115429;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6184.199,`position_y`=-1985.717,`position_z`=434.6442 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6184.199,-1985.717,434.6442,0,0,0,100,0),
+(@PATH,2,6205.602,-1997.712,423.9775,0,0,0,100,0),
+(@PATH,3,6209.002,-2021.652,426.0051,0,0,0,100,0),
+(@PATH,4,6191.328,-2043.418,431.6164,0,0,0,100,0),
+(@PATH,5,6172.321,-2047.748,423.9775,0,0,0,100,0),
+(@PATH,6,6159.705,-2039.765,423.9775,0,0,0,100,0),
+(@PATH,7,6151.034,-2030.29,423.9775,0,0,0,100,0),
+(@PATH,8,6148.249,-2012.318,427.6442,0,0,0,100,0),
+(@PATH,9,6160.55,-1991.355,423.9775,0,0,0,100,0);
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp
index 14839196da8..31e49e4b8d3 100644
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -130,7 +130,6 @@ void PetAI::UpdateAI(const uint32 diff)
}
else
HandleReturnMovement();
-
}
// Autocast (casted only in combat or persistent spells in any state)
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index 81e32a2f8b6..a3cb57b3332 100644
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -162,6 +162,28 @@ void UnitAI::DoCast(uint32 spellId)
me->CastSpell(target, spellId, false);
}
+void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
+{
+ if (!victim || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
+ return;
+
+ me->CastSpell(victim, spellId, triggered);
+}
+
+void UnitAI::DoCastVictim(uint32 spellId, bool triggered)
+{
+ // Why don't we check for casting unit_state and existing target as we do in DoCast(.. ?
+ me->CastSpell(me->getVictim(), spellId, triggered);
+}
+
+void UnitAI::DoCastAOE(uint32 spellId, bool triggered)
+{
+ if (!triggered && me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ me->CastSpell((Unit*)NULL, spellId, triggered);
+}
+
#define UPDATE_TARGET(a) {if (AIInfo->target<a) AIInfo->target=a;}
void UnitAI::FillAISpellInfo()
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 8491a055516..427818fe571 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -174,3 +174,91 @@ void CreatureAI::EnterEvadeMode()
if (!me->getVictim())
AttackStart(attacker);
}*/
+
+void CreatureAI::SetGazeOn(Unit* target)
+{
+ if (me->IsValidAttackTarget(target))
+ {
+ AttackStart(target);
+ me->SetReactState(REACT_PASSIVE);
+ }
+}
+
+bool CreatureAI::UpdateVictimWithGaze()
+{
+ if (!me->isInCombat())
+ return false;
+
+ if (me->HasReactState(REACT_PASSIVE))
+ {
+ if (me->getVictim())
+ return true;
+ else
+ me->SetReactState(REACT_AGGRESSIVE);
+ }
+
+ if (Unit* victim = me->SelectVictim())
+ AttackStart(victim);
+ return me->getVictim();
+}
+
+bool CreatureAI::UpdateVictim()
+{
+ if (!me->isInCombat())
+ return false;
+
+ if (!me->HasReactState(REACT_PASSIVE))
+ {
+ if (Unit* victim = me->SelectVictim())
+ AttackStart(victim);
+ return me->getVictim();
+ }
+ else if (me->getThreatManager().isThreatListEmpty())
+ {
+ EnterEvadeMode();
+ return false;
+ }
+
+ return true;
+}
+
+bool CreatureAI::_EnterEvadeMode()
+{
+ if (!me->isAlive())
+ return false;
+
+ // dont remove vehicle auras, passengers arent supposed to drop off the vehicle
+ me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE);
+
+ // sometimes bosses stuck in combat?
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ me->LoadCreaturesAddon();
+ me->SetLootRecipient(NULL);
+ me->ResetPlayerDamageReq();
+
+ if (me->IsInEvadeMode())
+ return false;
+
+ return true;
+}
+
+Creature* CreatureAI::DoSummon(uint32 entry, const Position& pos, uint32 despawnTime, TempSummonType summonType)
+{
+ return me->SummonCreature(entry, pos, summonType, despawnTime);
+}
+
+Creature* CreatureAI::DoSummon(uint32 entry, WorldObject* obj, float radius, uint32 despawnTime, TempSummonType summonType)
+{
+ Position pos;
+ obj->GetRandomNearPosition(pos, radius);
+ return me->SummonCreature(entry, pos, summonType, despawnTime);
+}
+
+Creature* CreatureAI::DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius, uint32 despawnTime, TempSummonType summonType)
+{
+ Position pos;
+ obj->GetRandomNearPosition(pos, radius);
+ pos.m_positionZ += flightZ;
+ return me->SummonCreature(entry, pos, summonType, despawnTime);
+}
diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h
index f3e32b6033d..559240c4a3f 100644
--- a/src/server/game/AI/CreatureAIImpl.h
+++ b/src/server/game/AI/CreatureAIImpl.h
@@ -540,115 +540,5 @@ struct AISpellInfoType
AISpellInfoType* GetAISpellInfo(uint32 i);
-inline void CreatureAI::SetGazeOn(Unit* target)
-{
- if (me->IsValidAttackTarget(target))
- {
- AttackStart(target);
- me->SetReactState(REACT_PASSIVE);
- }
-}
-
-inline bool CreatureAI::UpdateVictimWithGaze()
-{
- if (!me->isInCombat())
- return false;
-
- if (me->HasReactState(REACT_PASSIVE))
- {
- if (me->getVictim())
- return true;
- else
- me->SetReactState(REACT_AGGRESSIVE);
- }
-
- if (Unit* victim = me->SelectVictim())
- AttackStart(victim);
- return me->getVictim();
-}
-
-inline bool CreatureAI::UpdateVictim()
-{
- if (!me->isInCombat())
- return false;
-
- if (!me->HasReactState(REACT_PASSIVE))
- {
- if (Unit* victim = me->SelectVictim())
- AttackStart(victim);
- return me->getVictim();
- }
- else if (me->getThreatManager().isThreatListEmpty())
- {
- EnterEvadeMode();
- return false;
- }
-
- return true;
-}
-
-inline bool CreatureAI::_EnterEvadeMode()
-{
- if (!me->isAlive())
- return false;
-
- // dont remove vehicle auras, passengers arent supposed to drop off the vehicle
- me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE);
-
- // sometimes bosses stuck in combat?
- me->DeleteThreatList();
- me->CombatStop(true);
- me->LoadCreaturesAddon();
- me->SetLootRecipient(NULL);
- me->ResetPlayerDamageReq();
-
- if (me->IsInEvadeMode())
- return false;
-
- return true;
-}
-
-inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
-{
- if (!victim || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
- return;
-
- me->CastSpell(victim, spellId, triggered);
-}
-
-inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered)
-{
- // Why don't we check for casting unit_state and existing target as we do in DoCast(.. ?
- me->CastSpell(me->getVictim(), spellId, triggered);
-}
-
-inline void UnitAI::DoCastAOE(uint32 spellId, bool triggered)
-{
- if (!triggered && me->HasUnitState(UNIT_STATE_CASTING))
- return;
-
- me->CastSpell((Unit*)NULL, spellId, triggered);
-}
-
-inline Creature* CreatureAI::DoSummon(uint32 entry, const Position& pos, uint32 despawnTime, TempSummonType summonType)
-{
- return me->SummonCreature(entry, pos, summonType, despawnTime);
-}
-
-inline Creature* CreatureAI::DoSummon(uint32 entry, WorldObject* obj, float radius, uint32 despawnTime, TempSummonType summonType)
-{
- Position pos;
- obj->GetRandomNearPosition(pos, radius);
- return me->SummonCreature(entry, pos, summonType, despawnTime);
-}
-
-inline Creature* CreatureAI::DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius, uint32 despawnTime, TempSummonType summonType)
-{
- Position pos;
- obj->GetRandomNearPosition(pos, radius);
- pos.m_positionZ += flightZ;
- return me->SummonCreature(entry, pos, summonType, despawnTime);
-}
-
#endif
diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h
index 647386e0f75..e41716dde36 100644
--- a/src/server/game/Entities/Object/ObjectDefines.h
+++ b/src/server/game/Entities/Object/ObjectDefines.h
@@ -187,13 +187,12 @@ bool IS_GROUP_GUID(uint64 guid)
uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h)
{
- return uint64(uint64(l) | (uint64(e) << 32) | (uint64(h) << (h == HIGHGUID_CORPSE) ? 48 : 52));
+ return uint64(uint64(l) | (uint64(e) << 24) | (uint64(h) << 48));
}
uint32 GUID_HIPART(uint64 guid)
{
- uint32 t = ((uint64(guid) >> 48) & 0x0000FFFF);
- return (t == HIGHGUID_CORPSE) ? t : ((t >> 4) & 0x00000FFF);
+ return (uint32)((uint64(guid) >> 48) & 0x0000FFFF);
}
uint32 GUID_ENPART(uint64 x)
@@ -205,8 +204,9 @@ uint32 GUID_ENPART(uint64 x)
uint32 GUID_LOPART(uint64 x)
{
- // _GUID_LOPART_3 and _GUID_LOPART_2 were both equal to PAIR64_LOPART
- return PAIR64_LOPART(x);
+ return IsGuidHaveEnPart(x)
+ ? ((uint32)(x & UI64LIT(0x00000000FFFFFFFF)))
+ : ((uint32)(x & UI64LIT(0x0000000000FFFFFF)));
}
bool IsGuidHaveEnPart(uint64 guid)
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 1a2818c9af2..8732d562bc3 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -820,10 +820,10 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
for (uint32 j = effIndex + 1; j < MAX_SPELL_EFFECTS; ++j)
{
SpellEffectInfo const* effects = GetSpellInfo()->Effects;
- if (effects[effIndex].TargetA.GetTarget() == effects[j].TargetA.GetTarget()
- && effects[effIndex].TargetB.GetTarget() == effects[j].TargetB.GetTarget()
- && effects[effIndex].ImplicitTargetConditions == effects[j].ImplicitTargetConditions
- && effects[effIndex].CalcRadius(m_caster) == effects[j].CalcRadius(m_caster))
+ if (effects[effIndex].TargetA.GetTarget() == effects[j].TargetA.GetTarget() &&
+ effects[effIndex].TargetB.GetTarget() == effects[j].TargetB.GetTarget() &&
+ effects[effIndex].ImplicitTargetConditions == effects[j].ImplicitTargetConditions &&
+ effects[effIndex].CalcRadius(m_caster) == effects[j].CalcRadius(m_caster))
{
effectMask |= 1 << j;
}
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
index 19b717fa6ea..85a113ec495 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
@@ -70,9 +70,9 @@ public:
return new boss_vexallusAI (creature);
};
- struct boss_vexallusAI : public ScriptedAI
+ struct boss_vexallusAI : public BossAI
{
- boss_vexallusAI(Creature* creature) : ScriptedAI(creature)
+ boss_vexallusAI(Creature* creature) : BossAI(creature, DATA_VEXALLUS_EVENT)
{
instance = creature->GetInstanceScript();
}
@@ -87,6 +87,7 @@ public:
void Reset()
{
+ summons.DespawnAll();
ChainLightningTimer = 8000;
ArcaneShockTimer = 5000;
OverloadTimer = 1200;
@@ -104,6 +105,7 @@ public:
void JustDied(Unit* /*killer*/)
{
+ summons.DespawnAll();
if (instance)
instance->SetData(DATA_VEXALLUS_EVENT, DONE);
}
@@ -206,7 +208,10 @@ public:
struct mob_pure_energyAI : public ScriptedAI
{
- mob_pure_energyAI(Creature* creature) : ScriptedAI(creature) {}
+ mob_pure_energyAI(Creature* creature) : ScriptedAI(creature)
+ {
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
+ }
void Reset() {}
diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp
index 3256c3c9db3..86010e61686 100644
--- a/src/server/shared/Database/PreparedStatement.cpp
+++ b/src/server/shared/Database/PreparedStatement.cpp
@@ -33,7 +33,7 @@ void PreparedStatement::BindParameters()
{
ASSERT (m_stmt);
- uint32 i = 0;
+ uint8 i = 0;
for (; i < statement_data.size(); i++)
{
switch (statement_data[i].type)
@@ -241,7 +241,7 @@ void MySQLPreparedStatement::ClearParameters()
}
}
-static bool ParementerIndexAssertFail(uint32 stmtIndex, uint8 index, uint32 paramCount)
+static bool ParamenterIndexAssertFail(uint32 stmtIndex, uint8 index, uint32 paramCount)
{
sLog->outError(LOG_FILTER_SQL_DRIVER, "Attempted to bind parameter %u%s on a PreparedStatement %u (statement has only %u parameters)", uint32(index) + 1, (index == 1 ? "st" : (index == 2 ? "nd" : (index == 3 ? "rd" : "nd"))), stmtIndex, paramCount);
return false;
@@ -250,7 +250,7 @@ static bool ParementerIndexAssertFail(uint32 stmtIndex, uint8 index, uint32 para
//- Bind on mysql level
bool MySQLPreparedStatement::CheckValidIndex(uint8 index)
{
- ASSERT(index < m_paramCount || ParementerIndexAssertFail(m_stmt->m_index, index, m_paramCount));
+ ASSERT(index < m_paramCount || ParamenterIndexAssertFail(m_stmt->m_index, index, m_paramCount));
if (m_paramsSet[index])
sLog->outWarn(LOG_FILTER_SQL, "[WARNING] Prepared Statement (id: %u) trying to bind value on already bound index (%u).", m_stmt->m_index, index);
@@ -386,7 +386,7 @@ void MySQLPreparedStatement::setValue(MYSQL_BIND* param, enum_field_types type,
memcpy(param->buffer, value, len);
}
-std::string MySQLPreparedStatement::getQueryString(std::string const &sqlPattern) const
+std::string MySQLPreparedStatement::getQueryString(std::string const& sqlPattern) const
{
std::string queryString = sqlPattern;
diff --git a/src/server/shared/Database/PreparedStatement.h b/src/server/shared/Database/PreparedStatement.h
index 9334bc6dc66..2cab6e40de0 100644
--- a/src/server/shared/Database/PreparedStatement.h
+++ b/src/server/shared/Database/PreparedStatement.h
@@ -135,7 +135,7 @@ class MySQLPreparedStatement
PreparedStatement* m_stmt;
void ClearParameters();
bool CheckValidIndex(uint8 index);
- std::string getQueryString(std::string const &sqlPattern) const;
+ std::string getQueryString(std::string const& sqlPattern) const;
private:
void setValue(MYSQL_BIND* param, enum_field_types type, const void* value, uint32 len, bool isUnsigned);