Skip to main content

Level 2: reference tables

Level 2 · The levels · Level data (INF)

In brief​

The details of level 2: 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 LEVEL2.MAZ, the dung graphics and the CATACOMB sounds, has two door records (both door1), sets a step threshold of 90 and defines one script timer. Its monster graphics are cleric2, with its decoration file CLERIC2.DCR (three groups), and skelwar, without one.1

This page covers every reachable script of the reference file: 89 cell bindings, 93 script entry points including four shared subroutines, and 738 instructions. The decoding finds no unknown operand layout; 15 bytes in five 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 XX and the row YY, counting from 00; the block index used by the files and the instructions is YY × 32 + XX.
  • Directions and sides. Directions are 0 = north (decreasing row), 1 = east, 2 = south and 3 = west, and side s of a block is its face turned towards direction s (Direction). A wall is activated from the neighbouring block that its face looks into: the lock on side 2 of [06:12], for example, is used from [06:13], south of it.
  • Script offsets count from the start of the INF script_data field (decoded payload offset 1037 in the reference file). Message numbers index the level's 42 strings and text numbers TEXT.DAT; both are summarized, not quoted.
  • Speakers are chosen as on the level 4 page.
  • Level flags are bits of this level's flag word (SCRIPT_FLAG_TARGET_LEVEL); their names below are descriptive.
  • Item names are those of the reference ITEM.DAT; a template is an entry that scripts and monsters copy.
  • Barriers are blocks with WALL_REFERENCE_CLEARED_ON_ENTRY on all four sides: invisible faces that the party and flying objects cross but monsters do not, until the party enters the block or a script clears it.

Stairs​

Five stair blocks follow the pattern of the level 5 stairs: entering in the required direction prints message 39 (going up) or 41 (going down), plays sound 79 and loads another level with SCRIPT_LOAD_LEVEL_OR_MONSTERS; entering in any other direction prints message 40, plays sound 29 and moves the party back one block. Items placed in a stair block or thrown into it go to the destination block.2

StairsRequired directionMessageDestinationPushed back to
[10:11]039Level 1, sublevel 0, [10:26], facing 0[10:12]
[17:15]039Level 1, sublevel 0, [17:14], facing 0[17:16]
[27:01]339Level 1, sublevel 1, [26:01], facing 3[28:01]
[24:03]141Level 3, sublevel 0, [26:02], facing 1[23:03]
[29:04]241Level 3, sublevel 0, [29:05], facing 2[29:03]

The stairs at [27:01] lead to the spider quarter of level 1, which uses that level's second record. The stairs at [24:03] are reached through the frail wall of [23:03].

On the first entries into [10:13], south of the arrival from [10:27] of level 1, a CHARACTER_RACE_DWARF (CharacterRace), or failing that a CHARACTER_RACE_HUMAN, remarks that the party is far underground in a vast, dark, abandoned place (message 11, sound 79); level flag 6 is set when the remark is made.

Guard rooms​

Three rooms in the west each hold guards placed when the party approaches, behind a door and barriers:2

Trigger, first entryDoor openedGuards placed (position: type, item left)Barriers clearedBy an entry into
[02:04] (flag 3)[02:03][02:02], facing 2: 0–3 skeletons; the one at 1 a Short sword (template 5) one time in ten[01:02], [02:01], [03:02][02:03]
[09:07] (flag 4)[10:07][11:07], facing 3: 0–2 skeletons, the one at 1 a Long Sword (template 34) one time in ten; 3 a cleric of type 0 who always leaves a Skull Key (template 29)[11:06], [11:08], [12:07][10:07]
[08:07] (flag 9)none[08:05], facing 2: 0 a cleric of type 1, a Mace (template 26) one time in ten; 1–3 skeletons, at 2 a Short sword and at 3 a Long Sword one time in ten[08:04], [07:05], [09:05][08:06]

The guards wait (MONSTER_MODE_WAIT of MonsterMode). Each room's three other neighbours are barriers, so its guards can leave only through the door block. The script of that door block runs when the party or a monster enters it, and clears each of the three barriers whose side 0 still holds the barrier reference. The door at [08:06] is locked; its lock is at [07:07], next to the trigger.

