Black Crypt dungeon structures.
This list is created from structures placed on dungeon.
Any structure is around 20 bytes inserted every time to dungeon file, plus actions if its switch etc.
Some types splited to be more clear, like glyph/magic field/illusionary wall its one type and used bits is too confusing.

X is for unique number and it's not structure data itself, but must be set.

Door + frame
X XX 00 aa 00 00 bb 11 00 00 00 00 00 00 00 00 00 cc 00 00
aa - gfx; first tileset 35 - grate, 36 - full, other tilesets 35 - full, 36 - grate / 8 bits
bb - orientation; 50 - walkable WE, A0 - walkable NS / 8 bits
cc - initial state; 00 - closed, 01 - opened, 02 - closed blocked (locked by key); 03 - opened blocked (frame for stairs, fountain, special panel) / 8 bits

Door switch
X XX 00 37 00 00 aa 0F 00 0b 00 00 00 00 00 cc 00 0d 00 00
+ actions (actions explained at end)
aa - orientation, must by that same as door orientation; 50 - walkable WE; A0 - walkable NS / 8 bits
b - switch position bitflag; +1 - NW, +2 - NE, +4 - SE, +8 - SW / 4 bits
cc - action ID; 00 - no extra actions, just operate door / 8 bits
d - number of click to start action; 0-2 used once at level 27 to generate Skeleron Lords, max clicks is 2 / 4 bits
note: need door frame, switch always operate door and dont need configured action for this, just set cc - 00 and ignore action bits to be standard door switch

Door lock
X XX 00 aa 00 00 bb 22 00 0c 00 00 00 00 00 dd 00 01 00 00
aa - lock gfx, 51 - 53 (any map has own 3 gfx) / 8 bits
bb - orientation, must by that same as door orientation; 50 - walkable WE; A0 - walkable NS / 8 bits
c - lock position bitflag; +1 - NW, +2 - NE, +4 - SE, +8 - SW / 4 bits
dd - key number; must be that same as corresponding key cc byte / 8 bits
note: need door frame

Pillar
X XX 00 38 00 00 00 17 00 00 00 00 00 aa 00 00 00 00 00 00
aa - initial state; 00 - on, 01 - off / 8 bits

Alcove
X XX 00 39 00 00 a0 16 bb bb 00 00 00 cc 00 dd 00 ee 00 00
+ actions
aa - alcove position on square; N - 1, E - 2, S - 4, W - 8 / 4 bits
bbbb - specified item as a trigger; uses item "gfx number" bytes, 00 00 - none / 16 bits
cc - trigger initial state; 00 - on, 02 - off / 8 bits
dd - action ID; 00 - no actions, standard alcove / 8 bits
ee - trigger; 01 - any item in, 02 - specified item in, 03 - any item out, 04 - specified item out / 8 bits

Fountain
X XX 00 45 00 00 00 1F 00 aa 00 bb 00 00 00 00 00 00 00 00
aa - charges; FF - infinite / 8 bits
bb - effect; 9E - water, 98 - poison, 9B - disease, 96 - healing, 9D - extra healing, and much more values / 8 bits
note: need door frame and set as opened blocked

Illusionary Wall
X XX 00 C1 01 F3 00 10 00 00 00 00 00 aa 00 01 00 00 00 00
aa - initial state; 00 - on, 01 - off / 8 bits

Magic Field
X XX 00 48 00 00 00 10 00 aa 00 00 00 bb 00 02 00 cc 00 dd
aa - additional field to remove, height; 00 - none, coordinates on 64x64 map / 8 bits
bb - initial state; 00 - on, 01 - off / 8 bits
cc - field level / 8 bits
dd - additional field to remove, width; 00 - none, coordinates on 64x64 map / 8 bits

Glyph
X XX 00 3C 00 00 00 10 00 00 00 00 00 aa 00 03 00 bb 00 cc
aa - initial state; 00 - on, 01 - off / 8 bits
bb - glyph level / 8 bits
cc - glyph type; 01 - death, 02 - fire, 03 - ice, 04 - poison / 8 bits

