Container

From NetHackWiki
Revision as of 05:19, 4 June 2024 by Furey (talk | contribs) (Generation: update quantity generated. Add a refsrc to back it up. (These are 3.6.7 numbers; this article will be 3.6.7 soon.) Verify quantity generated, items generated, and other facts against 3.6.7 src/mkobj.c.)
Jump to navigation Jump to search

A container is a type of tool that appears in NetHack, and is designed for the purpose of storing and removing items.

List of containers

The following items are considered containers:

Although the bag of tricks appears as a "bag", it cannot actually store items. Statues, floor squares and ice squares can contain items, but are not considered containers.

Generation

Containers created via normal generation (i.e. outside of bones files or trap "bones") are always uncursed and may contain the following quantities of items:[1]

Container Contents Lockable
sack 0–1 items No
large box 0–5 items Yes
chest 0–7 items Yes
ice box 0–20 corpses No
bag of holding 0–1 items No
oilskin sack 0–1 items No

Containers that can be locked have a 45 chance of generating as locked, and a separate 110 chance of generating with a container trap.[2]

Containers in the hero's starting inventory will always be empty. Otherwise, for containers other than the ice box, each of the items in randomly generated containers are created with the following probabilities:[3]

Type Probability
gem or stone 18%
comestible 15%
potion 18%
scroll 18%
spellbook 12%
gold 7%
wand 6%
ring 5%
amulet 1%

There are some special cases. Gold is increased to 2.5x normal amount. Gems will not include flint stones, touchstones, or rocks. And a bag of holding will never contain a bag of holding, a bag of tricks, or a wand of cancellation.[4]

Description

Containers can store an unlimited number of items. Containers on the ground can be opened with the #loot extended command, which is used to view a container's contents and add and/or remove items, including stashing a singular item (or stack of items); they can also be emptied with the #tip command, which will dump the contents onto the ground at the character's square. A container in the character's inventory is used by applying it, which works the same as looting, and can also be tipped to deposit its contents on the ground. Tipping a container while levitating will cause fragile items to break.

Large boxes and chests can be locked, requiring an unlocking tool, the wand of opening, or the spell of knock in order to open, and may also have a container trap hidden on them, which will trigger if the box is opened, locked, unlocked, or else the character fails an untrap attempt. It is possible to force a locked container and break the lock open, though this comes with risks: Forcing the lock with a bladed weapon exercises dexterity, but risks breaking that weapon unless it is cursed, while forcing the lock with a blunt weapon exercises strength, but may destroy the container and possibly some or all of its contents. Kicking a container can break open locks if applicable, but can also destroy items inside the container, particularly fragile ones. A broken lock can be repaired with the wand of locking or the spell of wizard lock.

The contents of containers are protected from certain forms of damage, with the exact level of protection depending on the specific container: a container generally prevents its contents being affected by fire, cold, shock, or cancellation. Magical containers (i.e. the bag of holding) also protect their contents from being destroyed if the bag is kicked, thrown, being dropped down stairs, or being dropped while levitating. If a container is polymorphed, its contents are lost.

There are limitations to what can be placed in a container:

  • Unique items cannot ever be placed into containers.
  • Large boxes, ice boxes, and chests are too big to fit into any other container.
  • Placing certain items in a bag of holding will cause it to explode and destroy any items within - see the article on the bag of holding for specific details.

Some monsters can pick up containers, but most will not attempt to access their contents, with one notable exception: a gelatinous cube that engulfs a container made of an organic material (i.e. all except the ice box) will eat the container, destroying it and harmlessly engulfing the contents regardless of whether it would eat those items normally. A character polymorphed into a gelatinous cube can only eat these containers if they are empty.

The following information pertains to an upcoming version (NetHack 3.7.0). If this version is now released, please verify that the information below is still accurate, then update the page to incorporate it.

Monsters can loot containers and will use unlocking tools to open locked containers.

Strategy

Randomly generated containers are typically used as stash locations, and common places for stashes often include a guaranteed container or two, such as the Quest home level and the Castle - the latter even provides a cursed scroll of scare monster to deter monsters with.

History

In NetHack 3.2.0 and previous versions, including some variants based on those versions, a popular technique for identifying worthless glass was called "kickboxing". Players would gather a large pile of gems, name all of them "fake red" or whatever color, dump them in a box, and then repeatedly kick the box until they were all broken, then retrieve the remaining gems and un-name them, informally identifying worthless glass of all colors. Starting in NetHack 3.2.0, worthless glass no longer breaks, so kickboxing no longer works.

Messages

You hear a muffled shatter.
You kicked or threw a container, or dropped it from a significant height, and broke at least one item inside it.
You hear a muffled cracking.
As above, and at least one egg inside was destroyed.
That would be an interesting topological exercise.
You attempted to place a container inside itself.

Variants

Some variants of NetHack add new containers, while others may change how certain containers function. The magic chest is a common addition to many variants, with each one implementing it differently (e.g. it may be an item or a dungeon feature).

SporkHack

SporkHack introduces the iron safe, which is an iron container that can only be locked and unlocked by magic or stethoscope.

UnNetHack

UnNetHack adds the iron safe from SporkHack, and makes the bag of tricks usable as a container once it runs out of charges.

dNetHack

dNetHack, notdNetHack and notnotdNetHack add three new containers:

The huge stone crate replaces the boulders in Sokoban and combines the properties of a container and a boulder, but cannot be used as a proper container.

DynaHack

DynaHack includes the iron safe from SporkHack and adds the magic chest as a dungeon feature that is generated at fixed points in the dungeon and shares its contents across each magic chest.

NetHack Fourk

NetHack Fourk adds the magic chest as a dungeon feature that contains randomized items suited to a character's current role - magic chests can be created in any location by reading a scroll of consecration while confused.

FIQHack

In FIQHack, monsters are capable of looting containers and carrying items in bags. The Castle chest is special-cased to prevent monsters from stealing the guaranteed wand of wishing.

FIQHack also adds the magic chest as an item that behaves like a dungeon feature similar to DynaHack and Nethack Fourk: they can't be picked up, teleported, polymorphed, etc. Minetown, Sokoban, the Castle, Orcus-town, and the Quest home level all have magic chests, and magic chests can be created by wishing for one.

EvilHack

EvilHack includes the iron safe from SporkHack, and magic chests are implemented as dungeon features similarly to DynaHack, and are generated at fixed locations in the dungeon - there are also special magic keys that are required to lock and unlock the chest. EvilHack adds the crystal chest as a type of container that can only be unlocked or locked through magical means and is immune to other forms of magic.

References

This page may need to be updated for the current version of NetHack.

It may contain text specific to NetHack 3.6.0. Information on this page may be out of date.

Editors: After reviewing this page and making necessary edits, please change the {{nethack-360}} tag to the current version's tag or {{noversion}} as appropriate.