Skip to content

Sources

Jon Tamayo edited this page Dec 2, 2026 · 7 revisions

Sources

Where the numbers of these pages come from. The pages are written by the script tools/wiki_rules.py of ASCENT from the files of an installed Descent to Undermountain 1.3. Addresses are linear addresses in DTUGAME.EXE 1.3 (object 1 at 0x10000). The reverse engineering notes are in docs/re/ of the ASCENT repository.

Kinds of numbers

Kind Source
Item and spell names, damage dice, to-hit and damage bonuses, values, class flags, spell levels, radii the item and spell lines ($WEAPON, $ARMOR, $OBJECT, $SPELL) of the table YPINN.BIN, after the table fixup of DTUGAME.EXE (below)
Race, class, ability, experience, THAC0, hit point, saving throw, slot, thief and turn undead tables; armor class of the items data tables of DTUGAME.EXE (below)
Spell effects, durations, saves, item effects, potion effects the code of DTUGAME.EXE: the spell cases of 0x8CFFF (jump table 0x8CF1F), the item use 0x37A6A, the worn item bits 0xAFB55
Icons of the items and spells icon= of the item or spell line after the table fixup; the picture is that cell of the high resolution icon sheet, entry 24 of FEBGND.DAT (32x32 cells, eight in a row: icon n at column n & 7, row n / 8; 0x3420C, 0x36E3F), in the colors of PALETTE.256, with color 255 transparent

The icons of the item and spell tables come from the game files of Descent to Undermountain. They are the property of their owner and are shown here only to identify the items and spells.

Units

  • Two game units are one foot: the fall message of the game divides the fall distance by two (fell >> 17).
  • Game seconds: the game messages call 60 of them a minute and 3600 an hour.
  • Spell missiles fly 100 units (50 ft) per second: no $SPELL line has speed=, and the default of the reader 0x242F6 is 100.0. They live 30 s, Lightning Bolt 2 s and Melf's Acid Arrows (L/3 + 1) minutes (0x56FF6 writes the life of the missile template).

The table fixup

After it reads the tables, DTUGAME.EXE writes fixed values into fixed lines of the item, weapon, armor and spell tables (0x1A344, called at 0x1C8F9). The game never shows the table text of these fields, so the pages show the values after the fixup. It renames ten items and spells (Produce Fire, Find Traps, Cure Blindness or Deafness, Drowslayer, Longsword +3, Dwarven Scimitar, Ring of Wizardry, Gauntlets of Dexterity, Cloak of Lathandar, Potion of Invisibility), copies four spell lines to make the cleric versions 52 to 55, and changes ranges, radii, the area flag, damage dice, classes and prices. The full list is in engine/main/dtutblfix.c of ASCENT; tools/check_tblfix.py prints each change (124 lines of YPINN.BIN).

The tables of all levels

The item and spell lines of the level tables were compared with YPINN.BIN: names, dice, bonuses, values, classes, spell levels, ranges, radii, durations, types and the rule flags. 31 tables are levels of the mission list DTU.MSN; all of them agree. The mission levels madlands, playgrnd have no table of their own in the unpacked files.

The tables BASE.BIN, BAT1.BIN, CLAN.BIN, CLAN4.BIN, DEMO.BIN, DROW.BIN, MINES1.BIN, MOIN1.BIN, MULHOR.BIN, NETHER.BIN, PORTAL.BIN, PRISON1.BIN, SPIDER.BIN, THIEF.BIN, TRAIN1.BIN are not levels of the mission. Of these, BASE.BIN, DEMO.BIN, MINES1.BIN, MOIN1.BIN, PRISON1.BIN, SPIDER.BIN, TRAIN1.BIN differ from YPINN.BIN (older dialects of the table, docs/formats/tbl.md); the pages do not use them.

Data tables of the executable

Address Count Contents
0x13FECE 6 allowed classes by race (bit masks, tested at 0x88B25)
0x13FCFF 36 racial ability adjustments, 6 rows of STR DEX CON INT WIS CHA (pointers at 0x13FD8F)
0x13FB03 72 racial ability limits, 6 rows of 6 minimums and 6 maximums (pointers at 0x13FCE3)
0x13A956 20 strength to-hit bonus (read by 0x2A789)
0x13A9A2 20 strength damage bonus (0x2B494)
0x13A9F2 5 exceptional strength to-hit, 18/01-50 to 18/00 (0x2A7B9)
0x13AA06 5 exceptional strength damage
0x14019A 20 dexterity armor class adjustment (0xAFB55)
0x1402E2 20 constitution hit points per level, not a fighter
0x140332 20 constitution hit points per level, fighter
0x14023E 20 intelligence column of the statistics screen (no rule reads it)
0x1403D2 80 cleric bonus slots by wisdom, 4 rows for spell levels 1 to 4 (0x3575B)
0x13F2DD 20 market: percent of the value that the player gets (0x86F75)
0x13F32D 20 market: percent of the value that the player pays
0x1461C8 30 thief skills by race, 5 rows (0x8BDE5)
0x146078 84 thief skills by dexterity, 4 rows of 21
0x1466E8 6 racial search for secret doors, d6 (0xB3ECE)
0x145FA0 21 experience, cleric (0xAF43A)
0x145F4C 21 experience, mage
0x145EF8 21 experience, fighter
0x145FF4 21 experience, thief
0x146548 18 THAC0, cleric (read at level + 1 by 0xAF605)
0x14657E 18 THAC0, mage
0x14656C 18 THAC0, fighter
0x14655A 18 THAC0, thief
0x146518 4 hit die by class (0xAF694)
0x146298 20 hit dice by level, cleric
0x1462E8 20 hit dice by level, mage
0x146338 20 hit dice by level, fighter
0x146388 20 hit dice by level, thief
0x1463D8 20 fixed hit points by level, cleric
0x146428 20 fixed hit points by level, mage
0x146478 20 fixed hit points by level, fighter
0x1464C8 20 fixed hit points by level, thief
0x145642 20 saving throws, cleric (0xAE596)
0x145656 15 saving throws, thief
0x145665 30 saving throws, fighter
0x145683 15 saving throws, mage
0x1456E2 4 levels per row of the saving throw tables
0x145CD8 162 mage spell slots, 18 rows of 9 (0x3575B)
0x145DF8 126 cleric spell slots, 18 rows of 7
0x145C04 53 armor class of the armor lines by number (0xAFBDA)
0x145A04 128 armor class of the misc lines by number
0x1458B8 83 armor class of the weapon lines by number
0x146240 20 Gloves of Dexterity, by dexterity
0x2FACC 19 Potion of Toughening: system shock by constitution 1 to 19
0x2FA94 14 spells of the Spider Piece (misc 20)
0x13A8DB 56 cast time of each spell in game seconds; the table fixup 0x1A344 writes it over cast_time= of the $SPELL lines
0xA6487 126 turn undead: 9 rows of 14 (0xADC46)

