-----------------------------------
-- Area: Castle Zvahl Baileys (161)
--   NM: Grand Duke Batym
-----------------------------------
mixins = { require('scripts/mixins/job_special') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.spawnPoints =
{
    { x = -78.000, y = -4.000, z = -15.000 },
    { x = -78.599, y = -4.000, z = -12.779 },
    { x = -75.554, y = -4.000, z =  -1.731 },
    { x = -89.634, y = -4.000, z = -16.589 },
    { x = -94.442, y = -4.000, z = -12.632 },
    { x = -92.577, y = -4.000, z = -15.753 },
    { x = -77.281, y = -4.000, z =   0.192 },
    { x = -97.803, y = -4.000, z = -18.198 },
    { x = -94.602, y = -4.000, z =  -1.419 },
    { x = -77.211, y = -4.000, z =  -5.770 },
    { x = -85.634, y = -4.000, z =  -0.250 },
    { x = -91.147, y = -4.000, z =   1.775 },
    { x = -89.712, y = -4.000, z = -18.195 },
    { x = -75.448, y = -4.000, z =  -2.352 },
    { x = -96.616, y = -4.000, z = -11.441 },
    { x = -75.108, y = -4.000, z = -11.319 },
    { x = -99.765, y = -4.000, z = -16.407 },
    { x = -93.873, y = -4.000, z = -11.325 },
    { x = -91.976, y = -4.000, z = -11.120 },
    { x = -77.095, y = -4.000, z = -13.986 },
    { x = -78.175, y = -4.000, z =   3.555 },
    { x = -79.723, y = -4.000, z = -18.266 },
    { x = -90.053, y = -4.000, z =   6.087 },
    { x = -88.349, y = -4.000, z =   3.165 },
    { x = -77.482, y = -4.000, z =   4.662 },
    { x = -83.591, y = -4.000, z = -19.229 },
    { x = -97.623, y = -4.000, z =   3.297 },
    { x = -84.199, y = -4.000, z =  -5.215 },
    { x = -91.006, y = -4.000, z =  -1.435 },
    { x = -86.071, y = -4.000, z = -19.344 },
    { x = -84.769, y = -4.000, z = -17.758 },
    { x = -73.396, y = -4.000, z =   3.381 },
    { x = -79.338, y = -4.000, z = -12.368 },
    { x = -96.680, y = -4.000, z = -13.712 },
    { x = -75.614, y = -4.000, z =  -1.859 },
    { x = -89.863, y = -4.000, z =   1.327 },
    { x = -94.948, y = -4.000, z =   3.443 },
    { x = -82.133, y = -4.000, z =   1.375 },
    { x = -81.149, y = -4.000, z =  -8.920 },
    { x = -94.966, y = -4.000, z =   6.514 },
    { x = -77.628, y = -4.000, z = -16.071 },
    { x = -86.462, y = -4.000, z =   0.844 },
    { x = -85.265, y = -4.000, z = -11.511 },
    { x = -99.690, y = -4.000, z =  -0.093 },
    { x = -97.706, y = -4.000, z =  -2.414 },
    { x = -79.080, y = -4.000, z =  -3.112 },
    { x = -90.451, y = -4.000, z =  -4.216 },
    { x = -83.520, y = -4.000, z =   1.644 },
    { x = -79.246, y = -4.000, z =   2.357 },
    { x = -76.682, y = -4.000, z =  -1.974 },
}

entity.onMobInitialize = function(mob)
    xi.pet.setMobPet(mob, 1, 'Demons_Elemental')
    xi.mob.updateNMSpawnPoint(mob)
    mob:setRespawnTime(math.random(900, 10800))
end

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

return entity
