Skip to main content

Level 5: reference tables

Level 5 · The levels · Level data (INF)

In brief​

The details of level 5: 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 LEVEL5.MAZ and the mezz graphics, sets a step threshold of 20 and has no script timer. Its only monster graphics resource is cleric1. Two monsters are present at the start, both at [13:08] in MONSTER_MODE_PEACEFUL (MonsterMode): one of type 0 at position 3 and one of type 2 at position 2, in slots 16 and 17. The dialogues identify them as the clerics Nadia and Joril; their monster types are described below.1

This page covers every reachable script of the reference file: 31 cell bindings, 32 script entry points including one shared subroutine, and 359 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). Sound numbers select entries of the level's sound file, MEZANINE.ADL or MEZANINE.SND (see the sound-effect table).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). For example, the window tests read side 2 of [14:08] when the party at [14:09] faces 0, and side 0 of [14:10] when it faces 2.
  • Script offsets count from the start of the INF script_data field (decoded payload offset 880 in the reference file). Message numbers index the level's 31 strings and text numbers TEXT.DAT; both are summarized, not quoted.
  • Speakers are chosen as on the level 4 page.
  • Clerics present means that the occupancy of [13:08], read with SCRIPT_EXPR_BLOCK_OCCUPANCY_OR_MONSTER_COUNT, is nonzero.
  • Clerics attack means that the script sets MONSTER_RUNTIME_PROVOKED on monster slots 16 and 17 with SCRIPT_FLAG_TARGET_MONSTER, which also switches each to MONSTER_MODE_PURSUE: they leave their peaceful mode and pursue the party. Damaging either cleric has the same result for both, because a provoked monster in MONSTER_MODE_PEACEFUL turns every monster of the level in that mode.

Front door​

The door at [15:09], east of the arrival position, leads back to the forest.2

  • Party enters [15:09]. Facing 1, the party leaves: message 1, sound 79 and a level load to level 4, at [15:11] facing 2 if SCRIPT_GLOBAL_FLAG_DARKMOON_SOUTH_APPROACH is set, otherwise at [16:10] facing 1, which are the positions from which the party approached the forest entrance. In any other direction, message 2 says that the way is barred, sound 29 plays and the party is moved back to [14:09].
  • Item placed or flying object at [15:09]. Its items go to the same level 4 position.
  • Closing. SCRIPT_CLOSE_DOOR closes [15:09] when the clerics attack after the greeting or at the private doorway, on any BLOCK_EVENT_ITEM_USED or BLOCK_EVENT_MONSTER_EXIT at [13:08], and on entering [10:10] once SCRIPT_GLOBAL_FLAG_TEMPLE_STAIRS_DESCENDED is set. The [13:08] script tests whether a used item has type properties 1 and the clerics are present, but both branches close the door.

Nadia and Joril​

Entering [13:09], south of the clerics, starts their dialogue once (level flag 0) while they are present. The party is turned to face 0; the dialogue screen shows the lower-right region of SOUT1, plays sound 52 and offers three answers to text 22, in which they welcome the party (messages 3–5: inquire, attack, leave):2

  • Attack (answer 2): sounds play, the clerics attack, level flag 1 is set, Joril calls to close the door (message 6) and the front door is closed.
  • Inquire (answer 1): text 23; the party asks about its lost friend and the clerics have not seen her.
  • Leave (answer 3): a party member asks to rest (message 7) and text 24 grants it.

Entering [11:09], a doorway west of the hall, starts Joril's warning once (level flag 2) while the clerics are present: sound 57 and text 30, which forbids the private chambers, with two answers (messages 17 and 18). Ignoring him makes the clerics attack and closes the front door; obeying shows an apology (message 19) and moves the party back to [12:09]. Entering [11:09] again, or when the clerics are absent, makes them attack directly.

The armored woman​

Entering [13:11] starts a dialogue once (level flag 1) while the clerics are present. The party is turned to face 1 and the screen shows the upper-left region of SOUT2, with sound 53 and text 25: a troubled woman in full armor. Answering with the inquiry (message 3) shows text 26, in which she says she is looking for her sister Calandra; ignoring her (message 8) shows her leaving (message 9). The scripts of this level do not otherwise involve her.2

