TILEMASTER2004 DATA V1
SCRIPT: 600
0 DBG "Rest script running"
0 AddKeyWords _NEXT 603
0 PartyIterator -INIT
600 PartyIterator -ETAG N602
0 CheckCondition POISONED N601
0 GOTO P600
601 AddKeyWords _NEXT 610
0 GOTO P600
602 DoKeyWord _NEXT
603 NOOP
0 Check FP == 1 N300
0 EnterZM -DEFFILE 1
0 CCheckPos -MAP 100 -TAG 10  -MAP 101 -TAG 20  -MAP 102 -TAG 30  -MAP 103 -TAG 40  -MAP 104 -TAG 50  -MAP 111 -TAG 60  -MAP 131 -TAG 70  -MAP 105 -TAG 80  -MAP 106 -TAG 90
0 M "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
610 M "You may not rest while poisoned"
0 BREAK ABORT
10 DBG "Grassland"
0 SetRedraw 0
0 Party -STARTCHAR 2 -MOVEBYDEF 550
0 Teleport 0 4 5
0 SetRedraw 1
0 Pause
0 M "You build a fire"
0 AlterTiles 35 5 5
0 Sound 105
0 Pause
0 M "You put some padding on the ground and lay down"
0 AddKeyWords _RETURN 11
0 GOTO N800
11 Pause
0 CM "You fall asleep"
0 Script 500
1 CM -NL
0 Random 10 700
0 AddKeyWords _RETURN 12
0 GOTO N810
12 NOOP
0 VerifyRE 15 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 10 410 7 200 3 240
15 GOTO N100
20 DBG "Swamp"
0 SetRedraw 0
0 M "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 Party -STARTCHAR 2 -MOVEBYDEF 551
0 Teleport 0 3 5
0 SetRedraw 1
0 Pause
0 M "You build a fire"
0 AlterTiles 35 4 5
0 Sound 105
0 Pause
0 M "You put some padding on the ground and lay down"
0 AddKeyWords _RETURN 21
0 GOTO N800
21 Pause
0 CM "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
1 CM -NL
0 Random 20 710
0 AddKeyWords _RETURN 22
0 GOTO N810
22 NOOP
0 VerifyRE 25 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 85 - 8 411 5 231 2 201
25 GOTO N105
30 DBG "Forest"
0 SetRedraw 0
0 M "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 Party -STARTCHAR 2 -MOVEBYDEF 552
0 Teleport 0 5 5
0 SetRedraw 1
0 Pause
0 M "You build a fire"
0 AlterTiles 35 6 5
0 Sound 105
0 Pause
0 M "You put some padding on the ground and lay down"
0 AddKeyWords _RETURN 31
0 GOTO N800
31 Pause
0 CM "You fall asleep"
0 Script 500
1 CM -NL
0 Random 20 700
0 AddKeyWords _RETURN 32
0 GOTO N810
32 NOOP
0 VerifyRE 35 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 90 - 5 410 3 200 2 240
35 GOTO N100
40 DBG "Hills"
0 SetRedraw 0
0 M "You find a relatively flat place in the hills"
0 AlterTiles 111 4 4 6 6
0 AlterTiles 10 6 3
0 Party -STARTCHAR 2 -MOVEBYDEF 550
0 Teleport 0 4 5
0 SetRedraw 1
0 Pause
0 M "You build a fire"
0 AlterTiles 35 5 5
0 Sound 105
0 Pause
0 M "You put some padding on the ground and lay down"
0 AddKeyWords _RETURN 41
0 GOTO N800
41 Pause
0 CM "You fall asleep"
0 Script 500
1 CM -NL
0 Random 10 700
0 AddKeyWords _RETURN 42
0 GOTO N810
42 NOOP
0 VerifyRE 45 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 10 412 7 202 3 240
45 GOTO N100
50 DBG "Bushes"
0 SetRedraw 0
0 M "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 Party -STARTCHAR 2 -MOVEBYDEF 550
0 Teleport 0 4 5
0 SetRedraw 1
0 Pause
0 M "You build a fire"
0 AlterTiles 35 5 5
0 Sound 105
0 Pause
0 M "You put some padding on the ground and lay down"
0 AddKeyWords _RETURN 51
0 GOTO N800
51 Pause
0 CM "You fall asleep"
0 Script 500
1 CM -NL
0 Random 10 700
0 AddKeyWords _RETURN 52
0 GOTO N810
52 NOOP
0 VerifyRE 55 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 10 410 7 200 3 240
55 GOTO N100
60 DBG "Ship"
0 M "You decide to rest outside on the upper deck in case of a threat to the ship"
0 SetRedraw 0
0 Party -STARTCHAR 2 -MOVEBYDEF 560
0 Teleport 0 4 8
0 SetRedraw 1
0 Pause
0 M "You put some padding on the deck and lay down"
0 AddKeyWords _RETURN 61
0 GOTO N800
61 Pause
0 CM "You fall asleep"
0 Script 500
1 CM -NL
0 Random 30 720
0 AddKeyWords _RETURN 62
0 GOTO N810
62 NOOP
0 VerifyRE 65 -ETAB OMAP -TYPE CREATURE -TERRAIN WATER -NOT
0 CRandom 85 - 8 210 7 220
65 M "You wake up rested, although a little cold"
0 GOTO N111
70 DBG "Boat"
0 SetRedraw 0
0 Party -STARTCHAR 2 -MOVEBYDEF 561
0 NeedRedraw
0 SetRedraw 1
0 Pause
0 M "You put some padding on the deck and lay down"
0 AddKeyWords _RETURN 71
0 GOTO N800
71 Pause
0 CM "The small craft is not comfortable, but you manage to fall asleep"
0 Script 500
1 CM -NL
0 Random 30 730
0 AddKeyWords _RETURN 72
0 GOTO N810
72 NOOP
0 VerifyRE 75 -ETAB OMAP -TYPE CREATURE -TERRAIN WATER -NOT
0 CRandom 85 - 8 210 7 220
75 GOTO N105
80 DBG "Desert"
0 SetRedraw 0
0 Party -STARTCHAR 2 -MOVEBYDEF 550
0 Teleport 0 4 5
0 SetRedraw 1
0 Pause
0 M "The desert grows cold as night falls, so you build a fire"
0 AlterTiles 35 5 5
0 Sound 105
0 Pause
0 M "You put some padding on the ground and lay down"
0 AddKeyWords _RETURN 81
0 GOTO N800
81 Pause
0 CM "You fall asleep"
0 Script 500
1 CM -NL
0 Random 10 740
0 AddKeyWords _RETURN 82
0 GOTO N810
82 NOOP
0 VerifyRE 85 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 10 410 7 230 3 240
85 GOTO N100
90 DBG "Arctic"
0 SetRedraw 0
0 Party -STARTCHAR 2 -MOVEBYDEF 550
0 Teleport 0 4 5
0 SetRedraw 1
0 Pause
0 M "You use some firewood you are carrying to build a much-needed fire"
0 AlterTiles 35 5 5
0 Sound 105
0 Pause
0 M "You put some padding on the ground and lay down"
0 AddKeyWords _RETURN 91
0 GOTO N800
91 Pause
0 CM "The bitter cold here is very uncomfortable, but you manage to fall asleep"
0 Script 500
1 CM -NL
0 Random 40 750
0 AddKeyWords _RETURN 92
0 GOTO N810
92 NOOP
0 VerifyRE 95 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 10 410 10 200
95 GOTO N105
300 DBG "Dungeon"
0 SetFlag 27 0
0 StartSLineIterator PC N 10 -NOSTART
331 SetSafety 256
332 SetTargetSLineIterator 340
0 CheckTarget N335 -CREATURE
0 CheckTarget N340 -VIEW BLOCKED
0 GOTO 332
335 M "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 P335 -CREATURE
0 GOTO N350
341 StartSLineIterator PC E 10 -NOSTART
0 GOTO P331
342 StartSLineIterator PC S 10 -NOSTART
0 GOTO P331
343 StartSLineIterator PC W 10 -NOSTART
0 GOTO P331
350 EnterZM -DEFFILE 1
0 M "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 Party -STARTCHAR 2 -MOVEBYDEF 574
0 Teleport 0 4 5
0 GOTO N310
311 Party -STARTCHAR 2 -MOVEBYDEF 570
0 Teleport 0 1 4
0 GOTO N310
312 Party -STARTCHAR 2 -MOVEBYDEF 571
0 Teleport 0 9 4
0 GOTO N310
314 Party -STARTCHAR 2 -MOVEBYDEF 572
0 Teleport 0 4 1
0 GOTO N310
315 Party -STARTCHAR 2 -MOVEBYDEF 573
0 Teleport 0 4 9
310 SetRedraw 1
0 Pause
0 M "You put some padding on the ground and lay down"
0 AddKeyWords _RETURN 301
0 GOTO N800
301 Pause
0 CM "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
1 CM -NL
0 AddKeyWords _RETURN 302
0 GOTO N810
302 NOOP
0 VerifyRE 305 -ETAB OMAP -TYPE CREATURE -TERRAIN LAND -NOT
0 CRandom 80 - 20 320
305 GOTO N105
320 Pos 5 0 -TAG 321 -CHECKTERRAIN BLOCKED
0 GOTO N400
321 Pos 10 5 -TAG 322 -CHECKTERRAIN BLOCKED
0 GOTO N401
322 Pos 5 10 -TAG 323 -CHECKTERRAIN BLOCKED
0 GOTO N402
323 Pos 0 5 -TAG 324 -CHECKTERRAIN BLOCKED
0 GOTO N403
324 DBG "Could not create encounter (all walls blocked)"
0 GOTO P305
100 M "You wake up well-rested"
101 NOOP
0 PartyIterator -INIT
1 PartyIterator -ETAG N2 -PNAME
0 GivePCMB 2 5 10
0 Heal 5% SKIPNE
0 GiveSP 50%
0 GOTO P1
2 SetLightSource 0
0 GOTO 1
105 M "You wake up somewhat rested after a few hours of restless sleep"
106 NOOP
0 PartyIterator -INIT
1 PartyIterator -ETAG N2 -PNAME
0 GivePCMB 2 3 6
0 Heal 3% SKIPNE
0 GiveSP 30%
0 GOTO P1
2 SetLightSource 0
0 GOTO 1
110 M "You wake up fairly well-rested"
111 NOOP
0 PartyIterator -INIT
1 PartyIterator -ETAG N2 -PNAME
0 GivePCMB 2 4 8
0 Heal 4% SKIPNE
0 GiveSP 40%
0 GOTO P1
2 SetLightSource 0
0 GOTO 1
115 M "You wake up only very slightly rested after a few hours of extremely restless sleep"
116 NOOP
0 PartyIterator -INIT
1 PartyIterator -ETAG N2 -PNAME
0 GivePCMB 2 2 4
0 Heal 2% SKIPNE
0 GiveSP 20%
0 GOTO P1
2 SetLightSource 0
0 GOTO 1
120 M "You are unable to get any rest at all"
0 GOTO 1
200 VerifyRE 410 -ETAB OMAP -TYPE CREATURE -ID 11 -NOT
0 M "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 M "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 M "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 M "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 M "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 M "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 M "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 M "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 M "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -DIRPOS N
0 GOTO 5
401 M "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -DIRPOS E
0 GOTO 5
402 M "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -DIRPOS S
0 GOTO 5
403 M "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -DIRPOS W
0 GOTO 5
410 M "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -POSDEF 500
0 GOTO 5
411 M "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -POSDEF 501
0 GOTO 5
412 M "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN LAND -ETAB OMAP -EGTAB OMAP -CTYPE 11 -POSDEF 502
0 GOTO 5
420 M "You suddenly wake up!"
0 CreateZMEnemies -TERRAIN WATER -ETAB OMAP -EGTAB OMAP -NOCDFTYPE 1 -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
550 Def 5 4  5 6  6 5  4 4  4 6  6 4  6 6
551 Def 4 4  4 6  5 5  3 4  3 6  5 4  5 6
552 Def 6 4  6 6  7 5  5 4  5 6  7 4  7 6
560 Def 6 8  5 8  4 9  6 9  5 9  3 9  7 9
561 Def 5 7  5 9  6 8  4 8  4 7  4 9  6 7
570 Def 1 5  1 6  2 4  2 5  2 6  3 4  3 5
571 Def 9 5  9 6  8 4  8 5  8 6  7 4  7 5
572 Def 5 1  6 1  4 2  5 2  6 2  4 3  5 3
573 Def 5 9  6 9  4 8  5 8  6 8  4 7  5 7
574 Def 3 5  4 6  3 6  5 6  4 7  3 7  5 7
700 CRandom 80 -  20 702
701 M "It is very rainy and wet"
0 TileFX 135 0 -SOUND 102 -FS -NOEMPTY
0 Pause
0 AddKeyWords _RETURN 110
0 GOTO N810
702 M "It is snowing and very cold"
0 TileFX 137 0 -SOUND 102 -DELAY 200 -FS -NOEMPTY
0 Pause
0 AddKeyWords _RETURN 110
0 GOTO N810
710 M "It is very rainy, making it even more unpleasant than before"
0 TileFX 135 0 -SOUND 102 -FS -NOEMPTY
0 Pause
0 AddKeyWords _RETURN 115
0 GOTO N810
720 CRandom 90 -  5 722  5 725
721 M "It is very rainy and wet"
0 TileFX 135 0 -SOUND 102 -FS -NOEMPTY
0 Pause
0 AddKeyWords _RETURN 105
0 GOTO N810
722 M "It is snowing and very cold"
0 TileFX 137 0 -SOUND 102 -DELAY 200 -FS -NOEMPTY
0 Pause
0 AddKeyWords _RETURN 105
0 GOTO N810
725 M "You awaken to a fierce storm!"
0 AddKeyWords _RETURN 726
0 GOTO N810
726 NOOP
0 TileFX 135 0 -SOUND 102 -DELAY 50 -FS -NOEMPTY
0 Pause
0 TileFX 135 0 -SOUND 101 -DELAY 50 -FS -NOEMPTY
0 AbilCheck PILOT 90 727
0 M "You quickly begin trying to pilot your way through it but are unable to avoid the worst of it in time."
0 Damage 1d20+10 -ZMVEHICLE
0 GOTO 1
727 M "You quickly begin trying to pilot your way through it and manage to avoid the worst of it."
0 Damage 1d10+5 -ZMVEHICLE
0 GOTO 1
730 CRandom 90 -  5 732  5 725
731 M "It is very rainy and wet"
0 TileFX 135 0 -SOUND 102 -FS -NOEMPTY
0 Pause
0 AddKeyWords _RETURN 115
0 GOTO N810
732 M "It is snowing and very cold"
0 TileFX 137 0 -SOUND 102 -DELAY 200 -FS -NOEMPTY
0 Pause
0 AddKeyWords _RETURN 115
0 GOTO N810
740 CRandom 95 -  5 745
741 M "Your sleep is interrupted by a mild sandstorm"
0 ReplaceTile 42 0
0 TileFX 148 0 -SOUND 102 -FS
0 ReplaceTile 0 42
0 Pause
0 AddKeyWords _RETURN 742
0 GOTO N810
742 Pause -APINC -DONE
0 GOTO 1
745 M "You awaken to a sandstorm!"
0 AddKeyWords _RETURN 746
0 GOTO N810
746 ReplaceTile 42 0
0 TileFX 148 0 -SOUND 102 -FS
0 ReplaceTile 0 42
0 PartyIterator -INIT
10 PartyIterator -ETAG 1 -PNAME
0 AbilCheck F 75 747
0 Damage 2d6 -DEATHCONT
0 GOTO P10
747 M "You manage to avoid the worst of it."
0 Damage 1d6 -DEATHCONT
0 GOTO P10
750 CRandom 95 -  5 755
751 M "Particularly poor weather decreases the quality of your sleep"
0 ReplaceTile 147 0
0 TileFX 137 0 -SOUND 102 -DELAY 200 -FS
0 ReplaceTile 0 147
0 Pause
0 AddKeyWords _RETURN 115
0 GOTO N810
755 M "You awaken to a blizzard!"
0 AddKeyWords _RETURN 756
0 GOTO N810
756 ReplaceTile 147 0
0 TileFX 137 0 -SOUND 102 -FS
0 ReplaceTile 0 147
0 PartyIterator -INIT
10 PartyIterator -ETAG 1 -PNAME
0 AbilCheck F 75 757
0 Damage 2d6 -DEATHCONT
0 GOTO P10
757 M "You manage to avoid the worst of it."
0 Damage 1d6 -DEATHCONT
0 GOTO P10
800 SetRedraw 0
0 PartyIterator -INIT
1 PartyIterator -ETAG N2
0 AlterPCTile 144
0 GOTO P1
2 SetRedraw 1
0 DoKeyWord _RETURN
810 SetRedraw 0
0 PartyIterator -INIT
1 PartyIterator -ETAG N2
0 AlterPCTile BASE
0 GOTO P1
2 SetRedraw 1
0 DoKeyWord _RETURN
