Defensive item

From NetHackWiki
Revision as of 07:45, 3 December 2021 by Cathartes (talk | contribs) (update refs for 3.6.6, and note that shopkeeper, guard, priest can receive digging despite the code)
Jump to navigation Jump to search

When a monster is generated, there is a chance that it will be given a defensive item to protect itself from hostile adventurers. This will happen if the monster's level equals or exceeds the roll of a d50.[1] The following monster types are ineligible for defensive items:

In addition, regular soldiers have a 12/13 chance of missing out on the defensive item roll.[2]

If chosen to receive a defensive item, the monster selects and rolls a die according to its difficulty:

Difficulty Roll
3 or less d8
4–6 d9
7–8 d10
9 or more d11

The die roll determines the item, as shown by the following table:[3]

Roll Outcome
1–2 scroll of teleportation
3 scroll of create monster
4 potion of healing
5 potion of extra healing
6 potion of full healing
(potion of sickness for Pestilence)
7 wand of teleportation (33%) or scroll of teleportation (67%)
(reroll up to 2 times if no-teleport level)
8 wand of digging
(nothing for floating eyes)[7]
9 wand of create monster (33%) or scroll of create monster (67%)
10 (teleport item, same as case 7)
11 (create-monster item, same as case 9)

Use

A user has suggested improving this page or section as follows:

"Outline the circumstances under which a monster will make use of a defensive item."

See Also

References

  1. src/makemon.c in NetHack 3.6.6, line 794
  2. src/makemon.c in NetHack 3.6.6, line 791
  3. src/muse.c in NetHack 3.6.6, line 1014
  4. src/shknam.c in NetHack 3.6.6, line 655
  5. src/vault.c in NetHack 3.6.6, line 387
  6. src/priest.c in NetHack 3.6.6, line 239
  7. The code indicates that shopkeepers, guards, and temple priests are also not to receive a wand of digging, but mtmp->{isshk,isgd,ispriest} are only set after makemon() is called,[4][5][6] thus they are eligible to receive it.