Every 91st move, the step-triggered script at [00:00] (offset 655) tests side 2 of [06:01], one of the barriers of the northern ambush. Once that barrier has been cleared, each run places three skeletons at positions 0 to 2 of [12:02], facing 3, in MONSTER_MODE_PURSUE.

The northern ambush​

North of the guard room of [08:05], the barrier [08:04] leads to a stuck door at [08:03] (wall reference 51, an INF_WALL_SPECIAL_FORCE_DOOR door of InfWallSpecialType, which the strongest character can force) and to a room where weapons, armour, scrolls and food lie at [08:01].2

  • Entering [08:04], every time, allows resting again (SCRIPT_SET_FLAGS with SCRIPT_FLAG_TARGET_REST_ALLOWED). The first time a CHARACTER_CLASS_FIGHTER is present, it says the door looks stuck but can be forced (message 14, sound 79, level flag 14).
  • The first entry into [08:04] (level flag 5) also places 24 waiting monsters in the rooms on either side of the room beyond the door: four skeletons at [05:01] (the one at position 1 leaving a Short sword one time in ten), and at [05:02] a cleric of type 0 (a Mace one time in ten), a skeleton, a cleric of type 2 and a skeleton, all facing 1; four skeletons at [10:03] facing 0; four skeletons at [12:02] and four at [11:03] (the one at position 2 with a Short sword one time in ten), facing 3; and at [12:03] a skeleton, a cleric of type 1, a skeleton and a cleric of type 2 (a Mace one time in ten), facing 3. The barriers [06:01], [06:02], [10:02] and [11:02] keep them in their rooms. If the guards of the three guard rooms are still alive, the 30 monster slots do not suffice, and the last placements replace the living monsters farthest from the party.
  • Entering [08:02], every time, forbids resting (SCRIPT_CLEAR_FLAGS with SCRIPT_FLAG_TARGET_REST_ALLOWED) and clears the four barriers: the ambush is released. Resting is allowed again only when the party comes back through [08:04].

Locks and keys​

Seven locks follow the pattern of the level 1 locks, with this level's messages: 10 when the door is already open, 5 for a wrong key, 7 for a failed pick and 8 when no thief is present, 9 when no key is held; sound 14 when the door opens and 81 on a failure.2

Lock (side)DoorKey
[06:12] (2)[05:13]Grey Key (value 1)
[02:09] (1)[02:08]Skull Key (value 5)
[07:07] (1)[08:06]Skull Key (value 5)
[16:22] (0)[15:22]Skull Key (value 5)
[25:12] (2)[24:12]Dark Moon Key (value 4)
[23:09] (2)[22:09]Dark Moon Key (value 4)
[16:19] (1)[18:19]value 99; can be picked

The lock of [16:19] can be picked: with Lock picks in hand and a CHARACTER_CLASS_THIEF in the party, one time in three (1d3 equal to 1) the door opens with sound 14, message 6 and sound 79; the script also deletes every key lying in block [00:00], where nothing lies. No item of the reference ITEM.DAT is a key of value 99, so this is the only way to open that door. The other locks cannot be picked.

The keys of this level come from these places:3

  • Skull Keys: one at [09:04] from the start; the cleric of [11:07] (see guard rooms); the fireball trap of [03:11]; and the copy placed at [12:25] (see Calandra).
  • Dark Moon Keys: one in the niche on the west face of [14:03] from the start, and the cleric of type 1 placed at [13:25]. The sealed wall of level 1 also takes a Dark Moon Key.
  • Grey Keys: none on this level; they come from level 1.

Near the lock of [06:12], entering [06:13] the first time makes a party member remark that these doors are not part of the original construction (message 12, sound 79, level flag 7).

A switch. The west face of [18:18] holds wall reference 27, an INF_WALL_SPECIAL_LEVER_INCREMENT wall used from [17:18]. Activating it, or hitting it with a flying object, which this binding enables, plays sound 7 at [18:18] and opens the door at [16:18] (SCRIPT_OPEN_DOOR).

