Skip to main content

Hit rolls

Combat · Attacking with a weapon · Damage to a monster

In brief​

A character's attack on a monster, and a monster's attack on a character, is decided by a roll of a twenty-sided die. A character must reach a number that falls as its level and the monster's armour class rise; the weapon's value helps, and so does strength in melee or dexterity with thrown weapons and launchers. A 20 is not an automatic hit. A monster must reach a number set by its hit chance and the character's defense, and always hits on a 20. An item thrown by a monster, a wall or a script hits a monster without a roll, and so does any attack on a monster turned to stone.

A character's hit roll​

if the attacker is not a character: hit
if the monster is turned to stone: hit
bonus = weapon value, for a melee weapon, thrown weapon or launcher, else 0
if (weapon of those kinds, or no item):
if immunity MONSTER_IMMUNE_NEEDS_MAGIC_WEAPON and bonus <= 0: miss
if immunity MONSTER_IMMUNE_NEEDS_PLUS_TWO and bonus <= 1: miss
bonus += strength hit modifier (melee) or dexterity hit modifier (missiles)
needed = to_hit(class, first level, monster armour class) - bonus
roll = 1d20, + 1 if the party has Bless or Prayer or the character has Aid
roll = clamp(roll, 1, 20); the monster becomes provoked
hit if roll >= needed

There is no automatic hit on a 20. The number needed, to_hit, is 20 − ((first level − 1) / divisor) × step − armour class, rounded toward zero. The character's class gives the divisor and the step: 1 and 1 for warriors, 3 and 1 for wizards, 3 and 2 for priests, 2 and 1 for rogues. A multi-class character uses one group, the same as for its saving throw. The immunities are those of the monster type, in MonsterImmunityFlags.1

Strength and dexterity modifiers​

Strength adds to the hit roll of a melee blow, and to its damage; dexterity adds to the hit roll of a thrown weapon or a missile.

Two charts by ability score, from 1 to 25. To hit: the strength modifier, used in melee, rises from −5 at 1 to 0 from 8 to 16 and +7 at 25; the dexterity modifier, used with thrown weapons and launchers, rises from −6 at 1 to 0 from 6 to 11 and +4 at 19, the end of its table; scores 20 to 22 read the three bytes that follow the table, +5, +5, +5. To damage: the strength modifier rises from −4 at 1 to 0 from 6 to 15, +2 at 18, then jumps to +7 at 19 and reaches +14 at 25.
Strength above 18 adds 7 to 14 points to the damage of a melee blow; dexterity adds at most 4 to the hit roll within its table.
ScoreStrength, to hitStrength, to damageDexterity, to hit
1−5−4−6
2−3−2−4
3−3−1−3
4−2−1−2
5−2−1−1
6−100
7−100
8–11000
12001
13002
14002
15003
16013
17114
18124
19374
2038—
2149—
22410—
23511—
24612—
25714—

Exceptional strength, a score of 18 with a percentage, replaces both strength modifiers:

Percentage from1517691100
To hit+1+2+2+2+3
To damage+3+3+4+5+6

Anomaly

ANOMALY-20 — The dexterity table has 19 entries: a score of 20 to 22 reads the three bytes that follow it, 5, 5 and 5, which belong to the next table. A faithful reimplementation gives these scores a modifier of 5.1

A monster's hit roll​

roll = 1d20
if roll != 20:
roll -= 2 if the character has SPELL_EFFECT_PROTECTION_FROM_EVIL
roll -= 2 if the character has SPELL_EFFECT_BLUR
roll -= 1 if the party has SPELL_EFFECT_PRAYER
hit if roll == 20 or roll >= monster hit chance - character defense

The effects are SpellEffectFlags. The character is the one attacked, except in a monster's melee attack, where attack number i uses the character in slot i; see the bug.1

Sources​

Locations refer to the game executable reference; comparative sources are listed in the technical references.

Footnotes​

  1. The character hit roll, the monster hit roll and the combat tables. Comparative sources: REF-SCUMM-020, characterAttackHitTest; REF-SCUMM-021, monsterAttackHitTest. ↩ ↩2 ↩3