Spell code

L is the caster level: 0x91EC1 returns the level of the class of the spell. For a mage spell it takes the first class that is not a cleric, so a fighter or a thief casts a mage wand at the own class level. The damage function is 0x91BC3 (each die rand() % sides + 1, then the per level part), the save function 0xAE596 (category 4 for spells). The area function 0x90CEF takes each object within radius + L x level_radius units (0x90D20 to 0x90D37: the high words of the dwords at Spell_info+6 and +0xA are the words radius, +8, and level_radius, +0xC, of the reader 0x242F6), with the quick distance. After the table fixup every area spell has level_radius 0. ASCENT uses the same sum (dtu_spell_area) with the exact distance.

Spell Line Code Detail
Abjure 0 0x8D297
Aid 1 0x8D3F7
Armor 2 0x8D4E7, 0xB05D9
Bless 3 0x8D58E, 0x2AD27
Burning Hands 4 0x8D614, 0x911AA
Chill Touch 5 0x8D62F, 0x29E3D The case acts only when the target is the caster (0x8D633). The table line is not self-cast; the table fixup (0x1A65E) sets the cast on the caster. The cold dice of the line are never rolled.
Color Spray 6 0x8D6D4
Confusion 7 0x8DB82
Continual Light (Cleric) 8 0x8DC1D, 0x90CEF Light 60.0 (player_light of the table fixup). A light-sensitive creature that fails would also take the damage of the line, which is 0.
Continual Light (Mage) 9 0x8DC1D, 0x90CEF Light 60.0 (player_light of the table fixup). A light-sensitive creature that fails would also take the damage of the line, which is 0.
Cure Light Wounds 10 0x8DE4B
Cure Serious Wounds 11 0x8DF37
Detect Magic 12 0x8E019 Sets effect bit 6. The renderer reads it (0x670DB, 0x75726).
Dispel Magic 13 0x8E0B5, 0x90CEF The table fixup (0x1A8ED) writes flags 0x803: AREA, and +0x37 bit 3, with which 0x90CEF also takes objects that are not creatures. The table line had cast_in_front (a cast on the caster); the fixup removes it.
Fear 14 0x8E2D8, 0x13407, 0x903D4
Feather Fall 15 0x8E464, 0x9DEDD
Fireball 16 0x8E55C, 0x91BC3 The table fixup (0x1A972) writes fire_damage_dice=6, #1, level 0 and flags 0x803 (AREA, objects too); the case sets #fire_damage_dice = min(L, 10). The table text has 0 sides and 6 per level (6L, one target).
Produce Fire 17 0x8E5B1, 0x91BC3 The table fixup (0x1AD67) makes line 17 (Flaming Sphere, mage) the cleric spell Produce Fire of level 4: fire 1d4 + 1 per level, the flags of Fireball (AREA, objects too), radius 24, the sounds of Fireball, the value of Abjure.
Flame Walk 18 0x8E5D1
Fly 19 0x8E665
Free Action 20 0x8E6F2
Haste 21 0x8E79C, 0x9DE13, 0x41EC3
Hold Person 22 0x8E85A, 0x56FF6 The counter Spell_info+0x49 is 1d4 at each cast (0x56FF6); the case needs it above 0 and takes 1 for each hold (0x8E8C5).
Hold Undead 23 0x8EA21
Improved Invisibility 24 0x8EB53
Infravision 25 0x8EBE8 (L + 2) x 3600 s in 16.16 fixed point wraps from L = 8 (Dtu_fix_spell_hours). The case also gives the effect to a half-elf (race byte 0), who has infravision by race.
Invisibility 26 0x8ECB4
Jump 27 0x8ED20, 0x9EA62 Jump strength 2.0 instead of 1.5 (0x9EA62).
Knock 28 0x8FFE5, 0x26C2F The case of 0x8CFFF has no code; the door code is in the wall hit 0x26C2F (0x7E859). The table line has self_cast_ok and cast_in_front (a cast on the caster, no missile); the table fixup (0x1A73F) writes flags 2 and removes them.
Levitate 29 0x8EDB2, 0x9DEAE
Light (Mage) 30 0x8DC1D, 0x90CEF Light 20.0 (player_light of the table fixup).
Light (Cleric) 31 0x8DC1D, 0x90CEF Light 20.0 (player_light of the table fixup).
Lightning Bolt 32 0x8EE76, 0x91BC3 The table fixup (0x1AABA) writes elec_damage_dice=6, #1, level 0 and flags 0x802; the case sets #elec_damage_dice = min(L, 10): 1d6 per level, at most 10d6. The missile lives 2 s in 1.3 and bounces at a wall (0x571C5, 0xA0731); 0x272DD removes it at the first body. Dtu_fix_bolt_pass (dtuobj_missile.c) lets it go on.
Magic Missile 33 0x8EED5, 0x56FF6 The table fixup (0x1AABA) writes damage_level=1; the dice are rolled at level 1. damage_bonus=1 of the line is not added (0x91BC3 does not read it).
Magical Stone 34 0x8EEFE
Magical Vestment 35 0x8EF49, 0xB0606
Melf's Acid Arrows 36 0x8EFE0, 0x56FF6 Dtu_fix_melf_acid (dtuspell.c melf_acid_hit, acid_frame). 1.3: the table fixup (0x1AB90) writes acid 4 sides and level 0; the case sets #acid_damage_dice = 2 (L/3) + 2. The missile lives (L/3 + 1) minutes. The later rounds of acid are not in the level state and end at a save and load.
Melf's Minute Meteors 37 0x8F021
Prayer 38 0x8F078, 0x56D6A
Protection From Evil 39 0x8F116, 0x2AD36
Protection From Fire 40 0x8F1B2
Rary's Mnemonic Enhancer 41 0x8F21D
Cure Blindness or Deafness 42 0x8F2FA
Resist Fire 43 0x8F3CD
Scare 44 0x8F467
Shield 45 0x8F6AE, 0xB0659
Sleep 46 0x8F766
Slow 47 0x8FAD8
Spider Climb 48 0x8FBEE, 0xB3038
Stone Skin 49 0x8FC7A, 0x2AE44
Strength 50 0x8FCFA The time L x 3600 s overflows the 16.16 fixed point timer from L = 10 on (Dtu_fix_spell_hours).
Find Traps 51 0x8E4F6 The table line is a second Burning Hands; the table fixup (0x1AE9A) names it Find Traps, a cleric spell of level 2 cast on the caster (flags 0x102). The case: Find/Remove Traps counts as 100% and the search runs each frame. The creature weapon Ice Shards (weapon 79) casts it.
Hold Person 52 0x8E85A, 0x56FF6 The counter Spell_info+0x49 is 1d4 at each cast (0x56FF6); the case needs it above 0 and takes 1 for each hold (0x8E8C5).
Protection From Evil 53 0x8F116
Detect Magic 54 0x8E019
Dispel Magic 55 0x8E0B5

