-----------------------------------
-- Area: Bostaunieux Oubliette (167)
--   NM: Phanduron the Condemned
-----------------------------------
mixins = { require('scripts/mixins/job_special') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.spawnPoints =
{
    { x = -84.000, y =  1.000, z = -224.000 },
    { x = -91.555, y =  0.000, z = -225.159 },
    { x = -63.534, y =  0.250, z = -243.227 },
    { x = -65.750, y =  0.287, z = -231.269 },
    { x = -97.215, y =  0.250, z = -247.476 },
    { x = -88.673, y =  0.342, z = -228.348 },
    { x = -96.614, y =  0.052, z = -229.255 },
    { x = -95.678, y =  0.250, z = -244.603 },
    { x = -70.042, y =  0.384, z = -230.101 },
    { x = -66.117, y =  0.250, z = -233.085 },
    { x = -81.811, y =  0.250, z = -255.389 },
    { x = -64.688, y =  0.361, z = -233.734 },
    { x = -72.015, y =  0.197, z = -250.155 },
    { x = -93.281, y =  0.048, z = -224.381 },
    { x = -76.480, y =  0.104, z = -222.346 },
    { x = -83.250, y =  0.306, z = -224.719 },
    { x = -81.428, y =  0.250, z = -254.973 },
    { x = -78.359, y =  0.250, z = -225.492 },
    { x = -94.035, y =  0.250, z = -241.571 },
    { x = -63.537, y =  0.250, z = -239.212 },
    { x = -92.296, y =  0.232, z = -251.894 },
    { x = -59.187, y =  0.000, z = -236.816 },
    { x = -86.662, y =  0.292, z = -225.357 },
    { x = -67.760, y =  0.280, z = -248.605 },
    { x = -73.569, y =  0.250, z = -256.151 },
    { x = -87.915, y =  0.238, z = -226.147 },
    { x = -69.448, y =  0.342, z = -229.310 },
    { x = -69.018, y =  0.321, z = -228.577 },
    { x = -78.407, y =  0.250, z = -223.560 },
    { x = -92.123, y =  0.244, z = -228.230 },
    { x = -86.419, y =  0.236, z = -254.408 },
    { x = -80.003, y =  0.000, z = -257.732 },
    { x = -64.395, y =  0.311, z = -245.005 },
    { x = -90.081, y =  0.386, z = -249.993 },
    { x = -66.146, y =  0.250, z = -231.751 },
    { x = -69.730, y =  0.360, z = -252.132 },
    { x = -83.329, y = -0.007, z = -221.367 },
    { x = -95.895, y =  0.346, z = -235.778 },
    { x = -91.773, y =  0.239, z = -231.250 },
    { x = -70.994, y =  0.250, z = -226.381 },
    { x = -61.289, y =  0.015, z = -246.933 },
    { x = -91.704, y =  0.344, z = -250.660 },
    { x = -64.790, y =  0.381, z = -246.006 },
    { x = -66.641, y =  0.250, z = -246.572 },
    { x = -92.282, y =  0.250, z = -248.386 },
    { x = -91.506, y =  0.361, z = -250.426 },
    { x = -73.250, y =  0.250, z = -252.108 },
    { x = -94.985, y =  0.358, z = -233.485 },
    { x = -77.298, y =  0.250, z = -223.686 },
    { x = -65.492, y =  0.250, z = -247.396 }
}

entity.onMobInitialize = function(mob)
    mob:setMobMod(xi.mobMod.ADD_EFFECT, 1)

    xi.mob.updateNMSpawnPoint(mob)
    mob:setRespawnTime(math.random(900, 10800))
end

entity.onAdditionalEffect = function(mob, target, damage)
    return xi.mob.onAddEffect(mob, target, damage, xi.mob.ae.EVA_DOWN)
end

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

entity.onMobDespawn = function(mob)
    xi.mob.updateNMSpawnPoint(mob)
    mob:setRespawnTime(math.random(216000, 259200)) -- 60 to 72 hours
end

return entity