Fireball traps​

Every launch below uses SCRIPT_LAUNCH_OBJECT with SCRIPT_LAUNCH_MAGIC and magic object 2, Fireball, which deals 1d6 × 5 on this level.2

The corridor of column 03. The lever on the east face of [02:11] (reference 31, a lever wall), used from [03:11], plays sound 1 there and launches a fireball from [03:08] southwards, along the corridor towards the lever. The first time a flying object enters [03:11] while the party is elsewhere (level flag 8), a copy of the Skull Key (template 29) appears in the niche on the east face of [02:10], seen from [03:10]. Any flying object counts: the fireball when the party has left [03:11] before it arrives, or an item thrown into [03:11].

Entering [03:08] while the door at [02:08] is closed rolls 1d6; on a roll below 3 level flag 10 is set, and a CHARACTER_CLASS_THIEF, if present, recognizes a fireball trap that a switch or a plate may trigger (message 13, sound 79). Failed rolls change nothing, so the hint keeps its chance at each entry until a roll succeeds.

Charred holes. Five faces hold reference 61, a decoration-script wall: the south face of [03:07], the north face of [03:12], the east face of [18:05], the west face of [26:05] and the south face of [22:01]. Activating one calls the subroutine at offset 2, which says the hole looks charred (message 0). The holes of [03:07], [18:05], [26:05] and [22:01] face the blocks from which the fireballs start.

Pressure plates. [21:05], [23:05] and [22:04] carry wall reference 35, a floor plate, on all sides. Entering [21:05] or [23:05] toggles the plate's four sides between references 35 and 36 (SCRIPT_TOGGLE) and plays sound 12; when the plate has just become 36, a fireball is launched towards it, from [19:05] eastwards for [21:05] and from [25:05] westwards for [23:05]. The plates therefore fire at every second entry. [22:04] fires once: only while it holds 35, it becomes 36, plays sound 12 and launches a fireball southwards from [22:02], from the second starting position.

Hidden ways​

West of [07:15]. The first time a dwarf enters [07:15], it remarks that a well-travelled path leads through this wall (message 15) if the party faces 3, or through the west wall (message 16) otherwise; sound 79, level flag 18. The east face of [06:15] holds reference 42, a lever wall with decoration 11; activating it plays sound 13 and clears the four sides of [06:15].2

An illusion. [04:19] carries WALL_REFERENCE_ILLUSION on all four sides: it is drawn as a wall, but the party passes through it. North and south of it, the first time a CHARACTER_CLASS_MAGE enters [04:18] or [04:20] (level flag 11, shared), it remarks that the wall before the party is a poor illusion (message 17) when the party faces it — direction 2 at [04:18], 0 at [04:20] — and otherwise that the southern wall should be examined (message 18, at [04:18]) or that the wall to the north is not really there (message 19, at [04:20]); sound 79.

North of [22:21]. The north and south faces of [22:20] hold reference 42; activating either plays sound 13 and clears the four sides of [22:20], which joins [22:19] and [22:21]. Entering [22:19] the first time makes a party member wonder where the passage leads (message 26, sound 79, level flag 16).

A hiding place. The first time a CHARACTER_CLASS_THIEF or a CHARACTER_RACE_HALFLING enters [02:17], it remarks that this is a good place to hide things (message 20, sound 79, level flag 15). Two potions lie there from the start.3

The prison block​

The prison block is the corridor of row 20, from [04:20] to [14:20], with cells behind doors on both sides.2

Remarks. Entering [08:20] the first time makes a party member remark that this looks and smells like a prison block (message 24, level flag 1); entering [10:20] the first time, that someone in a cell may still be alive (message 25, level flag 2); both with sound 79.

Levers. Seven levers (reference 27, a lever wall) face the corridor, each opposite a cell door that it toggles (SCRIPT_TOGGLE with SCRIPT_TOGGLE_DOOR, which does nothing while a monster or the party is in the door block):

