-----------------------------------
-- Area: Norg
--  NPC: Oruga
-----------------------------------
---@type TNpcEntity
local entity = {}

local pathNodes =
{
    { x = -0.016294, y = -1.251156, z = -30.703135 },
    { x = 1.135162, y = -1.295192, z = -30.737705 },
    { x = 2.267773, y = -1.620833, z = -30.756174 },
    { x = 3.344393, y = -1.879029, z = -30.778761 },
    { x = 5.049327, y = -2.361731, z = -30.823250 },
    { x = 6.117022, y = -2.563100, z = -30.886162 },
    { x = 7.181621, y = -2.772666, z = -30.972755 },
    { x = 8.245983, y = -2.954788, z = -31.051538 },
    { x = 9.328338, y = -3.061133, z = -31.039093 },
    { x = 10.409624, y = -3.143949, z = -30.961086 },
    { x = 11.492971, y = -3.171996, z = -30.865526 },
    { x = 15.815061, y = -3.447035, z = -30.455658 },
    { x = 16.874792, y = -3.526491, z = -30.227465 },
    { x = 17.896387, y = -3.708385, z = -29.895599 },
    { x = 18.898493, y = -3.908274, z = -29.532429 },
    { x = 19.895685, y = -4.079228, z = -29.134384 },
    { x = 20.737349, y = -4.216307, z = -28.413183 },
    { x = 21.407436, y = -4.330055, z = -27.513542 },
    { x = 22.016415, y = -4.434795, z = -26.589983 },
    { x = 22.619663, y = -4.506055, z = -25.649052 },
    { x = 23.082552, y = -4.733766, z = -24.577311 },
    { x = 23.317366, y = -4.843967, z = -23.488529 },
    { x = 23.503233, y = -4.784823, z = -22.336891 },
    { x = 23.579830, y = -4.873768, z = -21.227167 },
    { x = 23.595615, y = -4.955327, z = -20.067602 },
    { x = 23.604248, y = -4.673836, z = -15.539319 },
    { x = 23.576544, y = -4.747251, z = -14.438788 },
    { x = 23.589468, y = -4.701037, z = -15.602610 },
    { x = 23.583118, y = -4.819503, z = -16.757050 },
    { x = 23.603765, y = -4.955882, z = -20.001656 },
    { x = 23.589598, y = -4.852837, z = -21.216965 },
    { x = 23.512104, y = -4.780120, z = -22.266308 },
    { x = 23.371975, y = -4.846354, z = -23.286993 },
    { x = 23.154896, y = -4.779443, z = -24.363916 },
    { x = 22.713276, y = -4.551100, z = -25.401381 },
    { x = 22.164385, y = -4.452671, z = -26.342907 },
    { x = 21.586670, y = -4.363403, z = -27.264763 },
    { x = 21.003744, y = -4.252445, z = -28.176605 },
    { x = 20.161383, y = -4.131409, z = -28.924875 },
    { x = 19.176140, y = -3.957754, z = -29.401279 },
    { x = 18.169416, y = -3.773172, z = -29.799803 },
    { x = 17.226116, y = -3.551686, z = -30.132439 },
    { x = 16.238331, y = -3.480612, z = -30.356184 },
    { x = 15.180473, y = -3.392950, z = -30.503290 },
    { x = 14.115976, y = -3.279427, z = -30.617214 },
    { x = 9.767619, y = -3.120346, z = -31.023869 },
    { x = 8.737691, y = -3.001644, z = -31.048111 },
    { x = 7.659624, y = -2.875193, z = -30.995384 },
    { x = 6.561257, y = -2.650589, z = -30.911077 },
    { x = 5.400178, y = -2.428268, z = -30.843111 },
    { x = 4.195887, y = -2.202940, z = -30.804506 },
    { x = 1.013752, y = -1.273776, z = -30.729916 },
    { x = -0.022560, y = -1.251507, z = -30.706329 },
    { x = -2.217780, y = -1.106099, z = -30.654016 },
    { x = -1.043870, y = -1.248653, z = -30.678118 },
}

entity.onSpawn = function(npc)
    npc:initNpcAi()
    npc:setPos(xi.path.first(pathNodes))
    npc:pathThrough(pathNodes, xi.path.flag.PATROL)
end

return entity
