-----------------------------------
-- Area: Garlaige Citadel (200)
--   NM: Old Two-Wings
-----------------------------------
---@type TMobEntity
local entity = {}

entity.spawnPoints =
{
    { x =  -99.000, y = -0.500, z =  226.000 },
    { x = -100.067, y =  0.000, z =  212.220 },
    { x = -100.196, y =  0.000, z =  253.509 },
    { x = -151.483, y =  0.000, z =  260.145 },
    { x = -180.270, y =  0.000, z =  228.063 },
    { x = -179.392, y =  0.000, z =  186.668 },
    { x =  -94.011, y =  0.000, z =  222.850 },
    { x = -146.672, y =  0.000, z =  181.931 },
    { x =  -99.804, y =  0.000, z =  204.174 },
    { x = -138.148, y =  0.000, z =  247.792 },
    { x = -180.289, y =  0.000, z =  235.430 },
    { x = -140.859, y =  0.000, z =  269.985 },
    { x = -183.484, y =  0.000, z =  220.377 },
    { x = -180.822, y =  0.000, z =  198.857 },
    { x = -159.527, y =  0.000, z =  179.309 },
    { x = -101.038, y =  0.000, z =  225.392 },
    { x = -140.333, y =  0.000, z =  195.324 },
    { x = -180.746, y =  0.000, z =  235.899 },
    { x =  -99.310, y =  0.000, z =  233.119 },
    { x = -161.895, y =  0.000, z =  180.105 },
    { x = -121.320, y =  0.000, z =  179.397 },
    { x = -167.665, y =  0.000, z =  175.938 },
    { x =  -96.443, y =  0.000, z =  218.911 },
    { x = -139.191, y =  0.000, z =  188.000 },
    { x = -101.034, y = -0.191, z =  194.019 },
    { x = -113.993, y =  0.000, z =  179.747 },
    { x = -157.577, y =  0.000, z =  180.375 },
    { x =  -99.542, y =  0.000, z =  186.363 },
    { x = -143.826, y =  0.000, z =  258.477 },
    { x = -179.502, y =  0.000, z =  262.085 },
    { x = -180.383, y =  0.000, z =  254.393 },
    { x =  -89.186, y =  0.000, z =  215.729 },
    { x = -117.520, y =  0.000, z =  260.279 },
    { x = -138.888, y =  0.000, z =  239.155 },
    { x = -151.905, y =  0.000, z =  174.673 },
    { x = -101.825, y =  0.000, z =  201.559 },
    { x = -152.005, y =  0.000, z =  180.332 },
    { x = -140.174, y =  0.000, z =  275.309 },
    { x = -100.016, y =  0.000, z =  215.784 },
    { x = -180.314, y =  0.000, z =  243.029 },
    { x = -101.899, y =  0.000, z =  261.406 },
    { x = -139.858, y =  0.000, z =  197.250 },
    { x = -169.835, y =  0.000, z =  262.432 },
    { x = -144.489, y =  0.000, z =  259.614 },
    { x = -150.449, y =  0.000, z =  258.380 },
    { x =  -87.103, y =  0.000, z =  224.191 },
    { x = -100.504, y =  0.000, z =  196.897 },
    { x = -140.960, y =  0.000, z =  178.832 },
    { x =  -98.406, y =  0.000, z =  213.379 },
    { x = -130.853, y =  0.000, z =  181.213 }
}

entity.onMobInitialize = function(mob)
    xi.mob.updateNMSpawnPoint(mob)
    mob:setRespawnTime(math.random(75600, 86400))
end

entity.onMobDeath = function(mob, player, optParams)
end

entity.onMobDespawn = function(mob)
    -- Set Old_Two_Wings's spawnpoint and respawn time (21-24 hours)
    xi.mob.updateNMSpawnPoint(mob)
    mob:setRespawnTime(math.random(75600, 86400))
end

return entity
