Difference between revisions of "Container"

From NetHackWiki
Jump to navigation Jump to search
m (Capitalization)
(Magic chest: Evil)
 
(36 intermediate revisions by 26 users not shown)
Line 1: Line 1:
A '''container''' usually means one of the following items: '''[[#Large box|large box]]''', '''[[#Chest|chest]]''', '''[[#Ice box|ice box]]''', '''[[#Sack|sack]]''', '''[[#Oilskin sack|oilskin sack]]''' or '''[[#Bag of holding|bag of holding]]'''. Each can store an unlimited number of items (objects or money), but may become too heavy to lift as a consequence. You can open an unlocked container by using the #[[loot]] command. Even though the '''[[#Bag of tricks|bag of tricks]]''' is defined with the CONTAINER macro in [[objects.c]], you cannot put items in it in vanilla Nethack (but see '''[[#UnNetHack|UnNetHack]]''' below).
+
A '''container''' is one of the following items:  
 +
* [[large box]]
 +
* [[chest]]
 +
* [[ice box]]
 +
* [[sack]]
 +
* [[oilskin sack]]
 +
* [[bag of holding]]
  
A [[statue]] can also function as a container; this causes messages like, "The statue of the [[Foo]] is empty."{{refsrc|end.c|948}} The contents correspond to the [[inventory]] of that monster before it was stoned. Some statues are generated with spellbooks inside.
+
Each can store an unlimited number of items (objects or money), but may become too heavy to lift as a consequence. For a container that's in your inventory, you can access its contents with the [[apply]] command. If the container is on the ground, you can do the same by using the #[[loot]] command, or #[[tip]] the container to dump all its contents on the ground.
  
== General properties of containers ==
+
Although the [[bag of tricks]] is defined with the `CONTAINER` macro in [[objects.c]] (and an unidentified one appears as a "bag", like three other containers), it cannot actually store items in vanilla NetHack.
  
As long as a container is not destroyed or polymorphed, all its contents stay unchanged, protected from any magical or physical influence, with four exceptions:
+
A [[statue]] is a type of container, but cannot be applied, looted, or tipped; the only ways to access the contents are to break it, or [[stone to flesh]] it and kill the resulting monster. A statue of a stoned monster will contain the monster's [[inventory]]. A randomly-generated statue may contain a [[spellbook]].
* Rot. Only the [[ice box]] preserves eggs and corpses from (further) rotting, in other containers they rot as usual. Furthermore, trolls will resurrect in containers, unless the container is locked. ("A <troll type> writhes out of a <container type> in your pack!" if in inventory, "A <troll type> escapes from a <container type>!" if not.)
 
