-----------------------------------
-- Area: Gustav Tunnel
--   NM: Bune
-----------------------------------
---@type TMobEntity
local entity = {}

entity.spawnPoints =
{
    { x = -72.000, y = -10.000, z = -170.000 },
    { x = -67.566, y = -9.052,  z = -158.554 },
    { x = -50.912, y = -9.966,  z = -171.669 },
    { x = -79.788, y = -9.000,  z = -173.946 },
    { x = -46.102, y = -9.995,  z = -157.439 },
    { x = -90.210, y = -9.579,  z = -161.059 },
    { x = -79.521, y = -9.000,  z = -175.899 },
    { x = -71.371, y = -9.739,  z = -168.789 },
    { x = -74.199, y = -10.180, z = -167.294 },
    { x = -72.434, y = -10.000, z = -186.258 },
    { x = -77.987, y = -10.012, z = -203.403 },
    { x = -63.150, y = -9.000,  z = -160.368 },
    { x = -69.676, y = -10.000, z = -166.645 },
    { x = -88.883, y = -9.500,  z = -199.547 },
    { x = -84.583, y = -9.596,  z = -172.726 },
    { x = -87.079, y = -9.622,  z = -187.315 },
    { x = -78.017, y = -9.194,  z = -184.132 },
    { x = -82.768, y = -9.368,  z = -189.457 },
    { x = -71.961, y = -9.602,  z = -169.802 },
    { x = -83.395, y = -9.312,  z = -172.427 },
    { x = -83.407, y = -10.177, z = -167.660 },
    { x = -59.900, y = -10.000, z = -166.809 },
    { x = -83.912, y = -9.052,  z = -182.189 },
    { x = -46.285, y = -9.805,  z = -161.678 },
    { x = -76.916, y = -9.852,  z = -194.764 },
    { x = -54.737, y = -9.353,  z = -166.081 },
    { x = -62.276, y = -10.015, z = -168.081 },
    { x = -47.245, y = -9.644,  z = -168.424 },
    { x = -84.997, y = -9.680,  z = -191.642 },
    { x = -59.572, y = -9.341,  z = -162.928 },
    { x = -63.111, y = -9.632,  z = -163.706 },
    { x = -74.863, y = -10.465, z = -156.289 },
    { x = -83.517, y = -9.585,  z = -177.477 },
    { x = -82.202, y = -10.000, z = -203.307 },
    { x = -55.649, y = -9.109,  z = -156.580 },
    { x = -71.079, y = -10.059, z = -161.571 },
    { x = -64.606, y = -10.099, z = -185.664 },
    { x = -67.923, y = -10.061, z = -198.402 },
    { x = -85.492, y = -10.147, z = -168.654 },
    { x = -43.474, y = -10.000, z = -164.605 },
    { x = -56.935, y = -10.109, z = -172.612 },
    { x = -70.494, y = -10.116, z = -165.057 },
    { x = -57.027, y = -9.597,  z = -153.959 },
    { x = -69.683, y = -9.449,  z = -159.494 },
    { x = -69.229, y = -10.000, z = -165.856 },
    { x = -91.113, y = -9.807,  z = -200.988 },
    { x = -82.025, y = -9.672,  z = -191.129 },
    { x = -77.888, y = -10.000, z = -193.552 },
    { x = -74.891, y = -10.230, z = -167.159 },
    { x = -81.769, y = -9.699,  z = -191.310 },
}

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

entity.onMobSpawn = function(mob)
    mob:addImmunity(xi.immunity.DARK_SLEEP)
    mob:addImmunity(xi.immunity.LIGHT_SLEEP)
    mob:addImmunity(xi.immunity.TERROR)
end

entity.onMobDespawn = function(mob)
    xi.mob.updateNMSpawnPoint(mob)
    mob:setRespawnTime(math.random(75600, 86400)) -- 21-24 hours
end

return entity