Lever (side)Door
[06:19] (2)[06:21]
[07:21] (0)[07:19]
[08:19] (2)[08:21]
[09:21] (0)[09:19]
[10:19] (2)[10:21]
[11:21] (0)[11:19]
[12:19] (2)[12:21]

The door of [07:19] is open at the start; the others are closed. The cell behind [10:21] is Shorn's.

Guards and shouts. The first entry into [09:20] or [21:21] (level flag 12, shared) places two waiting clerics at [14:19], facing 2: from [09:20] a cleric of type 0 at position 0 (a Mace one time in ten) and one of type 2 at position 1; from [21:21] the same types at positions 2 and 3. The first entry into [14:20] or [14:21] (level flag 13, shared) turns the party to face 0, redraws the view and, after sound 56 and a delay of 5, opens a dialogue box in which a guard orders the party to stop (message 21 at [14:20], message 23 at [14:21]), with an "ok" prompt (message 22). [14:21] first clears the four sides of [14:20], a barrier.

Shorn​

Shorn, a dwarf cleric who can join the party, is held in the cell behind the door of [10:21]. These scripts use three global flags whose names stay descriptive: bit 1 records that the party has spoken with Shorn, bit 2 that his bones have been placed, and bit 3 is set by Shorn's conversation when the party releases him.2

  • [10:23], at each entry while global bits 2 and 3 are clear: the party is turned to face 3, towards [09:23], and SCRIPT_RUN_SEQUENCE runs SCRIPT_SEQUENCE_NPC_SHORN (conversations with characters). When the party then faces 0, which the "leave" answer sets, it is moved out of the cell to [10:22], [10:21] and [10:20], with a delay of 15 before each move and a redraw after the first two. Global bit 1 is then set, whatever the answer.
  • [14:20] and [05:20], at each entry while global bit 3 is clear, bit 1 set and bit 2 clear: global bit 2 is set and Shorn's bones appear at [09:23], the block the party faces during the conversation. [14:20] moves there the items of [00:31], an out-of-reach block that holds from the start a set of bones named "a complete set of dwarf bones", of value 3; [05:20] creates a copy of the Set of bones of template 19 with value 3, at position 0. Whichever of the two is entered first acts.

So when the party leaves Shorn in his cell, his bones lie there the next time it passes [14:20] or [05:20], and the conversation no longer runs. Bones of value 3 bring back preset 2, Shorn, at a resurrection.

Anomaly

ANOMALY-120 — Insal's departure resets Shorn's flags. When Insal leaves the party after a rest, the game clears global bits 1 and 2. In the original levels, only the scripts of this level use these two bits, to record Shorn's conversation and his bones. If Shorn was not released (bit 3 clear), the conversation runs again at the next entry into [10:23], even when his bones already lie at [09:23], and after it [14:20] or [05:20] can place bones a second time: [05:20] creates a new copy, while [14:20] finds [00:31] empty if it acted before. If the party had spoken with Shorn but his bones were not yet placed, they are not placed until the conversation runs again. This can arise in ordinary play: Insal joins on level 1, before the party reaches Shorn, and a party of five or more that has spoken with Shorn without releasing him only has to rest for more than four hours. These consequences are inferred from the code and the scripts; they have not been observed in play. A faithful reimplementation clears the two bits when Insal leaves.4

Calandra​

South of the prison block, behind the doors of [15:22] and [22:22], lie the rooms where Calandra is met.2

  • [15:23], first entry (level flag 17): a copy of the Skull Key (template 29) is placed at position 2 of [12:25], where armour, weapons, a Spellbook and rations lie from the start, and two waiting clerics are placed at [13:25], facing 0: one of type 1 at position 2, who always leaves a Dark Moon Key (template 30), and one of type 2 at position 3, who always leaves a Cleric Holy symbol (template 8).
  • [22:21], first entry (level flag 24): two waiting clerics, of types 1 and 2, at positions 2 and 3 of [23:25], facing 0, with no item.
  • [13:26], while SCRIPT_GLOBAL_FLAG_CALANDRA_DIALOGUE_RUN is clear: the party is turned to face 1 and SCRIPT_SEQUENCE_NPC_CALANDRA runs Calandra's conversation; the flag is then set, so it runs once.