Item code

Item Code
Potion of Agility case 0x48 of 0x37A6A
Potion of Anti-Magic case 0x49
Potion of Dragon's Blood case 0x4A
Potion of Extra-Healing case 0x4B
Potion of Fire Resistance case 0x4C
Potion of Flying case 0x4D
Potion of Freedom case 0x4E
Potion of Healing case 0x4F
Potion of Hill Giant Strength case 0x50
Poshun uv Hil Gient Inteljuns case 0x51
Potion of Infravision case 0x52
Potion of Invisibility case 0x53
Potion of Invulnerability case 0x54, 0x2A24A
Potion of Jumping case 0x55
Potion of Luck case 0x56, 0x2A87B (P+0x1A58, day clock bit P+0x83)
Potion of Speed case 0x57
Potion of Toughening case 0x58, table 0x2FACC
Gem of Curing case 2 of 0x37A6A (0x3890F)
Scroll, thief scroll cases 0x66 and 0x7F of 0x37A6A, text screen 0x9DC42
Cursed Scroll case 0x6A of 0x37A6A
Spider Pieces cases 0x12 to 0x1A of 0x37A6A: misc 18 turn undead at level (class 1 level + 1) x 2 (0x38196), 19 the map, 20 the people in sight (0x385D3), 21 no case, 22 Fear and seven spells, 23 the view of each creature (0x38268), 24 script 0x1FC, 25 the Assembled Spider, 26 all hit points and nine spells. The statue of FLAME takes 18, 19, 24, 26, 22, 23 and 20
Ring of Armoring 0xB0014, 0xB01B6, 0xAFAD1 (after the caps 0xB05FC, 0xB064F, 0xB067C)
Boots (misc 8) the boot place counts only an armor line (0xAFBC8)
Drowslayer (weapon 13) use 0x37B58, drop 0xB7197, warp 0x59D2D, script 0x1FD
Plot items cannot be dropped 0xB611C
Partial stacks 0xB65BB (1.3 cuts the count to stack_limit)
Worn items the item bits of 0xAFB55
Weapon powers 0x2AB9F, 0x2B1F2, 0xB337E, 0xAFB55, 0xB038F

Other rules

Rule Code
Character: 7 bonus points 0x89B95
Character: start hit points, two classes 0x8BA3A
Character: start items and spells 0x8BB91, 0x8BEBC, lists at 0x13F6CD
Level cap 18 (a level is raised while level + 1 < 18) 0xAF43A
Hit points of a new level: rand() % (die - die/2 + 1) + die/2 0xAF694
THAC0 at level + 1, index at most 17 0xAF605
Saving throws: class and level only 0xAE596
Infravision by race 0x54632
Sleep resistance of elves and half-elves 0x8F766
Scare save of elves, half-elves and clerics 0x8F467
Move Silently of elves, drow and halflings 0xB4196
Find/Remove Traps 50% of dwarves 0x8BDE5
Infravision spell and ring: race byte 0 (human, half-elf) 0x8EBE8, 0xB0968
Racial search for secret doors 0xB3ECE
Mage spell refused in armor without MAGIC_OK 0x41A4D
Spell slots filled by a rest, a new character and the way from Waterdeep into the dungeon; not by a level change or a load 0x3551B (0x3608B, 0x8BFFE, 0x42284), 0x3575B
Wisdom divides Fear, Scare, Hold Person and the Color Spray stun on the player 0x8DAA2, 0x8E338, 0x8E8FA, 0x8F57F
Charisma market prices 0x86F75
Thief skills 0xB3038, 0xB31BD (Open Locks), 0xB3400, 0xB4196 (Move Silently), 0xB333F (Hide In Shadows), 0x951DE (Climb Walls), 0xB337E (backstab), worn items 0xAFB55
Turn undead; the Cloak of Lathandar as a cleric of level 7 0xADC46, table 0xA6487; 0xADCB3
Rest place: again after 300 s 0x3E1F6
Armor class order and limits 0xAFB55, armor table 0x145C04
Melee swing max(fire_wait, 1.0) s, Slow doubles it 0x441E9
Missile fire rate fire_wait (default 0.25 s, 0x207E7): the timer of 1.3 never limits it 0x56A0D, 0x56BB0
Weapon resistant creatures and the magic flag 0x29D9D
Thrown and other missiles take the crossbow bonus; arrows the bow bonus 0x2AB0A
Critical hit rolls twice; fumble drop 0x29A9C, 0xAE837
Wand and scroll cast, charges 0x56A0D, 0xB7084
Caster level of a spell, wand or scroll 0x91EC1
Spell items learned on pick up 0xB69AD
Spell items in hot key boxes (39, 40, 53 for all) 0x3533C

Rules found in the code

