Intenta con algo así
- script poring_walk -1,{
end;
OnInit:
npcspeed 100;
initnpctimer;
end;
OnTimer4000:
getmapxy .@map$, .@x, .@y, BL_NPC;
set .@curX, callfunc("rent_aliceXY",.@x,46,61);
set .@curY, callfunc("rent_aliceXY",.@y,54,73);
npcwalkto .@curX, .@curY;
initnpctimer;
end;
}
prontera,153,155,3 duplicate(poring_walk) Poring#gm 1002
function script rent_aliceXY {
set .@CP, getarg(0); // Present position XoY
set .@DST, rand(1,5); // Distance to cross
if (rand(2)) // Direccion a tomar (izq der arr abj)
set .@CP, .@CP + .@DST;
else
set .@CP, .@CP - .@DST;
if (.@CP < getarg(1))
set .@CP, .@CP + .@DST; // If the new point is smaller, thats the minimum
if (.@CP > getarg(2))
set .@CP, .@CP - .@DST; // If the new point is greater, thats the maximum
return .@CP;
}