Pit
X XX aa aa 00 00 00 14 00 00 00 00 00 bb 00 cc 00 dd 00 ee
aaaa - gfx; 00 3A - floor, 00 3B - ceiling / 16 bits
bb - initial state; 00 - on, 01 - off / 8 bits
cc - destination, width; coordinates on 64x64 map / 8 bits
dd - destination, height; coordinates on 64x64 map / 8 bits
ee - pit type; 00 - floor, 01 - ceiling / 8 bits
note: game bug drops party when ceiling pit opens at square where party stands

Stairs
X XX 00 44 00 00 00 12 00 aa 00 00 00 00 00 bb 00 cc 00 dd
aa - destination map number; 00 if destination is another level on that same map / 8 bits
bb - destination, width; coordinates on 64x64 map / 8 bits
cc - destination, height; coordinates on 64x64 map / 8 bits
dd - gfx; 02 - stairs up; 03 - stairs down / 8 bits
note: need door frame and set as opened blocked

Teleport
X XX 00 40 00 00 00 12 00 00 00 aa 00 bb 00 cc 00 dd 00 ee
aa - rotation; clockwise, 00 - none, 01 - 90', 02 - 180', 03 - 270' / 8 bits
bb - initial state; 00 - on, 01 - off / 8 bits
cc - destination, width; coordinates on 64x64 map / 8 bits
dd - destination, height; coordinates on 64x64 map / 8 bits
ee - gfx; 00 - invisible, 01 - visible, 05 - invisible and invisible on automap / 8 bits

Spinner
X XX 00 1E 00 00 0F 12 00 00 00 aa 00 bb 00 00 00 00 00 04
aa - rotation; clockwise, 00 - none, 01 - 90', 02 - 180', 03 - 270' / 8 bits
bb - initial state; 00 - on, 01 - off / 8 bits

Monster Generator
X XX 00 E8 01 97 aa 2E 00 00 00 bb 00 cc 00 dd 00 ee ff ff
aa - ?; 01, 0F, F0 / 8 bits?
bb - ?; 00, if aa byte is 01 then C8 / 8 bits?
cc - ?; 00, if aa byte is 01 then 96 / 8 bits?
dd - total number of generations / 8 bits
ee - delay betwen generations; 00 lowest / 8 bit
ffff - source square; square number from bottom left map corner and goes to right on 64x64 map / 16 bits
note: source square must contain monster on it, if not game freeze; creates exacly monster copy from source square on monster generator square
or one square to N, E, S, W if occupied; dont place generator next to glyph, teleporter etc. to prevent generate on it and freeze game
sometimes name bytes "01 97" is 00 00

Plaque
X XX 00 49 00 00 a0 20 00 00 00 00 00 00 00 bb 00 cc 00 00
aa - plaque position on square; 1 - N, 2 - E, 4 - S, 8 - W / 4 bits
bb - text number; texts from bcdft file, 2D - "insert your name here" medusa plaques / 8 bits
cc - minimum character level to read without read runes spell / 8 bits

Plaque Input
X XX 00 1F 00 00 aF 21 00 bb 00 00 00 00 00 cc 00 dd 00 00
+ actions
aa - plaque position on square; 1 - N, 2 - E, 4 - S, 8 - W / 4 bits
bb - answer number; texts from bcdft file / 8 bits
cc - action ID / 8 bits
dd - question number; texts from bcdft file, 2E - random protection / 8 bits

Statue (empty - "new additions")
X XX 00 BD 0C EA 00 2F 00 00 00 00 00 aa 00 bb 00 00 00 00
aa - initial state; 00 - on, 01 - off, always set to 01 / 8 bits
bb - gfx?; 00 - 02 / 8 bit?
note: map 11 only

Statue
X XX 00 BD 00 00 00 2F 00 00 00 00 00 aa 00 bb 00 04 00 00
aa - initial state; 00 - on, 01 - off, always set to 00 / 8 bits
bb - gfx; 00 - druid, 01 - mage, 02 - fighter / 8 bits
note: map 11 only