These rules were open questions of the reverse engineering. Each was decided from the 1.3 code.

Rule Evidence
The table text of Fireball, Lightning Bolt and Melf's Acid Arrows has 0-sided dice, which add 0. The table fixup gives them 6, 6 and 4 sides, so 1.3 never rolls the 0-sided dice; only -rawtables of ASCENT shows the rule. The count of the 0-sided dice is set by the cases 0x8E592, 0x8EEAB, 0x8EFE0. 0x91BC3 divides by the sides with idiv dword ptr [esp] (0x91C25, 0x91C8E, 0x91CEC, 0x91D4E). The divide error handler of div0.asm (div0_init(1) at 0xB8323, handler 0xF6D94, saturate mode, no lists) returns remainder 0 and, because it decodes the SIB form wrongly, resumes after the next instruction inc edx. So each 0-sided die adds 0. Emulated from 0xF6E18 for all four addresses.
Arrows +1 do 1d6+1, Arrows +2 1d6+2, Magic Arrow 1d6. The lines have no damage_dice. The $WEAPON reader 0x209F3 calls 0x207E7 first, which sets sides 6 and count 1 (0x208D7, 0x208DB). 0x2AF5E rolls them (0x2B077) and adds damage_bonus (0x2B1E7).
The Short Sword of Quickness never casts Haste and has no Haste in 1.3. PC_spell (Weapon_info+0x3A) is read only in 0x56A0D (0x56B1C, 0x56CA4). Its one caller 0x44300 calls it only for a spell (type 0x11) or a weapon with attack_type 0 (0x44423 to 0x44445). The sword is a melee weapon (default attack_type 1). ASCENT makes its swings twice as fast, with no Haste effect (docs/re/combat.md, section A8).
The Short Bow of Speed has no Haste in 1.3. The line has pc_spell1=21. The image has no keyword pc_spell1 (PC_spell 0x1121AD, PC_spell_2 0x112742), and the code of the worn items 0xAFB55 does not read the bow slot. ASCENT makes its arrows twice as fast, with no Haste effect (docs/re/combat.md, section A8).
Arrows, bolts and thrown weapons have no wait between shots in 1.3. The fire timer of 0x56A0D starts again when the function was not called in the last two frames (0x56BB0), and each shot ends the request, which needs a new key press. fire_wait is read only at 0x4421B (melee swing) and 0x56C01 (this timer).
No class or level gives more attacks. The melee gate 0x41E36 reads the game time, the time of the last attack 0x13B74B, the swing time of the model and the Haste bit (0x41EC3). 0x13B74B has no other reference.
Gem of Curing: one use at the start, one more for each mission. 0x3891B: the use counter P+0x1D4D73 must be <= 0x8445A(), the mission number 0x13E588 (0 at a new game, 0x82BC7; the next mission at Khelben, 0x83E5E). 0x389E0 adds 1. No other code writes the counter.
The Scroll shows Khelben's mission summary; found Scrolls show their own text. Case 0x66 calls 0x9DC42 with the count of the item. 0x9CEA3: count 0 (the Scroll of a new character) takes the mission blurb table 0x1451E5[mission]; another count n takes the text table 0x144FE5[n] (0x144DE5[n], longer texts, in the high resolution). Both hold entries of FETXT (for example 271 "Quest One: Corner the Kobolds", 141 "A Brief History of Undermountain"). The levels give Scrolls counts 2 to 27.
The thief scroll shows a picture clue. Case 0x7F calls 0x9DC42(1): text 0x144FE5[1] = FETXT 270, which is the picture markup ~pc3.
The Lantern gives no light. Its player_light (Misc_info at 0x19BAF0 + 0x44 x item) is written only by the reader 0x23780 (0x23B5D); lightcast is stored only. 0x37A6A has no case for item 0 (0x37DAE).
Spider Piece 21 does nothing. 0x37A6A has no case for item 0x15 (0x37DA1 jumps to the end 0x396A0). The mission switch 0x83EF5 does not ask for it.
Thief skill points: 20 per thief level, 20 more at the first visit. Talking to Mirt (TEX 905) in level 0: 0xABB53 gives (thief level - P+0x1A53) x 20 points, + 20 if P+0x1A53 is 0, into P+0x1AB3, and opens the screen 0xB5B49. 0xB44B4 adds 1 per point, not above 95; 0xB4ECF limits one skill to half of the points (at least 1).
Where 1.3 enforces the class flags. 0x3533C tests the class bits of an item entry (byte 3) against the classes (0x352F7). It is called when the cursor takes an item (0x30344, 0x312C3: no wear bits, so no slot takes it), for the hot key boxes (0x304B7, 0x31A67), the paper doll figure (0x35CFB), the hand (0x5453A) and the market (0x87649, 0x877BD). The texts 825 "You cannot use this object." and 828 "You cannot use this armor." are pickup refusals (0x28220, 0x284D7) when the item cannot be added.
The Fireball blindness of the readme comes only from a fire trap. The blind and deaf code for Fireball is in the area function 0x90CEF. Every caller tests the area flag of the spell (Spell_info+0x36 bit 0), which Fireball (type TARGET) does not have, except 0xA6F51 and 0xA6F61: the fire trap object 0x29 of level 0 ("You set off a fire trap!!!").
Fear moves the view of a frightened player. 0x8E2D8 calls 0x13407 for the player: it gates a creature at the player and makes it the viewer; at the end of Fear 0x903D4 deletes it and moves the player to its segment.
Sleep resistance of people. 0x8F840: a creature with Robot_info+0xD9 bit 3 (names starting with rf, rm, av or dro, set at 0x1F448) resists on d10 <= 9.

Corrections of ASCENT

ASCENT corrects these defects of 1.3 that change the rules of these pages. Each setting is on by default unless the row says otherwise; the option turns it off for one run ("none": no option). The corrections of the physics, the creature movement, the sound and the triggers are in the reverse engineering notes.

