From 3379eefa302147749aa6625b04b5f3b460873ee4 Mon Sep 17 00:00:00 2001 From: Frankie-hz <105882754+Frankie-hz@users.noreply.github.com> Date: Thu, 23 Jan 2025 20:07:25 -0500 Subject: [PATCH] Setup system to move nm spawn points to lua Sets up system to move nm spawn points to lua Fixes an issue with respawn timers not working onMobInitialize --- scripts/globals/mobs.lua | 24 ++++- scripts/zones/Attohwa_Chasm/Zone.lua | 3 - scripts/zones/Attohwa_Chasm/mobs/Tiamat.lua | 60 ++++++++++- .../zones/Valkurm_Dunes/mobs/Damselfly.lua | 58 +++++++++- sql/mob_groups.sql | 12 +-- sql/nm_spawn_points.sql | 100 ------------------ src/map/utils/zoneutils.cpp | 5 + 7 files changed, 150 insertions(+), 112 deletions(-) diff --git a/scripts/globals/mobs.lua b/scripts/globals/mobs.lua index cfa31fd606a..ca3fda6abe7 100644 --- a/scripts/globals/mobs.lua +++ b/scripts/globals/mobs.lua @@ -31,6 +31,21 @@ local function lotteryPrimed(phList) return false end +xi.mob.updateNMSpawnPoint = function(mob, spawnPoints) + -- This function is used to replace UpdateNMSpawnPoints() inside the Zone.lua files and the NM despawn scripts + -- Once UpdateNMSpawnPoints() is no longer used, this note can be removed + -- Spawnpoints is a table of {x = , y = , z = } + if spawnPoints ~= nil and #spawnPoints > 0 then + local chosenSpawn = utils.randomEntry(spawnPoints) + local randomRotation = math.random(0, 255) -- rotation does not matter + + -- Updates the mob's spawn point + mob:setSpawn(chosenSpawn.x, chosenSpawn.y, chosenSpawn.z, randomRotation) + else + printf('No spawn points defined for mob %s (%u) in spawnPoints.', mob:getName(), mob:getID()) + end +end + -- potential lottery placeholder was killed xi.mob.phOnDespawn = function(ph, phList, chance, cooldown, params) params = params or {} @@ -38,6 +53,7 @@ xi.mob.phOnDespawn = function(ph, phList, chance, cooldown, params) params.immediate = true pop NM without waiting for next PH pop time params.nightOnly = true spawn NM only at night time params.noPosUpdate = true do not run UpdateNMSpawnPoint() + params.spawnPoints = {x = , y = , z = } table of spawn points to choose from ]] if type(params.immediate) ~= 'boolean' then @@ -94,8 +110,14 @@ xi.mob.phOnDespawn = function(ph, phList, chance, cooldown, params) DisallowRespawn(phId, true) DisallowRespawn(nmId, false) + -- This is a temporary solution until all NMs have been updated to use params.spawnPoints and moved out of sql + if params.spawnPoints then + xi.mob.updateNMSpawnPoint(nm, params.spawnPoints) + params.noPosUpdate = true -- If we have a table of spawn points, we don't need to run UpdateNMSpawnPoint() + end + if not params.noPosUpdate then - UpdateNMSpawnPoint(nmId) + UpdateNMSpawnPoint(nmId) -- This needs to stay here until all NMs have been updated to use params.spawnPoints and moved out of sql end -- if params.immediate is true, spawn the nm params.immediately (1ms) else use placeholder's timer diff --git a/scripts/zones/Attohwa_Chasm/Zone.lua b/scripts/zones/Attohwa_Chasm/Zone.lua index 225a5e0d8f6..7a2e94ceaf9 100644 --- a/scripts/zones/Attohwa_Chasm/Zone.lua +++ b/scripts/zones/Attohwa_Chasm/Zone.lua @@ -39,9 +39,6 @@ zoneObject.onInitialize = function(zone) zone:registerTriggerArea(29, -238, 5, -118, 0, 0, 0) zone:registerTriggerArea(30, -385.349, 5, -173.973, 0, 0, 0) - UpdateNMSpawnPoint(ID.mob.TIAMAT) - GetMobByID(ID.mob.TIAMAT):setRespawnTime(math.random(86400, 259200)) - xi.helm.initZone(zone, xi.helmType.EXCAVATION) end diff --git a/scripts/zones/Attohwa_Chasm/mobs/Tiamat.lua b/scripts/zones/Attohwa_Chasm/mobs/Tiamat.lua index b4ebc302143..d291c55853e 100644 --- a/scripts/zones/Attohwa_Chasm/mobs/Tiamat.lua +++ b/scripts/zones/Attohwa_Chasm/mobs/Tiamat.lua @@ -5,6 +5,60 @@ ---@type TMobEntity local entity = {} +local spawnPointTable = +{ + { x = -509.612, y = -7.883, z = -57.162 }, + { x = -511.114, y = -8.854, z = -61.300 }, + { x = -513.979, y = -9.972, z = -66.404 }, + { x = -516.567, y = -11.228, z = -71.118 }, + { x = -516.019, y = -12.018, z = -77.012 }, + { x = -516.266, y = -12.074, z = -82.299 }, + { x = -520.644, y = -12.033, z = -84.040 }, + { x = -525.511, y = -11.937, z = -79.784 }, + { x = -531.459, y = -12.028, z = -75.823 }, + { x = -537.182, y = -11.317, z = -79.414 }, + { x = -541.642, y = -11.083, z = -80.879 }, + { x = -546.247, y = -11.653, z = -78.959 }, + { x = -550.252, y = -11.713, z = -81.462 }, + { x = -553.738, y = -12.191, z = -83.898 }, + { x = -558.361, y = -12.178, z = -84.656 }, + { x = -562.449, y = -12.202, z = -84.500 }, + { x = -565.689, y = -12.420, z = -79.477 }, + { x = -559.911, y = -11.622, z = -67.839 }, + { x = -556.672, y = -11.939, z = -66.284 }, + { x = -551.187, y = -12.342, z = -67.364 }, + { x = -545.686, y = -11.851, z = -64.526 }, + { x = -540.688, y = -12.420, z = -61.299 }, + { x = -547.407, y = -11.494, z = -56.208 }, + { x = -545.911, y = -11.480, z = -53.302 }, + { x = -543.347, y = -11.080, z = -49.358 }, + { x = -547.281, y = -11.188, z = -46.117 }, + { x = -551.477, y = -11.580, z = -48.592 }, + { x = -555.466, y = -11.945, z = -50.986 }, + { x = -560.512, y = -12.042, z = -51.924 }, + { x = -563.436, y = -12.140, z = -48.995 }, + { x = -563.185, y = -12.002, z = -46.441 }, + { x = -563.587, y = -12.005, z = -43.905 }, + { x = -566.766, y = -12.674, z = -41.782 }, + { x = -563.552, y = -12.000, z = -39.131 }, + { x = -560.329, y = -12.000, z = -37.608 }, + { x = -553.611, y = -11.488, z = -36.440 }, + { x = -547.924, y = -9.652, z = -32.699 }, + { x = -545.229, y = -9.139, z = -26.835 }, + { x = -539.781, y = -6.688, z = -24.802 }, + { x = -537.228, y = -6.278, z = -21.546 }, + { x = -536.608, y = -4.329, z = -16.014 }, + { x = -540.775, y = -4.301, z = -13.786 }, + { x = -547.040, y = -4.759, z = -13.895 }, + { x = -552.430, y = -5.316, z = -11.979 }, + { x = -556.140, y = -4.988, z = -8.711 }, + { x = -560.106, y = -4.234, z = -5.819 }, + { x = -559.868, y = -4.000, z = -1.305 }, + { x = -557.823, y = -4.000, z = 3.232 }, + { x = -553.009, y = -3.918, z = 4.200 }, + { x = -549.802, y = -8.944, z = -24.848 }, +} + local function setupFlightMode(mob, battleTime, mobHP) mob:setAnimationSub(1) -- Change to flight. mob:addStatusEffectEx(xi.effect.ALL_MISS, 0, 1, 0, 0) @@ -14,7 +68,10 @@ local function setupFlightMode(mob, battleTime, mobHP) end entity.onMobInitialize = function(mob) - mob:setCarefulPathing(true) + mob:setCarefulPathing(true) -- Used for drawin + + xi.mob.updateNMSpawnPoint(mob, spawnPointTable) + mob:setRespawnTime(math.random(86400, 259200)) -- When server restarts, reset timer end entity.onMobSpawn = function(mob) @@ -117,6 +174,7 @@ end entity.onMobDespawn = function(mob) mob:setRespawnTime(math.random(259200, 432000)) -- 3 to 5 days + xi.mob.updateNMSpawnPoint(mob, spawnPointTable) end return entity diff --git a/scripts/zones/Valkurm_Dunes/mobs/Damselfly.lua b/scripts/zones/Valkurm_Dunes/mobs/Damselfly.lua index 01e31721a92..9517d3902db 100644 --- a/scripts/zones/Valkurm_Dunes/mobs/Damselfly.lua +++ b/scripts/zones/Valkurm_Dunes/mobs/Damselfly.lua @@ -13,13 +13,69 @@ local emperorPHList = [ID.mob.VALKURM_EMPEROR - 4] = ID.mob.VALKURM_EMPEROR, -- -228.957 2.776 -101.226 } +local emperorSpawnPoints = +{ + { x = -228.957, y = 2.776, z = -101.226 }, + { x = -264.829, y = -0.843, z = -91.306 }, + { x = -95.250, y = -0.268, z = -49.386 }, + { x = -144.284, y = -1.103, z = 4.202 }, + { x = -270.823, y = -2.168, z = -16.349 }, + { x = -327.000, y = -1.000, z = -21.000 }, + { x = -173.748, y = 0.359, z = -77.374 }, + { x = -143.231, y = -1.973, z = -67.419 }, + { x = -281.184, y = 0.000, z = -41.859 }, + { x = -205.980, y = 0.227, z = -86.736 }, + { x = -282.016, y = 0.955, z = -60.878 }, + { x = -246.524, y = -0.916, z = -51.146 }, + { x = -228.267, y = -0.028, z = -36.761 }, + { x = -220.278, y = 1.528, z = -92.214 }, + { x = -225.198, y = 3.304, z = -102.791 }, + { x = -185.404, y = -1.042, z = -60.996 }, + { x = -120.077, y = -0.006, z = -78.574 }, + { x = -346.179, y = -0.286, z = -23.185 }, + { x = -338.025, y = 0.232, z = -30.453 }, + { x = -253.393, y = 0.372, z = -87.479 }, + { x = -205.024, y = -1.791, z = -24.880 }, + { x = -279.494, y = 0.111, z = 7.036 }, + { x = -160.476, y = -0.069, z = -41.088 }, + { x = -328.453, y = -0.837, z = -47.501 }, + { x = -205.095, y = -0.040, z = -39.637 }, + { x = -197.814, y = 0.000, z = -80.991 }, + { x = -252.723, y = -1.271, z = -43.100 }, + { x = -333.218, y = -1.442, z = -8.725 }, + { x = -226.117, y = -1.772, z = 11.871 }, + { x = -210.075, y = -1.062, z = -27.973 }, + { x = -265.240, y = -0.799, z = -48.374 }, + { x = -130.870, y = -0.088, z = -54.813 }, + { x = -291.648, y = 0.381, z = -42.898 }, + { x = -283.645, y = 0.351, z = -68.965 }, + { x = -317.890, y = -0.426, z = -5.929 }, + { x = -168.851, y = -1.917, z = -54.953 }, + { x = -132.327, y = -0.742, z = -71.357 }, + { x = -329.940, y = -0.704, z = -24.331 }, + { x = -211.036, y = -0.286, z = -55.029 }, + { x = -155.887, y = 1.180, z = -93.927 }, + { x = -291.247, y = 0.396, z = 5.381 }, + { x = -221.531, y = 3.786, z = -108.07 }, + { x = -284.165, y = 0.902, z = -58.260 }, + { x = -170.882, y = -0.857, z = -35.825 }, + { x = -257.265, y = -0.995, z = -57.143 }, + { x = -212.513, y = 3.307, z = -105.39 }, + { x = -215.818, y = 0.651, z = -43.917 }, + { x = -297.203, y = -1.108, z = -9.745 }, + { x = -308.615, y = 0.242, z = -44.649 }, + { x = -264.390, y = -1.137, z = 29.689 }, +} + entity.onMobDeath = function(mob, player, optParams) xi.regime.checkRegime(player, mob, 9, 1, xi.regime.type.FIELDS) xi.regime.checkRegime(player, mob, 10, 2, xi.regime.type.FIELDS) end entity.onMobDespawn = function(mob) - xi.mob.phOnDespawn(mob, emperorPHList, 10, 3600) -- 1 hour + local params = { } + params.spawnPoints = emperorSpawnPoints + xi.mob.phOnDespawn(mob, emperorPHList, 10, 3600, params) -- 1 hour end return entity diff --git a/sql/mob_groups.sql b/sql/mob_groups.sql index 66f3e937b60..e6f251cfcf4 100644 --- a/sql/mob_groups.sql +++ b/sql/mob_groups.sql @@ -1077,7 +1077,7 @@ INSERT INTO `mob_groups` VALUES (4,2770,28,'Mummy',960,0,1754,0,0,54,56,0); INSERT INTO `mob_groups` VALUES (5,2407,28,'Lich',960,0,958,0,0,54,56,0); INSERT INTO `mob_groups` VALUES (6,476,28,'Blubber_Eyes',960,0,315,0,0,57,59,0); INSERT INTO `mob_groups` VALUES (7,4112,28,'Utukku',960,0,2528,0,0,55,55,0); -INSERT INTO `mob_groups` VALUES (8,1196,28,'Elel',7200,128,757,6000,0,56,58,0); +INSERT INTO `mob_groups` VALUES (8,1196,28,'Elel',0,128,757,6000,0,56,58,0); INSERT INTO `mob_groups` VALUES (9,1388,28,'Fomor_Ranger',960,0,874,0,0,54,58,0); INSERT INTO `mob_groups` VALUES (10,1386,28,'Fomor_Ninja',960,0,871,0,0,54,58,0); INSERT INTO `mob_groups` VALUES (11,1380,28,'Fomor_Bard',960,0,857,0,0,54,58,0); @@ -2483,7 +2483,7 @@ INSERT INTO `mob_groups` VALUES (3,3344,51,'Red_Osculator',0,128,174,0,0,67,71,0 INSERT INTO `mob_groups` VALUES (4,2269,51,'Kissing_Leech',0,128,174,0,0,67,71,0); INSERT INTO `mob_groups` VALUES (5,2616,51,'Mercurial_Makara',0,128,607,0,0,68,70,0); -INSERT INTO `mob_groups` VALUES (6,714,51,'Chigoe_pet',330,128,466,0,0,71,73,0); +INSERT INTO `mob_groups` VALUES (6,714,51,'Chigoe_pet',0,128,466,0,0,71,73,0); INSERT INTO `mob_groups` VALUES (7,2396,51,'Lesser_Colibri',330,0,1509,0,0,63,65,0); INSERT INTO `mob_groups` VALUES (8,4650,51,'Fomor_Thief',330,1,0,0,0,63,65,0); INSERT INTO `mob_groups` VALUES (9,6518,51,'Fomor_Beastmaster',330,1,0,0,0,63,65,0); @@ -2613,7 +2613,7 @@ INSERT INTO `mob_groups` VALUES (14,4275,52,'Wajaom_Tiger',330,0,2602,0,0,67,69, INSERT INTO `mob_groups` VALUES (15,4650,52,'Fomor_Thief',330,1,0,0,0,63,65,0); INSERT INTO `mob_groups` VALUES (16,5137,52,'Harvestman',7200,0,2891,10000,0,72,72,0); INSERT INTO `mob_groups` VALUES (17,3991,52,'Treant_Sapling',330,0,2464,0,0,66,68,0); -INSERT INTO `mob_groups` VALUES (18,714,52,'Chigoe_pet',330,128,466,0,0,71,73,0); +INSERT INTO `mob_groups` VALUES (18,714,52,'Chigoe_pet',0,128,466,0,0,71,73,0); INSERT INTO `mob_groups` VALUES (19,1787,52,'Grand_Marid',0,32,1214,0,0,78,79,0); INSERT INTO `mob_groups` VALUES (20,2562,52,'Marid',330,0,3206,0,0,77,78,0); INSERT INTO `mob_groups` VALUES (21,765,52,'Colibri',330,0,500,0,0,71,73,0); @@ -3052,7 +3052,7 @@ INSERT INTO `mob_groups` VALUES (19,2686,62,'Moblin_Billionaire',960,0,1704,0,0, INSERT INTO `mob_groups` VALUES (20,1341,62,'Fire_Elemental',960,4,831,0,0,74,75,0); INSERT INTO `mob_groups` VALUES (21,1426,62,'Friars_Lantern',960,0,908,0,0,72,76,0); INSERT INTO `mob_groups` VALUES (22,5210,62,'Flammeri',0,128,0,22500,5000,79,80,0); -INSERT INTO `mob_groups` VALUES (23,4280,62,'Wamoura',960,128,2608,0,0,81,82,0); +INSERT INTO `mob_groups` VALUES (23,4280,62,'Wamoura',0,128,2608,0,0,81,82,0); -- zone 62 group 24: free INSERT INTO `mob_groups` VALUES (25,4009,62,'Troll_Artilleryman',960,0,2473,0,0,78,83,0); INSERT INTO `mob_groups` VALUES (26,4012,62,'Troll_Combatant',960,0,2475,0,0,78,83,0); @@ -4184,7 +4184,7 @@ INSERT INTO `mob_groups` VALUES (67,5208,79,'Chorus_Toad',0,128,0,0,20000,95,96, INSERT INTO `mob_groups` VALUES (68,6554,79,'Guard_Skeleton_war',330,1,1247,0,0,66,69,0); INSERT INTO `mob_groups` VALUES (69,6758,79,'Shedu',0,128,0,0,0,99,99,0); INSERT INTO `mob_groups` VALUES (70,0,79,'Vidhuwa_the_Wrathborn',0,128,0,0,0,0,0,0); -INSERT INTO `mob_groups` VALUES (71,714,79,'Chigoe_pet',330,128,466,0,0,62,66,0); +INSERT INTO `mob_groups` VALUES (71,714,79,'Chigoe_pet',0,128,466,0,0,62,66,0); -- ------------------------------------------------------------ -- Southern_San_dOria_[S] (Zone 80) @@ -11970,7 +11970,7 @@ INSERT INTO `mob_groups` VALUES (11,2043,177,'Ice_Elemental',960,0,1347,0,0,79,8 INSERT INTO `mob_groups` VALUES (12,1341,177,'Fire_Elemental',960,0,831,0,0,79,81,0); INSERT INTO `mob_groups` VALUES (13,2664,177,'Mimic',0,128,1687,0,0,75,78,0); INSERT INTO `mob_groups` VALUES (14,531,177,'Brigandish_Blade',0,128,357,14000,5000,82,84,0); -INSERT INTO `mob_groups` VALUES (15,3763,177,'Steam_Cleaner',7200,128,2326,10000,0,81,82,0); +INSERT INTO `mob_groups` VALUES (15,3763,177,'Steam_Cleaner',0,128,2326,10000,0,81,82,0); INSERT INTO `mob_groups` VALUES (16,4504,177,'Zipacna',10800,0,2800,10000,0,83,85,0); INSERT INTO `mob_groups` VALUES (17,4719,177,'Uptala',0,128,0,0,0,95,96,0); INSERT INTO `mob_groups` VALUES (18,4718,177,'Bisa',0,128,0,0,5000,91,92,0); diff --git a/sql/nm_spawn_points.sql b/sql/nm_spawn_points.sql index d9f351973e4..9df1ecaa8d2 100644 --- a/sql/nm_spawn_points.sql +++ b/sql/nm_spawn_points.sql @@ -199,56 +199,6 @@ INSERT INTO `nm_spawn_points` VALUES (16806162,0,-364.014,-4.634,-2.627); INSERT INTO `nm_spawn_points` VALUES (16806162,1,-328.973,-12.876,67.481); INSERT INTO `nm_spawn_points` VALUES (16806162,2,-398.931,-4.536,79.640); INSERT INTO `nm_spawn_points` VALUES (16806162,3,-381.284,-9.233,40.054); -INSERT INTO `nm_spawn_points` VALUES (16806227,0,-509.612,-7.883,-57.162); -INSERT INTO `nm_spawn_points` VALUES (16806227,1,-511.114,-8.854,-61.300); -INSERT INTO `nm_spawn_points` VALUES (16806227,2,-513.979,-9.972,-66.404); -INSERT INTO `nm_spawn_points` VALUES (16806227,3,-516.567,-11.228,-71.118); -INSERT INTO `nm_spawn_points` VALUES (16806227,4,-516.019,-12.018,-77.012); -INSERT INTO `nm_spawn_points` VALUES (16806227,5,-516.266,-12.074,-82.299); -INSERT INTO `nm_spawn_points` VALUES (16806227,6,-520.644,-12.033,-84.040); -INSERT INTO `nm_spawn_points` VALUES (16806227,7,-525.511,-11.937,-79.784); -INSERT INTO `nm_spawn_points` VALUES (16806227,8,-531.459,-12.028,-75.823); -INSERT INTO `nm_spawn_points` VALUES (16806227,9,-537.182,-11.317,-79.414); -INSERT INTO `nm_spawn_points` VALUES (16806227,10,-541.642,-11.083,-80.879); -INSERT INTO `nm_spawn_points` VALUES (16806227,11,-546.247,-11.653,-78.959); -INSERT INTO `nm_spawn_points` VALUES (16806227,12,-550.252,-11.713,-81.462); -INSERT INTO `nm_spawn_points` VALUES (16806227,13,-553.738,-12.191,-83.898); -INSERT INTO `nm_spawn_points` VALUES (16806227,14,-558.361,-12.178,-84.656); -INSERT INTO `nm_spawn_points` VALUES (16806227,15,-562.449,-12.202,-84.500); -INSERT INTO `nm_spawn_points` VALUES (16806227,16,-565.689,-12.420,-79.477); -INSERT INTO `nm_spawn_points` VALUES (16806227,17,-559.911,-11.622,-67.839); -INSERT INTO `nm_spawn_points` VALUES (16806227,18,-556.672,-11.939,-66.284); -INSERT INTO `nm_spawn_points` VALUES (16806227,19,-551.187,-12.342,-67.364); -INSERT INTO `nm_spawn_points` VALUES (16806227,20,-545.686,-11.851,-64.526); -INSERT INTO `nm_spawn_points` VALUES (16806227,21,-540.688,-12.420,-61.299); -INSERT INTO `nm_spawn_points` VALUES (16806227,22,-547.407,-11.494,-56.208); -INSERT INTO `nm_spawn_points` VALUES (16806227,23,-545.911,-11.480,-53.302); -INSERT INTO `nm_spawn_points` VALUES (16806227,24,-543.347,-11.080,-49.358); -INSERT INTO `nm_spawn_points` VALUES (16806227,25,-547.281,-11.188,-46.117); -INSERT INTO `nm_spawn_points` VALUES (16806227,26,-551.477,-11.580,-48.592); -INSERT INTO `nm_spawn_points` VALUES (16806227,27,-555.466,-11.945,-50.986); -INSERT INTO `nm_spawn_points` VALUES (16806227,28,-560.512,-12.042,-51.924); -INSERT INTO `nm_spawn_points` VALUES (16806227,29,-563.436,-12.140,-48.995); -INSERT INTO `nm_spawn_points` VALUES (16806227,30,-563.185,-12.002,-46.441); -INSERT INTO `nm_spawn_points` VALUES (16806227,31,-563.587,-12.005,-43.905); -INSERT INTO `nm_spawn_points` VALUES (16806227,32,-566.766,-12.674,-41.782); -INSERT INTO `nm_spawn_points` VALUES (16806227,33,-563.552,-12.000,-39.131); -INSERT INTO `nm_spawn_points` VALUES (16806227,34,-560.329,-12.000,-37.608); -INSERT INTO `nm_spawn_points` VALUES (16806227,35,-553.611,-11.488,-36.440); -INSERT INTO `nm_spawn_points` VALUES (16806227,36,-547.924,-9.652,-32.699); -INSERT INTO `nm_spawn_points` VALUES (16806227,37,-545.229,-9.139,-26.835); -INSERT INTO `nm_spawn_points` VALUES (16806227,38,-539.781,-6.688,-24.802); -INSERT INTO `nm_spawn_points` VALUES (16806227,39,-537.228,-6.278,-21.546); -INSERT INTO `nm_spawn_points` VALUES (16806227,40,-536.608,-4.329,-16.014); -INSERT INTO `nm_spawn_points` VALUES (16806227,41,-540.775,-4.301,-13.786); -INSERT INTO `nm_spawn_points` VALUES (16806227,42,-547.040,-4.759,-13.895); -INSERT INTO `nm_spawn_points` VALUES (16806227,43,-552.430,-5.316,-11.979); -INSERT INTO `nm_spawn_points` VALUES (16806227,44,-556.140,-4.988,-8.711); -INSERT INTO `nm_spawn_points` VALUES (16806227,45,-560.106,-4.234,-5.819); -INSERT INTO `nm_spawn_points` VALUES (16806227,46,-559.868,-4.000,-1.305); -INSERT INTO `nm_spawn_points` VALUES (16806227,47,-557.823,-4.000,3.232); -INSERT INTO `nm_spawn_points` VALUES (16806227,48,-553.009,-3.918,4.200); -INSERT INTO `nm_spawn_points` VALUES (16806227,49,-549.802,-8.944,-24.848); INSERT INTO `nm_spawn_points` VALUES (16806249,0,-490.195,-4.503,145.451); -- Ambusher Antlion INSERT INTO `nm_spawn_points` VALUES (16822423,0,4.609,11.472,-101.235); -- Bugbear Strongman (west) INSERT INTO `nm_spawn_points` VALUES (16822427,0,60.728,15.487,-118.886); -- Bugbear Strongman (east) @@ -1200,56 +1150,6 @@ INSERT INTO `nm_spawn_points` VALUES (17199351,1,289.000,4.000,-168.000); INSERT INTO `nm_spawn_points` VALUES (17199351,2,326.000,4.000,-171.000); INSERT INTO `nm_spawn_points` VALUES (17199351,3,346.000,3.000,-150.000); INSERT INTO `nm_spawn_points` VALUES (17199351,4,351.000,4.000,-198.000); -INSERT INTO `nm_spawn_points` VALUES (17199438,0,-228.957,2.776,-101.226); -INSERT INTO `nm_spawn_points` VALUES (17199438,1,-264.829,-0.843,-91.306); -INSERT INTO `nm_spawn_points` VALUES (17199438,2,-95.250,-0.268,-49.386); -INSERT INTO `nm_spawn_points` VALUES (17199438,3,-144.284,-1.103,4.202); -INSERT INTO `nm_spawn_points` VALUES (17199438,4,-270.823,-2.168,-16.349); -INSERT INTO `nm_spawn_points` VALUES (17199438,5,-327.000,-1.000,-21.000); -INSERT INTO `nm_spawn_points` VALUES (17199438,6,-173.748,0.359,-77.374); -INSERT INTO `nm_spawn_points` VALUES (17199438,7,-143.231,-1.973,-67.419); -INSERT INTO `nm_spawn_points` VALUES (17199438,8,-281.184,0.000,-41.859); -INSERT INTO `nm_spawn_points` VALUES (17199438,9,-205.980,0.227,-86.736); -INSERT INTO `nm_spawn_points` VALUES (17199438,10,-282.016,0.955,-60.878); -INSERT INTO `nm_spawn_points` VALUES (17199438,11,-246.524,-0.916,-51.146); -INSERT INTO `nm_spawn_points` VALUES (17199438,12,-228.267,-0.028,-36.761); -INSERT INTO `nm_spawn_points` VALUES (17199438,13,-220.278,1.528,-92.214); -INSERT INTO `nm_spawn_points` VALUES (17199438,14,-225.198,3.304,-102.791); -INSERT INTO `nm_spawn_points` VALUES (17199438,15,-185.404,-1.042,-60.996); -INSERT INTO `nm_spawn_points` VALUES (17199438,16,-120.077,-0.006,-78.574); -INSERT INTO `nm_spawn_points` VALUES (17199438,17,-346.179,-0.286,-23.185); -INSERT INTO `nm_spawn_points` VALUES (17199438,18,-338.025,0.232,-30.453); -INSERT INTO `nm_spawn_points` VALUES (17199438,19,-253.393,0.372,-87.479); -INSERT INTO `nm_spawn_points` VALUES (17199438,20,-205.024,-1.791,-24.880); -INSERT INTO `nm_spawn_points` VALUES (17199438,21,-279.494,0.111,7.036); -INSERT INTO `nm_spawn_points` VALUES (17199438,22,-160.476,-0.069,-41.088); -INSERT INTO `nm_spawn_points` VALUES (17199438,23,-328.453,-0.837,-47.501); -INSERT INTO `nm_spawn_points` VALUES (17199438,24,-205.095,-0.040,-39.637); -INSERT INTO `nm_spawn_points` VALUES (17199438,25,-197.814,0.000,-80.991); -INSERT INTO `nm_spawn_points` VALUES (17199438,26,-252.723,-1.271,-43.100); -INSERT INTO `nm_spawn_points` VALUES (17199438,27,-333.218,-1.442,-8.725); -INSERT INTO `nm_spawn_points` VALUES (17199438,28,-226.117,-1.772,11.871); -INSERT INTO `nm_spawn_points` VALUES (17199438,29,-210.075,-1.062,-27.973); -INSERT INTO `nm_spawn_points` VALUES (17199438,30,-265.240,-0.799,-48.374); -INSERT INTO `nm_spawn_points` VALUES (17199438,31,-130.870,-0.088,-54.813); -INSERT INTO `nm_spawn_points` VALUES (17199438,32,-291.648,0.381,-42.898); -INSERT INTO `nm_spawn_points` VALUES (17199438,33,-283.645,0.351,-68.965); -INSERT INTO `nm_spawn_points` VALUES (17199438,34,-317.890,-0.426,-5.929); -INSERT INTO `nm_spawn_points` VALUES (17199438,35,-168.851,-1.917,-54.953); -INSERT INTO `nm_spawn_points` VALUES (17199438,36,-132.327,-0.742,-71.357); -INSERT INTO `nm_spawn_points` VALUES (17199438,37,-329.940,-0.704,-24.331); -INSERT INTO `nm_spawn_points` VALUES (17199438,38,-211.036,-0.286,-55.029); -INSERT INTO `nm_spawn_points` VALUES (17199438,39,-155.887,1.180,-93.927); -INSERT INTO `nm_spawn_points` VALUES (17199438,40,-291.247,0.396,5.381); -INSERT INTO `nm_spawn_points` VALUES (17199438,41,-221.531,3.786,-108.077); -INSERT INTO `nm_spawn_points` VALUES (17199438,42,-284.165,0.902,-58.260); -INSERT INTO `nm_spawn_points` VALUES (17199438,43,-170.882,-0.857,-35.825); -INSERT INTO `nm_spawn_points` VALUES (17199438,44,-257.265,-0.995,-57.143); -INSERT INTO `nm_spawn_points` VALUES (17199438,45,-212.513,3.307,-105.392); -INSERT INTO `nm_spawn_points` VALUES (17199438,46,-215.818,0.651,-43.917); -INSERT INTO `nm_spawn_points` VALUES (17199438,47,-297.203,-1.108,-9.745); -INSERT INTO `nm_spawn_points` VALUES (17199438,48,-308.615,0.242,-44.649); -INSERT INTO `nm_spawn_points` VALUES (17199438,49,-264.390,-1.137,29.689); INSERT INTO `nm_spawn_points` VALUES (17199564,0,-804.502,-8.567,22.082); INSERT INTO `nm_spawn_points` VALUES (17199564,1,-798.674,-8.672,19.204); INSERT INTO `nm_spawn_points` VALUES (17199564,2,-778.844,-7.842,25.860); diff --git a/src/map/utils/zoneutils.cpp b/src/map/utils/zoneutils.cpp index 2c6eec7d0f1..6a841a49cec 100644 --- a/src/map/utils/zoneutils.cpp +++ b/src/map/utils/zoneutils.cpp @@ -685,6 +685,11 @@ namespace zoneutils else { PMob->PAI->Internal_Respawn(std::chrono::milliseconds(PMob->m_RespawnTime)); + // If the mob is a scripted spawn and it has a respawn time defined when the mob initializes then allow it to respawn + if (PMob->m_SpawnType == SPAWNTYPE_SCRIPTED && PMob->m_RespawnTime > 0) + { + PMob->m_AllowRespawn = true; + } } }); });