Switch
X XX aa aa 00 00 b0 1D 00 00 00 cc 00 dd 00 ee 00 00 00 00
+ actions
aaaa - gfx; small - 00 3D, medium - 00 3E, large - 00 3F / 16 bits
b - switch position on square; 1 - N, 2 - E, 4 - S, 8 - W / 4 bits
cc - gfx state; 00 - normal, 01 - switch pressed / 8 bits
dd - initial state; 00 - on, 02 - off / 8 bits
ee - action ID / 8 bits

Floor Plate
X XX 00 42 00 00 00 1E 00 aa 00 bb 00 cc 00 dd 00 00 00 00
+ actions
aa - type; normal - 00, invisible and silent - 01 / 8 bits
bb - gfx state; 00 - normal, 01 - plate pressed / 8 bits
cc - initial state; 00 - on, 02 - off / 8 bits
dd - action ID / 8 bits

Trap
X XX 00 4A 00 00 00 1E 00 01 00 00 00 aa 00 bb 00 01 00 00 00
+ actions
aa - initial state; 00 - on, 02 - off / 8 bits
bb - action ID / 8 bits
note: trap is floor plate with different gfx and trap action with destination coordinates to this trap itself

The Golden Face Panel
X XX 00 46 00 00 00 1F 00 00 00 00 00 00 00 aa 00 bb 00 00 00
+ actions
aa - action ID / 8 bits
bb - panel number; 02, special panel item cc byte / bits
note: map 2 only, originaly needs Eyes of True Sight to run actions

The Druid Face Panel
X XX 00 46 00 00 0F 1F 00 00 00 00 00 00 00 aa 00 bb 00 00 00
+ actions
aa - action ID / 8 bits
bb - panel number; 03, special panel item cc byte / bits
note: map 3 only, originaly needs Moon Key and Sun Key to run independent actions to each key

The Tomb Panel
X XX 00 46 00 00 00 1F 00 00 00 00 00 00 00 aa 00 bb 00 00 00
+ actions
aa - action ID / 8 bits
bb - panel number; 04, originaly no item exist to run actions / bits
note: map 4 only, decoration only, "smiley" :)

The Skull Panel
X XX 00 46 00 00 00 1F 00 00 00 E6 00 00 00 aa 00 bb 00 00 00
+ actions
aa - action ID / 8 bits
bb - panel number; 06, special panel item cc byte / bits
note: map 6 only, originaly needs 3 Skull Crown to run independent actions to each crown

The Clam Panel
X XX 00 46 00 00 00 1F 00 00 00 00 00 00 00 aa 00 bb 00 00 00
+ actions
aa - action ID / 8 bits
bb - panel number; 09, special panel item cc byte / bits
note: map 9 only, originaly needs Pearl to run actions

The Medusa Panel
X XX 00 46 00 00 00 1F 00 00 00 00 00 00 00 aa 00 bb 00 00 00
+ actions
aa - action ID / 8 bits
bb - panel number; 0B, originaly no item exist to run actions / bits
note: map 11 only, decoration only

Finally actions for switch, floor plate, plaque with input, special panel and optionaly alcove or door switch.
When one of above has action, some data reading was changed. Two bytes of unique number or 00 00 to skip to next square is moved betwen switch and action data.
Switch
0 05 00 3F 00 00 10 1D 00 00 00 00 00 00 00 02 00 00 00 00
00 00 - two bytes moved from square end and skip to next square when action bytes ends
+ actions
If its not 00 00 but unique number, starts reading item/monster etc. data when actions ends, explained in stacking section.

Action is basicaly 8 bytes it consists of: action ID, action, clicks to run, destination width, destination height, max runs, delay, action value.
First action is 7 bytes because has no action ID, value moved to our switch action ID "02", next actions has standard 8 bytes.
8 bytes explained:
aa bb cc dd ee ff gg hh
aa - action ID; any action has own unique number 01-FF for each map, sorted on 64x64 map from left to right and bottom to top
bb - action itself:
  spell failed square: 00 - toggle, 01 - on, 02 - off
  pillar: 03 - toggle, 04 - on, 05 - off
  pit: 06 - toggle, 07 - on, 08 - off
  teleport/spinner: 09 - toggle, 0A - on, 0B - off
  trap (as presure plate): 0C - toggle, 0D - on, 0E - off
  wall: 0F - toggle, 10 - on, 11 - off
  monster generator: 12
  party held: 13
  items drop: 14
  teleportation: 15
  switch/floor plate/alcove trigger: 16 - on, 17 - off
  door: 18 - toggle, 19 - off, 1A - on
  trap (as damage): 1C - fire, 1D - ice
  teleportation and dungeon color: 1E
  dungeon color: 1F
  magic field/glyph/illusionary wall: 20 - toggle, 21 - on, 22 - off
