DIM map(10, 10) DIM player(5, 5) DIM grass(5, 5) DIM tree(5, 5) DIM water(5, 5) DIM road(5, 5) DIM cavefloor(5, 5) DIM cavewall(5, 5) DIM rock(5, 5) DIM sign(5, 5) DIM house(5, 5) DIM market(5, 5) DIM townhall(5, 5) DIM snow(5, 5) DIM keep(5, 5) DIM wall(5, 5) DIM farm(5, 5) DIM villager(5, 5) DIM orc(5, 5) DIM goblin(5, 5) DIM dagger(5, 5) DIM npc\$(100) DIM npcax(100) DIM npcay(100) DIM npcx(100) DIM npcy(100) DIM npcox(100) DIM npcoy(100) DIM npcs(100) DIM npcsc(100) DIM npct(100) DIM npctc(100) DIM npch(100) DIM npcoh(100) RESTORE npcdata FOR cn = 0 TO 99 READ dat\$ IF dat\$ <> "END" THEN LET npc\$(cn) = dat\$ READ npcax(cn) READ npcay(cn) READ npcx(cn) READ npcy(cn) READ npcs(cn) LET npcsc(cn) = npcs(cn) READ npct(cn) LET npctc(cn) = npct(cn) READ npch(cn) LET npcoh(cn) = npch(cn) ELSE EXIT FOR END IF NEXT cn DIM item\$(100) DIM itemax(100) DIM itemay(100) DIM itemx(100) DIM itemy(100) DIM items(100) DIM itemsc(100) LET item\$(0) = "DAGGER" LET itemax(0) = 5 LET itemay(0) = 3 LET itemx(0) = 4 LET itemy(0) = 4 LET items(0) = 0 LET itemsc(0) = items(0) LET pax = 4 LET pay = 3 LET px = 3 LET py = 3 LET hp = 30 LET lvl = 1 LET tnl = 5 LET xp = 0 LET str = 1 LET mag = 1 LET load = 3 LET wep\$ = "NONE" LET money = 150 LET maxinv = 10 DIM inv\$(maxinv) DIM brief\$(3) DIM cond(3) LET game = 1 GOSUB loadmap GOSUB loadgraphics DO GOSUB drawgraphics GOSUB handleinput GOSUB handleaction LOOP UNTIL game = 0 END drawgraphics: LOCATE 1, 5: PRINT "** THE ADVENTURES OF GORLIK **" LOCATE 1, 39: PRINT "N" LOCATE 2, 38: PRINT "WE" LOCATE 3, 39: PRINT "S" LOCATE 22, 1: PRINT "[1] USE ITEM" LOCATE 23, 1: PRINT "[2] DROP ITEM" LOCATE 3, 1: PRINT "HEALTH :"; hp LOCATE 4, 1: PRINT "LEVEL :"; lvl LOCATE 5, 1: PRINT "NEXT LEVEL:"; tnl LOCATE 6, 1: PRINT "EXPERIENCE:"; xp LOCATE 7, 1: PRINT "STRENGTH :"; str LOCATE 8, 1: PRINT "MAGIC :"; mag LOCATE 9, 1: PRINT "LOAD :"; load LOCATE 10, 1: PRINT "WEAPON : "; wep\$ LOCATE 11, 1: PRINT "MONEY :"; money LOCATE 3, 25: PRINT "INVENTORY:" FOR cinv = 0 TO load LOCATE cinv + 5, 25: PRINT inv\$(cinv) NEXT cinv LET sy = 10 FOR cy = py - 2 TO py + 2 LET sx = 130 LET sy = sy + 5 FOR cx = px - 2 TO px + 2 FOR dy = 0 TO 4 FOR dx = 0 TO 4 IF cx >= 0 AND cx <= 9 AND cy >= 0 AND cy <= 9 THEN SELECT CASE map(cx, cy) CASE 0 PSET (sx + dx, sy + dy), grass(dx, dy) CASE 1 PSET (sx + dx, sy + dy), tree(dx, dy) CASE 2 PSET (sx + dx, sy + dy), water(dx, dy) CASE 3 PSET (sx + dx, sy + dy), road(dx, dy) CASE 4 PSET (sx + dx, sy + dy), cavefloor(dx, dy) CASE 5 PSET (sx + dx, sy + dy), cavewall(dx, dy) CASE 6 PSET (sx + dx, sy + dy), rock(dx, dy) CASE 7 PSET (sx + dx, sy + dy), sign(dx, dy) CASE 8 PSET (sx + dx, sy + dy), house(dx, dy) CASE 9 PSET (sx + dx, sy + dy), market(dx, dy) CASE 10 PSET (sx + dx, sy + dy), townhall(dx, dy) CASE 11 PSET (sx + dx, sy + dy), snow(dx, dy) CASE 12 PSET (sx + dx, sy + dy), keep(dx, dy) CASE 13 PSET (sx + dx, sy + dy), wall(dx, dy) CASE 14 PSET (sx + dx, sy + dy), farm(dx, dy) END SELECT ELSE PSET (sx + dx, sy + dy), 0 END IF NEXT dx NEXT dy FOR ci = 0 TO 99 IF itemax(ci) = pax AND itemay(ci) = pay AND itemx(ci) = cx AND itemy(ci) = cy THEN FOR dy = 0 TO 4 FOR dx = 0 TO 4 SELECT CASE item\$(ci) CASE "DAGGER" IF dagger(dx, dy) > -1 THEN PSET (sx + dx, sy + dy), dagger(dx, dy) END IF END SELECT NEXT dx NEXT dy END IF NEXT FOR cn = 0 TO 99 IF npcax(cn) = pax AND npcay(cn) = pay AND npcx(cn) = cx AND npcy(cn) = cy THEN IF npch(cn) > 0 THEN FOR dy = 0 TO 4 FOR dx = 0 TO 4 SELECT CASE npc\$(cn) CASE "VILLAGER" IF villager(dx, dy) > -1 THEN PSET (sx + dx, sy + dy), villager(dx, dy) END IF CASE "ORC" IF orc(dx, dy) > -1 THEN PSET (sx + dx, sy + dy), orc(dx, dy) END IF CASE "GOBLIN" IF goblin(dx, dy) > -1 THEN PSET (sx + dx, sy + dy), goblin(dx, dy) END IF END SELECT NEXT dx NEXT dy END IF END IF NEXT cn IF cx = px AND cy = py THEN FOR dy = 0 TO 4 FOR dx = 0 TO 4 IF player(dx, dy) > -1 THEN PSET (sx + dx, sy + dy), player(dx, dy) END IF NEXT dx NEXT dy END IF LET sx = sx + 5 NEXT cx NEXT cy RETURN handleinput: LET opx = px LET opy = py LET wkey = 1 LET redraw = 0 WHILE wkey = 1 AND redraw = 0 LET keypress = INP(96) LET flush\$ = INKEY\$ SELECT CASE keypress CASE 72 LET py = py - 1 LET wkey = 0 CASE 77 LET px = px + 1 LET wkey = 0 CASE 80 LET py = py + 1 LET wkey = 0 CASE 75 LET px = px - 1 LET wkey = 0 CASE 2 CLS LINE INPUT "WHAT ITEM WOULD YOU LIKE TO USE? ", op\$ IF UCASE\$(op\$) = "BREAD" THEN FOR cinv = 0 TO load IF inv\$(cinv) = "BREAD" THEN LET inv\$(cinv) = "" LET hp = hp + 1 PRINT "YOU EAT THE BREAD AND FEEL A LITTLE BETTER." EXIT FOR END IF NEXT cinv END IF IF UCASE\$(op\$) = "DAGGER" THEN FOR cinv = 0 TO load IF inv\$(cinv) = "DAGGER" THEN LET wep\$ = inv\$(cinv) END IF NEXT cinv END IF IF UCASE\$(op\$) = "SHORT SWORD" THEN FOR cinv = 0 TO load IF inv\$(cinv) = "SHORT SWORD" THEN LET wep\$ = inv\$(cinv) END IF NEXT cinv END IF IF UCASE\$(op\$) = "LONG SWORD" THEN FOR cinv = 0 TO load IF inv\$(cinv) = "LONG SWORD" THEN LET wep\$ = inv\$(cinv) END IF NEXT cinv END IF IF UCASE\$(op\$) = "BATTLE AXE" THEN FOR cinv = 0 TO load IF inv\$(cinv) = "BATTLE AXE" THEN LET wep\$ = inv\$(cinv) END IF NEXT cinv END IF IF UCASE\$(op\$) = "MORNING STAR" THEN FOR cinv = 0 TO load IF inv\$(cinv) = "MORNING STAR" THEN LET wep\$ = inv\$(cinv) END IF NEXT cinv END IF DO LOOP UNTIL INKEY\$ <> "" CLS LET redraw = 1 CASE 3 CLS LINE INPUT "WHAT ITEM WOULD YOU LIKE TO DROP? ", op\$ FOR cinv = 0 TO load IF inv\$(cinv) = UCASE\$(op\$) THEN LET inv\$(cinv) = "" END IF NEXT cinv CLS LET redraw = 1 CASE 1 LET game = 0 LET wkey = 0 END SELECT WEND RETURN handleaction: IF py < 0 THEN IF pay > 1 THEN LET pay = pay - 1 LET py = 9 GOSUB loadmap ELSE LET py = py + 1 END IF END IF IF px > 9 THEN IF pax < 5 THEN LET pax = pax + 1 LET px = 0 GOSUB loadmap ELSE LET px = px - 1 END IF END IF IF py > 9 THEN IF pay < 5 THEN LET pay = pay + 1 LET py = 0 GOSUB loadmap ELSE LET py = py - 1 END IF END IF IF px < 0 THEN IF pax > 1 THEN LET pax = pax - 1 LET px = 9 GOSUB loadmap ELSE LET px = px + 1 END IF END IF IF map(px, py) = 1 OR map(px, py) = 2 OR map(px, py) = 5 OR map(px, py) = 6 OR map(px, py) = 13 THEN LET px = opx LET py = opy END IF IF map(px, py) = 7 THEN LET px = opx LET py = opy CLS PRINT "SIGN:" PRINT IF pax = 4 AND pay = 2 THEN PRINT "WELCOME TO LUMBY VILLAGE" PRINT "" PRINT "FARMS ARE EAST OF HERE" PRINT "THE CASTLE IS WEST PAST DOWN THE ROAD" PRINT "" PRINT "BEWARE OF ORKS AND GOBLINS IN THE" PRINT "SURROUNDING FORESTS" END IF IF pax = 2 AND pay = 2 THEN PRINT "BEHOLD THE KINGS CASTLE" PRINT "YOU MAY FIND THE KING IN THE KEEP" END IF IF pax = 3 AND pay = 2 THEN PRINT "LUMBY VILLAGE TO THE EAST" PRINT "KINGS CASTLE TO THE WEST" END IF IF pax = 5 AND pay = 1 THEN PRINT "DOOMSPEAK MOUNTAIN RANGE" END IF IF pax = 5 AND pay = 2 THEN PRINT "LUMBY FARMS" END IF DO LOOP UNTIL INKEY\$ <> "" CLS END IF IF map(px, py) = 8 THEN LET px = opx LET py = opy CLS IF pax = 4 AND pay = 3 THEN PRINT "YOUR HOUSE:" PRINT IF wep\$ = "NONE" THEN PRINT "YOU HAVE NO WEAPON, YOU CAN FIND ONE AT THE FARM EAST OF HERE." PRINT "THERE IS A PIECE OF BREAD ON THE TABLE." LINE INPUT "TAKE BREAD? (Y/N) ", op\$ IF UCASE\$(op\$) = "Y" THEN FOR cinv = 0 TO load IF inv\$(cinv) = "" THEN LET inv\$(cinv) = "BREAD" EXIT FOR END IF NEXT IF inv\$(cinv) = "BREAD" THEN PRINT "YOU TOOK THE BREAD." END IF END IF END IF IF pax = 4 AND pay = 2 THEN PRINT "VILLAGER HOUSE:" PRINT SELECT CASE INT(RND * 3) CASE 0 PRINT "THE DOOR IS LOCKED." CASE 1 PRINT "A LADY INVITES YOU INSIDE." LINE INPUT "GO INSIDE? (Y/N)", op\$ IF UCASE\$(op\$) = "Y" THEN PRINT "SHE GIVES YOU SOME WATER AND FRESH APPLE PIE." PRINT "YOU FEEL A LITTLE BETTER." LET hp = hp + INT(RND * 2) + 1 END IF CASE 2 PRINT "YOU SEE A MAN SITTING ON HIS PORCH." CASE 3 PRINT "YOU HEAR SOMEONE ARGUING INSIDE." END SELECT END IF IF pax = 5 AND pay = 2 THEN PRINT "FARMERS HOUSE:" PRINT PRINT "THE DOOR IS LOCKED." END IF DO LOOP UNTIL INKEY\$ <> "" CLS END IF IF map(px, py) = 9 THEN LET px = opx LET py = opy CLS PRINT "MARKET:" PRINT PRINT "WE HAVE MANY ITEMS FOR SALE THAT" PRINT "CAN HELP YOU IN THE FOREST." PRINT PRINT "(1) SHORT SWORD - 25 MONEY" PRINT "(2) LONG SWORD - 35 MOMEY" PRINT "(3) BATTLE AXE - 50 MONEY" PRINT "(4) MORNING STAR - 70 MONEY" PRINT PRINT "(5) HEALTH POTION - 5 MONEY" PRINT PRINT "(0) LEAVE MARKET" PRINT LINE INPUT "SELECT AN ITEM: ", op\$ SELECT CASE op\$ CASE "1" IF money >= 25 THEN FOR cinv = 0 TO load IF inv\$(cinv) = "" THEN LET money = money - 25 LET inv\$(cinv) = "SHORT SWORD" PRINT "YOU BOUGHT THE SHORT SWORD." EXIT FOR END IF NEXT cinv ELSE PRINT "YOU DONT HAVE ENOUGH MONEY!" END IF CASE "2" IF money >= 35 THEN FOR cinv = 0 TO load IF inv\$(cinv) = "" THEN LET money = money - 35 LET inv\$(cinv) = "LONG SWORD" PRINT "YOU BOUGHT THE LONG SWORD." EXIT FOR END IF NEXT cinv ELSE PRINT "YOU DONT HAVE ENOUGH MONEY!" END IF CASE "3" IF money >= 50 THEN FOR cinv = 0 TO load IF inv\$(cinv) = "" THEN LET money = money - 50 LET inv\$(cinv) = "BATTLE AXE" PRINT "YOU BOUGHT THE BATTLE AXE." EXIT FOR END IF NEXT cinv ELSE PRINT "YOU DONT HAVE ENOUGH MONEY!" END IF CASE "4" IF money >= 70 THEN FOR cinv = 0 TO load IF inv\$(cinv) = "" THEN LET money = money - 70 LET inv\$(cinv) = "MORNING STAR" PRINT "YOU BOUGHT THE MORNING STAR." EXIT FOR END IF NEXT cinv ELSE PRINT "YOU DONT HAVE ENOUGH MONEY!" END IF CASE "5" IF money >= 5 THEN FOR cinv = 0 TO load IF inv\$(cinv) = "" THEN LET money = money - 5 LET inv\$(cinv) = "HEALTH POTION" PRINT "YOU BOUGHT THE HEALTH POTION." EXIT FOR END IF NEXT cinv ELSE PRINT "YOU DONT HAVE ENOUGH MONEY!" END IF CASE "0" PRINT "PLEASE COME AGAIN." END SELECT DO LOOP UNTIL INKEY\$ <> "" CLS END IF IF map(px, py) = 10 THEN LET px = opx LET py = opy END IF IF map(px, py) = 12 THEN LET px = opx LET py = opy END IF FOR cn = 0 TO 99 IF npcsc(cn) < npcs(cn) THEN LET npcsc(cn) = npcsc(cn) + 1 IF npcsc(cn) = npcs(cn) THEN LET npch(cn) = npcoh(cn) END IF END IF IF npch(cn) > 0 THEN IF npcx(cn) = px AND npcy(cn) = py AND npcax(cn) = pax AND npcay(cn) = pay THEN CLS SELECT CASE npc\$(cn) CASE "ORC" PRINT "YOU ENCOUNTER AN ORC!" PRINT PRINT "(1) Fight (2) Attempt to run" LET fight = 1 CASE "GOBLIN" PRINT "YOU ENCOUNTER A GOBLIN!" PRINT PRINT "(1) Fight (2) Attempt to run" LET fight = 1 CASE "VILLAGER" PRINT "YOU PASS BY A VILLAGER." END SELECT LET move = 0 WHILE fight IF move = 0 THEN DO IF INKEY\$ = "1" THEN LET move = 1 ELSEIF INKEY\$ = "2" THEN LET move = 2 END IF LOOP UNTIL move = 1 OR move = 2 END IF IF move = 1 THEN DO CLS PRINT "HEALTH:"; hp PRINT npc\$(cn); " HEALTH:"; npch(cn) PRINT PRINT "(1) Attack with weapon." PRINT "(2) Attack with magic." PRINT DO IF INKEY\$ = "1" THEN LET move = 1 ELSEIF INKEY\$ = "2" THEN LET move = 2 ELSE LET move = 0 END IF LOOP UNTIL move = 1 OR move = 2 IF move = 1 THEN LET damage = INT(RND * lvl + 1) + INT(RND * str) IF wep\$ = "DAGGER" THEN LET damage = damage + INT(RND * 3) ELSEIF wep\$ = "SHORT SWORD" THEN LET damage = damage + INT(RND * 4) ELSEIF wep\$ = "LONG SWORD" THEN LET damage = damage + INT(RND * 6) ELSEIF wep\$ = "BATTLE AXE" THEN LET damage = damage + INT(RND * 9) ELSEIF wep\$ = "MORNING STAR" THEN LET damage = damage + INT(RND * 13) ELSEIF wep\$ = "STAFF" THEN LET damage = damage + INT(RND * 4) ELSEIF wep\$ = "ENCHANTED STAFF" THEN LET damage = damage + INT(RND * 5) END IF LET npch(cn) = npch(cn) - damage PRINT "YOU ATTACK THE "; npc\$(cn); " FOR"; damage; "DAMAGE." ELSEIF move = 2 THEN END IF LET move = 1 IF npch(cn) > 0 THEN IF npc\$(cn) = "ORC" THEN LET damage = INT(RND * 5) + INT(RND * lvl * 3) END IF LET hp = hp - damage PRINT "THE "; npc\$(cn); " ATTACKS YOU FOR"; damage; "DAMAGE." DO LOOP UNTIL INKEY\$ <> "" ELSE LET xp = xp + INT(RND * lvl) + 1 LET money = money + INT(RND * 6) LET npcsc(cn) = 0 LET fight = 0 PRINT "YOU HAVE KILLED THE "; npc\$(cn) END IF IF hp <= 0 THEN CLS PRINT "YOU HAVE BEEN KILLED BY THE "; npc\$(cn); "!" DO LOOP UNTIL INKEY\$ <> "" END END IF LOOP UNTIL fight = 0 ELSEIF move = 2 THEN PRINT "YOU ATTEMPT TO RUN." DO LOOP UNTIL INKEY\$ <> "" IF INT(RND * 3) = 1 THEN LET fight = 0 PRINT "YOU RAN AWAY SUCCESSFULLY!" ELSE LET move = 1 PRINT "YOU WERE UNABLE TO RUN AWAY." DO LOOP UNTIL INKEY\$ <> "" END IF END IF DO LOOP UNTIL INKEY\$ <> "" WEND DO LOOP UNTIL INKEY\$ <> "" CLS END IF END IF LET npctc(cn) = npctc(cn) - 1 IF npctc(cn) = 0 THEN LET npctc(cn) = npct(cn) LET npcox(cn) = npcx(cn) LET npcoy(cn) = npcy(cn) SELECT CASE INT(RND * 4) CASE 0 LET npcy(cn) = npcy(cn) - 1 CASE 1 LET npcx(cn) = npcx(cn) + 1 CASE 2 LET npcy(cn) = npcy(cn) + 1 CASE 3 LET npcx(cn) = npcx(cn) - 1 END SELECT IF npcy(cn) < 0 OR npcx(cn) > 9 OR npcy(cn) > 9 OR npcx(cn) < 0 THEN LET npcx(cn) = npcox(cn) LET npcy(cn) = npcoy(cn) END IF IF map(npcx(cn), npcy(cn)) = 1 OR map(npcx(cn), npcy(cn)) = 2 OR map(npcx(cn), npcy(cn)) = 6 OR map(npcx(cn), npcy(cn)) = 7 OR map(npcx(cn), npcy(cn)) = 8 OR map(npcx(cn), npcy(cn)) = 9 OR map(npcx(cn), npcy(cn)) = 10 OR map(npcx(cn), npcy(cn)) = 12 THEN LET npcx(cn) = npcox(cn) LET npcy(cn) = npcoy(cn) END IF END IF NEXT cn FOR ci = 0 TO 99 IF itemax(ci) = pax AND itemay(ci) = pay AND itemx(ci) = px AND itemy(ci) = py THEN SELECT CASE item\$(ci) CASE "DAGGER" CLS PRINT "YOU FOUND A DAGGER." LINE INPUT "PICK IT UP? (Y/N) ", op\$ IF UCASE\$(op\$) = "Y" THEN FOR cinv = 0 TO load IF inv\$(cinv) = "" THEN LET inv\$(cinv) = "DAGGER" LET item\$(ci) = "" PRINT "YOU GOT THE DAGGER." EXIT FOR END IF NEXT END IF DO LOOP UNTIL INKEY\$ <> "" CLS END SELECT END IF NEXT ci RETURN loadgraphics: SCREEN 13 RESTORE playerdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ player(imgx, imgy) NEXT imgx NEXT imgy RESTORE grassdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ grass(imgx, imgy) NEXT imgx NEXT imgy RESTORE treedata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ tree(imgx, imgy) NEXT imgx NEXT imgy RESTORE waterdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ water(imgx, imgy) NEXT imgx NEXT imgy RESTORE roaddata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ road(imgx, imgy) NEXT imgx NEXT imgy RESTORE cavefloordata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ cavefloor(imgx, imgy) NEXT imgx NEXT imgy RESTORE cavewalldata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ cavewall(imgx, imgy) NEXT imgx NEXT imgy RESTORE rockdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ rock(imgx, imgy) NEXT imgx NEXT imgy RESTORE signdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ sign(imgx, imgy) NEXT imgx NEXT imgy RESTORE housedata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ house(imgx, imgy) NEXT imgx NEXT imgy RESTORE marketdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ market(imgx, imgy) NEXT imgx NEXT imgy RESTORE townhalldata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ townhall(imgx, imgy) NEXT imgx NEXT imgy RESTORE snowdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ snow(imgx, imgy) NEXT imgx NEXT imgy RESTORE keepdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ keep(imgx, imgy) NEXT imgx NEXT imgy RESTORE walldata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ wall(imgx, imgy) NEXT imgx NEXT imgy RESTORE farmdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ farm(imgx, imgy) NEXT imgx NEXT imgy RESTORE villagerdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ villager(imgx, imgy) NEXT imgx NEXT imgy RESTORE orcdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ orc(imgx, imgy) NEXT imgx NEXT imgy RESTORE goblindata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ goblin(imgx, imgy) NEXT imgx NEXT imgy RESTORE daggerdata FOR imgy = 0 TO 4 FOR imgx = 0 TO 4 READ dagger(imgx, imgy) NEXT imgx NEXT imgy RETURN loadmap: IF pax = 1 AND pay = 1 THEN RESTORE map1 ELSEIF pax = 2 AND pay = 1 THEN RESTORE map2 ELSEIF pax = 3 AND pay = 1 THEN RESTORE map3 ELSEIF pax = 4 AND pay = 1 THEN RESTORE map4 ELSEIF pax = 5 AND pay = 1 THEN RESTORE map5 ELSEIF pax = 1 AND pay = 2 THEN RESTORE map6 ELSEIF pax = 2 AND pay = 2 THEN RESTORE map7 ELSEIF pax = 3 AND pay = 2 THEN RESTORE map8 ELSEIF pax = 4 AND pay = 2 THEN RESTORE map9 ELSEIF pax = 5 AND pay = 2 THEN RESTORE map10 ELSEIF pax = 1 AND pay = 3 THEN RESTORE map11 ELSEIF pax = 2 AND pay = 3 THEN RESTORE map12 ELSEIF pax = 3 AND pay = 3 THEN RESTORE map13 ELSEIF pax = 4 AND pay = 3 THEN RESTORE map14 ELSEIF pax = 5 AND pay = 3 THEN RESTORE map15 ELSEIF pax = 1 AND pay = 4 THEN RESTORE map16 ELSEIF pax = 2 AND pay = 4 THEN RESTORE map17 ELSEIF pax = 3 AND pay = 4 THEN RESTORE map18 ELSEIF pax = 4 AND pay = 4 THEN RESTORE map19 ELSEIF pax = 5 AND pay = 4 THEN RESTORE map20 ELSEIF pax = 1 AND pay = 5 THEN RESTORE map21 ELSEIF pax = 2 AND pay = 5 THEN RESTORE map22 ELSEIF pax = 3 AND pay = 5 THEN RESTORE map23 ELSEIF pax = 4 AND pay = 5 THEN RESTORE map24 ELSEIF pax = 5 AND pay = 5 THEN RESTORE map25 END IF FOR mapy = 0 TO 9 FOR mapx = 0 TO 9 READ map(mapx, mapy) NEXT mapx NEXT mapy RETURN playerdata: DATA -1,-1,14,-1,-1 DATA -1,14,14,14,-1 DATA -1,-1,14,-1,-1 DATA -1,14,-1,14,-1 DATA -1,14,-1,14,-1 grassdata: DATA 02,02,02,02,02 DATA 02,02,02,02,02 DATA 02,02,02,02,02 DATA 02,02,02,02,02 DATA 02,02,02,02,02 treedata: DATA 02,02,10,02,02 DATA 02,10,10,10,02 DATA 10,10,10,10,10 DATA 02,02,06,02,02 DATA 02,02,06,02,02 waterdata: DATA 01,01,01,01,01 DATA 01,01,01,01,01 DATA 01,01,01,01,01 DATA 01,01,01,01,01 DATA 01,01,01,01,01 roaddata: DATA 06,02,06,02,06 DATA 02,06,02,06,02 DATA 06,02,06,02,06 DATA 02,06,02,06,02 DATA 06,02,06,02,06 cavefloordata: DATA 07,00,07,00,07 DATA 00,07,00,07,00 DATA 07,00,07,00,07 DATA 00,07,00,07,00 DATA 07,00,07,00,07 cavewalldata: DATA 08,00,08,00,08 DATA 00,08,00,08,00 DATA 08,00,08,00,08 DATA 00,08,00,08,00 DATA 08,00,08,00,08 rockdata: DATA 08,08,08,08,08 DATA 08,08,08,08,08 DATA 08,08,08,08,08 DATA 08,08,08,08,08 DATA 08,08,08,08,08 signdata: DATA 02,02,02,02,02 DATA 02,06,06,06,02 DATA 02,06,06,06,02 DATA 02,02,06,02,02 DATA 02,02,06,02,02 housedata: DATA 02,07,07,07,02 DATA 07,07,07,07,07 DATA 02,06,06,06,02 DATA 02,06,06,06,02 DATA 02,06,06,06,02 marketdata: DATA 02,02,02,02,02 DATA 13,05,13,05,13 DATA 02,06,06,06,02 DATA 02,06,06,06,02 DATA 02,06,06,06,02 townhalldata: DATA 02,07,02,02,02 DATA 07,07,07,02,02 DATA 06,06,06,06,06 DATA 06,06,06,06,06 DATA 06,06,06,06,06 snowdata: DATA 15,15,15,15,15 DATA 15,15,15,15,15 DATA 15,15,15,15,15 DATA 15,15,15,15,15 DATA 15,15,15,15,15 keepdata: DATA 08,02,08,02,08 DATA 08,08,08,08,08 DATA 08,00,08,00,08 DATA 08,00,08,00,08 DATA 08,08,08,08,08 walldata: DATA 02,08,08,08,02 DATA 08,08,08,08,08 DATA 08,08,08,08,08 DATA 08,08,08,08,08 DATA 02,08,08,08,02 farmdata: DATA 02,02,02,02,02 DATA 06,06,10,06,06 DATA 02,02,02,02,02 DATA 06,10,06,06,06 DATA 02,02,02,02,02 villagerdata: DATA -1,-1,14,-1,-1 DATA -1,06,06,06,-1 DATA -1,-1,06,-1,-1 DATA -1,06,-1,06,-1 DATA -1,14,-1,14,-1 orcdata: DATA -1,-1,04,-1,07 DATA -1,04,04,04,06 DATA -1,-1,04,-1,06 DATA -1,04,-1,04,06 DATA -1,04,-1,04,06 goblindata: DATA -1,-1,06,-1,-1 DATA -1,06,06,06,-1 DATA -1,-1,06,-1,-1 DATA -1,06,-1,06,-1 DATA -1,06,-1,06,-1 daggerdata: DATA -1,-1,08,-1,-1 DATA -1,-1,08,-1,-1 DATA -1,-1,08,-1,-1 DATA -1,06,06,06,-1 DATA -1,-1,06,-1,-1 map1: DATA 11,11,11,11,11,11,02,11,11,11 DATA 11,11,06,06,06,06,02,06,06,06 DATA 11,06,06,00,00,00,02,00,00,06 DATA 06,06,00,00,00,00,02,01,00,00 DATA 06,06,00,00,00,02,02,00,01,00 DATA 06,00,00,00,02,02,02,00,00,00 DATA 06,00,00,02,02,02,02,00,00,00 DATA 00,01,00,00,02,02,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map2: DATA 11,11,06,00,00,00,00,00,01,06 DATA 06,06,06,00,01,00,00,00,00,00 DATA 06,06,00,00,00,00,00,00,00,00 DATA 00,00,00,01,00,00,01,00,01,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,01,00,00,00,00,01,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,01,00,00,01,00,00,01,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map3: DATA 06,06,11,11,11,11,11,11,06,06 DATA 00,06,06,11,11,11,06,06,06,06 DATA 00,06,06,06,06,06,06,06,06,06 DATA 00,06,06,06,06,00,00,01,00,06 DATA 00,00,06,06,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,01,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,01,00,00 DATA 00,00,01,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map4: DATA 11,06,06,06,00,00,00,00,00,00 DATA 06,06,00,00,00,00,00,00,00,00 DATA 06,00,01,00,00,00,00,00,00,00 DATA 06,00,00,00,00,01,00,01,00,00 DATA 00,00,01,00,00,00,00,00,00,00 DATA 00,01,00,00,00,00,00,01,00,00 DATA 00,00,01,00,00,00,01,00,00,00 DATA 00,01,00,00,01,00,00,00,00,00 DATA 00,01,00,01,00,00,00,01,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map5: DATA 00,06,06,06,06,06,06,06,06,06 DATA 00,06,06,06,06,06,06,06,06,06 DATA 00,06,06,06,06,06,06,06,06,06 DATA 00,00,00,06,06,06,06,06,06,06 DATA 00,00,00,06,06,06,06,06,06,06 DATA 00,00,00,00,06,06,06,06,06,06 DATA 00,00,00,00,00,06,06,06,06,06 DATA 00,00,07,00,00,00,06,06,06,06 DATA 00,00,00,00,00,00,00,00,06,06 DATA 00,00,00,00,00,00,00,00,00,00 map6: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,01,00,00,01,00,00,00,00 DATA 01,00,00,00,00,00,00,01,00,00 DATA 00,00,01,00,00,01,00,01,00,00 DATA 00,01,00,00,00,00,00,00,00,00 DATA 00,00,00,01,00,00,00,01,01,00 DATA 00,01,00,00,01,01,00,00,00,00 DATA 01,00,00,00,00,00,00,01,00,00 DATA 00,01,00,01,00,01,00,00,01,00 DATA 00,00,00,00,00,00,00,00,00,00 map7: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,13,13,13,13,13,13,00,00,00 DATA 00,13,00,00,00,00,13,00,00,00 DATA 00,13,00,12,00,00,13,07,00,00 DATA 00,13,00,00,00,00,00,00,00,03 DATA 00,13,00,00,00,00,13,00,00,00 DATA 00,13,13,13,13,13,13,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map8: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,14,14,14,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,01,00,00,07,00,14,14,14,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 03,03,03,03,03,03,03,03,03,03 DATA 00,00,00,00,00,00,00,01,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map9: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,01,00,00,00,00,00,00,00 DATA 00,01,01,08,00,08,00,01,00,00 DATA 00,08,00,00,00,00,08,00,00,00 DATA 00,00,00,07,10,00,00,00,01,00 DATA 03,03,03,00,00,00,00,00,00,00 DATA 00,08,00,00,00,09,00,00,00,00 DATA 00,00,00,00,00,00,00,01,00,00 DATA 00,01,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map10: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,14,14,14,14,00,14,14,14,00 DATA 00,14,14,14,14,00,14,14,14,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,14,14,14,14,00,07,08,00,00 DATA 00,14,14,14,14,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,14,14,14,14,14,14,14,14,00 DATA 00,14,14,14,14,14,14,14,14,00 DATA 00,00,00,00,00,00,00,00,00,00 map11: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,01,00,01,00,01,00,02 DATA 00,01,01,00,00,00,02,02,02,02 DATA 00,00,00,00,00,02,02,02,02,02 DATA 01,00,00,00,01,02,02,02,02,02 DATA 00,00,01,00,00,00,00,02,02,02 DATA 00,00,00,00,00,00,01,00,02,02 DATA 00,00,01,00,01,00,00,00,00,00 DATA 00,01,00,00,00,00,00,01,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map12: DATA 00,00,00,00,00,00,00,00,00,00 DATA 02,00,00,00,00,00,00,00,00,00 DATA 02,02,00,00,00,00,00,00,00,00 DATA 02,02,02,02,02,02,02,02,00,00 DATA 02,02,02,02,02,02,02,02,00,00 DATA 02,02,02,02,02,02,02,02,00,00 DATA 02,02,02,02,02,02,02,02,02,00 DATA 00,02,02,02,02,02,02,02,02,00 DATA 00,02,02,02,02,02,02,02,02,00 DATA 00,00,02,02,02,02,02,02,02,00 map13: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,06,06,00,06,06,00,00,00 DATA 00,00,06,06,06,06,06,06,00,00 DATA 00,06,06,06,06,11,11,06,06,00 DATA 00,06,06,06,11,11,11,06,06,00 DATA 00,06,06,06,06,11,06,06,06,00 DATA 00,06,06,06,06,06,06,06,06,00 DATA 00,06,06,06,06,06,06,06,06,00 DATA 00,00,06,00,00,06,06,06,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map14: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,01,00,00,01,00,01,00,01,00 DATA 00,00,01,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,01,00,00 DATA 00,01,00,00,00,08,00,00,01,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,01,00,00,00,01,00,00 DATA 00,00,01,00,00,00,01,00,00,00 DATA 00,00,00,00,00,00,01,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map15: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,14,14,00,02,02,00,00,01,00 DATA 00,14,14,00,00,02,02,00,00,00 DATA 00,00,00,00,00,02,00,00,01,00 DATA 00,14,14,14,00,00,00,00,00,00 DATA 00,14,14,14,00,00,00,00,00,00 DATA 00,00,00,00,01,01,00,01,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,01,00,01,00,00,01,00,01,00 DATA 00,00,00,00,00,00,00,00,00,00 map16: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,01,00,00,00,00,00,00,00,00 DATA 00,01,00,00,01,00,00,00,01,00 DATA 00,00,01,00,01,00,00,00,01,00 DATA 00,00,00,00,00,00,01,00,00,00 DATA 00,01,00,01,00,00,00,01,01,00 DATA 00,00,00,00,01,01,00,01,00,00 DATA 00,00,01,00,01,01,00,01,00,00 DATA 01,01,00,00,01,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 map17: DATA 00,00,02,02,02,02,02,02,02,00 DATA 00,00,02,02,02,02,02,02,02,00 DATA 00,00,02,02,02,02,02,02,02,00 DATA 00,00,02,02,02,02,02,02,02,02 DATA 00,00,02,02,02,02,02,02,02,02 DATA 00,02,02,02,02,02,02,02,02,02 DATA 00,02,02,02,02,02,02,02,02,02 DATA 00,02,02,02,02,02,02,02,02,02 DATA 00,02,02,02,02,02,02,02,02,02 DATA 00,00,00,00,02,02,02,02,02,02 map18: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 02,02,02,02,02,02,02,02,00,00 DATA 02,02,02,02,02,02,02,02,02,02 DATA 02,02,02,02,02,02,02,02,02,02 DATA 02,02,02,02,02,02,02,02,02,02 DATA 02,02,02,02,02,02,02,02,02,02 DATA 02,02,02,02,02,02,02,02,02,02 DATA 02,02,02,02,02,02,02,02,02,02 map19: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 02,00,00,00,00,00,00,00,00,00 DATA 02,02,02,02,02,02,02,00,00,00 DATA 02,02,02,02,02,02,02,00,00,00 DATA 02,02,02,02,02,02,02,02,00,00 DATA 02,02,02,02,02,02,02,02,02,00 DATA 02,02,02,02,02,02,02,02,02,00 map20: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,01,00,00,00,00,01,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,01,00,00,01,00,00,00,00 DATA 00,01,00,00,00,00,00,00,00,00 DATA 00,00,01,00,00,00,00,01,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,01,00,00,00,00,00,00,01,00 DATA 00,00,00,00,00,00,00,00,00,00 map21: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,01,00,01,01,00,00,01,00,00 DATA 00,00,01,00,00,00,01,01,00,00 DATA 00,00,01,00,00,01,01,01,01,00 DATA 00,01,00,00,00,00,00,01,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 01,00,00,00,00,00,00,00,01,00 DATA 01,00,00,00,00,01,01,00,00,00 DATA 01,00,00,01,01,01,01,01,00,00 DATA 01,00,01,01,01,01,01,00,00,00 map22: DATA 00,00,00,00,02,02,02,02,02,02 DATA 00,00,00,00,00,00,00,00,05,05 DATA 00,00,00,00,00,00,01,00,05,05 DATA 00,00,01,00,01,00,00,00,04,04 DATA 00,01,00,00,00,01,00,00,05,05 DATA 00,01,00,00,00,00,00,00,05,05 DATA 00,00,00,00,00,00,00,00,05,05 DATA 00,01,00,00,00,00,00,00,05,05 DATA 00,01,01,00,00,00,01,05,05,05 DATA 00,00,01,01,01,00,05,05,05,05 map23: DATA 05,05,05,05,05,05,05,05,05,05 DATA 05,05,05,05,05,05,05,05,05,05 DATA 05,05,05,05,05,05,05,05,05,05 DATA 04,04,04,05,04,04,05,05,05,05 DATA 05,05,04,05,04,04,04,04,05,05 DATA 05,05,04,05,05,04,04,04,05,05 DATA 05,05,04,05,04,04,04,05,05,05 DATA 05,05,04,04,04,05,04,04,05,05 DATA 05,05,05,05,05,05,05,05,05,05 DATA 05,05,05,05,05,05,05,05,05,05 map24: DATA 02,02,02,02,02,02,02,02,02,00 DATA 02,02,02,02,02,02,02,02,02,00 DATA 02,02,02,02,02,02,02,02,02,00 DATA 00,02,02,02,02,02,02,02,02,00 DATA 00,02,02,02,02,02,02,02,00,00 DATA 00,02,02,02,02,02,02,02,00,00 DATA 00,02,02,02,02,02,02,02,00,00 DATA 00,00,02,02,02,02,02,02,00,00 DATA 00,00,02,02,02,02,02,02,00,00 DATA 00,00,02,02,02,02,02,02,00,00 map25: DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,00,00,00,00,00,00,00 npcdata: REM AREA 2 DATA "GOBLIN",2,1,4,1,15,2,10 DATA "GOBLIN",2,1,5,1,15,2,10 DATA "GOBLIN",2,1,6,1,15,2,10 DATA "GOBLIN",2,1,7,1,15,2,10 DATA "ORC",2,1,8,1,15,2,15 DATA "ORC",2,1,8,2,15,2,15 REM AREA 3 DATA "GOBLIN",3,1,1,4,15,2,7 DATA "GOBLIN",3,1,1,5,15,2,7 REM AREA 4 DATA "GOBLIN",4,1,3,2,15,2,7 DATA "GOBLIN",4,1,4,2,15,2,7 DATA "GOBLIN",4,1,5,2,15,2,7 REM AREA 6 DATA "GOBLIN",1,2,1,1,15,2,10 DATA "GOBLIN",1,2,2,1,15,2,10 DATA "GOBLIN",1,2,3,1,15,2,10 DATA "ORC",1,2,4,1,15,2,15 DATA "ORC",1,2,5,1,15,2,15 REM AREA 9 DATA "VILLAGER",4,2,1,1,15,5,5 DATA "VILLAGER",4,2,2,1,15,5,5 DATA "VILLAGER",4,2,3,1,15,5,5 REM AREA 11 DATA "GOBLIN",1,3,1,1,10,2,15 DATA "GOBLIN",1,3,2,1,10,2,15 DATA "GOBLIN",1,3,3,1,10,2,15 DATA "ORC",1,3,4,1,10,2,25 DATA "ORC",1,3,5,1,10,2,25 DATA "ORC",1,3,6,1,10,2,25 DATA "ORC",1,3,7,1,10,2,25 DATA "ORC",1,3,8,1,10,2,25 DATA "ORC",1,3,9,1,10,2,25 REM AREA 16 DATA "GOBLIN",1,4,1,1,5,1,20 DATA "GOBLIN",1,4,2,1,5,1,20 DATA "GOBLIN",1,4,3,1,5,1,20 DATA "GOBLIN",1,4,4,1,5,1,20 DATA "GOBLIN",1,4,1,2,5,1,30 DATA "GOBLIN",1,4,1,3,5,1,30 DATA "GOBLIN",1,4,1,4,5,1,30 DATA "GOBLIN",1,4,1,5,5,1,30 DATA "GOBLIN",1,4,1,6,5,1,30 DATA "GOBLIN",1,4,1,7,5,1,30 REM END OF DATA DATA "END"