-----------------------------------
-- Area: Ordelles Caves (193)
--   NM: Morbolger
-----------------------------------
---@type TMobEntity
local entity = {}

entity.spawnPoints =
{
    { x =  -96.898, y = -27.154, z = -258.763 },
    { x =  -86.207, y = -26.437, z = -261.129 },
    { x =  -80.230, y = -27.000, z = -254.982 },
    { x = -118.601, y = -27.500, z = -271.380 },
    { x =  -96.492, y = -26.937, z = -262.414 },
    { x = -120.137, y = -27.500, z = -235.894 },
    { x = -106.642, y = -26.937, z = -254.012 },
    { x =  -79.451, y = -27.268, z = -266.960 },
    { x =  -84.513, y = -27.484, z = -249.720 },
    { x = -102.225, y = -27.000, z = -278.759 },
    { x =  -78.937, y = -27.000, z = -258.936 },
    { x = -115.199, y = -27.273, z = -268.452 },
    { x = -120.593, y = -27.500, z = -284.897 },
    { x =  -97.824, y = -27.000, z = -279.110 },
    { x = -104.895, y = -27.000, z = -239.855 },
    { x = -122.838, y = -27.783, z = -246.968 },
    { x = -124.882, y = -27.583, z = -235.636 },
    { x = -109.451, y = -27.500, z = -238.434 },
    { x = -116.254, y = -27.243, z = -269.381 },
    { x = -120.139, y = -27.000, z = -262.069 },
    { x = -119.702, y = -27.500, z = -284.861 },
    { x = -121.853, y = -27.917, z = -246.403 },
    { x = -118.661, y = -28.000, z = -238.711 },
    { x =  -94.156, y = -26.991, z = -233.659 },
    { x =  -89.426, y = -27.500, z = -238.931 },
    { x =  -76.626, y = -26.923, z = -260.493 },
    { x = -122.531, y = -27.071, z = -254.146 },
    { x = -125.380, y = -27.500, z = -281.635 },
    { x = -121.647, y = -27.500, z = -235.040 },
    { x =  -80.653, y = -28.000, z = -242.915 },
    { x = -105.554, y = -26.858, z = -256.833 },
    { x = -126.008, y = -27.258, z = -252.023 },
    { x = -100.163, y = -26.937, z = -260.996 },
    { x =  -81.859, y = -27.500, z = -248.561 },
    { x =  -98.111, y = -27.590, z = -230.878 },
    { x =  -86.062, y = -27.644, z = -275.271 },
    { x = -126.563, y = -28.163, z = -259.566 },
    { x =  -85.324, y = -27.546, z = -234.117 },
    { x =  -82.902, y = -27.893, z = -272.457 },
    { x = -120.079, y = -27.917, z = -273.530 },
    { x = -116.962, y = -27.549, z = -284.044 },
    { x = -122.612, y = -27.873, z = -241.736 },
    { x =  -84.267, y = -27.644, z = -275.472 },
    { x =  -86.806, y = -27.825, z = -278.830 },
    { x =  -80.523, y = -27.500, z = -233.666 },
    { x = -113.994, y = -27.846, z = -282.935 },
    { x = -105.689, y = -27.716, z = -286.394 },
    { x =  -83.507, y = -27.917, z = -269.486 },
    { x =  -81.155, y = -27.000, z = -263.012 },
    { x = -105.685, y = -27.003, z = -281.789 }
}

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

    mob:setMobMod(xi.mobMod.ALWAYS_AGGRO, 1) -- "Aggros regardless of level"
end

entity.onMobDeath = function(mob, player, optParams)
    player:addTitle(xi.title.MORBOLBANE)
end

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

return entity
