-----------------------------------
-- Area: Ifrit's Cauldron
--  Mob: Ash Dragon
-----------------------------------
---@type TMobEntity
local entity = {}

entity.spawnPoints =
{
    { x = -280.018, y =  39.995, z =  120.030 },
    { x = -273.377, y =  40.016, z =  111.106 },
    { x = -272.359, y =  40.098, z =  113.425 },
    { x = -279.967, y =  40.184, z =  126.850 },
    { x = -283.913, y =  40.201, z =  125.809 },
    { x = -286.155, y =  40.207, z =  127.544 },
    { x = -280.583, y =  40.245, z =  127.086 },
    { x = -280.087, y =  40.000, z =  118.274 },
    { x = -285.973, y =  40.156, z =  125.035 },
    { x = -288.577, y =  40.211, z =  129.951 },
    { x = -273.890, y =  40.006, z =  122.530 },
    { x = -284.594, y =  40.000, z =  119.917 },
    { x = -285.990, y =  39.623, z =  129.955 },
    { x = -276.997, y =  40.237, z =  129.374 },
    { x = -285.374, y =  40.268, z =  127.231 },
    { x = -286.802, y =  40.000, z =  126.913 },
    { x = -279.198, y =  40.283, z =  130.751 },
    { x = -276.714, y =  39.920, z =  126.808 },
    { x = -288.806, y =  40.083, z =  122.141 },
    { x = -281.061, y =  40.312, z =  127.364 },
    { x = -276.613, y =  40.270, z =  114.858 },
    { x = -279.707, y =  40.379, z =  127.621 },
    { x = -281.681, y =  39.817, z =  124.297 },
    { x = -278.458, y =  40.124, z =  113.329 },
    { x = -275.397, y =  39.787, z =  121.407 },
    { x = -271.061, y =  40.311, z =  121.586 },
    { x = -285.336, y =  40.264, z =  123.162 },
    { x = -288.219, y =  40.123, z =  129.936 },
    { x = -284.214, y =  40.000, z =  120.431 },
    { x = -278.228, y =  40.446, z =  128.556 },
    { x = -270.932, y =  40.000, z =  114.520 },
    { x = -280.578, y =  39.983, z =  126.043 },
    { x = -273.754, y =  40.000, z =  118.419 },
    { x = -277.366, y =  40.000, z =  117.554 },
    { x = -274.613, y =  40.220, z =  116.415 },
    { x = -277.368, y =  40.196, z =  114.953 },
    { x = -271.987, y =  39.989, z =  115.090 },
    { x = -285.952, y =  39.973, z =  128.291 },
    { x = -286.453, y =  40.092, z =  121.307 },
    { x = -277.890, y =  40.423, z =  129.504 },
    { x = -277.869, y =  39.765, z =  124.782 },
    { x = -282.257, y =  39.941, z =  131.323 },
    { x = -288.323, y =  40.304, z =  122.437 },
    { x = -272.215, y =  40.000, z =  115.314 },
    { x = -282.281, y =  39.772, z =  125.025 },
    { x = -278.844, y =  40.000, z =  124.750 },
    { x = -284.835, y =  40.359, z =  127.630 },
    { x = -278.404, y =  39.804, z =  124.018 },
    { x = -278.698, y =  40.000, z =  118.521 },
    { x = -273.051, y =  40.231, z =  113.202 }
}

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

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

entity.onMobDespawn = function(mob)
    xi.mob.updateNMSpawnPoint(mob)
    mob:setRespawnTime(math.random(259200, 432000)) -- 3 to 5 days
end

return entity