The four winds​

The south face of [12:07] carries a carving of the four winds (wall reference 65, an INF_WALL_SPECIAL_DECORATION_SCRIPT wall). Activating it shows message 11. Using an item while facing it dispatches BLOCK_EVENT_ITEM_USED to [12:07]; the script then reads the item through SCRIPT_EXPR_LAST_USED_ITEM:3

  • Only items of type 17 count, and only while level flag 8 is clear. Their value selects a direction: 1 north (message 12), 2 east (13), 3 south (14), 4 west (15), each setting one of level flags 3–6. In the reference ITEM.DAT, the four items of type 17 with values 1–4 are named after the four winds; type 17 is also the type of the item named Horn. They are placed on level 1 at [05:22], level 2 at [15:07] and level 3 at [30:10] and [01:20].
  • When flags 3–6 are all set, message 16 announces that the wall vanishes, sound 58 plays, the four quarters of AIRSEAL are drawn in turn with SCRIPT_DIALOGUE_BITMAP_KEEP_BACKGROUND and short delays, all four sides of [12:07] become reference 0 and level flag 8 is set.

Entering [12:08], the position in front of the carving, clears flags 3–6, so the four items must be used without leaving it. The same entry gives a one-time remark (message 10, sound 79, level flag 16) that the carving is a magical seal, when the party enters facing 1, has a CHARACTER_CLASS_THIEF or a CHARACTER_CLASS_MAGE (CharacterClassMask) and side 2 of [12:07] is still nonzero; once flag 16 is set, the remark recurs with a probability of 33 in 100 under the same conditions.

Windows and decorations​

Five blocks carry windows (wall reference 62): [14:08] and [14:10], north and south of the arrival position, [15:11], [12:11] and [13:12]. Each script reacts to two events:2

  • Activation (BLOCK_EVENT_WALL_DECORATION): message 22 describes the window while the side still holds reference 62, otherwise message 23 the shrubs seen through it. At [14:08] and [14:10] the window test runs only when the party faces the window (0 and 2 respectively); from another side these blocks show message 24, a holy water basin (reference 59).
  • Item use: an item whose type properties value is 1 breaks the window: sound 77, the side becomes reference 63, the scene is redrawn and the desecration warning is called.

The desecration warning (offset 2) has two outcomes. The first time, while the clerics are present, it sets level flag 7 and shows text 43, in which Nadia orders the party to leave if it means to desecrate the temple. Afterwards, or if the clerics are absent, the clerics attack and level flag 1 is set.

Activating the banners at [11:08] and [11:10] shows message 25.

Stairs​

Three stair blocks share one pattern. Entering in the required direction prints a message (20 up, 21 down), plays sound 79 and loads another level. Entering in any other direction prints message 2, plays sound 29 and moves the party back one block. Items placed or flying into a stair block go to the destination.2

StairsRequired directionDestinationPushed back to
[10:06]0Level 6, sublevel 0, [10:03], facing 0[10:07]
[14:06]1Level 7, sublevel 0, [15:06], facing 1[13:06]
[10:11]2Level 1, sublevel 0, [10:12], facing 2[10:10]

The push-back is compiled as four conditional moves that compare a constant with 0–3, the constant being the stair's required direction. Only the case equal to the constant can execute; it moves the party one block against that direction.

Returning clerics​

Reaching level 1 at [10:12], the arrival point of these stairs down, sets SCRIPT_GLOBAL_FLAG_TEMPLE_STAIRS_DESCENDED. From then on, in this level, at every 21st move (when the move counter exceeds 20) the [00:00] script places a monster of type 0 at position 2 and one of type 2 at position 3, both facing 2, at [10:07] next to the stairs up, subject to the SCRIPT_SPAWN_MONSTER checks, and entering [10:10] closes the front door. The types are those of Nadia and Joril. Their occupancy class 0 lets the two share the block, so both placements can succeed.4

Secret passage and teleporters​

Entering [10:08] can produce a hint that the wall to the west lets a draft through: message 26 if the party has a CHARACTER_CLASS_THIEF, otherwise message 27 with a probability of 30 in 100; either sets level flag 15. That wall is the east face of [09:08] (reference 42, an INF_WALL_SPECIAL_DECORATION_SCRIPT wall).2