The rooms hold instruments of torture. Shackles (wall reference 62) on the east face of [11:24], the north faces of [12:26], [13:27], [21:26] and [23:26], the west faces of [15:26] and [19:24] and the south face of [21:23] are in working order (message 31); head crushers (reference 64) on the north face of [17:26], the east face of [20:25] and the west face of [24:24] do not look comfortable (message 32).

Crumbling walls​

North-east of the prison, many walls look as if they could crumble. Their bindings enable BLOCK_EVENT_ITEM_USED, which the game sends to the block in front of the party when a character uses an item; the scripts look for an item of kind ITEM_KIND_MELEE (ItemKind), read through SCRIPT_EXPR_LAST_USED_ITEM. Activating a wall, or using another item on it, gives a remark instead.2

Walls (face)ReferenceA melee weapon used on itOtherwise (subroutine)
[21:02] (1), [19:04] (2), [21:04] (2), [25:06] (0), [19:07] (2), [24:09] (0); [19:06] (all)60; 66Message 33: the wall does not give way8: a dwarf says the cracks show the walls are unstable (message 1, sound 79), otherwise message 2
[23:02] (3), [21:03] (1), [25:04] (2), [20:06] (0), [24:06] (0), [25:07] (2)65Message 34 and sound 79 while level flag 25 is clear: try another wall; nothing while it is set34: a dwarf says the wall will not stand long (message 3, sound 79), otherwise a party member that it does not look safe (message 4)

None of these walls changes. Level flag 25 alternates with the level's timed block script: the timer sends BLOCK_EVENT_TIMER to [30:00] with an interval of 10, that is 180 ticks of the game clock, about ten seconds, and the script there sets the flag when it is clear and clears it otherwise.

The frail wall. [23:03] carries reference 66 on all four sides, the same as [19:06]. Its west face, seen from [22:03], gives way:

  • A melee weapon used on it plays sound 90, then changes that face from 66 to 67, or from any other reference to 68, a face that the party, monsters and flying objects cross. Two blows therefore open the way to [23:03] and to the stairs down at [24:03].
  • Activating the face while it holds 66 makes a party member say the wall is exceptionally frail here (message 29); activating it while it holds 67, that a few more swings may do (message 30); both with sound 79.

The four faces of [23:03] stop only a party entering the block: a party that arrives there from level 3 leaves westwards freely, since a move tests the face of the block entered. Entering [22:03] has one chance in ten (1d10 equal to 1) of making a dwarf remark that the walls here could crumble at any time (message 28, sound 79); level flag 20 is set when the remark is made.

The parchments. The niche on the east face of [15:07] holds, from the start, the item named "east wind", one of the four winds of the level 5 seal, and a parchment. The binding of [15:07] enables BLOCK_EVENT_ITEM_REMOVED; the first time an item is taken from it, a party member suggests reading all the parchments again (message 27, sound 79, level flag 19).3

Khelben's vision​

The first time the party enters [22:08] while exactly one present character carries an item of type 46 (ITEM_TYPE_QUEST_ITEM) and value 4 — Khelben's Coin, which a new party receives — the vision runs (level flag 21). The test counts the characters with SCRIPT_EXPR_PARTY_BLOCK_OR_ITEM_HOLDERS and compares the count with 1.2

  1. A dialogue box describes a moment of dizziness and a vision of Khelben (message 35); after a delay of 40, the KHELBEN picture appears with SCRIPT_DIALOGUE_BITMAP_TRANSITION (ScriptDialogueBitmapFlags), with sound 59 and a delay of 60.
  2. Khelben asks what the party has discovered (message 36). The subroutine at offset 60 animates him: it draws 18 times one of three regions of the picture, with a delay of 6 between draws. With UL the upper-left region (source_x 0, source_y 0), UR the upper-right (20, 0) and LR the lower-right (20, 96), the order is UL, UR, LR, UR, UR, LR, UR, UL, LR, UL, UR, LR, UR, UR, LR, UR, UL, LR. An "ok" prompt (message 22) follows.
  3. The party reports that the temple is a stronghold of evil (message 37), with a prompt.
  4. Khelben fears an army is being raised and tells the party to go on while he consults the lords of Waterdeep (message 38). The animation runs twice, with a delay of 6 between, the upper-left region is drawn again, and the screen closes after a last prompt.

