**BANNED The Man
2011-01-27 17:23:52
It will walk to the NPC desired.
Even if it isn't on the minimap.
It can be a maximum of 30 tiles away at the moment, can easily be edited to suffice more.
I need feedback to see whether a larger distance is needed/wanted, so it will walk more tiles.
And also, this gives me a reasonable base for a World Walker, or maybe not? :P
Hope you like it :)
-Boom
Even if it isn't on the minimap.
It can be a maximum of 30 tiles away at the moment, can easily be edited to suffice more.
Function WalkToNPC(NPCID, Randomness, FlagD:Integer):Boolean;
var
NPCVariable : TNPC;
NPCTile, PlayerTile, NewTile : TTile;
begin
Result := False;
NPCVariable := FindNPC(NPCID);
NPCTile := NPCVariable.Tile;
PlayerTile := GetMyPos;
if TileOnMM(NPCTile.Tile) then
Result := WalkToTile(tile(NPCTile.Tile), Randomness, FlagD)
else
if Distance(PlayerTile.x, PlayerTile.y, NPCTile.x, NPCTile.y) =< 30 then
begin
NewTile := MiddleTPA([point(PlayerTile.x, PlayerTile.y), point(NPCTile.x, NPCtile.y)]);
if WalkToTile(tile(NewTile.x, NewTile.y), Randomness, FlagD then
Result := WalkToTile(tile(NPCTile.Tile), Randomness, FlagD);
end;
end;I need feedback to see whether a larger distance is needed/wanted, so it will walk more tiles.
And also, this gives me a reasonable base for a World Walker, or maybe not? :P
Hope you like it :)
-Boom