cc - number of clicks to run action
dd - target width on 64x64 map
ee - target height on 64x64 map
ff - maximum runs (FF - infinite)
gg - delay (nonlinear values)
hh - action value; depends on action, if:
  wall: 00 - N, 01, - E, 02 - S, 03, - W
  monster generator: 00-FF - source square number, square can be empty and can generate anything, like items
  party held: held time
  teleportation: 00 - actual map, or map number 01-0D
  switch/floor plate/alcove trigger: 16 - alcove, 1D - switch, 1E - floor plate; specified structure on target square to interact
  trap damage: trap strength
  teleportation and dungeon color: color number
  dungeon color: color number

If action is for example pit on, on target square must be pit with state off. Actions not create structure, only operate existing one. Maximum runs is not maximum switch clicks, but maximum actions loops. If switch need 3 clicks to run action, its 1 run, 6 clicks 2 runs etc.
Actions must be sorted by number of clicks to run action, from lowest to highest.
When actions ends, its extra byte at end. 00 if its one shot actions without loops, or action ID that same as switch/floor plate/alcove action ID, works like "go to" first action and start loop.
And examples, from Blackest Crypt of course;)

Switch
Unique number - 0 23, gfx large - 3F, position east - 20, structure type switch - 1D, gfx state on - 00, initial state - on 00, action ID - 0C
 0 23 00 3F 00 00 20 1D 00 00 00 00 00 00 00 0C 00 00 00 00
00 00 - skips to next square when actions ends
19 01 0C 05 01 00 00 - door off - 19, one click to run - 01, target width - 12, target height - 05, one run - 01, no delay - 00, no value - 00
00 - no loop, actions ends
next square data

Switch
unique number - 0 87, gfx small - 3D, position west - 80, structure type switch - 1D, gfx state on - 00, initial state on - 00, action ID - 47
 0 87 00 3D 00 00 80 1D 00 00 00 00 00 00 00 47 00 00 00 00
00 00 - skips to next square when actions ends
   07 01 1A 10 FF 03 00 -                 pit on - 07, one click to run - 01, target width - 1A, target height - 10, infinite runs - FF, delay - 03, no value - 00
48 08 01 1A 10 FF 06 00 - action ID - 48, pit off - 08, one click to run - 01, target width - 1A, target height - 10, infinite runs - FF, delay - 06, no value - 00
49 07 02 1A 10 FF 03 00 - action ID - 49, pit on - 07, two clicks to run - 02, target width - 1A, target height - 10, infinite runs - FF, delay - 03, no value - 00
4A 08 02 1A 10 FF 06 00 - action ID - 4A, pit off - 08, two clicks to run - 02, target width - 1A, target height - 10, infinite runs - FF, delay - 06, no value - 00
4B 07 03 1A 10 FF 03 00 - action ID - 4B, pit on - 07, three clicks to run - 03, target width - 1A, target height - 10, infinite runs - FF, delay - 03, no value - 00
4C 08 03 1A 10 FF 06 00 - action ID - 4C, pit off - 08, three clicks to run - 03, target width - 1A, target height - 10, infinite runs - FF, delay - 06, no value - 00
4D 19 03 18 16 01 00 00 - action ID - 4D, door off - 19, three clicks to run - 03, target width - 18, target height - 16, one run - 01, no delay - 00, no value - 00
47 - loop, must be that same as first action ID
next square data

Floor Plate
unique number - 0 85, gfx - 00 42, structure type floor plate - 1E, invisible - 01, initial state on - 00, action ID - 19
 0 85 00 42 00 00 00 1E 00 01 00 00 00 00 00 19 00 00 00 00