* Water. If you get into or under the water without wearing a [[oilskin cloak]], only a non-cursed [[container#oilskin_sack|oilskin sack]], a [[container#chest|chest]], an [[container#ice_box|ice box]], or a [[container#large_box|large box]] completely protects its contents from the water damage. Other containers offer only partial protection.
 
* Fragile objects. If a container is kicked, thrown, or dropped from height, fragile objects in it may break (except in a bag of holding, see below).
 
* Opening a cursed bag of holding. Each time you do it, some of its contents may vanish.
 
  
In particular, containers completely protect their contents from [[fire]], [[cold]], [[shock]], [[cancellation]], being stolen (by nymphs, apes, leprechauns), being identified, and any change of their [[BUC]]. There is no monster in the game that can access containers' contents (but see below for [[gelatinous cube]]s).
+
The [[floor]] and [[ice]] can act as containers of sorts, as items can be buried in them (e.g. under a randomly generated [[headstone]]). These items can be accessed by digging a [[pit]].
  
When you carry a container, its contents do not take up slots (letters) in your inventory. Therefore, you can normally carry only 52 objects (counting each stack of objects, like 5 food rations, as one) in your main inventory, but unlimited number of objects in each container.
+
== General properties ==
  
Kicking a locked large box or chest may break it open, triggering a trap if applicable.
+
As long as a container is not destroyed or polymorphed, all its contents stay unchanged, protected from any magical or physical influence, with four exceptions:
 
+
* [[Corpse#Aging|Aging]]: Only an [[ice box]] preserves eggs and corpses from (further) aging; in other containers they rot as usual. Furthermore, [[troll]] corpses in containers can still resurrect, unless the container is locked.
The [[unique item]]s cannot be placed into containers. The [[cheap plastic imitation of the Amulet of Yendor]] can, however; this may be used to tell it from the real thing.
+
* [[Wet]]ting: If you get into or under the water without wearing an [[oilskin cloak]], only a non-cursed [[oilskin sack]], a [[chest]], an [[ice box]], or a [[large box]] completely protects its contents from the water damage.  
 +
* [[Fragile|Breaking]]: If a container is kicked, thrown, or dropped from height, fragile objects in it may break. A [[bag of holding]] is a magical container, and will protect its fragile contents from damage.
 +
* Vanishing: When opening a cursed bag of holding, each item inside has a chance of vanishing.
  
All of the containers except ice boxes can be eaten by [[gelatinous cube]]s; the contents will be engulfed but unharmed. They can be found on the cube's corpse.
+
In particular, containers completely protect their contents from [[fire]], [[cold]], [[shock]], [[cancellation]], being stolen or picked up by monsters, being identified, and changing their [[BUC]]. There is no monster in the game that can access containers' contents (but see below for [[gelatinous cube]]s).
  
When a container is polymorphed (even to another container, or even to the same container), all of its contents are destroyed.
+
When you carry a container, its contents do not take up slots (letters) in your inventory. Therefore, you can normally carry only 52 object stacks in your main inventory, but with a container, you can carry an unlimited number of objects.
  
===Breakable items===
+
If a container is trapped, opening it manually will trigger the trap.
If a container (other than a bag of holding) is [[kick]]ed, [[throw]]n, or dropped from a height, fragile contents (glass items, all potions, mirror, eggs etc.) may be destroyed.
 
  
When glass objects in a bag, large box or chest break, other than fake gems, you might hear a muffled shatter. An egg gives a muffled cracking when it breaks. You will lose that object and will not know what it was.
+
The [[unique item]]s cannot be placed into containers. A [[cheap plastic imitation of the Amulet of Yendor]] can, however; this is commonly used to distinguish the [[Amulet of Yendor|real Amulet]] from fake ones.
  
Though you do get the Luck penalty for breaking a mirror even if it is in a box, you need not fear this when kicking open locked boxes because tools cannot be generated inside them.
+
All of the containers except ice boxes can be eaten by [[gelatinous cube]]s; the contents will be engulfed. but unharmed, and can be found on the cube's corpse once killed. If you are polymorphed into a gelatinous cube, you can eat these containers only if they are empty.
  
Prior to NetHack 3.2.0, a popular technique for identifying fake gems was dubbed "kickboxing". One 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 no more muffled shatters were heard. One would then retrieve the remaining gems and un-name them. In this way, the fake gems of all colors could be identified.
+
When a container is polymorphed (even to another container, or even to the same container), all of its contents are destroyed.
  
Starting with NetHack 3.2.0, fake gems no longer break. Thus "kickboxing" no longer works.
+
{{upcoming|NetHack 3.7.0|Monsters now pick up containers and can loot containers other than a cursed bag of holding. As of yet, monsters cannot open locked containers.}}
  
 
== Containers within containers ==
 
== Containers within containers ==
  
 
Generally, containers may contain other containers. However, there are exceptions.
 
Generally, containers may contain other containers. However, there are exceptions.
* Large boxes, ice boxes and chests are too big to fit into any other container.
+
* Large boxes, ice boxes, and chests are too big to fit into any other container.
* If you put a [[#Bag of holding|bag of holding]], [[#Bag of tricks|bag of tricks]], or [[wand of cancellation]] into a bag of holding, the bag will explode, destroying all its contents including the item that caused the explosion. See the bag of holding section below for more info.
+
* If you put a [[bag of holding]], charged [[bag of tricks]], or charged [[wand of cancellation]] into a bag of holding, the bag will explode, destroying all its contents including the item that caused the explosion.
  
 
Attempting to place a container into itself yields the message "That would be an interesting topological exercise."
 
Attempting to place a container into itself yields the message "That would be an interesting topological exercise."
  
===Generation===
+
==Generation==
 +
Containers created via normal generation (i.e. outside of [[bones]] files or [[trap]] "bones") are uncursed, with the contents as described below:
  
Containers are generated uncursed, with the contents as described below.
+
Containers will not be generated containing tools, weapons, armor, or rocks. Containers in your starting inventory will be empty.
 
 
Containers will not be generated containing tools, weapons, armor or rocks. Containers in your initial inventory will be empty.
 
  
 
If the container can be locked, then there is an 80% chance that it will be generated locked and, independently, a 10% chance that it will be [[Container trap|trapped]].
 
If the container can be locked, then there is an 80% chance that it will be generated locked and, independently, a 10% chance that it will be [[Container trap|trapped]].
Line 57: Line 59:
 
|-
 
|-
 
|sack
 
|sack
|0-1 items
+
|0&ndash;1 items
 
|No
 
|No
 
|3.5%
 
|3.5%
 
|-
 
|-
 
|large box
 
|large box
|0-3 items
+
|0&ndash;3 items
 
|Yes
 
|Yes
 
|4.0%
 
|4.0%
 
|-
 
|-
 
|chest
 
|chest
|0-5 items
+
|0&ndash;5 items
 
|Yes
 
|Yes
 
|3.5%
 
|3.5%
 
|-
 
|-
 
|ice box
 
|ice box
|0-20 corpses
+
|0&ndash;20 corpses
 
|No
 
|No
 
|0.5%
 
|0.5%
 
|-
 
|-
 
|bag of holding
 
|bag of holding
|0-1 items
+
|0&ndash;1 items
 
|No
 
|No
 
|2.0%
 
|2.0%
 
|-
 
|-
 
|bag of tricks
 
|bag of tricks
|1-20 charges
+
|1&ndash;20 charges
 
|No
 
|No
 
|2.0%
 
|2.0%
 
|-
 
|-
 
|oilskin sack
 
|oilskin sack
|0-1 items
+
|0&ndash;1 items
 
|No
 
|No
 
|0.5%
 
|0.5%
Line 93: Line 95:
  
 
Tools can be generated in the [[Dungeons of Doom|main dungeon]] (8% of all [[object]]s) and [[Gehennom]] (12% of all objects). Each tool has the given probability of being a container.
 
Tools can be generated in the [[Dungeons of Doom|main dungeon]] (8% of all [[object]]s) and [[Gehennom]] (12% of all objects). Each tool has the given probability of being a container.
 +
 +
Large boxes and chests with contents may generate within some rooms in an ordinary room-and-corridor level.{{refsrc|src/mklev.c|839|nethack=3.6.1}}  Large boxes are twice as common as chests.  A comment in the source cites a 40% chance of at least one container (with a low probability of extra ones); the actual chance is slightly lower and depends on the number of rooms and presence of a [[special room]]; a good estimate is 34% without a special room and 30% with one.  <!-- Calculated for the number or rooms ranging from 6 to 10 (typical levels); more precise ranges are 33.5% to 34.6% and 29.2% to 31.1%. -->
  
 
[[Quantum mechanic]]s may carry a large box containing a [[housecat]] named [[Schroedinger's Cat]].
 
[[Quantum mechanic]]s may carry a large box containing a [[housecat]] named [[Schroedinger's Cat]].
Line 105: Line 109:
 
|18%
 
|18%
 
|-
 
|-
|food
+
|comestible
 
|15%
 
|15%
 
|-
 
|-
Line 133: Line 137:
  
 
== Unlocking ==
 
== Unlocking ==
To unlock a chest or large box, you can:
+
To unlock a locked container, you can:
 
* [[Apply]] an [[unlocking tool]] to it.
 
* [[Apply]] an [[unlocking tool]] to it.
 
* [[Zap]] a [[wand of opening]] at it.
 
* [[Zap]] a [[wand of opening]] at it.
* [[Kick]] it. Because this often destroys some of the items (e.g. potions and glass items) inside, it's not the best method.
+
* [[Kick]] it. Because this often destroys [[fragile]] items inside, it's not the best method.
* Cast a [[spellbook of knock|spell of knock]] at it
+
* Cast the {{spell of|knock}} spell at it
*<nowiki>#</nowiki>[[Force]] the lock with the currently-wielded weapon. Using a blunt weapon (such as a war hammer, staff, or mace) [[exercises]] [[Strength]] but risks destroying the container and/or its contents. Using a sharp weapon (such as a dagger, sword, or axe) [[exercises]] [[Dexterity]] but risks destroying the weapon. [[Artifact weapons]] are much less likely to break.  [[Cursed]] weapons will never break, preventing locks from being used to get rid of them.
+
* [[Force]] the lock with your currently-wielded weapon. Using a blunt weapon (such as a war hammer, staff, or mace) [[exercise]]s [[strength]] but risks destroying the container and possibly some of its contents. Using a sharp weapon (such as a dagger, sword, or axe) exercises [[dexterity]] but risks destroying the weapon. [[Artifact weapon]]s are much less likely to break.  [[Cursed]] weapons will never break, preventing locks from being used to get rid of them.
  
Usually, you will find enough disposable uncursed [[orcish dagger]]s to force with until you get an [[unlocking tool]]. If no other options are available, you could use a [[junk]] [[artifact]] such as [[Sting]], but chest contents in the early game aren't usually worth risking a good weapon or creating Sting.
+
Usually, you will find enough disposable uncursed [[orcish dagger]]s to force with until you get an [[unlocking tool]]. If no other options are available, you could use a junk artifact such as [[Sting]], but chest contents in the early game aren't usually worth risking a good weapon or creating Sting.
 
 
==Large box==
 
 
 
{{tool|name=large box|tile=[[image:large box.png]]|appearance=large box|cost=8|weight=350|color=brown|material=wood}}
 
 
 
Large boxes are waterproof, and an excellent [[stash]] container - they are slightly more common than chests and lighter for transporting to a convenient [[altar]]. You might want to <nowiki>#</nowiki>[[name]] your stash box, in case your [[pet]] [[dragon]] picks it up. Boxes and chests have a 10% chance of being generated [[container trap|trapped]].
 
  
 
===Messages===
 
===Messages===
 +
{{message|You succeed in unlocking the <container>.|You successfully applied an unlocking tool.}}
 +
{{message|Klick!|You unlocked it magically, with either the spell of knock or a wand of opening.}}
 
{{message|THUD!|You kicked it and didn't open it.}}
 
{{message|THUD!|You kicked it and didn't open it.}}
 
{{message|THUD! The lid slams open, then falls shut.|It wasn't locked, and you kicked it open.}}
 
{{message|THUD! The lid slams open, then falls shut.|It wasn't locked, and you kicked it open.}}
Line 155: Line 155:
 
{{message|You hear a muffled cracking.|You kicked it, and at least one [[egg]] inside was destroyed.}}
 
{{message|You hear a muffled cracking.|You kicked it, and at least one [[egg]] inside was destroyed.}}
  
==Chest==
+
==Breakable items==
{{tool|name=chest|tile=[[image:chest.png]]|appearance=chest|cost=16|weight=600|color=brown|material=wood}}
+
If a container is [[kick]]ed, [[throw]]n, or dropped from a height, contents which are [[fragile]] (such as potions, mirrors, and eggs) may be destroyed.
Chests are waterproof. They have a 10% chance of being [[container trap|trapped]].
 
 
 
===Encyclopedia entry===
 
 
 
{{encyclopedia|
 
Dantes rapidly cleared away the earth around the chest.  Soon
 
the center lock appeared, then the handles at each end, all
 
delicately wrought in the manner of that period when art made
 
precious even the basest of metals.  He took the chest by the
 
two handles and tried to lift it, but it was impossible.  He
 
tried to open it; it was locked.  He inserted the sharp end
 
of his pickaxe between the chest and the lid and pushed down
 
on the handle.  The lid creaked, then flew open.
 
Dantes was seized with a sort of giddy fever.  He cocked his
 
gun and placed it beside him.  The he closed his eyes like a
 
child, opened them and stood dumbfounded.
 
The chest was divided into three compartments.  In the first
 
were shining gold coins.  In the second, unpolished gold
 
ingots packed in orderly stacks.  From the third compartment,
 
which was half full, Dantes picked up handfuls of diamonds,
 
pearls and rubies.  As they fell through his fingers in a
 
glittering cascade, they gave forth the sound of hail beating
 
against the windowpanes.
 
|[ The Count of Monte Cristo, by Alexandre Dumas ]
 
}}
 
 
 
{{clear}}
 
==Ice box==
 
 
 
{{tool|name=ice box|tile=[[image:ice box.png]]|cost=42|color=white|weight=900|material=plastic}}
 
An ice box is a very heavy container, the main use of which is to keep [[corpse]]s fresh. Corpses in an ice box will not age and will remain fit to [[eat]] or [[sacrifice]] indefinitely. They will continue decaying where they left off when removed from the box, and will be tainted if they were before being placed in the box.
 
 
 
Ice boxes are rare, but are occasionally randomly generated in the dungeons and can also appear in [[general store]]s, [[delicatessen]]s, and [[hardware store]]s. (Food stores will not buy ice boxes.) An ice box can be generated with up to 20 corpses in it, and some might be too heavy to remove. However, as long as no one corpse is too heavy to carry it's possible to patiently #loot and then drop (or eat) the corpses until the box is empty. If a container is polymorphed, all items that were in it, including heavy corpses, will be destroyed. (In [[SLASH'EM]] polymorphing items is temporary, so a polymorphed ice box will eventually revert to a useful empty one.)
 
  
Some players bring an ice box containing [[potion of booze|booze]] and snacks for the [[demigod bar]] when they ascend. Because ice boxes are heavy, this is a challenge (unless they are [[wish]]ed for just before ascending).
+
When glass objects in a bag, large box, or chest break, you hear a muffled shatter. An egg gives a muffled cracking when it breaks. You will lose that object and will not know what it was.
  
Ice boxes are waterproof. They have no locks. [[Potion]]s do not freeze or shatter in an ice box.
+
If a mirror in a box is destroyed through your actions, you will still incur a [[Luck]] penalty. However, mirrors and other tools are never randomly generated inside boxes.
  
In [[SLASH'EM]], there is a new type of shop, the frozen food store, which contains mainly ice boxes.
+
== History ==
{{clear}}
 
  
==Sack==
+
Prior to [[NetHack 3.2.0]], a popular technique for identifying worthless glass was called "kickboxing". One 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 no more muffled shatters were heard. One would then retrieve the remaining gems and un-name them. In this way, glass of all colors could be identified. Starting with NetHack 3.2.0, worthless glass no longer breaks, so kickboxing no longer works.
{{tool|name=sack|tile=[[image:bag.png]]|appearance=bag|cost=2|weight=15|color=brown|material=cloth}}
 
A sack is the simplest kind of container. It merely stores items; its main function is to avoid the 52-item inventory limit, though it also protects its contents from fire, cold and other damages. It is extremely cheap.
 
  
When non-greased sacks get wet, their contents may get wet. Greasing the sack protects against this, but the grease may wear off. Sacks should be upgraded to [[#Oilskin sack|oilskin sacks]] or preferably [[#Bag of holding|bags of holding]] as soon as possible.  Many players, however, keep a sack to protect a [[wand of cancellation]] that can be used to uncurse their bag of holding if necessary.  Since wands are not adversely affected by water, an oilskin sack is not necessary for this purpose.
+
== Variants ==
 +
===Iron safe===
  
While a simple sack may seem a useless item to drag along, nested sacks with a [[bag of holding]] at the core also offer the possibility of reducing the weight of loot for extra points when you ascend. See the [[bag of holding]] entry for more on this tactic.
+
This is a container added to [[SporkHack]] (and later to [[UnNetHack]] and then [[EvilHack]]). It is possible to open it using a [[wand of opening]], {{spell of|knock}} spell, or [[stethoscope]]. The only way to lock an iron safe after it's been opened is to use either a [[wand of locking]] or the {{spell of|wizard lock}} spell on it.
  
===Encyclopedia entry===
+
===Magic chest===
 +
In [[DynaHack]], magic chests are [[dungeon feature]]s (not items) that are generated at fixed places in the dungeon. They share their contents, so putting items in any magic chest makes them available for looting in all other magic chest locations.<ref>https://github.com/tung/DynaHack/commit/b97d99ed27123fa0717ef8368b4f0d49d815c2c8</ref> (See below for [[FIQHack]]'s magic chests.)
  
{{encyclopedia|
+
In [[NetHack Fourk]], magic chests have some items inside when you first open one, randomized but suited for your roleAlso, you can create a magic chest in any location by reading a [[scroll of consecration]] while confused.
"Now, this third handkerchief," Mein Herr proceeded, "has also
 
four edges, which you can trace continuously round and round:
 
all you need do is to join its four edges to the four edges of
 
the opening.  The Purse is then complete, and its outer
 
surface--"
 
"I see!" Lady Muriel eagerly interrupted.  "Its outer surface
 
will be continuous with its inner surface!  But it will take
 
time. I'll sew it up after tea." She laid aside the bag, and
 
resumed her cup of tea.  "But why do you call it Fortunatus's
 
Purse, Mein Herr?"
 
The dear old man beamed upon her, with a jolly smile, looking
 
more exactly like the Professor than ever.  "Don't you see,
 
my child--I should say Miladi?  Whatever is inside that Purse,
 
is outside it; and whatever is outside it, is inside it.  So
 
you have all the wealth of the world in that leetle Purse!"
 
|[ Sylvie and Bruno Concluded, by Lewis Carroll ]
 
}}
 
{{clear}}
 
  
==Bag of holding==
+
In [[dNetHack]], magic chests are items rather than dungeon features, and they have 10 slots for different compartments for those willing to categorize items. All of the compartments are shared similarly across all chests. As items, they can be [[wish]]ed for. They weigh 1001 aum, and bolt to the floor when opened, meaning they cannot be carried around as an infinite weight container. When bolted to the floor, they cannot be picked up. The only way to unbolt them is the Master Key of Thievery's untrapping invoke.
{{tool|name=bag of holding|tile=[[image:bag.png]]|appearance=bag|cost=100|weight=15|color=brown|material=cloth}}
 
A bag of holding is one of the most coveted items in NetHack. Placing items into a bag of holding makes them weigh less; the effect is that you can carry more items.
 
  
Bags of holding, [[#Oilskin sack|oilskin sacks]] and [[#Bag of tricks|bags of tricks]] cost 100, while normal [[#Sack|sacks]] cost 2. (Make sure there is nothing in the bag when you check the price.) Bags of tricks are easily identifiable (better to #loot in a shop than to pay a use fee!), and if your [[encumbrance]] changes when you put something in the bag, it's a bag of holding and not an oilskin sack. (Exception: putting [[gold]] in a sack or an oilskin sack may change your encumbrance, because NetHack rounds the weight of your purse and the weight of the gold in your bag separately.)
+
In [[EvilHack]], magic chests are implemented as dungeon features similarly to DynaHack, and are generated at fixed locations in the dungeon - there are also special keys that are required to lock and unlock the chest.
  
At the end of [[Sokoban Level 4a|Sokoban]] there's a 50% chance of finding a bag of holding (you'll find either that or an [[Amulet of reflection]]). In [[Vulture's Eye]], a bag of holding always weighs 16 (empty).
+
=== FIQHack ===
  
The weight of a bag of holding (wgt) - including the 15 for the bag itself - depends on the weight of its contents (cwgt) and its [[BUC]]:
+
[[FIQHack]] has magic chests, similar to DynaHack or Nethack Fourk. They are objects but they behave like dungeon features - they can't be picked up, teleported, polymorphed, etc. You can create a magic chest by wishing for one. Minetown, Sokoban, the Castle, Orcus-town, and the quest home all have magic chests.
  blessed:  wgt = 15 + (cwgt/4 + 1)
 
  uncursed: wgt = 15 + (cwgt/2 + 1)
 
cursed:    wgt = 15 + cwgt*2
 
  
Roughly speaking, bags of holding halve the weight of the objects contained, blessed bags divide it by four, and cursed bags double it. You may also lose items when you use a cursed bag of holding; each item
+
Also note that monsters in FIQHack can use containers - they can carry items in bags and loot items from containers on the floorThe Castle chest is special-cased to prevent monsters from stealing the guaranteed wand of wishing.
in the bag has a 1/13 chance of disappearing each time you apply or loot
 
the bag.
 
 
 
If you find a bones pile with a cursed bag of holding, zap it with a wand of cancelation. This will only uncurse the bag of holding and does not affect its contents. You can also allow a [[gelatinous cube]] to eat the bag: the contents, even the organic ones, will land safely on the ground when you kill the cube. Just make sure you can secure all the items before something damages them, since they will be vulnerable to monsters once out of the cube. This destroys the bag of holding, so don't do this if you need it.
 
 
 
When non-greased bags of holding get wet, their contents may get wet. Greasing the bag protects against this, but the grease may wear off. You can also put the bag of holding in a non-cursed oilskin sack.
 
 
 
===Putting dangerous items into bags of holding===
 
Some items should not be put in a bag of holding as they may make the bag explode, destroying ''all'' its contents. These items are:
 
*other bags of holding
 
*bags of tricks with charges remaining
 
*[[wand of cancellation|wands of cancellation]] with charges remaining
 
*other bags containing any of the above items (these have a chance not to explode if you nest them; see below)
 
The first two are straightforward to avoid; the wand can be trickier. To be safe, do not put any unidentified wands inside the bag that make engravings disappear (this includes cancellation, [[wand of teleportation|teleportation]], and [[wand of make invisible|make invisible]]).
 
 
 
It is possible, though risky, to first put these items into nested sacks and/or oilskin sacks and then place them inside a bag of holding.
 
 
 
In general, at most two nested bags of holding are useful because the payload is limited by your ability to lift the innermost bag, not by the outermost weight. You risk an explosion again every time you add contents.
 
 
 
The chance of an explosion occurring then depends on the amount of nesting:{{refsrc|pickup.c|1740}}
 
{|class="wikitable"
 
!Number of sacks
 
!Odds of explosion
 
!Success probability
 
|-
 
|0
 
|1/1
 
|0
 
|-
 
|1
 
|2/2
 
|0
 
|-
 
|2
 
|3/4
 
|0.25
 
|-
 
|3
 
|4/8
 
|0.5
 
|-
 
|4
 
|5/16
 
|0.6875
 
|-
 
|5
 
|6/32
 
|0.8125
 
|-
 
|6
 
|7/64
 
|0.890625
 
|-
 
|7
 
|8/128
 
|0.9375
 
|-
 
|8
 
|9/128
 
|0.9296875
 
|-
 
|n, where n>6
 
|(n+1)/128
 
|
 
|}
 
 
 
If they do not explode, the effect of the two bags will be cumulative, as expected: If both are blessed, any items in the innermost bag will have their weight reduced to about 1/16.
 
 
 
As can be seen in the table above, nesting bags of holding with more than 7 sacks in between makes explosion more likely, so there is no point in using more than 7 sacks.
 
 
 
You may choose to continue to nest the bags of holding further; the chance of success with certain configurations of sacks between the bags of holding is given below:
 
{|class="wikitable"
 
!Number of bags of holding
 
!Sack spacing
 
!Success probability
 
|-
 
|2
 
|7
 
|0.9375
 
|-
 
|3
 
|7,7
 
|0.769042...
 
|-
 
|4
 
|7,7,7
 
|0.512570...
 
|-
 
|5
 
|7,7,7,7
 
|0.256222...
 
|-
 
|6
 
|7,6,6,6,7
 
|0.0935839...
 
|-
 
|7
 
|7,6,5,5,6,7
 
|0.0236287...
 
|-
 
|...
 
|-
 
|43
 
|3,2,2, ... ,2
 
|very small
 
|}
 
For example, if you use 7 sacks between each of three bags of holding like this (H for bag of holding, s for sack): HsssssssHsssssssH (denoted as "7,7" in the table above), the chance of successful nesting would be 1-(8/128) for the first nesting, and then (1-(8/128)) * (1-(16/128)) for the second nesting (each of the two 'inner' bags of holding put into the outermost bag must pass its own independent roll for the nesting to succeed{{refsrc|pickup.c|1750}}) giving roughly a 23.1% chance that something will explode.
 
 
 
===Strategy===
 
Many players name a plain sack something like "Cancel" or "Don't ever put this in BoH!" and keep what could be wands of cancellation in that sack as a safety measure.
 
 
 
Some players either consider the 6.25% chance of explosion from nesting to be an acceptable risk[http://groups.google.co.uk/group/rec.games.roguelike.nethack/msg/3c393a4f7b6a432f?] or assume from a test in wizard mode that it is safe. If you are confident you can withstand the explosion, you can risk it before you leave the main dungeon to increase your score or bring specific items to the [[Demigod bar|ascension bar]].
 
 
 
Item management becomes much less tedious if you additionally carry a sack around. Before [[stash]]ing or unstashing things, you temporarily put your entire main inventory into that sack ([[escape item]]s, primary weapon, often used tools, etc). Then you won't need to sort all your possessions whether you want them in your bag of holding or in the open. The same technique also helps avoid [[curse items|curses]] and [[nymph|theft]].
 
 
 
Bags of holding are quite possibly the best candidate in the game for [[blessing]] for some, as doing so doubles the amount you can carry in it.
 
 
 
Due to the risk of explosion, rare items like a [[wand of wishing]] or artifacts should probably not be kept in the same BoH you use for dungeon loot.  Any such item that you aren't currently using should probably be kept in a normal or oilskin sack, both to reduce inventory clutter and reduce the risk of destruction by exterior forces (e.g. lightning bolts, trapped boxes, etc).
 
 
 
Consider putting your bag of holding into a [[sack]] on lower levels when not in use due to the prevalence of the [[curse items]] spell, especially once the [[Wizard of Yendor]] starts after you.
 
 
 
==Bag of tricks==
 
 
 
{{tool|name=bag of tricks|tile=[[image:bag.png]]|appearance=bag|cost=100|weight=15|color=brown|material=cloth}}
 
 
 
A bag of tricks looks like an ordinary bag, but contains nasty surprises for prospective #looters.
 
 
 
Bags of tricks never hold any items, nor can any be placed in themInstead, when a bag of tricks is #looted, it will bite you (1 to 10 hit points damage, "It develops a huge set of teeth and bites you!") and become identified. If you (a)pply it and it has charges left, it will create one [[monster]] (22/23 chance), or create 2 to 8 monsters (1/23 chance). "Nothing happens" when you apply a bag with zero charges. Bags of tricks are generated with 1 to 20 charges. If the bag has more than 10 charges, a blessed [[scroll of charging]] will add 6 to 10 charges, otherwise it will add 6 to 15 charges; an uncursed scroll will always add 1 to 5 charges. It cannot hold more than 50 charges, but can be recharged an unlimited number of times.
 
 
 
Placing a bag of tricks with nonzero charges into a [[bag of holding]] will cause a [[Explosion#Magical explosion|magical explosion]], destroying both bags as well as everything in the bag of holding.
 
 
 
===Strategy===
 
 
 
If carrying a bag of holding, bags of tricks should be treated with the same caution as a [[wand of cancellation]]. Unless you need to create some monsters (for [[food]], [[sacrifice]] or [[experience]]), they are often best left alone. A magical explosion can be a game-ending mistake.
 
 
 
If you only want the bag to [[polypiling|polypile]] with, apply it until it runs out of charges. Make sure you can deal with the generated monsters! You know the bag is empty when "nothing happens" when you apply it. An uncharged bag of tricks is "safe", and if it polymorphs into another charged tool, the new tool's charges will be independent of the number of charges the bag had.
 
 
 
===UnNetHack===
 
 
 
In [[UnNetHack]], a charged bag of tricks has an equal chance of producing a creature as described above, or causing a random (mostly harmful) effect, such as briefly paralyzing the player, knocking a weapon from his or her hand, or spewing forth a [[scroll of stinking cloud|stinking cloud]].{{refsrc|src/makemon.c|1812|unnethack=251}}
 
 
 
{|class=wikitable
 
!Chance
 
!Effect
 
|-
 
|31/40
 
|Creates a monster.
 
|-
 
|2/40
 
|Spits out a random item of weight >= 100, or coughs nervously.
 
|-
 
|1/40
 
|Bag "wriggles away from you", causing it to drop.
 
|-
 
|1/40
 
|Tries to pull you in, paralyzing for d4 turns.
 
|-
 
|1/40
 
|Spits out a stinking cloud.
 
|-
 
|1/40
 
|Causes hallucination for 10+d35 turns.
 
|-
 
|1/40
 
|Yells "Boo!", scaring nearby monsters and possibly the player for a few turns.
 
|-
 
|1/40
 
|Grows teeth and bites, as if looted.
 
|-
 
|1/40
 
|Licks your wielded weapon from your hand, causing it to drop.
 
|}
 
 
 
A bag of tricks with no charges can hold items like a regular sack,{{refsrc|src/makemon.c|1802|unnethack=251}} but charging it again will destroy them.{{refsrc|src/read.c|500|unnethack=251}}
 
{{clear}}
 
 
 
==Oilskin sack==
 
 
 
{{tool|name=oilskin sack|tile=[[image:bag.png]]|appearance=bag|cost=100|weight=15|color=brown|material=cloth}}
 
 
 
The oilskin sack behaves exactly as the regular sack, with the exception that a [[blessed]] or [[uncursed]] oilskin sack will protect the items it contains from becoming [[wet]]. A [[cursed]] oilskin sack only protects its contents two-thirds of the time.  It is most useful in protecting scrolls and spellbooks.  One can get both weight reduction and water protection by putting an oilskin sack in a bag of holding or vice versa, but this adds time and tedium to accessing items in the nested bags.  An oilskin sack can also be used to protect a wand of cancellation that is stored outside your main bag of holding; generally a sack is sufficient for this purpose, but an oilskin sack does let you put a blessed scroll of remove curse in as well.
 
 
 
===Encyclopedia entry===
 
 
 
{{encyclopedia|
 
Summer passed all too quickly.  On the last day of camp, Mr.
 
Brickle called his counselors together and paid them what he
 
owed them.  Louis received one hundred dollars - the first
 
money he had ever earned.  He had no wallet and no pockets,
 
so Mr. Brickle placed the money in a waterproof bag that had
 
a drawstring.  He hung this moneybag around Louis' neck,
 
along with the trumpet, the slate, the chalk pencil, and the
 
lifesaving medal.
 
|[ The Trumpet of the Swan, by E.B. White ]
 
}}
 
{{clear}}
 
 
 
==Iron safe==
 
 
 
Container added in [[SporkHack]] (and later to [[UnNetHack]]). It is possible to open it using a [[wand of opening]], [[spell of knock]] or [[stethoscope]].
 
 
 
==Magic chest==
 
 
 
In [[DynaHack]], magic chests are [[dungeon feature|dungeon features]] (not items!) that are placed at fixed places in the dungeon. They share their content, so putting items in in one place makes them available for looting in all other magic chest locations<ref>https://github.com/tung/DynaHack/commit/b97d99ed27123fa0717ef8368b4f0d49d815c2c8</ref>.
 
  
 
== References ==
 
== References ==
 +
<references/>
  
<references/>
 
{{DOD}}
 
 
{{featured}}
 
{{featured}}
 
[[Category:Tools]]
 
[[Category:Tools]]
 +
{{nethack-360|offset=1}}

Latest revision as of 10:23, 12 December 2023

A container is one of the following items:

Each can store an unlimited number of items (objects or money), but may become too heavy to lift as a consequence. For a container that's in your inventory, you can access its contents with the apply command. If the container is on the ground, you can do the same by using the #loot command, or #tip the container to dump all its contents on the ground.

Although the bag of tricks is defined with the `CONTAINER` macro in objects.c (and an unidentified one appears as a "bag", like three other containers), it cannot actually store items in vanilla NetHack.

A statue is a type of container, but cannot be applied, looted, or tipped; the only ways to access the contents are to break it, or stone to flesh it and kill the resulting monster. A statue of a stoned monster will contain the monster's inventory. A randomly-generated statue may contain a spellbook.

The floor and ice can act as containers of sorts, as items can be buried in them (e.g. under a randomly generated headstone). These items can be accessed by digging a pit.

General properties

As long as a container is not destroyed or polymorphed, all its contents stay unchanged, protected from any magical or physical influence, with four exceptions:

  • Aging: Only an ice box preserves eggs and corpses from (further) aging; in other containers they rot as usual. Furthermore, troll corpses in containers can still resurrect, unless the container is locked.
  • Wetting: If you get into or under the water without wearing an oilskin cloak, only a non-cursed oilskin sack, a chest, an ice box, or a large box completely protects its contents from the water damage.
  • Breaking: If a container is kicked, thrown, or dropped from height, fragile objects in it may break. A bag of holding is a magical container, and will protect its fragile contents from damage.
  • Vanishing: When opening a cursed bag of holding, each item inside has a chance of vanishing.

In particular, containers completely protect their contents from fire, cold, shock, cancellation, being stolen or picked up by monsters, being identified, and changing their BUC. There is no monster in the game that can access containers' contents (but see below for gelatinous cubes).

When you carry a container, its contents do not take up slots (letters) in your inventory. Therefore, you can normally carry only 52 object stacks in your main inventory, but with a container, you can carry an unlimited number of objects.

If a container is trapped, opening it manually will trigger the trap.

The unique items cannot be placed into containers. A cheap plastic imitation of the Amulet of Yendor can, however; this is commonly used to distinguish the real Amulet from fake ones.

All of the containers except ice boxes can be eaten by gelatinous cubes; the contents will be engulfed. but unharmed, and can be found on the cube's corpse once killed. If you are polymorphed into a gelatinous cube, you can eat these containers only if they are empty.

When a container is polymorphed (even to another container, or even to the same container), all of its contents are destroyed.

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

Monsters now pick up containers and can loot containers other than a cursed bag of holding. As of yet, monsters cannot open locked containers.

Containers within containers

Generally, containers may contain other containers. However, there are exceptions.

  • Large boxes, ice boxes, and chests are too big to fit into any other container.
  • If you put a bag of holding, charged bag of tricks, or charged wand of cancellation into a bag of holding, the bag will explode, destroying all its contents including the item that caused the explosion.

Attempting to place a container into itself yields the message "That would be an interesting topological exercise."

Generation

Containers created via normal generation (i.e. outside of bones files or trap "bones") are uncursed, with the contents as described below:

Containers will not be generated containing tools, weapons, armor, or rocks. Containers in your starting inventory will be empty.

If the container can be locked, then there is an 80% chance that it will be generated locked and, independently, a 10% chance that it will be trapped.

Container Contents Lockable Probability
sack 0–1 items No 3.5%
large box 0–3 items Yes 4.0%
chest 0–5 items Yes 3.5%
ice box 0–20 corpses No 0.5%
bag of holding 0–1 items No 2.0%
bag of tricks 1–20 charges No 2.0%
oilskin sack 0–1 items No 0.5%

Tools can be generated in the main dungeon (8% of all objects) and Gehennom (12% of all objects). Each tool has the given probability of being a container.

Large boxes and chests with contents may generate within some rooms in an ordinary room-and-corridor level.[1] Large boxes are twice as common as chests. A comment in the source cites a 40% chance of at least one container (with a low probability of extra ones); the actual chance is slightly lower and depends on the number of rooms and presence of a special room; a good estimate is 34% without a special room and 30% with one.

Quantum mechanics may carry a large box containing a housecat named Schroedinger's Cat.

Items generated in a container (other than an ice box) will each be one of the following types:

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

Weapons, armor, and tools (including other containers) will never be generated in a container. Gold generated in containers will be 2.5 times the usual amount. Gemstones, glass, luckstones, and loadstones can all be generated, but flint stones, touchstones, and rocks cannot. A wand of cancellation will never be generated in a bag of holding.

Unlocking

To unlock a locked container, you can:

  • Apply an unlocking tool to it.
  • Zap a wand of opening at it.
  • Kick it. Because this often destroys fragile items inside, it's not the best method.
  • Cast the knock spell at it
  • Force the lock with your currently-wielded weapon. Using a blunt weapon (such as a war hammer, staff, or mace) exercises strength but risks destroying the container and possibly some of its contents. Using a sharp weapon (such as a dagger, sword, or axe) exercises dexterity but risks destroying the weapon. Artifact weapons are much less likely to break. Cursed weapons will never break, preventing locks from being used to get rid of them.

Usually, you will find enough disposable uncursed orcish daggers to force with until you get an unlocking tool. If no other options are available, you could use a junk artifact such as Sting, but chest contents in the early game aren't usually worth risking a good weapon or creating Sting.

Messages

You succeed in unlocking the <container>.
You successfully applied an unlocking tool.
Klick!
You unlocked it magically, with either the spell of knock or a wand of opening.
THUD!
You kicked it and didn't open it.
THUD! The lid slams open, then falls shut.
It wasn't locked, and you kicked it open.
You break open the lock!
It was locked, and you kicked the lid open.
You hear a muffled shatter.
You kicked it, and at least one breakable item inside was destroyed.
You hear a muffled cracking.
You kicked it, and at least one egg inside was destroyed.

Breakable items

If a container is kicked, thrown, or dropped from a height, contents which are fragile (such as potions, mirrors, and eggs) may be destroyed.

When glass objects in a bag, large box, or chest break, you hear a muffled shatter. An egg gives a muffled cracking when it breaks. You will lose that object and will not know what it was.

If a mirror in a box is destroyed through your actions, you will still incur a Luck penalty. However, mirrors and other tools are never randomly generated inside boxes.

History

Prior to NetHack 3.2.0, a popular technique for identifying worthless glass was called "kickboxing". One 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 no more muffled shatters were heard. One would then retrieve the remaining gems and un-name them. In this way, glass of all colors could be identified. Starting with NetHack 3.2.0, worthless glass no longer breaks, so kickboxing no longer works.

Variants

Iron safe

This is a container added to SporkHack (and later to UnNetHack and then EvilHack). It is possible to open it using a wand of opening, knock spell, or stethoscope. The only way to lock an iron safe after it's been opened is to use either a wand of locking or the wizard lock spell on it.

Magic chest

In DynaHack, magic chests are dungeon features (not items) that are generated at fixed places in the dungeon. They share their contents, so putting items in any magic chest makes them available for looting in all other magic chest locations.[2] (See below for FIQHack's magic chests.)

In NetHack Fourk, magic chests have some items inside when you first open one, randomized but suited for your role. Also, you can create a magic chest in any location by reading a scroll of consecration while confused.

In dNetHack, magic chests are items rather than dungeon features, and they have 10 slots for different compartments for those willing to categorize items. All of the compartments are shared similarly across all chests. As items, they can be wished for. They weigh 1001 aum, and bolt to the floor when opened, meaning they cannot be carried around as an infinite weight container. When bolted to the floor, they cannot be picked up. The only way to unbolt them is the Master Key of Thievery's untrapping invoke.

In EvilHack, magic chests are implemented as dungeon features similarly to DynaHack, and are generated at fixed locations in the dungeon - there are also special keys that are required to lock and unlock the chest.

FIQHack

FIQHack has magic chests, similar to DynaHack or Nethack Fourk. They are objects but they behave like dungeon features - they can't be picked up, teleported, polymorphed, etc. You can create a magic chest by wishing for one. Minetown, Sokoban, the Castle, Orcus-town, and the quest home all have magic chests.

Also note that monsters in FIQHack can use containers - they can carry items in bags and loot items from containers on the floor. The Castle chest is special-cased to prevent monsters from stealing the guaranteed wand of wishing.

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.