Setting Option Correction
Dtu_fix_multiclass_thac0 -origchar Two classes take the better THAC0, not the worse.
Dtu_fix_level_hit_points -origchar The hit points of a new level are added to the hit points in use; 1.3 adds them to the maximum only (the hit points in use grow by 1/65536 of them).
Dtu_fix_secret_door_names -origchar A door texture name that no table has makes no secret door; in 1.3 it matches texture 0, so some plain doors become secret doors (one more in THIEF2).
Dtu_fix_one_hit -origcombat One hit roll for each swing; 1.3 rolls again in each frame of the hit (about 4 rolls at 60 frames per second).
Dtu_fix_turn_undead -origcombat Turn undead keeps its d20 after a T result and does not spoil the next undead when the count is used up.
Dtu_fix_spell_hours -origcombat Strength and Infravision do not end at once at a high caster level (10 and 8 in 1.3); their time stops at 4 hours 33 minutes.
Dtu_fix_rest_effects -origcombat A rest ends your spell and potion effects. Armor, Stone Skin, Rary's Mnemonic Enhancer and the powers of worn items stay; in 1.3 a rest ends nothing.
Dtu_fix_cure_aid -origcombat Cure Light Wounds and Cure Serious Wounds keep the extra hit points of Aid; 1.3 cuts the hit points to the maximum.
Dtu_fix_haste_attack -origcombat Haste halves the swing time; 1.3 makes the melee attacks slower.
Dtu_fix_missile_rate -origcombat Arrows, bolts and thrown weapons wait their Speed from one shot to the next (Haste halves it, Slow doubles it); in 1.3 each key press fires.
Dtu_fix_speed_items -origcombat The Short Bow of Speed in the bow slot shoots and the Short Sword of Quickness in the hand swings twice as fast, as their table lines say; in 1.3 they have no power. It is no Haste: you do not move faster, it does not add to Haste, and with Slow the rate is normal.
Dtu_fix_magic_tint -origobj The blue tint of Detect Magic is drawn on all magic things in view; 1.3 draws it mostly on near ones.
Dtu_fix_spell_save_repair -origchar Saves of older ASCENT versions get their spells moved back from the item list to the spell lists.
Dtu_fix_learn_class -origchar A character learns a spell only when its classes can cast it: a mage keeps Protection From Fire (a priest spell) as a scroll; 1.3 puts it into the mage list, where it cannot be cast.
Dtu_fix_time_wrap -origcombat The timers work after 9 hours of play, when the game clock turns negative: spells and potions last their full time, rest places, item pick up, foot steps and traps work. In 1.3 an effect that ends past that point ends at once, and after it no rest place works and no item can be picked up until one is dropped.
Dtu_fix_sleep_wake -origcombat Any damage wakes a sleeping character, as in AD&D 2nd edition; in 1.3 only a melee hit does.
Dtu_sleep_view -origcombat or -nosleepview While the character sleeps the view is black with "zzz", and the character cannot move, look around or act; in 1.3 nothing shows the sleep.
Dtu_fix_stoneskin_word -origcombat Stone Skin keeps your other spell effects.
Dtu_fix_rary_manual -origcombat Rary's Mnemonic Enhancer follows the manual.
Dtu_fix_melf_acid -origcombat Melf's Acid Arrows makes an attack roll and burns 2d4 a round for 1 round + 1 per 3 levels, as in AD&D 2nd edition; 1.3 does 4 per level in one hit, save for half.
Dtu_fix_bolt_pass -origcombat Lightning Bolt goes on through each creature on its line, and comes back from a wall, until its range ends, as in AD&D 2nd edition; in 1.3 the first creature or the player ends it.
Dtu_fix_stoneskin_hit -origcombat Stone Skin takes a hit of a creature only after its attack roll hits; in 1.3 a miss uses one up too (D-197).
Dtu_fix_hold_hit -origcombat An attack on a held target (Hold Person, Hold Undead, the stun of Mind Blast) hits with no roll, as in AD&D 2nd edition; 1.3 rolls (D-198).
Dtu_fix_player_hold -origcombat Hold Person holds you for 6 to 18 seconds and blocks each action but the Potion of Freedom; 1.3 holds for 2 minutes per level divided by half the Wisdom and lets you attack and cast.
Dtu_fix_dispel_peace -origcombat Your Dispel Magic is no attack on a creature that is not hostile: it does not wake it, make it hostile or alert its friends, so Daland of the Temple of Myrkul can be freed (D-196).
Dtu_fix_burning_hands -origcombat Burning Hands burns each creature within 5 feet in an arc of 120 degrees in front of you, one roll each, as in AD&D 2nd edition; 1.3 fires 6 missiles that fly far and burn where they land.
Dtu_fix_haste_friends -origcombat Haste hastes only you and the creatures that are not hostile to you; in 1.3 it hastes every creature around you.
Dtu_fix_hold_undead_hd -origcombat Hold Undead holds undead whose levels add up to your level; in 1.3 each undead of your level or less.
Dtu_fix_haste_count -origcombat A creature that casts Haste hastes up to its level in creatures; in 1.3 it hastes no one.
Dtu_fix_fireball_blind -origcombat A made saving throw stops the blindness of Fireball near the point; in 1.3 the save does not.
Dtu_fix_wizardry_ring -origcombat The Ring of Wizardry doubles the slots once.
Dtu_fix_ability_saves -origcombat Dwarves and halflings get their Constitution bonus against Rod/Staff/Wand and Spell, and Wisdom changes the save against spells that attack the mind, as in AD&D 2nd edition; in 1.3 they do not.
Dtu_fix_prot_saves -origcombat The best Ring, Cloak or Amulet of Protection also makes your saving throws better by its bonus; in 1.3 no item changes a save. The statistics screen shows the five saves.
Dtu_fix_bracers_ac -origcombat Rings and cloaks of protection count with the Bracers of Defense; in 1.3 the bracers are magic armor and they do not.
Dtu_fix_armoring_cap -origcombat With the Ring of Armoring a better armor never gives a mage a worse armor class under Armor, Magical Vestment or Shield; in 1.3 Bracers of Defense AC6 give AC 6 with Armor and AC8 give AC 5.
Dtu_fix_ring_magic_armor -origcombat Only the highest magic protection bonus counts, of the magic of the armor, a Ring, a Cloak and an Amulet of Protection; they count with any armor and shield. In 1.3 no ring counts with magic armor, the cloak only with no shield, magic or heavy armor, and a ring, a cloak and an amulet add.
Dtu_fix_potion_frame -origcombat The intelligence potion does not depend on the frame rate.
Dtu_fix_luck_coin -origcombat The Potion of Luck uses a coin flip, not the day clock.
Dtu_fix_cursed_scroll -origcombat The Cursed Scroll can take up to all but one of your hit points; 1.3 does less than half a point.
Dtu_fix_creature_missile -origcombat Creature missiles do not get the bonus of your bow and do not use up your Potion of Luck.
Dtu_fix_partial_stack -origobj When a stack does not fit, you take what fits and the rest stays on the floor; 1.3 loses the rest.
Dtu_fix_guild_peace -origobj or -origguildpeace When the Shadow Thieves are at peace with you, their members stay peaceful; 1.3 makes most of them hostile again at the level start.
Dtu_fix_kobold_weapon -origobj The kobold spellcaster keeps its weapon on a return visit.
Dtu_fix_drow5_shields -origobj or -origdrow5 The dragon hatchling of the drow level has its 100 hit points; 1.3 reads a wrong table entry.
Dtu_fix_scenery_restore -origobj Breakable scenery keeps its hit points on a return visit; 1.3 sets it to 1.
Dtu_improved_ai (Improved AI) -origobj, -noimprovedai or -noimprovements Creatures notice you only along an open way (a wall or a closed door hides you), an alarm stops at a closed door, only humanoid creatures that fight you open doors, a blow or a missile stops at a wall or a closed door, melee creatures walk up and attack at once, and a creature that would turn hostile after a talk joins the fight of its group (Monster-Behavior). In 1.3 a melee creature notices you through a closed door.
Dtu_caster_ai (Caster AI) -origcasterai, -origobj or -noimprovements Each kind of caster has its own spells, protects itself when it notices you, keeps its distance and casts each round; new spells Mirror Image, Minor Globe of Invulnerability, Spiritual Hammer, Flame Strike and Mind Blast (Monster-Behavior, the spell pages). In 1.3 every caster picks from one table and rarely attacks.
Dtu_new_gear (New gear) -nonewgear, -origitems or -noimprovements New content: new magic items, wands and loot, more gold and gems (New-Gear).
Dtu_class_gear (Single class mage and thief gear) -noclassgear, -origitems, -origscript or -noimprovements New content: offers of Aleena Paladinstar, Nalbas Oddpepper and Mirt for a character with one class, a mage or a thief (New-Gear).
Dtu_restored_dragon (The dragon Tamaramagil) -origobj, -origtamaramagil or -noimprovements New content: the red dragon of the Temple of the Drow that the files of 1.3 have but no level places (Encounters).
Dtu_lich_phylactery (The phylactery of the lich) -origobj, -nophylactery or -noimprovements New content: an altar of Velsharoon in the east crypts of the Crypts of Clangeddin is the phylactery of the lich Morik Stormhand. Break it and he fights without Stone Skin, Shield, Minor Globe of Invulnerability and Mirror Image; break it during the fight and they end at once.
Dtu_fix_bane_texture -origobj Two spinning objects in Bane's level get their own texture; 1.3 takes it from the level played before.
Dtu_fix_revive -origobj or -origrevive A killed troll (a regenerating creature) gets up again unless fire or acid hurt it. Fire or acid on the fallen body, or weapon damage equal to its full hit points while it is down, destroys it. It gives its experience one time, when it stays dead; in 1.3 it never gets up.
Dtu_fix_body_ray -origcombat An arrow, bolt or thrown weapon shot steeply down at a low or wide creature from close range hits it; in 1.3 it misses.
Dtu_fix_prison_items -origprison In the prison of the Shadow Thieves every item that you do not wear goes to the thieves; 1.3 loses every second item and copies the next one.
Dtu_fix_script_daland -origscript Daland of the Temple of Myrkul talks while the curse holds him, and greets you the first time; in 1.3 the curse also silences him until a Dispel Magic, and his first words after it are the ones for a player who refused him.
Dtu_fix_script_guard_key -origscript In the caves of Xabash the captain of the guard answers "Where's Xabash?" with "Use the key I gave you" only when he gave you his key; in 1.3 he says it on every path. The door of Xabash opens only with his key, the Key to Xabash's Chamber (or a thief's lockpicks, or Knock); in 1.3 any Gold Key opens it.
Dtu_fix_script_xabash -origscript When Xabash, asked "Who did it?" about his freed hostage, answers that it was someone much like you, he attacks, as when you offer to kill the culprit; in 1.3 the talk ends and he waits.
Dtu_fix_market_charisma none The market uses the Charisma of your character; 1.3 uses the Charisma of the character made last in the same run of the program.
Dtu_fix_market_sell_count none A sale adds the number sold to the stock of the market; 1.3 adds the number that you had.
Dtu_fix_market_charges -origfe A wand from the market that has no count gets the charges of its kind; 1.3 gives it charges with no limit.
Dtu_fix_market_buy_stock -origfe Items that your bag cannot take stay in the market; 1.3 removes them from the stock.
Dtu_fix_market_reward -origfe Each reward of Khelben adds its goods to the market, also before your first visit there, and a saved game gets the goods of the rewards it missed; 1.3 loses the goods of a reward before the first visit, and the port had no reward goods before 2026-11-27 (D-149).
Dtu_fix_market_spell_line -origfe A bought scroll that goes into a spell book gets no sale line; in 1.3 that line sells for no gold (D-194).
Dtu_market_row -origfe The list of the market shows "*" for a stock of 100 or more or with no limit, and the names start right after the quantity, so long names fit; a few long names have a short form there, and a spell name that still reaches the price is cut. 1.3 writes the word "many" and starts the names after its width.
(port correction) none The market buys the scrolls of the item list, as 1.3 does (0x8770C); the port did not offer them before 2026-11-27.
(port correction) none Typed names (the character, a saved game) follow the keyboard layout of the system: dead keys, AltGr and the letters of the fonts work; the keys of the controls stay where they are.
Dtu_fix_item_names -origitems Items with a wrong name show the right one: the Cloak of Lathander (1.3: Lathandar), the Ring of Armoring and three more.
Dtu_rulebook_items (off by default) -rulebookitems turns it on; -norulebookitems, -origitems and -noimprovements turn it off The setting Rulebook items: some item values and class limits of the AD&D 2nd edition rulebooks.
Dtu_max_hp_level_up (off by default) -maxhplevelup turns it on; -nomaxhplevelup turns it off The setting Maximum HP on level up: a level that rolls its hit die gets the full die (the constitution bonus and the half for two classes stay).