Bindings​

Blocks whose flags are zero still receive the events that need no enabling bit: the step event at [00:00], the timer event at its target [30:00] and BLOCK_EVENT_WALL_DECORATION for activated walls. In the table, enter stands for BLOCK_EVENT_PARTY_ENTER, item placed, item removed, flying object, item used and monster enters for BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_ITEM_REMOVED, BLOCK_EVENT_FLYING_OBJECT, BLOCK_EVENT_ITEM_USED and BLOCK_EVENT_MONSTER_ENTER (BlockEventMask).1

PositionEnabled eventsScriptPurpose
[10:11]enter, item placed, flying object4197Stairs, up to level 1
[17:15]enter, item placed, flying object4324Stairs, up to level 1
[27:01]enter, item placed, flying object4578Stairs, up to level 1
[24:03]enter, item placed, flying object4451Stairs, down to level 3
[29:04]enter, item placed, flying object4705Stairs, down to level 3
[10:13]enter882Stairs, first remark
[00:00]none (BLOCK_EVENT_STEP_COUNT)655Guard rooms, every 91st move
[02:04]enter1340Guard rooms
[02:03]enter, monster enters508Guard rooms, barriers
[09:07]enter1417Guard rooms
[10:07]enter, monster enters557Guard rooms, barriers
[08:07]enter1494Guard rooms
[08:06]enter, monster enters606Guard rooms, barriers
[08:04]enter1717The northern ambush
[08:02]enter1694The northern ambush
[06:12]none (BLOCK_EVENT_WALL_DECORATION)941Locks and keys
[02:09]none (BLOCK_EVENT_WALL_DECORATION)1103Locks and keys
[07:07]none (BLOCK_EVENT_WALL_DECORATION)1568Locks and keys
[16:22]none (BLOCK_EVENT_WALL_DECORATION)2778Locks and keys
[25:12]none (BLOCK_EVENT_WALL_DECORATION)3051Locks and keys
[23:09]none (BLOCK_EVENT_WALL_DECORATION)3177Locks and keys
[16:19]none (BLOCK_EVENT_WALL_DECORATION)721Locks and keys
[06:13]enter1067Locks and keys, remark
[18:18]flying object713Locks and keys, switch
[02:11]none (BLOCK_EVENT_WALL_DECORATION)1090Fireball traps, lever
[03:08]enter1279Fireball traps, hint
[03:11]flying object1249Fireball traps, key
[03:07]none (BLOCK_EVENT_WALL_DECORATION)1229Fireball traps, hole
[03:12]none (BLOCK_EVENT_WALL_DECORATION)1233Fireball traps, hole
[18:05]none (BLOCK_EVENT_WALL_DECORATION)1237Fireball traps, hole
[26:05]none (BLOCK_EVENT_WALL_DECORATION)1241Fireball traps, hole
[22:01]none (BLOCK_EVENT_WALL_DECORATION)1245Fireball traps, hole
[21:05]enter3334Fireball traps, plate
[23:05]enter3303Fireball traps, plate
[22:04]enter3365Fireball traps, plate
[07:15]enter2132Hidden ways, hint
[06:15]none (BLOCK_EVENT_WALL_DECORATION)2122Hidden ways
[04:18]enter2203Hidden ways, illusion
[04:20]enter2274Hidden ways, illusion
[22:19]enter3028Hidden ways, hint
[22:20]none (BLOCK_EVENT_WALL_DECORATION)3018Hidden ways
[02:17]enter2345Hidden ways, hiding place
[08:20]enter2632The prison block, remark
[10:20]enter2655The prison block, remark
[06:19]none (BLOCK_EVENT_WALL_DECORATION)2597The prison block, lever
[07:21]none (BLOCK_EVENT_WALL_DECORATION)2602The prison block, lever
[08:19]none (BLOCK_EVENT_WALL_DECORATION)2607The prison block, lever
[09:21]none (BLOCK_EVENT_WALL_DECORATION)2612The prison block, lever
[10:19]none (BLOCK_EVENT_WALL_DECORATION)2617The prison block, lever
[11:21]none (BLOCK_EVENT_WALL_DECORATION)2622The prison block, lever
[12:19]none (BLOCK_EVENT_WALL_DECORATION)2627The prison block, lever
[09:20]enter2385The prison block, guards
[21:21]enter2429The prison block, guards
[14:20]enter2473The prison block, shout; Shorn
[14:21]enter2550The prison block, shout
[10:23]enter2714Shorn
[05:20]enter2678Shorn
[15:23]enter2904Calandra
[22:21]enter2955Calandra
[13:26]enter2999Calandra
[11:24]none (BLOCK_EVENT_WALL_DECORATION)3548Calandra, shackles
[12:26]none (BLOCK_EVENT_WALL_DECORATION)3554Calandra, shackles
[13:27]none (BLOCK_EVENT_WALL_DECORATION)3560Calandra, shackles
[15:26]none (BLOCK_EVENT_WALL_DECORATION)3566Calandra, shackles
[19:24]none (BLOCK_EVENT_WALL_DECORATION)3572Calandra, shackles
[21:23]none (BLOCK_EVENT_WALL_DECORATION)3578Calandra, shackles
[21:26]none (BLOCK_EVENT_WALL_DECORATION)3584Calandra, shackles
[23:26]none (BLOCK_EVENT_WALL_DECORATION)3590Calandra, shackles
[17:26]none (BLOCK_EVENT_WALL_DECORATION)3596Calandra, head crusher
[20:25]none (BLOCK_EVENT_WALL_DECORATION)3602Calandra, head crusher
[24:24]none (BLOCK_EVENT_WALL_DECORATION)3608Calandra, head crusher
[21:02]item used3634Crumbling walls
[19:04]item used3660Crumbling walls
[21:04]item used3686Crumbling walls
[19:06]item used3712Crumbling walls
[25:06]item used3738Crumbling walls
[19:07]item used3764Crumbling walls
[24:09]item used3790Crumbling walls
[23:02]item used3816Crumbling walls
[21:03]item used3856Crumbling walls
[25:04]item used3896Crumbling walls
[20:06]item used3936Crumbling walls
[24:06]item used3976Crumbling walls
[25:07]item used4016Crumbling walls
[30:00]none (BLOCK_EVENT_TIMER)3614Crumbling walls, timer
[23:03]item used3461Crumbling walls, the frail wall
[22:03]enter3419Crumbling walls, hint
[15:07]item removed3396Crumbling walls, parchments
[22:08]enter4056Khelben's vision

