Level 9: reference tables
Level 9 · The levels · Level data (INF)
In brief
The details of level 9: the data of the level, how to read the script details, every scripted place and encounter as the scripts run it, the cell bindings, the level flags and the monster types, with its sublevel records when it has two. Its story page tells the same places and encounters in a few sentences each.
Level data
The level has one sublevel record. It uses the maze LEVEL9.MAZ, the silver
graphics and the silver sound file (SILVER.ADL or SILVER.SND, see the
sound-effect table),
has a step threshold of 0, so no step-triggered script, and defines one
script timer. Its two monster images are beholder, with the decoration file
BEHOLDER.DCR, and willowis. Ten monsters are present at the start.1
This page covers every reachable script of the reference file: 53 cell bindings, 58 script entry points including five subroutines, and 575 instructions. The decoding finds no unknown operand layout; 10 bytes in two places follow a level load and are never executed. Message colors are palette colors (Print a message).2
Reading this page
- Coordinates. A position [XX:YY] gives the column
XXand the rowYY, counting from00; the block index used by the files and the instructions isYY × 32 + XX. - Directions and sides. Directions are 0 = north (decreasing row),
1 = east, 2 = south and 3 = west, and side
sof a block is its face turned towards directions(Direction). A face on sidesis seen from the neighbouring block on that side, facing the opposite way: the south face (side 2) of [11:06] is seen from [11:07], facing 0. - Script offsets count from the start of the INF
script_datafield (decoded payload offset 1123 in the reference file). Message numbers index the level's 36 strings and text numbersTEXT.DAT; both are summarized, not quoted. Pictures are named by their.CPSfile and by the quarter of it that the dialogue copies. - Speakers are chosen as on the level 4 page.
- Levers and buttons. A lever face (references 27, 29 and 42) changes to
the next reference when it is activated and back on the next activation
(
INF_WALL_SPECIAL_LEVER_INCREMENTandINF_WALL_SPECIAL_LEVER_DECREMENT), and each time the block's script runs (InfWallSpecialType). - Placing a monster uses
SCRIPT_SPAWN_MONSTER, whose checks can refuse it. Every monster type of this level has occupancy class 2, so a placement succeeds only in a block that holds no monster and is not the party's block. Several scripts place monsters inside blocks whose four sides are walls; the monster can leave such a block through the open sides of its neighbours.
Arrival and stairs
The arrival block [02:04] lies in a small area of eight blocks with two stair blocks of the common pattern of the level 5 stairs: entering in the required direction prints a message (5 down, 7 up) and plays sound 79; any other direction prints message 6 (the way is barred), plays sound 29 and moves the party back one block, against the required direction. Items placed or flying into a stair block go to its destination.2
| Stairs | Required direction | Destination | Pushed back to |
|---|---|---|---|
| [03:04] | 1 | Level 8, sublevel 0, [01:10], facing 1 | [02:04] |
| [04:02] | 1 | This level, [05:08], facing 1 (a move, not a level load) | [03:02] |
| [04:08] | 3 | This level, [03:02], facing 3 (a move, not a level load) | [05:08] |
[04:02] and [04:08] form a pair of stairs inside the level: going up at
[04:02] arrives beside [04:08], going down at [04:08] arrives beside [04:02].
The party moves with SCRIPT_MOVE_PARTY_OR_OBJECT,
then SCRIPT_SET sets its facing.
The four keys
The rotating teleporters
The area reached by the stairs up, around [06:07], holds the teleporter
[09:08]. Five more teleporters, each in a small room of its own or in the lock
room, share one destination routine: [08:03], [12:03], [11:08], [08:13] and
[12:13]. They carry WALL_REFERENCE_TELEPORTER
on their four sides, which draws sparkles in them.2
The counter. The level's only timed block script
sends BLOCK_EVENT_TIMER to [30:00] with an interval of 2, that is 36 ticks
or about 2 seconds. Its script calls the subroutine at offset 128, which
advances level flags 0–2 as a counter through the values 0, 1, 2, 3, 4, 5
and back to 0 (bit 0 lowest), one step per event: a full turn takes about
12 seconds of game time. The counter keeps running while the party is on the
level, as described for the level 4 timer.
The destination. Entering any of the six teleporters calls the subroutine at offset 2, which plays sound 15 at a block and moves the party, keeping its facing, according to the counter at that moment:
| Counter | Sound played at | Party moved to | Where that is |
|---|---|---|---|
| 0 | [09:03] | [09:03] | The room of [08:03] |
| 1 | [08:08] | [12:08] | The lock room |
| 2 | [09:13] | [11:13] | The room of [12:13] |
| 3 | [11:03] | [11:03] | The room of [12:03] |
| 4 | [12:08] | [08:08] | The area of [09:08], the stairs' arrival |
| 5 | [11:13] | [09:13] | The room of [08:13] |
Every destination is the block beside one of the teleporters, so the party never lands on a teleporter. In four of the six cases the sound comes from another block than the destination, the destination of the case three steps away; only the loudness of the sound depends on that block (environmental sounds). Items placed or flying into any of the six teleporters go to [06:07], in the stairs' arrival area, whatever the counter.
The four locks
Each of the four small rooms holds a Dark Moon Key in a niche: [06:02] (seen
from the room of [08:03]), [14:01] (room of [12:03]), [06:14] (room of
[08:13]) and [14:15] (room of [12:13]). The four keys are ITEM.DAT items of
type ITEM_TYPE_KEY (ItemType) and value 4. A
plaque at [05:07], read from [05:08], says that four keys open one
door (message 8).3
The lock room, [11:07] to [12:09] with the corridor [13:08]–[14:08], is closed
by the door at [15:08]. Four keyholes face it: the south faces of [11:06] and
[12:06] and the north faces of [11:10] and [12:10]. Clicking one dispatches
BLOCK_EVENT_WALL_DECORATION, and its script looks at the
held item:
- If the door [15:08] is no longer closed (its side 3 no longer holds the closed-door reference 8) or this lock's flag (3 to 6) is set, message 13 says that it is already unlocked.
- A held key of value 4: sound 14 at the lock, the lock's flag is set, the
key is removed with
SCRIPT_DELETE_ITEM, and the subroutine at offset 196 opens the door withSCRIPT_OPEN_DOORonce flags 3 to 6 are all set. - Another key: message 9 (it does not fit) and sound 81.
- Lock picks (item type 28): with a
CHARACTER_CLASS_THIEFin the party (CharacterClassMask), sound 81 and message 10, a failed attempt; without one, message 11 asks for a thief. Picking never succeeds. - Anything else, or nothing: message 12 asks for a key.
Any of the four keys opens any lock. Nothing in the level's scripts closes the door again.
Beyond the door
Past [15:08] the main part of the level begins.2
- [17:06], once (level flag 7): a monster of type 0 is placed at [20:06], facing 3, carrying a copy of item 33, a femur, which it always leaves when it dies. The party is turned to face 1, towards it, and the dialogue box shows message 14, with sound 53: the party are not acolytes of Darkmoon, and the speaker and its friends must stop them.
- [18:08], once (level flag 8): a monster of type 0 is placed at [18:10], facing 0, with one chance in ten of leaving a femur, and the door [18:09] between the two blocks opens.
- [21:08]: every entry sets the four sides of [22:08] to 0. That block
carries
WALL_REFERENCE_CLEARED_ON_ENTRYon its four sides, which no monster can cross; the script opens it before the party steps into it, to monsters as well. The first time (level flag 10), a party member says it has a bad feeling about the place (message 15, sound 79). - [18:10]: at each entry, with a probability of 4 in 10 (1d10 below 5) and until it has been given once (level flag 26), a party member points out a secret button on the south wall (message 31, sound 79).
- [18:11]: that button is a lever on the north face of [18:11], seen from [18:10]. Activating it plays sound 13 and sets the four sides of [18:11] to 0, opening the block, where three potions lie.
Khelben's vision
Entering [16:15] the first time (level flag 25) shows a long dialogue:
message 32 announces a vision of Khelben (sound 60), whose picture KHELBEN
then appears with SCRIPT_DIALOGUE_BITMAP_TRANSITION
(ScriptDialogueBitmapFlags).
He asks what the party has learned (messages 33 and 34); the party answers
that Darkmoon seems to be built on an older structure, perhaps of Dark Elven
origin (text 33), and that it has met Dran Draggore, who calls himself the
Overlord of the temple (text 36). Khelben warns them against Dran (text 100),
says that a growing magic barrier now surrounds Darkmoon, and the contact
breaks (text 101). Four times, the subroutine at offset 368 animates
Khelben: it draws 18 quarters of KHELBEN in turn, 6 ticks apart, the same
three quarters in the same order as the
vision of level 2.
At the end the script reloads the wall graphics with
SCRIPT_SPECIAL_EVENT
(SCRIPT_SPECIAL_EVENT_RELOAD_WALL_GRAPHICS), plays sound 58 and redraws the
scene. The vision changes nothing else in the game.2
The illusion maze
The blocks [14:16] to [22:23] form a maze in which the walls look alike: many
blocks carry WALL_REFERENCE_ILLUSION
(46) on their four sides, a wall that the party and monsters walk through,
while others carry reference 55, drawn with the same wall graphics, which
nothing crosses. Illusory walls vanish from view while True Seeing lasts.4
- The button. At [14:20], a plaque on the north (message 18) says to press
the button in an emergency; the button is the lever on the east face of
[13:20]. Pressing it plays sound 13 at [14:21] and rebuilds part of the
maze with
SCRIPT_SET_BLOCK_WALLS: ten blocks become illusions, [17:17], [18:17], [20:18], [17:19], [19:19], [20:20], [18:21], [21:21], [19:22] and [18:23], and ten illusions become plain walls (reference 2), [21:17], [20:19], [18:20], [21:20], [14:21], [19:21], [18:22], [21:22], [17:23] and [20:23]. The values are absolute, so pressing it again changes nothing more. - The alcoves. [23:18] carries a lever on its east and on its west face; either sets the four sides of the block to 0 with sound 13, opening a way between [22:18], in the maze, and [24:18]. Two plaques in the area beyond call its alcoves a safe place to rest ([23:17], message 16) and a shelter for meditation ([30:17], message 17). Their scripts only show these messages.
The changing corridors
West of the illusion maze, four pressure plates (reference 35) play sound 12 whenever the party steps on or off them, and act once each. A plaque at [10:18] warns that this is a test of vision that may change without warning (message 23).2
| Plate | Level flag | Effect, the first time |
|---|---|---|
| [12:21] | 17 | [11:19] and [08:20], two floor blocks, become walls (reference 1); sound 13 at [11:19]. |
| [06:16] | 18 | [07:18], a floor block, becomes a wall; [09:21], a wall block, becomes floor; sound 13. |
| [12:24] | 21 | [00:27], a floor block, becomes a wall; [12:23], a wall block, becomes floor; sound 13. |
| [01:12] | 19 | Three placements of a monster of type 4 at [01:17], in quarters 0, 1 and 2, facing 0. |
The three placements at [01:17] add at most one will-o'-wisp: once the first one stands in the block, its occupancy class refuses the others, and when the first is refused the others are refused for the same reason.
The south-west corner
- [03:24] silently moves the party, or the items placed or flying into it, to [05:24].
- [02:31] and [06:31] send the party to each other. The sending script sets level flag 24 before the move; the move runs the destination's script at once, which finds the flag set, clears it and does nothing else, so the party stays where it arrives. Items placed or flying into either block, while the flag is clear, go to the other one.
- [08:26] turns the party round with
SCRIPT_CHANGE_DIRECTION(adjustment 2) at each entry; if the party has aCHARACTER_CLASS_THIEFand 1d6 rolls above 3, that character remarks on the compass (message 24, sound 79). - [09:29], a block of illusory walls, places a monster of type 5 at [11:31], a wall block, facing 0, at each entry: the test of level flag 20 that precedes the placement always passes, since no script sets that flag. The placement succeeds whenever [11:31] holds no monster and the party is not there.
The will-o'-wisp guards
South of [25:20] and [28:20] lie two symmetric approaches to a corridor, [25:24] to [28:24]. The blocks of rows 22 to 24 between the two approaches carry references 25 and 35, which let the party and small flying objects through but no monster; in the walls at [24:24] and [29:24], at its two ends, are holes that are scorching hot when touched (message 30).5
- The guard. Entering [25:20] (or [28:20]) places a monster of type 4, facing 0, at [25:23] (or [28:23]) when that block holds no monster. The test of level flag 9 that precedes it always passes: no script sets that flag. Since no monster can enter the blocks around it, the will-o'-wisp stays in place and bars that approach: [25:23] (or [28:23]) is the only way into the corridor from that side.
- Pushing it. Using an item of
kind
ITEM_KIND_MELEEagainst [25:23] (or [28:23]) — striking the guard with a melee weapon or a bare hand from the front rank — sendsBLOCK_EVENT_ITEM_USEDto that block, whose script then moves its monsters, withSCRIPT_MOVE_PARTY_OR_OBJECT, to [25:24] (or [28:24]). A blow against [25:24] (or [28:24]) moves them on to [26:24] (or [27:24]). The moved monster's facing becomes its position, 4 (the move anomaly). Items used from party slots 2 and above, and items of other kinds, do not push it: the game sends no item-used event for a melee weapon used from the back, and other kinds fail the test. - The trap. Entering [25:24] (or [28:24]) plays sound 12 and launches a
fireball with
SCRIPT_LAUNCH_OBJECTfrom the hole at [24:24] eastwards (or from [29:24] westwards), towards the party's block; it then clears level flag 9, which changes nothing. The push test runs on entry too, but no monster can stand in the party's block, so it moves nothing.
A guard that has been pushed away or killed is replaced at the next entry into [25:20] or [28:20].
The stuck beholder and the wind buttons
Entering [19:25] the first time (level flag 11) calls the dialogue at offset
231: the upper-right quarter of SOUT4 appears with sound 53, and text 61, a
voice asking for help because it is stuck and will starve. The player answers
with message 0 (help him) or 1 (kill him).2
- Help. The wall graphics are reloaded, the party is turned to face 1, moved to [20:25], turned to face 2, and a monster of type 1 is placed at [20:26] facing it, on the block from which the upward button is pressed. In text 64 the beholder, smacking its lips, thanks its tender rescuers and offers to show its gratitude. Level flag 14 is set.
- Kill. Level flag 12 is set; in text 34 the beholder cries out in pain; after a pause the wall graphics are reloaded and a party member asks whether to chase it (message 4). No monster is placed.
Two buttons, on decoration-script walls (reference 60), link this part of the level with a separate area of 35 blocks in the north-east, which no other passage reaches:6
- Upwards, on the north face of [20:27], seen from [20:26]: message 19 (a wind blows the party upwards), sound 72, and the party is moved to [27:06]. The first time (level flag 14 clear), if the party attacked the stuck beholder (flag 12), the party is turned to face 0 and a monster of type 1 is placed at [27:05], facing it; message 20 then reproaches the party for attacking a helpless beholder. Flag 14 is set at this first use, so the ambush happens at most once, and never after helping.
- Downwards, on the north face of [27:07], seen from [27:06]: message 21 (a wind sucks the party downwards), the party is moved to [20:26], sound 72.
In the north-east area, entering [24:01] the first time (level flag 15)
places a monster of type 2 at [27:02], a wall block south of the door
[27:01], facing 0. Entering [30:01] the first time (level flag 16) places
one of type 2 at [30:00], facing 2, turns the party to face 0, towards it, and shows the
upper-left quarter of SOUT4 with sound 52 and message 22: the beholder is
glad that some of the party came back, to serve as its dessert.
The guardians and the pedestal
At the south-east of the main part, the lever on the west face of [18:29] opens that block (its four sides become 0, sound 13) onto a room that leads, through [24:29], to the guardians' hall, [25:28] to [27:30], and a pedestal at [28:29].7
- [24:29], the first time (level flag 22): the lower-left quarter of
SOUT3appears with sound 54, and text 63 proclaims that intruders who are not Children of Darkmoon must be destroyed by the guardians of the Tests; the upper-right quarter ofSOUT3follows. The script then sets the four sides of [26:28] and [26:30] to the teleporter reference, places a monster of type 3 in each, facing 3, redraws the scene, waits 10 ticks and sets both blocks toWALL_REFERENCE_CLEARED_ON_ENTRY. With the other blocks of the hall, which carry the same reference or reference 25, they keep the guardians from moving. - [25:29], at each entry: the six blocks [25:28] to [26:30] are set to 0, which frees the guardians, and [18:29] becomes a wall again (reference 1 on its four sides, with no lever), with sound 13. The 21 blocks east of [18:29] then have no way out but the pedestal.
- The pedestal, [28:29], carries reference 61, a decoration-script
wall, on its four faces and is reached from [27:29]. Activating it shows
the lower-left quarter of
SUICIDE, plays sound 95 and asks with message 25 whether to lay a hand on it (messages 26 and 27, yes or no). No closes the dialogue. Yes shows message 28, a bolt that knocks the party out, sets bit 31 of the global flags withSCRIPT_SET_FLAGS(SCRIPT_FLAG_TARGET_GLOBAL), shows the lower-right quarter ofSUICIDEand message 29, in which the party wakes near the temple entrance, and loads level 5, sublevel 0, at [14:11], facing 3.
Bit 31 of the global flags has no other use in the reference scripts: its
only reader is a script of level 6, at [18:12] of that level: a face (picture MMOUTH1) bars the way to
anyone without the mark of Darkmoon (message 26), and with the bit set grants
passage (message 27) and opens [19:12] and [19:13] there.8
Bindings
| Position | Enabled events | Script | Purpose |
|---|---|---|---|
| [03:04] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 820 | Stairs, down to level 8 |
| [04:02] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 947 | Stairs, up within the level |
| [04:08] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1075 | Stairs, down within the level |
| [30:00] | none (BLOCK_EVENT_TIMER) | 816 | The four keys, counter |
| [08:03] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1209 | The four keys, teleporter |
| [12:03] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1233 | The four keys, teleporter |
| [09:08] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1257 | The four keys, teleporter |
| [11:08] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1281 | The four keys, teleporter |
| [08:13] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1813 | The four keys, teleporter |
| [12:13] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1837 | The four keys, teleporter |
| [05:07] | none (BLOCK_EVENT_WALL_DECORATION) | 1203 | The four keys, plaque |
| [11:06] | none (BLOCK_EVENT_WALL_DECORATION) | 1305 | The four keys, lock |
| [12:06] | none (BLOCK_EVENT_WALL_DECORATION) | 1432 | The four keys, lock |
| [11:10] | none (BLOCK_EVENT_WALL_DECORATION) | 1559 | The four keys, lock |
| [12:10] | none (BLOCK_EVENT_WALL_DECORATION) | 1686 | The four keys, lock |
| [17:06] | BLOCK_EVENT_PARTY_ENTER | 1861 | Beyond the door, ambush |
| [18:08] | BLOCK_EVENT_PARTY_ENTER | 1915 | Beyond the door, ambush |
| [21:08] | BLOCK_EVENT_PARTY_ENTER | 1947 | Beyond the door, barrier and remark |
| [18:10] | BLOCK_EVENT_PARTY_ENTER | 3214 | Beyond the door, secret button hint |
| [18:11] | none (BLOCK_EVENT_WALL_DECORATION) | 1975 | Beyond the door, secret button |
| [16:15] | BLOCK_EVENT_PARTY_ENTER | 3249 | Khelben's vision |
| [13:20] | none (BLOCK_EVENT_WALL_DECORATION) | 2199 | The illusion maze, button |
| [14:19] | none (BLOCK_EVENT_WALL_DECORATION) | 2193 | The illusion maze, plaque |
| [23:18] | none (BLOCK_EVENT_WALL_DECORATION) | 1985 | The illusion maze, levers |
| [23:17] | none (BLOCK_EVENT_WALL_DECORATION) | 1995 | The illusion maze, plaque |
| [30:17] | none (BLOCK_EVENT_WALL_DECORATION) | 2001 | The illusion maze, plaque |
| [12:21] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_PARTY_LEAVE | 2555 | The changing corridors, plate |
| [06:16] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_PARTY_LEAVE | 2593 | The changing corridors, plate |
| [01:12] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_PARTY_LEAVE | 2625 | The changing corridors, plate |
| [12:24] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_PARTY_LEAVE | 2865 | The changing corridors, plate |
| [10:18] | none (BLOCK_EVENT_WALL_DECORATION) | 2587 | The changing corridors, plaque |
| [03:24] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 2688 | The south-west corner, teleporter |
| [02:31] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 2747 | The south-west corner, teleporter pair |
| [06:31] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 2793 | The south-west corner, teleporter pair |
| [08:26] | BLOCK_EVENT_PARTY_ENTER | 2715 | The south-west corner, spinner |
| [09:29] | BLOCK_EVENT_PARTY_ENTER | 2839 | The south-west corner, will-o'-wisp |
| [25:20] | BLOCK_EVENT_PARTY_ENTER | 2007 | The will-o'-wisp guards |
| [25:23] | BLOCK_EVENT_ITEM_USED | 2042 | The will-o'-wisp guards |
| [25:24] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_USED | 2059 | The will-o'-wisp guards |
| [28:20] | BLOCK_EVENT_PARTY_ENTER | 2100 | The will-o'-wisp guards |
| [28:23] | BLOCK_EVENT_ITEM_USED | 2135 | The will-o'-wisp guards |
| [28:24] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_USED | 2152 | The will-o'-wisp guards |
| [24:24] | none (BLOCK_EVENT_WALL_DECORATION) | 3202 | The will-o'-wisp guards, hole |
| [29:24] | none (BLOCK_EVENT_WALL_DECORATION) | 3208 | The will-o'-wisp guards, hole |
| [19:25] | BLOCK_EVENT_PARTY_ENTER | 2304 | The stuck beholder |
| [20:27] | none (BLOCK_EVENT_WALL_DECORATION) | 2321 | The wind buttons, upwards |
| [27:07] | none (BLOCK_EVENT_WALL_DECORATION) | 2422 | The wind buttons, downwards |
| [24:01] | BLOCK_EVENT_PARTY_ENTER | 2450 | The wind buttons, upper part |
| [30:01] | BLOCK_EVENT_PARTY_ENTER | 2479 | The wind buttons, upper part |
| [18:29] | none (BLOCK_EVENT_WALL_DECORATION) | 2897 | The guardians and the pedestal, lever |
| [24:29] | BLOCK_EVENT_PARTY_ENTER | 2907 | The guardians and the pedestal |
| [25:29] | BLOCK_EVENT_PARTY_ENTER | 3044 | The guardians and the pedestal |
| [28:29] | none (BLOCK_EVENT_WALL_DECORATION) | 3084 | The guardians and the pedestal |
Five subroutines are reached only by SCRIPT_CALL:
the teleporter destination at offset 2 (six callers), the counter at offset 128,
the door check at offset 196 (four callers), the stuck beholder's dialogue at
offset 231 and Khelben's animation at offset 368 (four calls from one script).
Level flags
| Bit | Set by | Cleared by | Meaning (descriptive) |
|---|---|---|---|
| 0–2 | The counter | The counter | A counter from 0 to 5 (bit 0 lowest). |
| 3–6 | The locks at [11:06], [12:06], [11:10], [12:10] | — | That lock has received its key. |
| 7 | [17:06] | — | The first ambush has happened. |
| 8 | [18:08] | — | The second ambush has happened. |
| 9 | — | [25:24], [28:24] | Tested before placing a will-o'-wisp guard; never set. |
| 10 | [21:08] | — | The remark at [21:08] has been made. |
| 11 | [19:25] | — | The stuck beholder has spoken. |
| 12 | Attacking the stuck beholder | — | The party attacked it. |
| 14 | Helping the stuck beholder; the first use of [20:27] | — | The ambush at the top of the wind button can no longer happen. |
| 15 | [24:01] | — | The beholder of [27:02] has been placed. |
| 16 | [30:01] | — | The beholder of [30:00] has been placed. |
| 17 | [12:21] | — | That plate has changed the corridors. |
| 18 | [06:16] | — | That plate has changed the corridors. |
| 19 | [01:12] | — | That plate has called the will-o'-wisps. |
| 20 | — | — | Tested before placing the will-o'-wisp of [11:31]; never set. |
| 21 | [12:24] | — | That plate has changed the corridors. |
| 22 | [24:29] | — | The guardians have been placed. |
| 24 | [02:31], [06:31] when sending the party | [02:31], [06:31] on arrival | The party has just been sent by the teleporter pair. |
| 25 | [16:15] | — | Khelben's vision has been shown. |
| 26 | [18:10] | — | The secret-button hint has been given. |
The pedestal also sets bit 31 of the global flags; see the guardians and the pedestal.
Monster types
The level defines six monster types, 0 to 5, and two monster images. Every
monster of the level, placed at the start or by a script, is drawn with
beholder (BEHOLDER.CPS) when it has type 0 to 3 and with willowis
(WILLOWIS.CPS, no decoration file) when it has type 4 or 5. The game stores
no name for a monster type; the types are known by their number, their image
and their properties:9
| Property (INF field) | Type 0 | Types 1–3 | Types 4 and 5 |
|---|---|---|---|
| Image | beholder | beholder | willowis |
Armour class (armor_class) | 0 | 0 | −8 |
Hit chance (hit_chance) | 7 | 5 | 10 |
Level for saving throws (level) | 4 | 4 | 9 |
Hit points (hit_points_dice) | 1d9 + 60 | 1d9 + 70, 1d9 + 80 and 1d9 + 100 | 5d8 + 32 and 3d8 + 48 |
| Melee attacks: count and damage | 1, 2d8 | 1, 2d8 | 1, 2d8 |
MonsterCapabilityFlags | MONSTER_CAP_ALT_FRAME_TABLE, MONSTER_CAP_PARALYZES, MONSTER_CAP_OPENS_DOORS | MONSTER_CAP_ALT_FRAME_TABLE, MONSTER_CAP_PARALYZES | MONSTER_CAP_ALT_FRAME_TABLE, MONSTER_CAP_POST_MOVE_ACTION |
MonsterImmunityFlags | none | none | none |
Type flags (type_flags) | none | none | none |
Experience (experience) | 14 000 | 14 000 | 3 000 |
Occupancy class (occupancy_class) | 2 | 2 | 2 |
Attack and step sounds (sound_1, sound_2) | 47, 46 | 47, 46 | 45, 44 |
| Ranged attacks | Never run out; a random one of magic objects 10 to 13 | The same | none |
Turn resistance, evasion (turn_resistance, damage_modifier) | −1, 100 | −1, 100 | −1, 99 |
Decoration groups (decoration_indices) | 1 | none | none |
The four beholder types differ only in their hit points, in the better hit
chance of type 0 and in MONSTER_CAP_OPENS_DOORS, which only type 0 has;
type 0 also carries the decorations of the single group of BEHOLDER.DCR
(monster images). Their ranged attacks
are the monster spells 10 (death spell),
11 (disintegration), 12 (wounds) and 13 (petrification, which never takes
effect). With an evasion of 100, damage carrying MONSTER_DAMAGE_MAGIC is
cancelled unless 1d100 rolls 100; with 99, unless it rolls 99 or 100
(damage to a monster). Monsters of unit 0
are updated every 25 ticks, those of unit 1 every 15
(monster update cadence).
The ten monsters present at the start:1
| Slot | Position | Type | Mode | Facing | Unit |
|---|---|---|---|---|---|
| 1 | [22:10], centre | 1 | MONSTER_MODE_PURSUE | 3 | 0 |
| 2 | [26:14], centre | 4 | MONSTER_MODE_PURSUE | 0 | 1 |
| 3 | [20:04], centre | 1 | MONSTER_MODE_WAIT | 1 | 0 |
| 4 | [24:00], centre | 2 | MONSTER_MODE_WAIT | 2 | 0 |
| 5 | [25:02], centre | 2 | MONSTER_MODE_WAIT | 0 | 0 |
| 6 | [13:18], centre | 4 | MONSTER_MODE_PURSUE | 1 | 1 |
| 7 | [03:17], quarter 0 | 5 | MONSTER_MODE_WAIT | 1 | 1 |
| 8 | [03:17], quarter 2 | 5 | MONSTER_MODE_WAIT | 1 | 1 |
| 9 | [16:25], centre | 1 | MONSTER_MODE_WAIT | 3 | 0 |
| 10 | [16:26], centre | 4 | MONSTER_MODE_WAIT | 3 | 1 |
Modes are MonsterMode values. Slots 7 and 8
share [03:17] although their occupancy class would refuse a second monster in
an occupied block: the initial records are not placed through those checks.
Sources
Locations refer to the game executable reference; the reference files are identified in the file inventory.