Spell line values the game does not use

The spell lines have range, level_range, duration and level_duration. The spell code does not read them: a missile flies until it hits or its life ends, and each spell case has its own time. The only reader of duration is 0x43E3A, for a spell with uses -1 (no line has that); the value it stores is never read. The values, for comparison with the manual:

Spell Line Range duration level_duration
Abjure 0 60 ft 3 -
Aid 1 0 ft 30 6
Armor 2 15 ft -1 0
Bless 3 180 ft 36 0
Burning Hands 4 10 ft 3 0
Chill Touch 5 3 ft 18 6
Color Spray 6 120 ft 10 0
Confusion 7 120 ft 12 6
Continual Light (Cleric) 8 360 ft -1 0
Continual Light (Mage) 9 180 ft -1 0
Cure Light Wounds 10 3 ft -1 0
Cure Serious Wounds 11 60 ft -1 0
Detect Magic 12 45 ft 60 -
Dispel Magic 13 360 ft -1 0
Fear 14 0 ft 0 6
Feather Fall 15 30 ft + 3 ft per level 0 15
Fireball 16 30 ft + 30 ft per level 3 0
Produce Fire 17 120 ft -1 0
Flame Walk 18 3 ft 6 6
Fly 19 3 ft - -
Free Action 20 3 ft 0 60
Haste 21 0 ft 18 6
Hold Person 22 360 ft 0 20
Hold Undead 23 60 ft - -
Improved Invisibility 24 1.5 ft 24 6
Infravision 25 3 ft 60 12
Invisibility 26 1.5 ft 36 -
Jump 27 3 ft -1 0
Knock 28 180 ft -1 -
Levitate 29 180 ft 0 60
Light (Mage) 30 180 ft 0 60
Light (Cleric) 31 360 ft 360 60
Lightning Bolt 32 120 ft + 30 ft per level 3 0
Magic Missile 33 180 ft + 30 ft per level 3 0
Magical Stone 34 90 ft 18 0
Magical Vestment 35 3 ft 0 30
Melf's Acid Arrows 36 540 ft 3 0
Melf's Minute Meteors 37 210 ft + 30 ft per level 3 0
Prayer 38 0 ft 0 20
Protection From Evil 39 1.5 ft 0 20
Protection From Fire 40 3 ft -1 0
Rary's Mnemonic Enhancer 41 0 ft -1 0
Cure Blindness or Deafness 42 10 ft 0 10
Resist Fire 43 10 ft 0 10
Scare 44 90 ft + 30 ft per level - -
Shield 45 0 ft 0 30
Sleep 46 90 ft 0 30
Slow 47 270 ft + 30 ft per level 18 6
Spider Climb 48 3 ft 18 6
Stone Skin 49 10 ft -1 0
Strength 50 10 ft 0 36
Find Traps 51 10 ft 3 0
Hold Person 52 360 ft 0 20
Protection From Evil 53 1.5 ft 0 20
Detect Magic 54 45 ft 60 -
Dispel Magic 55 360 ft -1 0