At [09:08], any event first sets level flag 15. Activating the wall plays sound 13 and sets all four sides of [09:08] to WALL_REFERENCE_TELEPORTER, the reference of the level's teleporter blocks. Entering [09:08] then plays sound 15 there and moves the party to [04:02]; items placed or flying into it go to the same place.

Four more blocks with WALL_REFERENCE_TELEPORTER on all sides move the party, or the items placed or flying into them, within the level, with sound 15:

TeleporterDestination
[06:01][26:03]
[06:03][10:08]
[24:02][04:02]
[24:04][10:08]

Resurrection altars​

Four plaques at [02:01], [02:03], [28:02] and [28:04] show message 30: the altar undoes death, but only three times. The altar wall of [01:02] (reference 73, INF_WALL_SPECIAL_SCRIPT) works while any of level flags 9–11 is clear. It shows message 28, asking whom to resurrect, and runs SCRIPT_SPECIAL_EVENT with SCRIPT_SPECIAL_EVENT_RESURRECTION. When the run variable is then 1, sound 91 plays and the first clear flag among 9, 10 and 11 is set. Once all three are set, and always at the altar wall of [29:03], a party member remarks that its powers are exhausted (message 29, sound 79).

The altar of [29:03] never resurrects anyone. Its wall (the west face of the block) carries the same reference 73 as the working altar, and the plaques at [28:02] and [28:04] beside it show the same message 30, but the script bound to [29:03] (offset 1921) contains only that remark: it tests no flag and no other condition. Nothing can give it another behavior: no command changes a block's script, the level's scripts write only the four walls of a block, and level flags 9–11, which it does not read anyway, are only ever set, by the altar of [01:02].5

SCRIPT_SPECIAL_EVENT_RESURRECTION (ScriptSpecialEvent) is the resurrection choice: it offers the dead party members and the sets of bones carried by the party, and sets the run variable to 0 only when the player aborts. A charge is therefore used even when bringing back the character of a set of bones fails because the player refuses to free a party slot.6

Bindings​

PositionEnabled eventsScriptPurpose
[00:00]none (BLOCK_EVENT_STEP_COUNT)52Returning clerics
[15:09]BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT93Front door
[13:08]BLOCK_EVENT_ITEM_USED, BLOCK_EVENT_MONSTER_EXIT200Front door, closing
[10:10]BLOCK_EVENT_PARTY_ENTER1206Front door, closing
[13:09]BLOCK_EVENT_PARTY_ENTER229Nadia and Joril
[11:09]BLOCK_EVENT_PARTY_ENTER854Nadia and Joril, private doorway
[13:11]BLOCK_EVENT_PARTY_ENTER391The armored woman
[12:08]BLOCK_EVENT_PARTY_ENTER492The four winds, reset and hint
[12:07]BLOCK_EVENT_ITEM_USED592The four winds
[14:08]BLOCK_EVENT_ITEM_USED1220Windows
[14:10]BLOCK_EVENT_ITEM_USED1295Windows
[15:11]BLOCK_EVENT_ITEM_USED1370Windows
[12:11]BLOCK_EVENT_ITEM_USED1430Windows
[13:12]BLOCK_EVENT_ITEM_USED1490Windows
[11:08]none (BLOCK_EVENT_WALL_DECORATION)1550Windows and decorations, banner
[11:10]none (BLOCK_EVENT_WALL_DECORATION)1556Windows and decorations, banner
[10:06]BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT952Stairs, up to level 6
[14:06]BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT1955Stairs, up to level 7
[10:11]BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT1079Stairs, down to level 1
[10:08]BLOCK_EVENT_PARTY_ENTER1562Secret passage, hint
[09:08]BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT1626Secret passage
[06:01]BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT1679Teleporters
[06:03]BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT1710Teleporters
[24:02]BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT1741Teleporters
[24:04]BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT1772Teleporters
[01:02]none (BLOCK_EVENT_WALL_DECORATION)1803Resurrection altars
[29:03]none (BLOCK_EVENT_WALL_DECORATION)1921Resurrection altars
[02:01]none (BLOCK_EVENT_WALL_DECORATION)1931Resurrection altars, plaque
[02:03]none (BLOCK_EVENT_WALL_DECORATION)1937Resurrection altars, plaque
[28:02]none (BLOCK_EVENT_WALL_DECORATION)1943Resurrection altars, plaque
[28:04]none (BLOCK_EVENT_WALL_DECORATION)1949Resurrection altars, plaque

