Files
moonwell-core-vanilla/sql/migrations/20230726202837_world.sql
T
ratkosrb 4835f619dc Add cyclic movement generator.
Movement type 3 is for flying creatures that send their whole path in a single SMSG_MONSTER_MOVE packet. It does not support other waypoint features like wait time and script id.
2023-07-27 01:12:04 +03:00

300 lines
13 KiB
SQL

DROP PROCEDURE IF EXISTS add_migration;
delimiter ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20230726202837');
IF v=0 THEN
INSERT INTO `migrations` VALUES ('20230726202837');
-- Add your query below.
-- Update movement types above waypoint as cyclic has been inserted after it in the enum.
UPDATE `creature_ai_scripts` SET `datalong`=`datalong`+1 WHERE `command`=20 && `datalong`>2;
UPDATE `creature_movement_scripts` SET `datalong`=`datalong`+1 WHERE `command`=20 && `datalong`>2;
UPDATE `creature_spells_scripts` SET `datalong`=`datalong`+1 WHERE `command`=20 && `datalong`>2;
UPDATE `event_scripts` SET `datalong`=`datalong`+1 WHERE `command`=20 && `datalong`>2;
UPDATE `generic_scripts` SET `datalong`=`datalong`+1 WHERE `command`=20 && `datalong`>2;
UPDATE `gossip_scripts` SET `datalong`=`datalong`+1 WHERE `command`=20 && `datalong`>2;
UPDATE `gameobject_scripts` SET `datalong`=`datalong`+1 WHERE `command`=20 && `datalong`>2;
UPDATE `spell_scripts` SET `datalong`=`datalong`+1 WHERE `command`=20 && `datalong`>2;
UPDATE `quest_end_scripts` SET `datalong`=`datalong`+1 WHERE `command`=20 && `datalong`>2;
UPDATE `quest_start_scripts` SET `datalong`=`datalong`+1 WHERE `command`=20 && `datalong`>2;
UPDATE `creature_ai_events` SET `event_param1`=`event_param1`+1 WHERE `event_type`=29 && `event_param1`>2;
-- Assign cyclic movement to these creatures.
UPDATE `creature` SET `movement_type`=3 WHERE `guid` IN (3343, 3344, 92881);
-- These should not use cyclic movement.
UPDATE `creature` SET `movement_type`=0 WHERE `guid` IN (40486, 40483);
-- Correct waypoints for Highperch Soarer.
UPDATE `creature` SET `position_x`=-5158.27, `position_y`=-1187.78, `position_z`=77.0217, `orientation`=1.39548, `movement_type`=3 WHERE `guid`=21708;
DELETE FROM `creature_movement` WHERE `id`=21708;
INSERT INTO `creature_movement` (`id`, `point`, `position_x`, `position_y`, `position_z`) VALUES
(21708, 1, -5155.99, -1199.75, 81.4902),
(21708, 2, -5166.31, -1220.04, 81.7681),
(21708, 3, -5170.55, -1226.35, 76.7123),
(21708, 4, -5178.02, -1237.04, 72.4347),
(21708, 5, -5190.3, -1239.18, 71.9069),
(21708, 6, -5215.8, -1225.13, 69.768),
(21708, 7, -5221.52, -1209.39, 67.7957),
(21708, 8, -5219.37, -1194.92, 67.1569),
(21708, 9, -5209.85, -1187.22, 65.9624),
(21708, 10, -5194.89, -1188.92, 70.7124),
(21708, 11, -5181.05, -1199.33, 60.2957),
(21708, 12, -5158.85, -1213.6, 57.6291),
(21708, 13, -5122.13, -1222.28, 42.4624),
(21708, 14, -5110.99, -1230.77, 15.3235),
(21708, 15, -5084.67, -1227.63, -11.8154),
(21708, 16, -5065.28, -1209.69, -34.8986),
(21708, 17, -5052.48, -1181.26, -39.4265),
(21708, 18, -5025.06, -1165.29, -32.5653),
(21708, 19, -5004.28, -1140.43, -38.3154),
(21708, 20, -4984.81, -1123.68, -38.1764),
(21708, 21, -4971.48, -1109.78, -38.1764),
(21708, 22, -4949.74, -1096.3, -32.4263),
(21708, 23, -4927.95, -1090.27, -24.843),
(21708, 24, -4909.84, -1080.73, -14.0652),
(21708, 25, -4914.71, -1066.64, -7.89855),
(21708, 26, -4927.92, -1056.95, -3.35201),
(21708, 27, -4942.7, -1055.22, 8.22042),
(21708, 28, -4951.95, -1049.14, 14.6255),
(21708, 29, -4960.18, -1028.92, 20.0332),
(21708, 30, -4970.47, -1008.43, 22.0888),
(21708, 31, -4980.97, -992.967, 23.4285),
(21708, 32, -4993.73, -980.054, 23.7592),
(21708, 33, -5012.75, -967.938, 24.0925),
(21708, 34, -5032.86, -971.138, 30.9258),
(21708, 35, -5052.13, -982.109, 39.0092),
(21708, 36, -5060.67, -991.191, 52.2871),
(21708, 37, -5072.28, -1008.99, 67.8427),
(21708, 38, -5090.26, -1005.56, 79.1867),
(21708, 39, -5106.01, -1004.31, 73.8841);
-- Correct waypoints for Highperch Soarer.
UPDATE `creature` SET `position_x`=-5132.25, `position_y`=-872.822, `position_z`=54.5155, `orientation`=3.1685, `movement_type`=3, `wander_distance`=0 WHERE `guid`=21707;
DELETE FROM `creature_movement` WHERE `id`=21707;
INSERT INTO `creature_movement` (`id`, `point`, `position_x`, `position_y`, `position_z`) VALUES
(21707, 1, -5126.78, -872.288, 59.3036),
(21707, 2, -5116.18, -894.691, 72.4981),
(21707, 3, -5095.89, -913.899, 53.4702),
(21707, 4, -5061.48, -926.323, 59.4147),
(21707, 5, -5031.17, -928.031, 63.3591),
(21707, 6, -5009.09, -920.385, 63.3591),
(21707, 7, -5003.4, -923.492, 63.3591),
(21707, 8, -4995.11, -928.877, 63.3591),
(21707, 9, -4961.05, -947.889, 63.3591),
(21707, 10, -4940.46, -957.058, 63.3591),
(21707, 11, -4929.92, -961.364, 50.7202);
-- Correct waypoints for Brood of Nozdormu.
UPDATE `creature` SET `position_x`=-6132.55, `position_y`=1194.44, `position_z`=231.859, `movement_type`=3, `wander_distance`=0 WHERE `guid`=42902;
DELETE FROM `creature_movement` WHERE `id`=42902;
INSERT INTO `creature_movement` (`id`, `point`, `position_x`, `position_y`, `position_z`) VALUES
(42902, 1, -6132.55, 1194.44, 231.859),
(42902, 2, -6148.33, 1190.85, 231.859),
(42902, 3, -6164.12, 1187.26, 231.859),
(42902, 4, -6181.24, 1179.72, 231.859),
(42902, 5, -6202.71, 1172.04, 231.859),
(42902, 6, -6229.83, 1168.33, 231.859),
(42902, 7, -6263.18, 1166.63, 231.859),
(42902, 8, -6290.23, 1166.51, 231.859),
(42902, 9, -6327.19, 1160.1, 231.859),
(42902, 10, -6365.29, 1153.61, 231.859),
(42902, 11, -6402.69, 1145.36, 231.859),
(42902, 12, -6436.51, 1126.72, 231.859),
(42902, 13, -6454.31, 1100.34, 231.859),
(42902, 14, -6475.01, 1072.5, 231.859),
(42902, 15, -6471.49, 1038.5, 231.859),
(42902, 16, -6485.88, 1007.71, 231.859),
(42902, 17, -6483.45, 969.669, 231.859),
(42902, 18, -6479.12, 928.468, 231.859),
(42902, 19, -6504.58, 907.092, 231.859),
(42902, 20, -6530.07, 882.316, 231.859),
(42902, 21, -6546.84, 843.153, 231.859),
(42902, 22, -6582.23, 820.957, 231.859),
(42902, 23, -6630.23, 809.253, 231.859),
(42902, 24, -6643.11, 825.063, 231.859),
(42902, 25, -6666.29, 844.62, 231.859),
(42902, 26, -6699.39, 870.621, 231.859),
(42902, 27, -6739.93, 892.456, 231.859),
(42902, 28, -6772.28, 898.783, 231.859),
(42902, 29, -6799.12, 906.09, 231.859),
(42902, 30, -6824.03, 909.751, 231.859),
(42902, 31, -6868.83, 916.167, 231.859),
(42902, 32, -6898.51, 901.309, 231.859),
(42902, 33, -6927.8, 870.07, 231.859),
(42902, 34, -6929.24, 837.958, 231.859),
(42902, 35, -6919.74, 807.285, 231.859),
(42902, 36, -6922.18, 775.308, 231.859),
(42902, 37, -6923.05, 742.136, 231.859),
(42902, 38, -6936.97, 706.052, 231.859),
(42902, 39, -6946, 685.331, 231.859),
(42902, 40, -6961.72, 661.689, 231.859),
(42902, 41, -6961.5, 646.29, 231.859),
(42902, 42, -6984.71, 618.989, 231.859),
(42902, 43, -7015.65, 596.539, 231.859),
(42902, 44, -7056.5, 593.22, 231.859),
(42902, 45, -7094.11, 608.767, 231.859),
(42902, 46, -7123.3, 623.996, 231.859),
(42902, 47, -7160.38, 652.129, 231.859),
(42902, 48, -7182.17, 684.455, 231.859),
(42902, 49, -7198.16, 714.692, 231.859),
(42902, 50, -7191.9, 741.369, 231.859),
(42902, 51, -7193.42, 748.352, 231.859),
(42902, 52, -7184.94, 770.472, 231.859),
(42902, 53, -7169.55, 792.322, 231.859),
(42902, 54, -7149.72, 818.153, 231.859),
(42902, 55, -7119.2, 842.394, 231.859),
(42902, 56, -7083.8, 860.16, 231.859),
(42902, 57, -7049.62, 868.486, 231.859),
(42902, 58, -7014.33, 859.917, 231.859),
(42902, 59, -6975.03, 851.771, 231.859),
(42902, 60, -6943.59, 828.714, 231.859),
(42902, 61, -6923.84, 802.551, 231.859),
(42902, 62, -6907.14, 780.131, 231.859),
(42902, 63, -6897.62, 755.048, 231.859),
(42902, 64, -6879.37, 728.623, 218.359),
(42902, 65, -6861.75, 717.885, 204.193),
(42902, 66, -6842.95, 713.493, 192.693),
(42902, 67, -6816.38, 709.887, 192.526),
(42902, 68, -6791.06, 709.856, 177.165),
(42902, 69, -6754.53, 723.85, 158.665),
(42902, 70, -6730.09, 739.688, 148.304),
(42902, 71, -6688.22, 763.253, 148.86),
(42902, 72, -6675.4, 772.873, 151.915),
(42902, 73, -6673.23, 786.264, 151.026),
(42902, 74, -6677.67, 798.919, 147.748),
(42902, 75, -6689.31, 818.305, 150.082),
(42902, 76, -6700.25, 835.345, 151.165),
(42902, 77, -6717.07, 837.324, 155.915),
(42902, 78, -6750.5, 824.896, 150.359),
(42902, 79, -6770.18, 814.583, 158.026),
(42902, 80, -6785.5, 798.543, 166.609),
(42902, 81, -6793.43, 773.484, 181.276),
(42902, 82, -6783.2, 732.933, 191.221),
(42902, 83, -6745.8, 711.179, 215.054),
(42902, 84, -6700.34, 725.113, 231.859),
(42902, 85, -6668.33, 741.267, 231.859),
(42902, 86, -6637.22, 756.75, 231.859),
(42902, 87, -6616.62, 770.323, 231.859),
(42902, 88, -6590.55, 788.055, 231.859),
(42902, 89, -6550.62, 812.543, 231.859),
(42902, 90, -6551.32, 827.29, 231.859),
(42902, 91, -6547.47, 848.693, 231.859),
(42902, 92, -6544.7, 872.062, 231.859),
(42902, 93, -6548.17, 894.387, 231.859),
(42902, 94, -6555.55, 921.146, 231.859),
(42902, 95, -6559.9, 951.207, 231.859),
(42902, 96, -6562.2, 995.147, 231.859),
(42902, 97, -6551.02, 1016.8, 231.859),
(42902, 98, -6536.71, 1042.54, 231.859),
(42902, 99, -6515.35, 1071.74, 231.859),
(42902, 100, -6504.1, 1097.51, 231.859),
(42902, 101, -6501.53, 1125.14, 231.859),
(42902, 102, -6483.63, 1138.02, 231.859),
(42902, 103, -6455.69, 1149.08, 231.859),
(42902, 104, -6421.1, 1146.83, 231.859),
(42902, 105, -6394.14, 1130.65, 231.859),
(42902, 106, -6362.81, 1113.94, 231.859),
(42902, 107, -6343.09, 1102.28, 231.859),
(42902, 108, -6318.23, 1088.11, 231.859),
(42902, 109, -6304.54, 1073.27, 231.859),
(42902, 110, -6287.23, 1073.55, 231.859),
(42902, 111, -6258.2, 1079.39, 231.859),
(42902, 112, -6227.41, 1097.12, 231.859),
(42902, 113, -6203.53, 1107.35, 231.859),
(42902, 114, -6181.97, 1115.24, 231.859),
(42902, 115, -6159.23, 1117.19, 231.859),
(42902, 116, -6137.22, 1130.4, 231.859),
(42902, 117, -6119.23, 1148.29, 231.859),
(42902, 118, -6112.39, 1173.68, 231.859),
(42902, 119, -6108.86, 1209.77, 231.859),
(42902, 120, -6121, 1215.51, 231.859),
(42902, 121, -6133.96, 1215.93, 231.859),
(42902, 122, -6148.33, 1190.85, 231.859),
(42902, 123, -6148.33, 1190.85, 231.859);
-- Correct waypoints for Brood of Nozdormu.
UPDATE `creature` SET `position_x`=-8147.35, `position_y`=1110.34, `position_z`=130.326, `movement_type`=3, `wander_distance`=0 WHERE `guid`=42900;
DELETE FROM `creature_movement` WHERE `id`=42900;
INSERT INTO `creature_movement` (`id`, `point`, `position_x`, `position_y`, `position_z`) VALUES
(42900, 1, -8147.35, 1110.34, 130.326),
(42900, 2, -8125.84, 1123.07, 130.326),
(42900, 3, -8104.6, 1135.43, 130.326),
(42900, 4, -8081.43, 1151.94, 130.326),
(42900, 5, -8046.5, 1175.41, 130.326),
(42900, 6, -8028.07, 1192.39, 130.326),
(42900, 7, -8006.2, 1202.83, 130.326),
(42900, 8, -7995.38, 1208.58, 130.326),
(42900, 9, -7986.86, 1223.25, 130.326),
(42900, 10, -7973.46, 1242.27, 130.326),
(42900, 11, -7967.57, 1262.46, 130.326),
(42900, 12, -7954.08, 1292.86, 130.326),
(42900, 13, -7951.33, 1311.9, 130.326),
(42900, 14, -7949.03, 1323.07, 130.326),
(42900, 15, -7940.65, 1356.12, 130.326),
(42900, 16, -7943.67, 1377.11, 130.326),
(42900, 17, -7945.43, 1398.93, 130.326),
(42900, 18, -7947.1, 1422.75, 130.326),
(42900, 19, -7946.36, 1451, 130.326),
(42900, 20, -7938.27, 1473.98, 130.326),
(42900, 21, -7943.05, 1503.94, 130.326),
(42900, 22, -7926.72, 1530.71, 130.326),
(42900, 23, -7920.12, 1572.31, 130.326),
(42900, 24, -7929.45, 1601.54, 130.326),
(42900, 25, -7932.94, 1648.54, 130.326),
(42900, 26, -7945.87, 1667.05, 130.326),
(42900, 27, -7939.4, 1691.4, 130.326),
(42900, 28, -7919.91, 1722.39, 130.326),
(42900, 29, -7923.83, 1761.65, 130.326),
(42900, 30, -7944.76, 1781.04, 130.326),
(42900, 31, -7961.6, 1790.97, 130.326),
(42900, 32, -7978.42, 1786.22, 130.326),
(42900, 33, -7986.01, 1772.08, 130.326),
(42900, 34, -7997.43, 1746.59, 130.326),
(42900, 35, -8013.44, 1736.98, 130.326),
(42900, 36, -8037.54, 1725.18, 130.326),
(42900, 37, -8044.47, 1702.88, 130.326),
(42900, 38, -8042.43, 1684.66, 130.326),
(42900, 39, -8029.89, 1662.23, 130.326),
(42900, 40, -8039.08, 1641.3, 130.326),
(42900, 41, -8056.28, 1624.56, 130.326),
(42900, 42, -8080.25, 1613.33, 130.326),
(42900, 43, -8090.12, 1598.15, 130.326),
(42900, 44, -8096.72, 1572.87, 130.326),
(42900, 45, -8099.74, 1549.02, 130.326),
(42900, 46, -8093.52, 1527.82, 130.326),
(42900, 47, -8081.68, 1509.06, 130.326),
(42900, 48, -8068.8, 1493.95, 130.326),
(42900, 49, -8075.57, 1470.47, 130.326),
(42900, 50, -8076.99, 1445.66, 130.326),
(42900, 51, -8078.25, 1426.36, 130.326),
(42900, 52, -8082.23, 1398.92, 130.326),
(42900, 53, -8076.23, 1371.59, 130.326),
(42900, 54, -8068.81, 1346.38, 130.326),
(42900, 55, -8065.87, 1320.74, 130.326),
(42900, 56, -8071.77, 1311.94, 130.326),
(42900, 57, -8069.73, 1292.72, 130.326),
(42900, 58, -8068.56, 1264.88, 130.326),
(42900, 59, -8066.9, 1244.61, 130.326),
(42900, 60, -8069.33, 1202.92, 130.326),
(42900, 61, -8081.82, 1185.17, 130.326),
(42900, 62, -8100.44, 1166.67, 130.326),
(42900, 63, -8115.23, 1151.11, 130.326),
(42900, 64, -8125.38, 1154.28, 130.326),
(42900, 65, -8138.5, 1150.57, 136.409),
(42900, 66, -8144.81, 1139.19, 142.576),
(42900, 67, -8164.84, 1122.41, 144.548),
(42900, 68, -8181.75, 1096.81, 141.187),
(42900, 69, -8169.55, 1088.01, 133.965),
(42900, 70, -8149.75, 1103.94, 131.465);
-- End of migration.
END IF;
END??
delimiter ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;