Other spell table lines

Lines of the spell table that are not on the spell pages.

Line name Line Why

Other weapon lines

Lines for spells, traps and creatures, and lines that the tables mark as unused.

Line Name Use
0 Empty hand the empty hand (1d2 plus strength, from the character record, not the line)
1 Flare Flare
2 Spell Cast template of a spell cast with the hands
3 Magic Wand template of a wand cast
4 Magic Scroll template of a scroll cast
5 Magic Bow template of a spell arrow
10 DO NOT USE named DO NOT USE
15 Bomb Bomb (trap)
16 Lava Flames Lava Flames (trap)
17 Mini Flames Mini Flames (trap)
25 SLow Bomb Slow Bomb (trap)
26 fast Bomb Fast Bomb (trap)
63 Wand of Genericness Wand of Genericness
64 Wand of Genericness Wand of Genericness
65 Wand of Genericness Wand of Genericness
66 Rod of Genericness Rod of Genericness
67 Rod of Genericness Rod of Genericness
68 Rod of Genericness Rod of Genericness
76 Temp Temp
77 Wand Wand (creature)
78 Acid Spittle Acid Spittle (creature)
80 Myconid Spores Myconid Spores (creature)
81 Beholder Burn Beholder Burn (creature)
82 Spectator Burn Spectator Burn (creature)
83 Spectator Burn Spectator Burn (creature)
84 Spectator Burn Spectator Burn (creature)
85 Spectator Burn Spectator Burn (creature)
86 Spectator Burn Spectator Burn (creature)
87 Spectator Burn Spectator Burn (creature)
88 Spectator Burn Spectator Burn (creature)
79 Ice Shards creature weapon; casts spell line 51 (Find Traps)

New gear (ASCENT-DTU)