Four subroutines are reached only through SCRIPT_CALL: offset 2, the charred holes; offsets 8 and 34, the two remarks of the crumbling walls; and offset 60, the animation of Khelben's vision.

Level flags​

BitSet byCleared byMeaning (descriptive)
1[08:20]—The prison remark has been made.
2[10:20]—The remark about a living prisoner has been made.
3[02:04]—The guards of [02:02] have been placed.
4[09:07]—The guards of [11:07] have been placed.
5[08:04]—The northern ambush has been placed.
6[10:13], when the remark is made—The first remark has been made.
7[06:13]—The remark about the doors has been made.
8[03:11]—The Skull Key of the fireball trap has appeared.
9[08:07]—The guards of [08:05] have been placed.
10[03:08], after a successful roll—The fireball-trap hint can no longer be given.
11[04:18] or [04:20], when the remark is made—The illusion remark has been made.
12[09:20] or [21:21]—The guards of [14:19] have been placed.
13[14:20] or [14:21]—The guards of the prison block have shouted.
14[08:04], when the remark is made—The stuck-door remark has been made.
15[02:17], when the remark is made—The hiding-place remark has been made.
16[22:19]—The passage remark has been made.
17[15:23]—The guards of [13:25] have been placed.
18[07:15], when the remark is made—The remark about the path has been made.
19[15:07]—The parchment remark has been made.
20[22:03], when the remark is made—The crumbling remark has been made.
21[22:08]—Khelben's vision has been shown.
24[22:21]—The guards of [23:25] have been placed.
25The timer at [30:00], every other eventThe same timerAlternates at each timer event.