00 00 - skips to next square when actions ends
   0B 01 0C 25 01 00 00 -                 teleport off - 0B, one click - 01, target width - 0C, target height - 25, one run - 01, no delay - 00, no value - 00
1A 0F 01 36 26 01 00 03 - action ID - 1A, wall toggle - 0F, one click to run - 01, target width - 36, target height - 26, one run - 01, no delay - 00, operate west wall - 03
1B 0F 01 36 26 01 20 03 - action ID - 1B, wall toggle - 0F, one click to run - 01, target width - 36, target height - 26, one run - 01, delay - 20, operate west wall - 03
00 - no loop, actions ends
next square data

Alcove
unique number - 0 06, gfx - 00 39, position south - 40, structure type alcove - 16, Scroll of Dispelling as trigger - 00 0D, trigger state on - 00, action ID - 01, specified item out - 04
 0 06 00 39 00 00 40 16 00 0D 00 00 00 00 00 01 00 04 00 00
00 00 - skips to next square when actions ends
   05 01 11 03 01 00 00 -                 pillar off - 05, one click to run - 01, target width - 11, target height - 03, one run - 01, no delay - 00, no value - 00
02 05 01 15 03 01 00 00 - action ID - 02, pillar off - 05, one click to run - 01, target width - 15, target height - 03, one run - 01, no delay - 00, no value - 00
03 1A 01 13 06 01 00 00 - action ID - 03, door on - 1A, one click to run - 01, target width - 13, target height - 06, one run - 01, no delay - 00, no value - 00
00 - no loop, actions ends
next square data

Trap
unique number - 1 32, gfx trap - 4A, structure type floor plate - 1E, initial state on - 00, action ID - 4A
 1 32 00 4A 00 00 00 1E 00 01 00 00 00 00 00 4A 00 01 00 00
00 00 - skips to next square when actions ends
   1C 01 3C 0B 01 00 07 - trap damage fire - 1C, one click to run - 01, target width - 3C, target height - 0B, one run - 01, no delay - 00, trap strength - 07
00 - no loop, actions ends
next square data

The Golden Face Panel
unique number - 1 33, gfx - 00 46, structure type special panel - 1F, action ID - 7D, special item number - 02
 1 33 00 46 00 00 00 1F 00 00 00 00 00 00 00 7D 00 02 00 00
01 34 - next unique number, reads item/structure when actions ends
   10 01 14 2E 01 00 00 -                 wall on - 10, one click to run - 01, target width - 14, target height - 2E, one run - 01, no delay - 00, operate north wall - 00
7E 10 01 13 2F 01 00 01 - action ID - 7E, wall on - 10, one click to run - 01, target width - 13, target height - 2F, one run - 01, no delay - 00, operate east wall - 01
7F 10 01 15 2F 01 00 03 - action ID - 7F, wall on - 10, one click to run - 01, target width - 15, target height - 2F, one run - 01, no delay - 00, operate west wall - 03
80 10 01 14 30 01 00 02 - action ID - 80, wall on - 10, one click to run - 01, target width - 14, target height - 30, one run - 01, no delay - 00, operate south wall 02
81 12 01 14 30 01 00 0B - action ID - 81, monster generator - 12, one click to run - 01, target width - 14, target height - 30, one run - 01, no delay - 00, source square - 0B
82 12 01 0B 00 01 01 0A - action ID - 82, monster generator - 12, one click to run - 01, target width - 0B, target height - 00, one run - 01, delay - 01, source square - 0A
83 06 01 14 2F 01 00 00 - action ID - 83, pit toggle - 06, one click to run - 01, target width - 14, target height - 2F, one run - 01, no delay - 00, no value 00
84 0B 01 14 3B 01 00 00 - action ID - 84, teleport off - 0B, one click to run - 01, target width - 14, target height - 3B, one run - 01, no delay - 00, no value - 00
00 - no loop, actions ends
00 35 00 00 50 11 00 00 00 00 00 00 00 00 00 03 00 00 - door data, cutted first 2 bytes, because next unique number set earlier "01 34"
00 00 - square ends, as usual
next square

BACK