The page New-Gear is the setting "New gear" of ASCENT (Dtu_new_gear, engine/main/dtugear.c and dtugear.h; docs/re/objects.md, "New gear"). The tool reads the tables of the code with tools/gear_tables.py:

  • The new item lines: Gear_lines (read after the table fixup by the table reader, armor 53 and up, misc 128 and up), their armor class Gear_armor_ac; the effects by number in dtuchar.c (item_bits: boot bit 5, cloak and armor bit 1, belt bit 6, ring bit 15; archer_bonus, regen_frame, the constitution of the belt) and the Mirror Shield in dtu_gear_mirror (called from missile_hit_object, dtuobj_missile.c).
  • The wands: Gear_wands (the lines 63 to 67 of 1.3 have enemy_spell=-1 and no PC_spell); the values of the Mace of Disruption and the Flame Tongue: Gear_values; the values of the Amulets of Protection: Gear_armor_values.
  • The market: Gear_market (stage, quantity, class, number, count), Gear_market_removed; the stages are the rewards 0x879A7 of the missions (docs/re/scripts.md, section 8).
  • The Mace of Disruption: script 160 gives misc 75 (dtu_gear_script_give, from the GIVE statement 0xA8F77 of dtuscript.c). Daland is held by the level fix 0xAD129; in 1.3 he cannot talk while held (0xABBE5), in ASCENT he can (Dtu_fix_script_daland).
  • The Flame Tongue: dtu_gear_place_flame_tongue (dtuobj_setup.c), level 21 of DTU.MSN at -172.5 -60.0 435.0, once in a game (global flag 0xF0).
  • The drops: gear_drops (dtuobj_combat.c) with dtu_gear_gold, dtu_gear_gem and dtu_gear_gem_class (the door bit, a person model of Improved AI, a spell level, a spell as the weapon, the weapons 81 to 88); the rule of 1.3 is 0x6A639. The named people: Gear_no_gold.
  • The treasury of the dragon: Gear_dragon (dtu_gear_dragon_treasure).
  • The checks: tools/check_items.py (gear_), tools/questtest.py (myrkul_daland_), tools/check_saveload.py (the fourth and fifth run), tools/gear_income.py (the gold and gems of the levels).

Spells of the port (ASCENT-DTU)

The spell lines 56 and up are added by the port after the table fixup of each table (dtu_spell_port_line, engine/main/dtuspell.c); their cast times are port_cast_time. The tool reads both with tools/port_tables.py. The icons 200 and up are new art of tools/spell_icons.py, stored as color numbers in engine/main/dtuspellicons.h and read from there. The scrolls of Caster AI are the table Port_scrolls of dtuobj_setup.c; the prices of Aleena Paladinstar are in patch_aleena of dtuscript.c. docs/re/spells.md, section 15.

Spell Line Cast Code
Mirror Image 56 2 s dtuspell.c: spell_amount (1d4 + L/3, at most 8), dtu_spell_mirror_takes; dtuobj_combat.c dtu_hit_test_vs
Minor Globe of Invulnerability 57 4 s dtuspell.c: dtu_spell_globe, globe_stops (in apply_spell, so each path of a spell)
Spiritual Hammer 58 5 s dtuspell.c: hammer_bonus (L/6, at most 3), dtu_spell_port_weapon_line; dtucombat.c hand_weapon
Flame Strike 59 8 s creature spell (Monster-Behavior)
Mind Blast 60 1 s creature spell (Monster-Behavior)

Corrected rules of 1.3 spells on the spell pages: Lightning Bolt (D-195, Dtu_fix_bolt_pass), Dispel Magic (D-196, Dtu_fix_dispel_peace), Stone Skin (D-197, Dtu_fix_stoneskin_hit), Hold Person and held targets (D-198, Dtu_fix_hold_hit; Dtu_fix_player_hold, engine/main/dtuhold.h), Sleep (D-191, Dtu_fix_sleep_wake; Dtu_sleep_view), the spell books of scrolls (D-189, Dtu_fix_learn_class). The D numbers are the rows of docs/audit/defects-1.3.md.

Monster behavior and encounters (ASCENT-DTU)

  • Monster-Behavior, Improved AI: Dtu_improved_ai, engine/main/dtuobj_aware.c (creature_senses_player, creature_in_combat, creature_join_fight, attack_wall_between; the distances DTU_HEAR_DIST, DTU_ALARM_DIST, DTU_JOIN_DIST and the time DTU_COMBAT_TIME, read by the tool) and dtuobj_ai.c (opens_doors, melee_fighter); docs/re/ai.md, "Improved AI".
  • Monster-Behavior, Caster AI: Dtu_caster_ai; the lists Caster_lists, the types Caster_types and Caster_limits of engine/main/dtucaster.h (the table of the page is made from them); the numbers CAI_ and CASTER_HOLD_ of dtuspell.c and DTU_CASTER_KEEP_ of dtuspell.h; docs/re/ai.md, "Caster AI".
  • Encounters, the dragon: Dtu_restored_dragon and Dtu_fix_tamaramagil, engine/main/dtudragon.c (the DR_ numbers and the table Dr_treasure, read by the tool); the hoard of 1.3 is objects 50 to 60 of DROW2; docs/re/dragon.md.
  • Encounters, the lich: Dtu_lich_phylactery, engine/main/dtulich.c; his list and Caster_limits (lich3) of dtucaster.h; the test fights of tools/caster_balance.py lich (docs/re/ai.md, "The lich and the holds, measured"); docs/re/lich.md.
  • Encounters, the Rod of Spellbreaking: dtu_gear_rod_* of engine/main/dtugear.c, dtu_gear_place_rod of dtuobj_setup.c; docs/re/objects.md, "The Rod of Spellbreaking".
  • Encounters, Daland: Dtu_fix_script_daland of engine/main/dtuscript.c (the silence test 0xABF24, the talk counter of 0xABFC4, ANIM 2 at 0x0F4 of script 160); docs/re/quests.md.
  • The class gear on New-Gear: the table of the tool is checked against the sales, the prices and the missions of the blocks of engine/main/dtuclassgear.c and the lines Class_lines, Class_arrow, Class_market of dtugear.c (tools/gear_tables.py); docs/re/scripts.md, section 10.

Item line values the game does not use

  • Sword of W'hin: ac_adjustment, adjust_strength, adjust_dexterity. Its powers are code for the item number.
  • Flame Arrow: levels_per_use=5.
  • Ring of Armoring: pc_spell=2 (Armor). Its power is code for the item number (0xB0014, 0xB01B6 set a flag that 0xAFAD1 reads for a mage).
  • Ring of Wizardry: pc_spell=42. Its power is code for the item number.
  • Glim-Gauntlet: player_light=1. Lantern: player_light=3, lightcast=3.
  • Gloves, Glim-Gauntlet, Gauntlets of Ogre Power, Elven Cloak: the AC bonus is in the executable table 0x145C04 only; the lines have no armor_class_decrement. Where a line has one, it agrees with the table.
  • Potions: pc_spell2, duration and the set_ keywords. Each potion is code for its number.
  • Worn items: pc_spell, set_strength and similar. Each effect is code for the item number.
  • Magic Missile: damage_bonus=1.

Clone this wiki locally