# To-hit
When attacking a monster, you must make a successful to-hit roll to actually strike it. To do this, your to-hit bonus must exceed the roll of 1d20.[1] Otherwise, your attack misses.

Contents

1 Melee

1.1 Weapon and equipment
1.2 Your characteristics and status
1.3 Skills
1.4 Monster characteristics and status
1.5 Monster-specific

2 Ranged
3 Spells
4 Bonus tables

4.1 Strength bonus
4.2 Dexterity bonus
4.3 Weapon skill bonus
4.4 Spell skill bonus
4.5 Two weapon penalty
4.6 Riding penalty
4.7 Monster size bonus

5 Variants
6 References

Melee
These are the factors that affect your chance of hitting in melee:

Weapon and equipment
A bonus (or penalty) equal to the weapon's enchantment, if using a weapon.[2]
The natural to-hit bonus of the object used to strike.[3]
The artifact's to-hit bonus, if using an artifact weapon against an appropriate target.[4]
A bonus equal to the enchantment level(s) of any rings of increase accuracy you are wearing.[5]
−20 if you are a Monk wearing body armor.[6]
If you are a Monk not wearing body armor or a shield, and not wielding any item, +(experience level / 3)+2.[7]
Your characteristics and status
+1 for all melee attacks.[8]
Bonuses based on your strength and dexterity (see strength table and dexterity table).[9]
A bonus equal to your Luck.[10]
A bonus equal to your experience level, if you are in your natural form.
A bonus equal to your monster level (hit dice) if you are polymorphed.[11]
+1 if you are at experience level 1 or 2.[12]
−1 if you are burdened, −3 if you are stressed, or −5 if you are strained; if you are overtaxed or overloaded you will be unable to attack at all.[13]
−3 if you are currently trapped.[14]
If you are engulfed, you always hit.[15]
Skills
A bonus or penalty from −4 to +3 (see table), depending on your skill with the wielded weapon, if you are not two-weaponing.[16]
A penalty from −9 to −3 (see table), depending on your two weapon combat skill (or your weapon skill, if it is lower), if you are two-weaponing.[17]
No bonus for bare hands or martial arts skill.[18]
A penalty if riding a steed: −2 if restricted or Unskilled in riding, −1 if Basic, and no penalty if Skilled or better.[19]
An additional −2 if you engage in two weapon combat while riding a steed.[20]
Monster characteristics and status
The target monster's AC.[21]
+2 (cumulative) against a stunned, fleeing, or sleeping monster.[22]
+4 against a paralyzed monster.[23]
Monster-specific
+2 for using a blessed weapon against a demon or undead.[24]
+2 for using any spear against a "kebabable" monster: xorns, nagas, dragons, jabberwocks, and giants.[25]
+4 for using a trident against any swimmer that is in water.[26]
+2 for using a trident against any ​S or ​; that is not in water.
+2 for using a pick-axe or dwarvish mattock against a xorn or earth elemental.[27]
+1 if you are hitting any orc as an elven hero currently in natural form, or polymorphed into an elven monster.[28]
Ranged
These are some of the factors that might affect your chance of hitting when throwing or kicking items, or when applying a polearm:

−1 for all ranged attacks.[29]
A bonus equal to the enchantment level(s) of any rings of increase accuracy you are wearing.[30]
The target monster's AC.[31]
A bonus based on your dexterity.
A bonus equal to your Luck.[32]
A bonus equal to your experience level, if you are in your natural form.
A bonus equal to your monster level (hit dice) if you are polymorphed.[33]
A bonus based on how far away the target is. A target adjacent to you gives a +2 bonus; this decreases by 1 for each move's worth of distance, to a maximum penalty of −4.
−2 if you are wielding any bow while wearing gauntlets of power.
−3 if you are wielding any bow while wearing gauntlets of fumbling.
A bonus or penalty from −2 to +5 (see table), depending on the size of the target monster.
+2 against a sleeping monster.
+4 against a paralyzed monster.
+2 if the item used is a heavy iron ball.
+6 if the item used is a boulder.
A bonus (or penalty) equal to the weapon's enchantment, if using a weapon.
The natural to-hit bonus of the item, if it is a weapon or gem.
+2 for using a blessed weapon against a demon or undead.[34]
+2 for using any spear against a "kebabable" monster: xorns, nagas, dragons, jabberwocks, and giants.[35]
+4 for using a trident against any swimmer that is in water.[36]
+2 for using a trident against any S or ; that is not in water.
+2 for using a pick-axe or dwarvish mattock against a xorn or earth elemental.[37]
The artifact's to-hit bonus, if using an artifact weapon (or artifact gem) against an appropriate target.[38]
+1 if you are hitting any orc as an elven hero currently in natural form, or polymorphed into an elven monster.[39]
If you throw any gem at a unicorn, it will always be caught.
If you throw your quest artifact at your quest leader, and he/she is peaceful and not paralyzed, it will be caught and returned to you.
−4 if you throw ammo without wielding the appropriate launcher.
A bonus (or penalty) equal to the enchantment of your launcher, if firing ammo from it.
A penalty based on the erosion of your launcher, if firing ammo from it: −1 if eroded, −2 if very eroded, or −3 if completely eroded.
The artifact's to-hit bonus, if firing appropriate ammo from an artifact launcher, against an appropriate target.
+1 if you are an elf or Samurai firing any arrows from any bow.
An additional +1 if you are an elf firing elven arrows from an elven bow.
An additional +1 if you are a Samurai firing ya from a yumi.
+4 if throwing or kicking a boomerang.
+2 if throwing or kicking an item that counts as a throwing weapon.
−2 if throwing or kicking an item that is neither a throwing weapon nor ammo.
A bonus or penalty from −4 to +3 (see table), depending on your skill with the thrown item, unless you throw ammo without wielding the appropriate launcher.
Spells
Spells to-hit calculation is quite different. For ray spells, your to-hit bonus must exceed the result of 4 minus 1d20.
The calculation  of the to-hit bonus is simple:

A bonus or penalty from −4 to +3 (see table), depending on your skill with the spell school.[40]
A bonus based on your dexterity (see dexterity table).[41]
If the monster's AC is non-negative, add the monster's AC.
If the monster's AC is negative, add a random number between −1 and its AC.
Non-ray spells work differently. Force bolt will hit if the roll of a d20 is lower than (10 + target's AC), with no modification for dexterity or skill. Other beam and non-directional spells will always hit, but may be resisted.

Bonus tables
Strength bonus
The strength bonus applies to melee attacks only.

Strength
Bonus

3 to 5
−2

6 to 7
−1

8 to 16
0

17 to 18/50
+1

18/51 to 18/99
+2

18/** to 25
+3

Dexterity bonus
The dexterity bonus applies to both melee and ranged attacks.

Dexterity
Bonus

3
−3

4 to 5
−2

6 to 7
−1

8 to 14
0

15
+1

16
+2

17
+3

18
+4

19
+5

20
+6

21
+7

22
+8

23
+9

24
+10

25
+11

Weapon skill bonus
The weapon skill bonus applies to both melee and ranged attacks.

Skill
Bonus

Restricted orUnskilled
−4

Basic
0

Skilled
+2

Expert
+3

Spell skill bonus
The spell skill bonus applies only to ray and beam attacks.

Skill
Bonus

Restricted orUnskilled
−4

Basic
0

Skilled
+2

Expert
+3

Two weapon penalty
The two weapon combat penalty applies to melee attacks only. It uses the lesser of the two weapon combat skill and your primary weapon's skill.

Skill
Penalty

Restricted or Unskilled
−9

Basic
−7

Skilled
−5

Expert
−3

Riding penalty
The riding penalty applies if you are mounted on a steed, and varies based on your riding skill.

Skill
Penalty

Restricted or Unskilled
−2

Basic
−1

Skilled or Expert
0

Monster size bonus
The monster size bonus applies to ranged attacks only.

Size
Bonus

Tiny
−2

Small
−1

Medium
0

Large
+1

Huge
+2

Gigantic
+5

Variants
SporkHack does grant to-hit bonues for bare-hands or martial arts skill when hitting in melee without any wielded item. Monks and Samurai get the martial arts bonus; other roles get the bare hands bonus.

Skill
Bare handsbonus
Martial artsbonus

Unskilled
+1
(n/a)

Basic
+1
+3

Skilled
+2
+4

Expert
+2
+5

Master
+3
+6

Grand Master
+3
+7

References

↑ uhitm.c in NetHack 3.4.3, line 478: to-hit roll

↑ weapon.c in NetHack 3.4.3, line 133: enchantment bonus for weapons

↑ weapon.c in NetHack 3.4.3, line 137: item to-hit bonus

↑ weapon.c in NetHack 3.4.3, line 164: artifact bonus

↑ uhitm.c in NetHack 3.4.3, line 236: your to-hit bonus from rings, u.uhitinc

↑ uhitm.c in NetHack 3.4.3, line 267

↑ uhitm.c in NetHack 3.4.3, line 267: monk penalty and bonus

↑ uhitm.c in NetHack 3.4.3, line 236: base +1 for melee

↑ weapon.c in NetHack 3.4.3, line 688: strength and dexterity bonuses

↑ uhitm.c in NetHack 3.4.3, line 236: Luck bonus

↑ uhitm.c in NetHack 3.4.3, line 237: natural and polymorphed level bonuses

↑ weapon.c in NetHack 3.4.3, line 703: beginner to-hit bonus

↑ uhitm.c in NetHack 3.4.3, line 277: weight penalty

↑ uhitm.c in NetHack 3.4.3, line 278: trap penalty

↑ uhitm.c in NetHack 3.4.3, line 478: always hit if engulfed

↑ weapon.c in NetHack 3.4.3, line 1109: skill bonus

↑ weapon.c in NetHack 3.4.3, line 1118: two weapon penalty

↑ weapon_hit_bonus in weapon.c: This function is never called because uhitm.c, line 283 or uhitm.c, line 1957 checks if you're wielding something

↑ weapon.c in NetHack 3.4.3, line 1146: base riding penalty

↑ weapon.c in NetHack 3.4.3, line 1154: two weapon riding penalty

↑ uhitm.c in NetHack 3.4.3, line 236: monster AC

↑ uhitm.c in NetHack 3.4.3, line 250: monster status bonuses

↑ uhitm.c in NetHack 3.4.3, line 257: paralyzed monster bonus

↑ weapon.c in NetHack 3.4.3, line 142: blessed bonus against demons/undead

↑ weapon.c in NetHack 3.4.3, line 145: spear versus "kebabable" monster

↑ weapon.c in NetHack 3.4.3, line 149: trident versus swimmers

↑ weapon.c in NetHack 3.4.3, line 155: pick versus phasing and thick-skinned

↑ uhitm.c in NetHack 3.4.3, line 264: elves versus orcs

↑ dothrow.c in NetHack 3.4.3, line 1198: base −1 for ranged

↑ uhitm.c in NetHack 3.4.3, line 236: your to-hit bonus from rings, u.uhitinc

↑ uhitm.c in NetHack 3.4.3, line 236: monster AC

↑ uhitm.c in NetHack 3.4.3, line 236: Luck bonus

↑ uhitm.c in NetHack 3.4.3, line 237: natural and polymorphed level bonuses

↑ weapon.c in NetHack 3.4.3, line 142: blessed bonus against demons/undead

↑ weapon.c in NetHack 3.4.3, line 145: spear versus "kebabable" monster

↑ weapon.c in NetHack 3.4.3, line 149: trident versus swimmers

↑ weapon.c in NetHack 3.4.3, line 155: pick versus phasing and thick-skinned

↑ weapon.c in NetHack 3.4.3, line 164: artifact bonus

↑ dothrow.c in NetHack 3.4.3, line 1232: elves versus orcs

↑ zap.c in NetHack 3.4.3, line 2540: skill bonus

↑ zap.c in NetHack 3.4.3, line 2548: spell dexterity bonus

This page may need to be updated for the current version of NetHack.
It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.
Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.