The scripts also use bits 1 to 4 of the global flags: bits 1 to 3 for Shorn and bit 4, SCRIPT_GLOBAL_FLAG_CALANDRA_DIALOGUE_RUN, for Calandra.

Monster types​

The level defines four monster types. Types 0 to 2 use the cleric2 image and are the temple's clerics; type 3 uses skelwar and is a skeleton warrior. Every monster placed by the level's scripts uses the image of its type. The game stores no name for a monster type:5

Property (INF field)Types 0, 1 and 2Type 3
Armour class (armor_class)22
Hit chance (hit_chance)139
Level for saving throws (level)910
Hit points (hit_points_dice)9d10 + 99d8 + 10
Melee attacks: count and damage1, 1d6 + 11, 1d12
MonsterCapabilityFlagsMONSTER_CAP_POST_MOVE_ACTION, MONSTER_CAP_OPENS_DOORSnone
MonsterImmunityFlagsnonenone
Type flags (type_flags)Hold Person can affect itTurn undead can affect it
Experience (experience)2 0002 000
Occupancy class (occupancy_class)00
Attack and step sounds (sound_1, sound_2)41, 4043, 42
Ranged attacksone Hold Person (magic object 3)none
Turn resistance, evasion (turn_resistance, damage_modifier)−1, 08, 90
Decoration groups (decoration_indices)type 0: 3; type 1: 2 and 3; type 2: 1 and 3none

The three cleric types have the same statistics and differ only in the decorations drawn over the image. With an evasion of 90, a skeleton warrior cancels damage marked MONSTER_DAMAGE_MAGIC when a roll of 1d100 is below 90.

All placements below use SCRIPT_SPAWN_MONSTER. Because every type has occupancy class 0, monsters placed at the positions 0 to 3 of a block share it: such a placement fails only when the block already counts seven monsters or is the party's block. When all 30 monster slots are alive, a placement replaces the living monster farthest from the party. Some monsters leave a copy of an item when they die, one time in ten or always; their items are given with each placement.2

Sources​

Locations refer to the game executable reference; the reference files are identified in the file inventory.

Footnotes​

  1. The reference LEVEL2.INF and LEVEL2.MAZ, read with INF.ksy and MAZ.ksy: sublevel record, step threshold 90, script timer target [30:00] with interval 10, monster graphics slots, the empty initial monster block, wall mappings, the walls of the blocks named and the cell bindings. The event meanings follow BlockEventMask and LevelBlockStateFlags; the gating is that of the block event dispatcher. ↩ ↩2

  2. Reachability decoding of the reference LEVEL2.INF with script_decoder.py and the layouts of the virtual machine reference. Offsets are those of the decoded instructions; wall references come from LEVEL2.MAZ and the level's wall mappings. The placement checks are those of the monster spawn routine; the timer is run by the script timers routine. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13

  3. The reference ITEM.DAT: the items of level 2 and their blocks, the keys of all levels, the templates 5, 8, 19, 26, 29, 30 and 34, and the item 93, Khelben's Coin. ↩ ↩2 ↩3

  4. The decoded scripts at offsets 2473–2549, 2678–2713 and 2714–2777 of the reference LEVEL2.INF; the Insal departure, which clears bits 1 and 2 of the global flags; the character dialogues. ↩

  5. The monster graphics slots and monster type entries of the reference LEVEL2.INF (INF.ksy), copied into the monster type properties by the type loader; the group count of the reference CLERIC2.DCR (DCR.ksy). ↩