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
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). 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_datafield (decoded payload offset 880 in the reference file). Message numbers index the level's 31 strings and text numbersTEXT.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_PROVOKEDon monster slots 16 and 17 withSCRIPT_FLAG_TARGET_MONSTER, which also switches each toMONSTER_MODE_PURSUE: they leave their peaceful mode and pursue the party. Damaging either cleric has the same result for both, because a provoked monster inMONSTER_MODE_PEACEFULturns 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_APPROACHis 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_DOORcloses [15:09] when the clerics attack after the greeting or at the private doorway, on anyBLOCK_EVENT_ITEM_USEDorBLOCK_EVENT_MONSTER_EXITat [13:08], and on entering [10:10] onceSCRIPT_GLOBAL_FLAG_TEMPLE_STAIRS_DESCENDEDis 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
AIRSEALare drawn in turn withSCRIPT_DIALOGUE_BITMAP_KEEP_BACKGROUNDand 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
| Stairs | Required direction | Destination | Pushed back to |
|---|---|---|---|
| [10:06] | 0 | Level 6, sublevel 0, [10:03], facing 0 | [10:07] |
| [14:06] | 1 | Level 7, sublevel 0, [15:06], facing 1 | [13:06] |
| [10:11] | 2 | Level 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:
| Teleporter | Destination |
|---|---|
| [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
| Position | Enabled events | Script | Purpose |
|---|---|---|---|
| [00:00] | none (BLOCK_EVENT_STEP_COUNT) | 52 | Returning clerics |
| [15:09] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 93 | Front door |
| [13:08] | BLOCK_EVENT_ITEM_USED, BLOCK_EVENT_MONSTER_EXIT | 200 | Front door, closing |
| [10:10] | BLOCK_EVENT_PARTY_ENTER | 1206 | Front door, closing |
| [13:09] | BLOCK_EVENT_PARTY_ENTER | 229 | Nadia and Joril |
| [11:09] | BLOCK_EVENT_PARTY_ENTER | 854 | Nadia and Joril, private doorway |
| [13:11] | BLOCK_EVENT_PARTY_ENTER | 391 | The armored woman |
| [12:08] | BLOCK_EVENT_PARTY_ENTER | 492 | The four winds, reset and hint |
| [12:07] | BLOCK_EVENT_ITEM_USED | 592 | The four winds |
| [14:08] | BLOCK_EVENT_ITEM_USED | 1220 | Windows |
| [14:10] | BLOCK_EVENT_ITEM_USED | 1295 | Windows |
| [15:11] | BLOCK_EVENT_ITEM_USED | 1370 | Windows |
| [12:11] | BLOCK_EVENT_ITEM_USED | 1430 | Windows |
| [13:12] | BLOCK_EVENT_ITEM_USED | 1490 | Windows |
| [11:08] | none (BLOCK_EVENT_WALL_DECORATION) | 1550 | Windows and decorations, banner |
| [11:10] | none (BLOCK_EVENT_WALL_DECORATION) | 1556 | Windows and decorations, banner |
| [10:06] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 952 | Stairs, up to level 6 |
| [14:06] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1955 | Stairs, up to level 7 |
| [10:11] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1079 | Stairs, down to level 1 |
| [10:08] | BLOCK_EVENT_PARTY_ENTER | 1562 | Secret passage, hint |
| [09:08] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1626 | Secret passage |
| [06:01] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1679 | Teleporters |
| [06:03] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1710 | Teleporters |
| [24:02] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1741 | Teleporters |
| [24:04] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 1772 | Teleporters |
| [01:02] | none (BLOCK_EVENT_WALL_DECORATION) | 1803 | Resurrection altars |
| [29:03] | none (BLOCK_EVENT_WALL_DECORATION) | 1921 | Resurrection altars |
| [02:01] | none (BLOCK_EVENT_WALL_DECORATION) | 1931 | Resurrection altars, plaque |
| [02:03] | none (BLOCK_EVENT_WALL_DECORATION) | 1937 | Resurrection altars, plaque |
| [28:02] | none (BLOCK_EVENT_WALL_DECORATION) | 1943 | Resurrection altars, plaque |
| [28:04] | none (BLOCK_EVENT_WALL_DECORATION) | 1949 | Resurrection altars, plaque |
The subroutine at offset 2, the desecration warning,
is reached only by the five window scripts through SCRIPT_CALL.
Level flags
| Bit | Set by | Cleared by | Meaning (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–6 | The four winds, one bit per direction (north, east, south, west) | Entering [12:08] | A wind has been used on the seal. |
| 7 | The desecration warning | — | Nadia has warned the party. |
| 8 | Opening the seal | — | The seal has been opened. |
| 9–11 | The 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 damage | 1, 2d8 |
MonsterCapabilityFlags | MONSTER_CAP_POST_MOVE_ACTION, MONSTER_CAP_OPENS_DOORS |
MonsterImmunityFlags | none |
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 attacks | none |
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):
| Type | Hit points (hit_points_dice) | Decoration groups (decoration_indices) |
|---|---|---|
| 0 | 8d8 + 8 | 3 |
| 1 | 2d8 + 56 | 3 |
| 2 | 8d8 + 8 | 1 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.