TILEMASTER2004 DATA V1
SCRIPT: 400
0 DBG "Rest script running"
0 CheckCondition POISONED 600
0 Check FP == 1 300
0 EnterZM -DEFFILE 1
0 CheckPos 100 -1 -1 10
0 CheckPos 101 -1 -1 20
0 CheckPos 102 -1 -1 30
0 CheckPos 103 -1 -1 40
0 CheckPos 104 -1 -1 50
0 CheckPos 111 -1 -1 60
0 CheckPos 131 -1 -1 70
0 CheckPos 105 -1 -1 80
0 CheckPos 106 -1 -1 90
0 Message "NOT HERE!"
0 Pause
0 ExitZM
0 BREAK ABORT
1 Pause
0 SetRedraw 0
0 ExitZM
0 BREAK
5 Random 50 0
0 SetZMRetreat -CREATURE TARGET
0 BREAK
600 Message "You may not rest while poisoned"
0 BREAK ABORT
10 DBG "Grassland"
0 Teleport 0 4 5
0 Pause
0 Message "You build a fire"
0 AlterTiles 35 5 5
0 Sound 105
0 Pause
0 Message "You put some padding on the ground and lay down"
0 AlterPCTile 144
0 Pause
0 CMessage "You fall asleep"
0 Script 500
11 CMessage -NL
0 AlterPCTile BASE
0 VerifyRE 12 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 10 410 7 200 3 240
12 GOTO 100
20 DBG "Swamp"
0 SetRedraw 0
0 Message "You find a clearing in the swamp"
0 AlterTiles 2 4 5
0 AlterTiles 2 3 6 5 6
0 AlterTiles 2 4 7 6 7
0 Teleport 0 3 5
0 SetRedraw 1
0 Pause
0 Message "You build a fire"
0 AlterTiles 35 4 5
0 Sound 105
0 Pause
0 Message "You put some padding on the ground and lay down"
0 AlterPCTile 144
0 Pause
0 CMessage "The swamp is not a comfortable place to sleep, but as you try to ignore the bugs, dampness, and threatening sounds, you manage to fall asleep"
0 Script 500
21 CMessage -NL
0 AlterPCTile BASE
0 VerifyRE 22 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 85 - 8 411 5 231 2 201
22 GOTO 101
30 DBG "Forest"
0 SetRedraw 0
0 Message "You find a clearing in the trees"
0 AlterTiles 2 5 4 7 6
0 AlterTiles 2 4 5
0 AlterTiles 2 6 3
0 AlterTiles 2 8 6
0 AlterTiles 2 7 7
0 Teleport 0 5 5
0 SetRedraw 1
0 Pause
0 Message "You build a fire"
0 AlterTiles 35 6 5
0 Sound 105
0 Pause
0 Message "You put some padding on the ground and lay down"
0 AlterPCTile 144
0 Pause
0 CMessage "You fall asleep"
0 Script 500
31 CMessage -NL
0 AlterPCTile BASE
0 VerifyRE 32 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 90 - 5 410 3 200 2 240
32 GOTO 100
40 DBG "Hills"
0 SetRedraw 0
0 Message "You find a relatively flat place in the hills"
0 AlterTiles 111 4 4 6 6
0 AlterTiles 10 6 3
0 Teleport 0 4 5
0 SetRedraw 1
0 Pause
0 Message "You build a fire"
0 AlterTiles 35 5 5
0 Sound 105
0 Pause
0 Message "You put some padding on the ground and lay down"
0 AlterPCTile 144
0 Pause
0 CMessage "You fall asleep"
0 Script 500
41 CMessage -NL
0 AlterPCTile BASE
0 VerifyRE 42 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 10 412 7 202 3 240
42 GOTO 100
50 DBG "Bushes"
0 SetRedraw 0
0 Message "You find a clearing in the bushes"
0 AlterTiles 2 4 4 6 6
0 AlterTiles 2 7 5
0 AlterTiles 7 4 2
0 AlterTiles 7 3 3
0 AlterTiles 7 2 4
0 AlterTiles 7 8 5 8 6
0 AlterTiles 7 4 8
0 Teleport 0 4 5
0 SetRedraw 1
0 Pause
0 Message "You build a fire"
0 AlterTiles 35 5 5
0 Sound 105
0 Pause
0 Message "You put some padding on the ground and lay down"
0 AlterPCTile 144
0 Pause
0 CMessage "You fall asleep"
0 Script 500
51 CMessage -NL
0 AlterPCTile BASE
0 VerifyRE 52 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 10 410 7 200 3 240
52 GOTO 100
60 DBG "Ship"
0 Message "You decide to rest outside on the upper deck in case of a threat to the ship"
0 Teleport 0 4 8
0 Pause
0 Message "You put some padding on the deck and lay down"
0 AlterPCTile 144
0 Pause
0 CMessage "You fall asleep"
0 Script 500
61 CMessage -NL
0 AlterPCTile BASE
0 VerifyRE 62 -ETAB OMAP -TYPE CREATURE -TERRAIN WATER -NOT
0 CRandom 85 - 8 210 7 220
62 Message "You wake up rested, although a little cold"
0 GivePCMB 2 4 8
0 Heal 4% SKIPNE
0 GiveSP 40%
0 GOTO 1
70 DBG "Boat"
0 NeedRedraw
0 Pause
0 Message "You put some padding on the deck and lay down"
0 AlterPCTile 144
0 Pause
0 CMessage "The small craft is not comfortable, but you manage to fall asleep"
0 Script 500
71 CMessage -NL
0 AlterPCTile BASE
0 VerifyRE 72 -ETAB OMAP -TYPE CREATURE -TERRAIN WATER -NOT
0 CRandom 85 - 8 210 7 220
72 GOTO 101
80 DBG "Desert"
0 Teleport 0 4 5
0 Pause
0 Message "The desert grows cold as night falls, so you build a fire"
0 AlterTiles 35 5 5
0 Sound 105
0 Pause
0 Message "You put some padding on the ground and lay down"
0 AlterPCTile 144
0 Pause
0 CMessage "You fall asleep"
0 Script 500
81 CMessage -NL
0 AlterPCTile BASE
0 VerifyRE 82 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 10 410 7 230 3 240
82 GOTO 100
90 DBG "Arctic"
0 Teleport 0 4 5
0 Pause
0 Message "You use some of the firewood you are carrying to build a much-needed fire"
0 AlterTiles 35 5 5
0 Sound 105
0 Pause
0 Message "You put some padding on the ground and lay down"
0 AlterPCTile 144
0 Pause
0 CMessage "The bitter cold here is very uncomfortable, but you manage to fall asleep"
0 Script 500
91 CMessage -NL
0 AlterPCTile BASE
0 VerifyRE 92 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 10 410 10 200
92 GOTO 101
300 DBG "Dungeon"
0 SetFlag 27 0
0 StartSLineIterator PC N 10 -NOSTART
331 SetSafety 256
332 SetTargetSLineIterator 340
0 CheckTarget 335 -CREATURE
0 CheckTarget 340 -VIEW BLOCKED
0 GOTO 332
335 Message "Creatures are nearby!  You may not rest here."
0 BREAK ABORT
340 SetFlag 27 +1
0 CheckFlagSwitch 27  1 341  2 342  3 343
0 Pos PC -SETTARGET
0 CheckTarget 335 -CREATURE
0 GOTO 350
341 StartSLineIterator PC E 10 -NOSTART
0 GOTO 331
342 StartSLineIterator PC S 10 -NOSTART
0 GOTO 331
343 StartSLineIterator PC W 10 -NOSTART
0 GOTO 331
350 EnterZM -DEFFILE 1
0 Message "You find a spot to rest"
0 SetRedraw 0
0 Pos 0 5 -TAG 311 -CHECKTERRAIN BLOCKED
0 Pos 10 5 -TAG 312 -CHECKTERRAIN BLOCKED
0 Pos 5 0 -TAG 314 -CHECKTERRAIN BLOCKED
0 Pos 5 10 -TAG 315 -CHECKTERRAIN BLOCKED
0 Teleport 0 4 5
0 GOTO 310
311 Teleport 0 1 4
0 GOTO 310
312 Teleport 0 9 4
0 GOTO 310
314 Teleport 0 4 1
0 GOTO 310
315 Teleport 0 4 9
310 SetRedraw 1
0 Pause
0 Message "You put some padding on the ground and lay down"
0 AlterPCTile 144
0 Pause
0 CMessage "The dungeon is not a comfortable place to sleep, but as you try to ignore the ominous silence and lurking dangers, you manage to fall asleep"
0 Script 500
301 CMessage -NL
0 AlterPCTile BASE
0 VerifyRE 302 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 20 320
302 GOTO 101
320 Pos 5 0 -TAG 321 -CHECKTERRAIN BLOCKED
0 GOTO 400
321 Pos 10 5 -TAG 322 -CHECKTERRAIN BLOCKED
0 GOTO 401
322 Pos 5 10 -TAG 323 -CHECKTERRAIN BLOCKED
0 GOTO 402
323 Pos 0 5 -TAG 324 -CHECKTERRAIN BLOCKED
0 GOTO 403
324 DBG "Could not create encounter (all walls blocked)"
0 GOTO 1
100 Message "You wake up rested"
0 GivePCMB 2 5 10
0 Heal 5% SKIPNE
0 GiveSP 50%
0 SetLightSource 0
0 GOTO 1
101 Message "You wake up somewhat rested after a few hours of restless sleep"
0 GivePCMB 2 3 6
0 Heal 3% SKIPNE
0 GiveSP 30%
0 SetLightSource 0
0 GOTO 1
200 VerifyRE 410 -ETAB OMAP -TYPE CREATURE -ID 11 -NOT
0 Message "You suddenly wake up!"
0 SetRedraw 0
0 MakeMapObj Creature 11 7 1
0 MakeMapObj Creature 11 2 8
0 Check LEVEL < 2 N1
0 MakeMapObj Creature 81 6 9
0 MakeMapObj Creature 11 9 3
0 Check LEVEL < 5 N1
0 MakeMapObj Creature 81 1 2
0 MakeMapObj Creature 11 8 7
1 InitZMEnemies COUNT -CREATURE 11 -TYPECOUNT 2
0 SetRedraw 1
0 GOTO 5
201 VerifyRE 411 -ETAB OMAP -TYPE CREATURE -ID 11 -NOT
0 Message "You suddenly wake up!"
0 SetRedraw 0
0 MakeMapObj Creature 11 4 1
0 MakeMapObj Creature 81 7 1
0 MakeMapObj Creature 11 0 5
0 MakeMapObj Creature 81 2 9
0 MakeMapObj Creature 11 6 9
0 MakeMapObj Creature 11 7 10
0 InitZMEnemies 6 -CREATURE 11 -TYPECOUNT 2
0 SetRedraw 1
0 GOTO 5
202 VerifyRE 412 -ETAB OMAP -TYPE CREATURE -ID 11 -NOT
0 Message "You suddenly wake up!"
0 SetRedraw 0
0 MakeMapObj Creature 81 2 1
0 MakeMapObj Creature 11 5 1
0 MakeMapObj Creature 11 7 1
0 MakeMapObj Creature 11 1 5
0 MakeMapObj Creature 81 9 7
0 MakeMapObj Creature 11 5 9
0 InitZMEnemies 6 -CREATURE 11 -TYPECOUNT 2
0 SetRedraw 1
0 GOTO 5
210 VerifyRE 420 -ETAB OMAP -TYPE CREATURE -ID 16 -NOT
0 Message "You suddenly wake up!"
0 SetRedraw 0
0 MakeMapObj Creature 16 4 5
0 Check LEVEL < 5 N1
0 MakeMapObj Creature 85 6 3
0 MakeMapObj Creature 16 8 4
1 InitZMEnemies COUNT -CREATURE 16 -TYPECOUNT 2
0 SetRedraw 1
0 GOTO 5
220 VerifyRE 420 -ETAB OMAP -TYPE SCRIPT -ID 20 -NOT
0 Message "You suddenly wake up!"
0 CreateZMEnemies -CTYPE 102 -EGTAB OMAP -POSDEF 510
0 BREAK
230 VerifyRE 410 -ETAB OMAP -TYPE CREATURE -ID 14 -NOT
0 Message "You suddenly wake up!"
0 SetRedraw 0
0 MakeMapObj Creature 14 2 2
0 MakeMapObj Creature 14 7 1
0 MakeMapObj Creature 14 9 3
0 InitZMEnemies 3 -CREATURE 14
0 SetRedraw 1
0 GOTO 5
231 VerifyRE 411 -ETAB OMAP -TYPE CREATURE -ID 14 -NOT
0 Message "You suddenly wake up!"
0 SetRedraw 0
0 MakeMapObj Creature 14 0 5
0 MakeMapObj Creature 14 6 3
0 MakeMapObj Creature 14 5 8
0 InitZMEnemies 3 -CREATURE 14
0 SetRedraw 1
0 GOTO 5
240 VerifyRE 410 -ETAB OMAP -TYPE CREATURE -ID 15 -NOT
0 Message "You suddenly wake up!"
0 SetRedraw 0
0 MakeMapObj Creature 15 2 8
0 Check LEVEL < 2 N1
0 MakeMapObj Creature 15 7 2
0 MakeMapObj Creature 15 8 7
0 Check LEVEL < 5 N1
0 MakeMapObj Creature 84 2 2
1 InitZMEnemies COUNT -CREATURE 15 -TYPECOUNT 2
0 SetRedraw 1
0 GOTO 5
400 Message "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -DIRPOS N
0 GOTO 5
401 Message "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -DIRPOS E
0 GOTO 5
402 Message "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -DIRPOS S
0 GOTO 5
403 Message "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -DIRPOS W
0 GOTO 5
410 Message "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -POSDEF 500
0 GOTO 5
411 Message "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -POSDEF 501
0 GOTO 5
412 Message "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -POSDEF 502
0 GOTO 5
420 Message "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN WATER -ETAB OMAP -EGTAB OMAP -CTYPE 16 -POSDEF 510
0 GOTO 5
500 Def 1 2 8 7 2 8 7 1 6 9 9 3 4 1 1 6 3 9 9 6 8 1 1 3 3 1 1 9 9 8 7 9
501 Def 0 5 4 1 6 9 7 1 2 9 7 10 0 6 3 0 6 1 4 10 5 0 1 8 8 9 8 0 0 7 2 0
502 Def 5 1 5 9 1 5 9 7 2 1 7 1 6 9 0 4 4 0 2 10 10 6 3 9 3 0 1 4 4 10 8 10
510 Def 3 5 5 4 7 5 2 3 9 3 4 2 6 1 7 3 1 1 8 2 1 4 3 1
