Level 16: reference tables
Level 16 · The levels · Level data (INF)
In brief
The details of level 16: 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
This page covers every reachable script of the reference file: 42 cell
bindings, 43 script entry points including one shared subroutine, and 237
instructions. The decoding finds no unknown operand layout; 6 bytes in two
places follow a level load and are never executed. Two bindings can never
run (see windows). Message colors are palette colors (Print a message). Sound
numbers select entries of the level's sound file, CRIMSON2.ADL or
CRIMSON2.SND (see the
sound-effect table).1
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 party facing directiondsees sided + 2(modulo 4) of the block ahead. - Script offsets count from the start of the INF
script_datafield (decoded payload offset 1089 in the reference file). Message numbers index the level's 11 strings and text numbersTEXT.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. - Monster types are numbers whose meaning depends on the sublevel record that is current: type 0 is a mind flayer with the first record and Dran with the second. Each section names the record that applies.
- Placing a monster goes through the checks of
SCRIPT_SPAWN_MONSTER. A placement at the centre of a block (position 4) succeeds only on a block that holds no monster and is not the party's block.
Arrival
The hole of level 15 loads the first record at [16:08], with the party's facing unchanged. The portals of levels 3, 6 and 14, used with a stone of value 4 (the Stone Cross), would load it at [16:16], facing 0 (portal animation); the cross never reaches them (see the Stone Cross).1
[16:08] is the centre of a closed room. Its only ways out are four blocks
three blocks away in each direction, [16:05], [13:08], [19:08] and [16:11],
which have WALL_REFERENCE_ILLUSION
on all four sides: they look like walls, but the party walks through them,
while monsters cannot. Entering any of them calls the subroutine at offset 2, which acts
once (level flag 2): it sets the four sides of all four blocks to 0 and places
a salamander (type 1) at the centre of the next block outward, facing the
arrival: [16:04] facing 2, [12:08] facing 1, [16:12] facing 0 and [20:08]
facing 3.
Mind flayers and salamanders
While the first record is current, two periodic scripts and two traps add monsters to the western part:1
- Every 71st move ([00:00], the step-triggered script): a salamander at the centre of [13:06] and one at [18:11], facing 2.
- Every 1 800 ticks ([02:00], a timed block script): a mind flayer (type 0) at the centre of [05:09], [07:11] and [09:11], facing 1.
- [16:03]. Each time the party enters it while the switch door [16:02]
north of it is closed (its side 2 holds reference 3), three salamanders are
placed at the centre of [16:01], [15:01] and [17:01], facing 2, and the
door opens (
SCRIPT_OPEN_DOOR). - [08:08]. Each time the party enters it, the switch door [10:08] east of
it closes (
SCRIPT_CLOSE_DOOR) and sound 12 plays there. The first time (level flag 7), seven mind flayers are placed: at [09:05], [07:05], [05:07], [05:09], [07:11] and twice at [09:11], all at the centre, facing 1. The second placement at [09:11] never succeeds: after the first one the block is occupied, and when the first one is refused the second is refused for the same reason. The ambush therefore adds at most six mind flayers.
Neither timer nor step script exists with the second record, so these placements stop while the party is in the eastern part.
The crystal
[05:08] holds a crystal: its four faces have reference 56, a decoration with
INF_WALL_SPECIAL_DECORATION_SCRIPT
(InfWallSpecialType) that the party
cannot cross. Activating any face runs the script of [05:08] — the
BLOCK_EVENT_PARTY_ENTER bit of its binding can never be used. The script
opens the dialogue screen, plays sound 72 and shows message 3, visions of the
future, then the four quarters of CRYSTAL, each drawn through the
pixel dissolve
(SCRIPT_DIALOGUE_BITMAP_TRANSITION) with sound 19 and waits of 30 to 75
ticks, interleaved with message 4, visions of the past, and message 5, that
one cannot be sure. A last prompt (message 6) closes the screen. The visions
can be watched as often as the party likes.1
The sealed niches
Two niches face west across the corridor of column 21: side 3 of [22:07], which holds the Amulet of Life, and side 3 of [22:09], which holds the Amulet of Death. Between them, the door [22:08] has no switch (reference 8) and no script opens it but these.1
At the start, magical fields fill both niches: their faces hold references 54
and 57, two decorations that send BLOCK_EVENT_WALL_DECORATION, instead of
the niche reference 45. The timer of [01:00] runs about once a second while
the first record is current and swaps 54 and 57 on each face whose field is
still there, so the fields flicker. Activating a field shows message 9, a
magical field filling the niche; the item events enabled on these two blocks
reach their scripts only once a niche is open, and then show nothing.
Standing at [21:07] or [21:09] and facing 1, in front of a niche, the party
removes its field by casting Dispel Magic: the BLOCK_EVENT_SPELL_CAST
event reaches the party's block, and the script tests
SCRIPT_EXPR_LAST_CAST_SPELL for
the definitions 12 and 44, the mage and cleric spells. The niche's face
becomes reference 45, a working niche, and level flag 5 or 6 is set. When the
other niche is already open, SCRIPT_OPEN_DOOR
opens [22:08].
Any other event at these two blocks — entering them, or casting another spell there — shows, one time in four (1d4 below 2) and only while the party faces 1, message 8, a party member's remark that magic holds the door shut, with sound 79. The remark does not check whether the field is still there.
The dying mage and the Stone Cross
The first time the party enters [23:08], beyond the door, it is turned to face
2 and the dialogue screen shows the BADMOOD picture with sound 58 and text
119: one of Dran's mages, dying, warns that his master is in a foul mood. The
other three quarters of the picture follow, 8 ticks apart. Before the screen
closes, a Stone Cross (template 42, type 37 with value 4) is created on
quarter 2 of [23:09], south of the party (level flag 1).1
The Stone Cross is the stone of value 4 that the portals of levels 3, 6 and 14 send to [16:16]. It is the only one in the game: no other script creates one, none lies in the levels at the start, no monster leaves one, and a party transferred from Eye of the Beholder I keeps no item of that type. Since no script of this level leads to another level, and only scripts change level during play, the cross never reaches those portals: their branch for value 4 never runs.
Stairs
The two stairways of the level sit side by side. They follow the pattern of
the level 5 stairs, with messages 0 (up) and 2 (down),
and change sublevel record with
SCRIPT_LOAD_LEVEL_OR_MONSTERS.
Items placed or flying into a stairway go to the arrival block.1
| Stairs | Required direction | Destination | Pushed back to |
|---|---|---|---|
| [25:08] | 1 | Level 16, sublevel 1, [27:08], facing 1 | [24:08] |
| [26:08] | 3 | Level 16, sublevel 0, [24:08], facing 3 | [27:08] |
A change of sublevel keeps the level's walls and its 30 monster slots
(sublevels). Monsters cannot use the stairs:
the stair references 23 and 24 lack WALL_RUNTIME_MONSTER_PASSAGE
(WallRuntimeFlags), so each monster stays
in its part of the map, but its type number is read with the record that is
current.
Dran Draggore
From [27:08], the arrival of the stairs, the door [28:08] leads east. Each time the party enters [29:08], beyond it, the door closes behind it. Seen from [29:08], its face is reference 8, a door without a switch; only its western face, reference 3, has one.1
The corridor beyond turns north to the door block [28:05]. The first time the party enters it, the script of [28:05] runs once (level flag 0):
- It clears
SCRIPT_FLAG_TARGET_REST_ALLOWED, so the rest routine refuses to let the party rest. No script of the level allows it again. - It places Dran (type 0) at the centre of [28:02], three blocks north,
facing 0, away from the party, in
MONSTER_MODE_WAIT(MonsterMode). He faces the decorated south face of [28:01] (reference 53). - After a redraw, the dialogue screen shows the four quarters of
ALTARin turn, each with its sound (52 to 55), and texts 112 to 115: Dran, caught in the middle of an incantation, says he expected the party; he had the drow build the first Darkmoon long ago and was injured in the cataclysm that ended it; he used Xanathar during the building of the new one; his skeletal army is ready to ride against Khelben and take Waterdeep, and he attacks. Sound 2 and a wait of 21 ticks follow each of the first three texts. SCRIPT_MOVE_PARTY_OR_OBJECTmoves the monsters of [28:02] — the Dran just placed — to [00:00], and a new Dran is placed at the centre of [28:02], facing 2, towards the party, inMONSTER_MODE_PURSUE. The screen closes.
The first Dran stays alive at [00:00], a block enclosed by solid walls, where
the party never meets him (inferred; see
living monsters at [00:00]).
He stays in MONSTER_MODE_WAIT too: a monster
notices the party only
within distance 3, and the nearest block the party can reach on this map,
[04:04], is at distance 6.
The final fight and the end of the game
The death of a monster takes a special branch on level 16 while the second
record is current, when its type has MONSTER_CAP_WALL_SPECIAL_TYPE_1 —
Dran's type and that of his second form
(when a monster dies):2
- When Dran (type 0) dies, the party receives his type's experience as for
any death, but the monster is not removed: it becomes type 1 with 150 hit
points, its image moves to the next one (
dragon), its ranged attacks restart from the first weapon and never run out, and the game shows theDRANXpictures. It keeps its block and its slot. Its maximum hit points stay Dran's, which matters only to Harm. - The second form fights with three melee attacks that reach every eligible
character of the attack order (
MONSTER_CAP_ATTACKS_ALL) and its unlimited spell. It does not open a closed switch door: it replaces both faces of the door's block with reference 72, which the second record maps as an open passage with its own decoration (walls and doors). - When the second form (type 1) dies, the game writes
FINAL.SAV, plays the ending and returns to DOS: see the end of the game and the ending.
No script of the level takes part in the fight: the branch belongs to the game's monster code, and the level's scripts only place Dran.
Windows
Twenty-three bindings show message 10, that it is very gloomy outside. In 21
of them the block has one window face (reference 55, a decoration with
INF_WALL_SPECIAL_DECORATION_SCRIPT): 14 in the western part and 7 in the
eastern part. All show the message unconditionally except [28:01].1
- [28:01] carries both a window on its west face, seen from [27:01] facing 1, and the decorated face behind Dran on its south face, seen from [28:02] facing 0. Its script shows the message only when the party faces 1, so activating the face behind Dran shows nothing.
- [22:00] and [22:01] have the same script, but none of their faces has a reference with an interaction type, so no event can reach them and their scripts never run.
Sublevel records
LEVEL16.INF has two sublevel records. Both use the maze LEVEL15.MAZ, the
crimson graphics, the sound name crimson2 and the same door record; the
scripts and cell bindings are shared. The map falls into two parts that only
the stairs at [25:08] and [26:08] join: the western part, of 150 blocks, and
the eastern part, of 48, where Dran waits, each counting its own stairway.
The stairs select the record, so the first record is current in the western
part and the second in the eastern part.3
| Field | Record 0 | Record 1 |
|---|---|---|
| Selected by | The hole of level 15 ([16:08]), the portals ([16:16]), the stairs at [26:08] | The stairs at [25:08] |
Step threshold (steps_until_script) | 70: the [00:00] script runs at every 71st move | 0: no step script |
| Script timers | [01:00] every 18 ticks (interval 1), [02:00] every 1 800 ticks (interval 100), about 99 seconds | None |
| Monster image of bank 0 | mindflay (MINDFLAY.CPS) | dran (DRAN.CPS) |
| Monster image of bank 1 | salamndr (SALAMNDR.CPS) | dragon (DRAGON.CPS, with DRAGON.DCR, two groups) |
| Monster types | 0 and 1: mind flayer and salamander | 0 and 1: Dran and his second form |
| Wall mappings | 40, 41, 45, 46, 54, 55, 56, 57, 58, 74 | 40, 41, 45, 53, 55, 58, 72, 74 |
The second record does not map the illusions (46), the crystal (56) or the niche fields (54, 57), but none of these faces is in the eastern part, so the party never sees them while that record is current (unmapped faces). Reference 53 is the decorated face behind Dran's position; reference 72 is the passage that Dran's second form leaves in place of a door.3
The level has no monster at the start; every monster comes from a script. Monsters of update unit 0 are updated every 25 ticks and those of unit 1 every 15 (monster update cadence).3
Bindings
| Position | Enabled events | Script | Purpose |
|---|---|---|---|
| [01:00] | none (BLOCK_EVENT_TIMER) | 96 | The sealed niches, field animation |
| [02:00] | none (BLOCK_EVENT_TIMER) | 180 | Mind flayers and salamanders |
| [25:08] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 226 | Stairs, up to the second record |
| [26:08] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_FLYING_OBJECT | 353 | Stairs, down to the first record |
| [05:08] | BLOCK_EVENT_PARTY_ENTER | 480 | The crystal, activated as a wall |
| [00:00] | none (BLOCK_EVENT_STEP_COUNT) | 624 | Mind flayers and salamanders |
| [28:05] | BLOCK_EVENT_PARTY_ENTER | 655 | Dran Draggore |
| [23:08] | BLOCK_EVENT_PARTY_ENTER | 866 | The dying mage |
| [08:08] | BLOCK_EVENT_PARTY_ENTER | 1007 | Mind flayers and salamanders, ambush |
| [21:07] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_SPELL_CAST | 1133 | The sealed niches |
| [22:07] | BLOCK_EVENT_ITEM_REMOVED | 1215 | The sealed niches |
| [21:09] | BLOCK_EVENT_PARTY_ENTER, BLOCK_EVENT_SPELL_CAST | 1242 | The sealed niches |
| [22:09] | BLOCK_EVENT_ITEM_PLACED, BLOCK_EVENT_ITEM_REMOVED | 1324 | The sealed niches |
| [16:05] | BLOCK_EVENT_PARTY_ENTER | 1351 | Arrival, illusions |
| [16:11] | BLOCK_EVENT_PARTY_ENTER | 1355 | Arrival, illusions |
| [13:08] | BLOCK_EVENT_PARTY_ENTER | 1359 | Arrival, illusions |
| [19:08] | BLOCK_EVENT_PARTY_ENTER | 1363 | Arrival, illusions |
| [16:03] | BLOCK_EVENT_PARTY_ENTER | 1367 | Mind flayers and salamanders, door |
| [29:08] | BLOCK_EVENT_PARTY_ENTER | 1428 | Dran Draggore, door |
| [03:05] | none (BLOCK_EVENT_WALL_DECORATION) | 1432 | Windows |
| [03:07] | none (BLOCK_EVENT_WALL_DECORATION) | 1438 | Windows |
| [03:09] | none (BLOCK_EVENT_WALL_DECORATION) | 1444 | Windows |
| [03:11] | none (BLOCK_EVENT_WALL_DECORATION) | 1450 | Windows |
| [05:03] | none (BLOCK_EVENT_WALL_DECORATION) | 1456 | Windows |
| [05:13] | none (BLOCK_EVENT_WALL_DECORATION) | 1462 | Windows |
| [07:03] | none (BLOCK_EVENT_WALL_DECORATION) | 1468 | Windows |
| [07:13] | none (BLOCK_EVENT_WALL_DECORATION) | 1474 | Windows |
| [09:03] | none (BLOCK_EVENT_WALL_DECORATION) | 1480 | Windows |
| [09:13] | none (BLOCK_EVENT_WALL_DECORATION) | 1486 | Windows |
| [11:03] | none (BLOCK_EVENT_WALL_DECORATION) | 1492 | Windows |
| [11:13] | none (BLOCK_EVENT_WALL_DECORATION) | 1498 | Windows |
| [15:17] | none (BLOCK_EVENT_WALL_DECORATION) | 1504 | Windows |
| [17:17] | none (BLOCK_EVENT_WALL_DECORATION) | 1510 | Windows |
| [22:00] | none (BLOCK_EVENT_WALL_DECORATION) | 1516 | Windows, never runs |
| [22:01] | none (BLOCK_EVENT_WALL_DECORATION) | 1522 | Windows, never runs |
| [25:14] | none (BLOCK_EVENT_WALL_DECORATION) | 1528 | Windows |
| [28:00] | none (BLOCK_EVENT_WALL_DECORATION) | 1534 | Windows |
| [28:13] | none (BLOCK_EVENT_WALL_DECORATION) | 1540 | Windows |
| [30:06] | none (BLOCK_EVENT_WALL_DECORATION) | 1546 | Windows |
| [30:08] | none (BLOCK_EVENT_WALL_DECORATION) | 1552 | Windows |
| [30:10] | none (BLOCK_EVENT_WALL_DECORATION) | 1558 | Windows |
| [28:01] | none (BLOCK_EVENT_WALL_DECORATION) | 1564 | Windows, and the face behind Dran |
The subroutine at offset 2, the fall of the illusions, is reached
only by the four illusion blocks through
SCRIPT_CALL.
Level flags
| Bit | Set by | Cleared by | Meaning (descriptive) |
|---|---|---|---|
| 0 | [28:05] | — | Dran has spoken. |
| 1 | [23:08] | — | The dying mage's scene has run. |
| 2 | The illusion subroutine | — | The illusions around the arrival have fallen. |
| 4 | The [01:00] timer script | The same script | Phase of the niche-field animation, switched at each run. |
| 5 | [21:07] | — | The field of the niche [22:07] has been dispelled. |
| 6 | [21:09] | — | The field of the niche [22:09] has been dispelled. |
| 7 | [08:08] | — | The mind flayers' ambush has run. |
The script of [28:05] also clears
SCRIPT_FLAG_TARGET_REST_ALLOWED; see
Dran Draggore.
Monster types
Each record defines two monster types, 0 and 1. A monster of type 0 is drawn with the image of bank 0 and one of type 1 with that of bank 1 in every placement of the level's scripts. The game stores no name for a monster type; the names below come from the images. All four types have turn resistance −1. The scripts place the mind flayers in update unit 0 and every other monster in unit 1.4
| Property (INF field) | Record 0, type 0 (mindflay) | Record 0, type 1 (salamndr) | Record 1, type 0 (dran) | Record 1, type 1 (dragon) |
|---|---|---|---|---|
Armour class (armor_class) | 5 | 2 | −8 | −8 |
Hit chance (hit_chance) | 5 | 12 | 12 | 4 |
Level for saving throws (level) | 9 | 8 | 15 | 15 |
Hit points (hit_points_dice) | 1d8 + 60 | 1d8 + 47 | 93 | 93 |
| Melee attacks: count and damage | 3: 2d20, 0, 0 | 3: 2d6 + 1, 1d8 + 1, 4 | 1: 1d8 + 1 | 3: 1d10, 1d10, 3d30 |
MonsterImmunityFlags | none | MONSTER_IMMUNE_NEEDS_MAGIC_WEAPON, MONSTER_IMMUNE_FIRE | MONSTER_IMMUNE_BIT_0_UNKNOWN, _DEATH, _MAGIC, _ELECTRICITY, _COLD, _FIRE, _NEEDS_PLUS_TWO, _WEAPON_REDUCED | Same as Dran |
MonsterCapabilityFlags | MONSTER_CAP_ALT_FRAME_TABLE, _OPENS_DOORS | MONSTER_CAP_ALT_FRAME_TABLE, _POST_MOVE_ACTION, _OPENS_DOORS | MONSTER_CAP_WALL_SPECIAL_TYPE_1, _SIDESTEP_SOMETIMES, _OPENS_DOORS | MONSTER_CAP_ALT_FRAME_TABLE, _WALL_SPECIAL_TYPE_1, _SIDESTEP_SOMETIMES, _OPENS_DOORS, _ATTACKS_ALL |
Type flags (type_flags) | Hold Monster can affect it | Hold Monster can affect it | none | none |
Experience (experience) | 8 000 | 2 000 | 11 000 | 12 000 |
Occupancy class (occupancy_class) | 1 | 2 | 0 | 2 |
Attack and step sounds (sound_1, sound_2) | 43, 42 | 41, 40 | 45, 44 | 47, 46 |
| Ranged attacks | Mind blast, without limit | none | 20: Flame Strike, Lightning Bolt, Hold Person in turn | Flying-object type 8, without limit |
Evasion (damage_modifier) | 90 | 0 | 0 | 0 |
Decoration groups (decoration_indices) | none | none | none | 1 and 2 |
Two dice rows of the mind flayer have no dice and no bonus, so its second and
third attacks deal no damage. Damage that carries MONSTER_DAMAGE_MAGIC is
cancelled against a mind flayer when 1d100 is below 90
(damage to a monster). Flying-object
type 8 of the dragon form is the
monster spell of unlimited range that deals
12d10 + 6 to its target, or 4d10 + 6 while the party has
SPELL_EFFECT_MYSTIC_DEFENSE. Dran's spells are cast at caster level 9. The
hit points of the second form do not come from its dice: it appears only when
Dran dies, with 150 hit points (see the final fight).4
Sources
Locations refer to the game executable reference; the reference files are identified in the file inventory.