The subroutine at offset 2, the desecration warning, is reached only by the five window scripts through SCRIPT_CALL.

Level flags​

BitSet byCleared byMeaning (descriptive)
0[13:09]—Nadia and Joril have greeted the party.
1[13:11]; attacking the clerics; the desecration warning's second call—The armored woman will not appear (any more).
2[11:09]—Joril has stopped the party at the private doorway.
3–6The four winds, one bit per direction (north, east, south, west)Entering [12:08]A wind has been used on the seal.
7The desecration warning—Nadia has warned the party.
8Opening the seal—The seal has been opened.
9–11The working altar, one bit per resurrection—Resurrections used.
15[10:08]; any event at [09:08]—The secret-passage hint is no longer needed.
16[12:08]—The seal remark has been made.

Monster types​

The level defines three monster types, 0 to 2, and one monster image, cleric1 (CLERIC1.CPS), with its decoration file CLERIC1.DCR, which has three groups. Nadia and Joril, and the clerics placed later by the step script, are of types 0 and 2; no monster of the level, placed at the start or by a script, uses type 1. The game stores no name for a monster type. The three types share these properties:7

Property (INF field)Value
Armour class (armor_class)2
Hit chance (hit_chance)13
Level for saving throws (level)8
Melee attacks: count and damage1, 2d8
MonsterCapabilityFlagsMONSTER_CAP_POST_MOVE_ACTION, MONSTER_CAP_OPENS_DOORS
MonsterImmunityFlagsnone
Type flags (type_flags)Hold Person can affect it
Experience (experience)2 000
Occupancy class (occupancy_class)0
Attack and step sounds (sound_1, sound_2)37, 36
Ranged attacksnone
Turn resistance, evasion (turn_resistance, damage_modifier)−1, 0

They differ only in their hit points and in the decorations drawn over the image (monster images):

TypeHit points (hit_points_dice)Decoration groups (decoration_indices)
08d8 + 83
12d8 + 563
28d8 + 81 and 3

Types 0 and 2 therefore have the same statistics; on screen, type 2 also carries the decorations of group 1 of CLERIC1.DCR.

Sources​

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

Footnotes​

  1. The reference LEVEL5.INF and LEVEL5.MAZ, read with INF.ksy and MAZ.ksy: sublevel names, steps_until_script 20, empty timer list, monster graphics slot cleric1, initial monsters, wall mappings and cell bindings; the arrival position comes from the decoded level 4 entrance script. ↩

  2. Reachability decoding of the reference LEVEL5.INF with script_decoder.py and the layouts of the virtual machine reference; wall references from LEVEL5.MAZ and the level's wall mappings. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7

  3. The decoded scripts at offsets 492–591 and 592–853, the wall mapping of reference 65 and the reference ITEM.DAT records 119, 154, 185 and 226 (type 17, values 1, 2, 4, 3; initial levels 1, 2, 3, 3). ↩

  4. The decoded scripts of the reference LEVEL1.INF (offset 59, bound to [10:12] with BLOCK_EVENT_PARTY_ENTER) and LEVEL5.INF (offsets 52 and 1206). ↩

  5. The decoded script at offsets 1921–1930 and the binding of [29:03] in the reference LEVEL5.INF; the wall bytes of [01:02] and [29:03] in LEVEL5.MAZ. Bindings are written only by the cell-binding loader (see scripts and the game's state), and SCRIPT_FLAG_TARGET_LEVEL addresses the current level's flags only (ScriptFlagTarget). ↩

  6. The decoded scripts at offsets 1803–1954, the special-event handler and the resurrection menu. Comparative source: oeob_specialEvent in script/script_eob.cpp (REF-SCUMM-012). ↩

  7. The monster graphics slot and monster type entries of the reference LEVEL5.INF (INF.ksy), copied into the monster type properties by the type loader; the group count of the reference CLERIC1.DCR (DCR.ksy). ↩