Bem antes de começar os ots q eu testei e funciono foram : yurots,darkonia e hotserv mas em outros deve funcionar!
Abra o arkivo data/npc/scripts/lib/npc.lua < e nele adicione. ( bote no meio de duas funções quaisquer )
CODE :
function moveRandom(ox,oy,max)
maxx = ox + max
maxy = oy + max
minx = ox - max
miny = oy - max
cx, cy, cz = selfGetPosition()
randmove = math.random(1,50)
if randmove == 1 then
nx = cx + 1
ny = cy
end
if randmove == 2 then
nx = cx - 1
ny = cy
end
if randmove == 3 then
ny = cy + 1
nx = cx
end
if randmove == 4 then
ny = cy - 1
nx = cx
end
if randmove >= 5 then
nx = cx
ny = cy
end
if((nx < maxx) and (ny < maxy) and (nx > minx) and (ny > miny)) then
moveToPosition(nx, ny, cz)
end
end
------------------------------------
depois disso vc vai trabalhar no arkivo lua do seu npc
lá no topo acrescente:
ox = 400
oy = 400
oz = 7
max = 5
ox, oy e oz é a posição de respaw do seu NPC, altere de acordo com cada NPC. o MAX é a quantidade maxima de SQMs que o NPC vai poder se afastar do ser respaw.
Ainda no arquivo do NPC dentro da função onThink() (use procura para achar onde está), coloque isso aki...
if(focus == 0) then
moveRandom(ox,oy,max)
end
Pronto agora seus npcs estão prontos para andar!!
Créditos pro JTE,
MeLeCa.