!NPC Walker Script ! Copyright (c)1997 AbyssWare ! By: AbyssDragon ! abyssdragon@juno.com http://www.geocities.com/TimesSquare/2795 ! Version 2! Fixes a a bug that Imi pointed out, and stops them from trampling ! over other NPCs and objects. They'll still walk off of the edge of a world, ! and appear on the other side, so be sure to wall them in :) ! NOTE: To use this you must put a WALKER npc type in your DCCTOKEN.DAT file! ! In my script there is animation, but I opted to leave it out of this simply ! because not everyone has drawn tiles for all NPCs. It is very easy to add if ! you want, but if you have trouble doing so, just ask me at ! abyssdragon@juno.com and I'll send you my script with instructions on how ! the blocks are arranged for it. if npc.class = walker then L1 = npc.x; L2 = npc.y; L3 = 0; L0 = random(4); if L0 = 0 then if world.density(L1,L2 + 1) > 0 goto END_WALKER; L4 = locate(npc,L1,L2 + 1); if L4 > -1 goto END_WALKER; L5 = locate(object,L1,L2 + 1); if L5 > -1 goto END_WALKER; inc(npc.y); elsif L0 = 1 then if world.density(L1,L2 - 1) > 0 goto END_WALKER; L4 = locate(npc,L1,L2 - 1); if L4 > -1 goto END_WALKER; L5 = locate(object,L1,L2 - 1); if L5 > -1 goto END_WALKER; dec(npc.y); elsif L0 = 2 then if world.density(L1 - 1,L2) > 0 goto END_WALKER; L4 = locate(npc,L1 - 1,L2); if L4 > -1 goto END_WALKER; L5 = locate(object,L1 - 1,L2); if L5 > -1 goto END_WALKER; dec(npc.x); elsif L0 = 3 then if world.density(L1 + 1,L2) > 0 goto END_WALKER; L4 = locate(npc,L1 + 1,L2); if L4 > -1 goto END_WALKER; L5 = locate(object,L1 + 1,L2); if L5 > -1 goto END_WALKER; inc(npc.x); endif; endif; :END_WALKER ! THE END!