# Shop
A shop is a special room that appears in NetHack, and may occur on some levels of the dungeon. Each has an attendant shopkeeper and a selection of items to buy - the shopkeepers will also buy items from you, and both types of items depend on the type of shop. A shop with no shopkeeper is considered abandoned.

Contents

1 Generation

1.1 Table of shops
1.2 Special levels with shops
1.3 Closed shops
1.4 Mimics
1.5 Traps

2 The shopkeeper

2.1 Theft prevention
2.2 Barring the entrance
2.3 Pick-axes
2.4 Angering the shopkeeper

3 Transactions and inventory

3.1 Buying items
3.2 Selling
3.3 Credit
3.4 Usage fees

4 Pricing

4.1 Base price

4.1.1 Unidentified gems

4.2 Buying
4.3 Selling

5 Strategy

5.1 Shopping while invisible
5.2 Shopping smart and safe
5.3 Combat
5.4 Zen shopping

6 History
7 Messages
8 Variants

8.1 SLASH'EM
8.2 UnNetHack

9 References

Generation
Shops have a base 3/DL chance of being created on any dungeon level between level 2 and Medusa's Island, with the exception of the Oracle level. The creation of a shop assumes there is a suitable room to put them in (i.e., no stairs, only one door) and that there are enough rooms on the level to start with - the minimum number of rooms required is 3 for normal dungeon levels, and 4 for a branch level. Note that this means that there will always be a shop on each of levels 2 and 3 if the conditions are right (which in practice turns out to only be the case about 45% of the time). 
With the exception of bones and Orcus-town, shops are never generated abandoned, and are never restocked under any circumstances - the only way they can gain more items is if they are brought in by you, a dead player from a bones file, or very rarely another monster.

Table of shops
The probability of a given type of shop being generated is detailed in this table:

Shop

Probability

Stock

general

42%

100% random

used armor dealership

14%

90% armor, 10% weapons

second-hand bookstore

10%

90% scrolls, 10% spellbooks

liquor emporium

10%

100% potions

antique weapons outlet

5%

90% weapons, 10% armor

delicatessen

5%

83% food, 5% fruit juice, 5% water, 4% booze, 3% ice boxes (containing corpses)

jewelers

3%

85% rings, 10% gems, 5% amulets

quality apparel and accessories

3%

90% wands, 5% leather gloves, 5% elven cloaks

hardware

3%

100% tools (containers may contain random items that are also for sale)

rare books

3%

90% spellbooks, 10% scrolls

health food

2%

70% vegetarian food, 20% fruit juice, 4% healing, 3% full healing, 2% scrolls of food detection, 1% royal jelly

lighting

Minetown only

48% tallow candles, 30% wax candles, 9% oil lamps, 5% brass lanterns, 5% potions of oil, 3% magic lamps

Accessories and rare book shops may not be larger than 20 squares (including the non-stocked squares); if they would otherwise be (about half the time), they are converted into general stores instead.

Special levels with shops
The following special levels are guaranteed to have shops at fixed locations:

Minetown (except for Orcish Town) is guaranteed to have at least 1 shop, including Izchak's lighting store. In addition, the first shop generated in Minetown will always be a health food store when the player is a Monk.
The Tourist Quest has several guaranteed general stores: two in the locate level (The Thieves Guild Hall) and two in the goal level (The Shades).
Orcus-town is usually host to a few abandoned shops.
Closed shops
Shops can also be generated "closed", in which case the message "Closed for inventory" will be written in dust outside of the shop door. The shop door itself will be locked. The door cannot be chopped down with an axe, and breaking down the door will anger the owner unless you immediately pay 400 zorkmids; opening the door with an unlocking tool, wand of opening or knock spell allows you to enter and shop as usual. Shops in special levels cannot ever generate closed.

Mimics
Main article: Mimic
Any mimics you encounter are most likely to appear in shops, disguised as items. There is a (dungeon level - 1)% chance to generate a mimic on a given shop square instead of an item.

Traps
Traps cannot normally be generated in shops, with the exceptions of shops placed on special levels. In practice, this will most likely occur in the Tourist quest and Orcus-town - while the various layouts of Minetown contain two traps each, they are very rarely placed within any of the shops.

The shopkeeper
Main article: Shopkeeper
The shopkeeper is a human monster that owns the shop and its contents and buys and sells items within. They are responsible for the upkeep of the shop as well - this includes magically repairing most damage done to the shop's floors, walls and door, and removing most traps that are set within their shop(with the exception of pits or webs), including those made by you. Damaged walls, broken doors and holes are repaired in five turns.[1][2] If the shopkeeper should end up dead for any reason, or else a shop has no shopkeeper, then the shop's items are free for you or any monster to take.

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.

Shopkeepers will now remove pits and webs as well.
Theft prevention
Main article: Stealing from shops
Shopkeepers are 50% faster than a normal character's base speed, and will keep close to their shop's entrance - this makes it difficult, but not impossible, to walk out with unpaid items. See the article linked at the top of this section for more information on how to steal from shops, and see the article on shopkeepers for more details about their movement.

Barring the entrance
In addition, shopkeepers will block the entrance square (the square inside the shop that is directly in front of the door) and will not allow you to enter their shop if you are invisible, have a visible pick-axe or dwarvish mattock, and/or are currently riding on a steed. If you dismount, become visible, or remove the digging tool(s) from your open inventory (including placing it in a container), you will be allowed entry. Note that the door of the shop is not considered suitable for dropping your digging tools - this is to prevent characters with extra speed from entering on a free turn. Shopkeepers will also catch any tools you attempt to throw in.
While in a shop, the shopkeeper will prevent you from leaving if you are mounted and/or invisible.

Pick-axes
On top of the above, the shopkeeper will yell at you if you pull out a digging tool(s) from a container while inside - but this does not anger them, and you can safely sell or otherwise walk around with the tool(s) as long as you do not dig through the shop walls. Digging a pit will have them warn you about falling through holes, though this will also not anger the shopkeeper - but if you dig again and create a hole, items on the same square and possibly adjacent squares will fall through.
Attempting to enter a shop with a dwarvish mattock or pulling one out inside a shop will also identify it.

Angering the shopkeeper
The shopkeeper will become angry if you attack them, damage the shop or its inventory, or they see you leave with unpaid items or debt - additionally, if you try to leave the shop with unpaid items via a hole made within the shop's boundaries, the shopkeeper will try to grab your pack as you fall if they can get adjacent. Theft includes any items on the same square as a hole falling through it, as well as items from potentially adjacent squares. Damaging the shop door or walls will immediately prompt you to pay 400zm, and the shopkeeper will be angry if you do not pay.
Paying for stolen items will always pacify the shopkeeper - note that there will be an additional price hike. In either case, you will need to be adjacent to the shopkeeper to pay them off unless you are both in the shop; you can also throw the required gold at the shopkeeper. In all other cases, you can pay them 1000zm for a 2/3 chance to pacify them.[3][4] Stealing an item while the shopkeeper is already angry due to another offense, then paying for it, will make the shopkeeper will "forget" about your previous offenses, and they will become calm and return to their shop as usual. Pacifying a shopkeeper by paying for stolen goods will also pacify any watchmen on that floor and cause any Keystone Kops present to disappear.

Transactions and inventory
A shop's inventory consists of all the items on any square of its floor, with the notable exception of the "entrance square" in front of the door; this is not to be confused with the shopkeeper's personal inventory. Items belonging to the shop will have their price displayed as you move over them, and an item's price can be also viewed by near looking on their square. For containers generated as belonging to a shop, the contents are also that shop's property, regardless of whether that shop would sell them normally. You cannot buy from shops normally while blind unless you have telepathy, as you will be unable to see the shopkeeper, although you can still sell items as normal.
Pressing $ will display any credit you have, along with any debts you currently owe the shopkeeper. You can #chat to get the price of an item(s) on your square without picking anything up. Buying and selling non-magical weapons and armor will have the shopkeeper partially identify that item(s) to you - e.g., if you sell a crude dagger, the shopkeeper will reveal that it was an orcish dagger. After each transaction, they will also tell you the item's appearance if you are blind.

Buying items
Picking up items off the shop floor adds them to your inventory, with each item(s) being given an "unpaid" tag that lists their price - pressing I and then u will display all the unpaid items you are currently carrying.
You can pay for your goods by pressing p, which will prompt you about itemized billing; answering "no" to this will pay for all the items at once if possible. For itemized billing, you can pay individually for each unpaid object (or stack of objects). Items that you pay for are yours, and the required gold will transfer to the shopkeeper's personal inventory. In both cases, if you have credit at that shop, it will be used up first before any gold is transferred.

Selling
If you drop an item onto the shop floor (with the exception of the entrance square), the shopkeeper will offer to buy it if they normally carry that type of wares. If you refuse, or if the shopkeeper makes no offer, then you continue to own the item and can pick it up again without paying.
Any items that unintentionally fall onto the shop floor, e.g. from throwing them or losing your grip on them will be considered "relinquished" and automatically sold if it is a type normally sold by the shop. Any items dropped by monsters killed within a shop also becomes that shop's property - this includes you, if you die while inside a shop.

Credit
Main article: Credit cloning
If you drop any gold onto the shop floor, the shopkeeper will give you credit which you can use to buy items and pay off debts. If you sell an item to a shopkeeper that is completely out of gold, they will instead offer you store credit in exchange for the item at 90% of the normal price. Any credit given in a shop is only good for that specific shop - if you leave a shop with unpaid items in your inventory (e.g., your intrinsic teleportitis suddenly kicks in), all of your credit will be used to cover the losses, and if your credit was not enough, the shopkeeper will become angry.
You can abuse this credit system through credit cloning - see the linked article at the top of this section for more detailed information.

Usage fees
Main article: Usage fee
If you use an unpaid item with charges in a shop before paying for it and the shopkeeper is present, you will be charged a usage fee.[5] Broken or destroyed items, including the locks of chests and large boxes, also incur fees.

Pricing
Main article: Price identification
Base price
Each item in NetHack has a base price, which is modified in various ways to produce the final selling price; an artifact has its own usually-high base price distinct from its base item. Positively-enchanted weapons and armor have an additional 10 zm added to their base price for every point of enchantment.
Some items are considered "worthless"; you cannot sell them, but their buying price is calculated as though they had a base price of 5 zm:

items with zero base price
cancelled wands (with -1 charges)
partly-eaten comestibles
uncursed potions of water
Unidentified gems
Valuable gems and worthless glass which aren't formally identified have their base prices determined by a different mechanism:

When buying, the base price is that of an arbitrary valuable gem.
When selling, the base price is between 3 and 8 zm.
The random modifiers to unidentified item prices listed below don't apply in this case. Even if you know for a fact that a gem is valuable (by e.g. engrave-testing) and have named it correctly, you can't get its full selling price unless you formally identify it.
Gray stones don't use this mechanism; an unidentified gray stone is priced the same as an identified one.

Buying
When you buy an item, you are charged the base price, modified as follows. All multipliers are applied in sequence:

Your charisma grants a modifier to the buying price.[6]
Some characters are considered "suckers", and will be charged 1⁄3 more. You are a sucker if:[7]
you're wearing a dunce cap
you're wearing a shirt not covered by a cloak or body armor
you're a Tourist below experience level 15
A hostile shopkeeper will charge 1⁄3 more.[8]
When buying unidentified objects, in 1⁄4 of cases the shopkeeper will charge 1⁄3 more. This surcharge is tied to the individual item or stack; merged stacks will inherit the higher of the two prices, while split stacks will inherit the price of the original stack.
Depending on your hunger status, shopkeepers will charge more for food and comestibles:[9]
If you are hungry, the price is doubled.
If you are weak from hunger, the price is tripled.
If you are fainting from hunger, the price is quadrupled.
Artifacts are bought for four times their already-inflated base cost.[10]
Selling
When you sell an item, you are normally offered 1⁄2 the base price; charisma modifiers do not apply. If you're a sucker, as above, you are offered 1⁄3 the base price instead.

1⁄4 of shopkeepers will pay 1⁄4 less for unidentified objects; this modifier is consistent for a given shopkeeper.
Artifacts are sold for 1⁄4 their base cost.[11]
Strategy
For shopkeeper-specific strategy, see Shopkeeper#Strategy.
Shops are a very useful resource overall, particularly in the early and mid-game - they are usually a primary source of items and equipment, and additionally provide a means of identifying them via prices, as mentioned above. They can also serve as a place to offload anything you consider junk, and can serve various other purposes besides.
It may sometimes be worthwhile to drop your gold and use credit to buy things, rather than paying directly - even if you do not plan on shoplifting, you may benefit from tricking a monster into bringing the gold back to you. Covertly stealing expensive items (usually including artifacts) may also be worthwhile for the early advantage they provide, e.g. a powerful weapon, or something to sell back to the shopkeeper for a significant price.

Shopping while invisible
If you are invisible and either do not want to wait until you are visible again, or your invisibility cannot be undone (either due to a cursed source or a quaffed blessed potion), then you can use one of the following methods to safely enter or exit a shop as normal:

Wearing a non-cursed mummy wrapping is the safest and most typical method, as it works in a mass majority of cases with the exception of a cursed cloak.
Teleporting into and out of the shop is possible, but requires teleport control for you to enter reliably.
Jump diagonally through the door.
Hurtle diagonally through the door by throwing things while levitating due to Newton’s Third Law.
Dig down on the level above - but this leaves you completely at the mercy of RNG.
You can also dig a hole out of the shop through the floor - this is safe as long as no unpaid items fall through with you.
You can forego entering entirely and instead use a pet and a magic whistle to steal from the shop.
Use any holes in the wall dug by a tunneling monster (e.g., a dwarf with a pick-axe or mattock); each hole will be magically repaired in at least 5 turns after it was made if no monster is present on that square.
Polymorph into a xorn to phase through the wall.
Be very fast (e.g. usually from wearing speed boots) and beat the shopkeeper to the door. Note that the shopkeeper will move to stay ahead of a player's intrinsic speed - this does not account for speed from polyself.
These methods are less safe and/or may cost you some gold:

Carry 800zm or more, then polymorph into an umber hulk or rock mole and chew through the wall, and pay for the damage.
Carry 800zm or more, then destroy the closed shop door, pay for the damage immediately, then enter/leave. The door will be fixed afterward.
Teleport the shopkeeper - but this will anger them, and you will have to avoid the shopkeeper on the way out unless you can pacify them.
Kill the shopkeeper, directly or otherwise - doing so directly counts as murder, and you are deprived of price identification for that shop in either case.
Shopping smart and safe
While each character's shopping needs will differ, price identification can generally narrow down what wares you may want to focus on, and even without thorough memorization a player can get an idea of which items are valuable.
There are other multipurpose pointers for a shopper to keep in mind - in general, never buy or sell gems that are unidentified.
In general, it is a Bad Idea to randomly wear or use items within a shop, since even if your pet is not averse to moving over them, you may end up endangering yourself or complicating play as you would with any randomly use-tested item - you may end up quaffing a potion of paralysis, wearing a helm of opposite alignment, exploding a cursed wand, or end up reading a non-cursed scroll of fire with the shopkeeper nearby and/or unpaid flammables in your inventory.
One particular obstacle to this end is the scroll of scare monster - a scroll that is cursed or has been picked up and dropped once turns to dust when picked up, which incurs a charge for the destroyed item. Novice adventurers who shop by picking up items can find themselves trapped in a store with no money and no way out. There is also the more direct threat to your life posed by mimics of any kind - even small mimics can end an unwary early character, and particularly unfortunate sorts may end up stuck to a giant mimic.
There are several ways to prevent any mishaps while shopping:

Be sure #chat to a shopkeeper before picking up certain items directly.
Always carry a few hundred spare zorkmids to cover any accidental charges you incur. In a worst-case scenario where you cannot avoid incurring damages, you may need to sell some additional items in your inventory - depending on your situation, this may be preferable to being branded a thief or dying.
Before entering a shop, quaff a non-cursed potion of object detection. You may notice suspicious blank squares if you have not yet seen the contents of the shop - those are likely to be mimics.
"Obvious" out-of-place objects are often mimics, especially in specialized shops (e.g., a long sword in a potion shop, or down staircase in any shop). However, this does not work as well for general stores (which sell almost anything) and bones files (which may have the inventory of the dead player - although you may encounter signs of this beforehand).
If you are playing with default tiles or standard ASCII, you can also discern mimics by their glyphs - they will appear as "strange objects", and the tiles for strange objects are chests with eyes peering out of them (/] versus /(). Additionally, their glyph is usually the mirror of the glyph for armor ([) - the only time ] is used for anything else is for actual armor on the Rogue level.
Telepathy and warning will reveal mimics and/or their locations.
The ring of protection from shape changers will force mimics into their standard form.
Any form of monster detection can reveal mimics - note that a non-blessed potion of monster detection or a detect monsters spell cast at lower than Skilled level only reveals their current location, while detection from a blessed potion or Skilled (or better) spell passively remains active.
A safe and surefire way to uncloak mimics inside a shop is to throw a single gold piece across each row of the store - this does not use up valuable projectiles and will only establish credit. Be careful not to hit and possibly anger the shopkeeper!
Search before walking onto an item to uncover any mimics - this will prevent you bumping into them, as the larger ones are sticky.
A stethoscope can also uncover mimics, and the first application of a stethoscope per turn is a free action.
Healing a mimic disguised as an item (e.g. via a spell of healing) will indirectly expose it, with the "object" seeming a more vivid color than before.[12]
If you lack any means of detection and are risk-averse, only walk where your pet or the shopkeeper has walked.
Combat
A shop can also function as a refuge if you need to heal or fight a powerful enemy. You can pick up an item and stand so that the shopkeeper blocks the door, preventing non-phasing monsters from getting in. If you stand a knight's jump from the door, you will not be exposed to ranged attacks from outside as well. You can then move next to the door to fight, and step away to heal at your leisure.

Zen shopping
Main article: Zen
For zen players, shops are one of the few methods available to identify item the appearances, particularly scrolls and potions. However, being unable to see the shopkeeper poses a great danger: paying only works if you can see the shopkeeper, and failing to discern the shopkeeper's location by searching before safe-moving via m will nearly always result in death. It may be advisable to avoid shops altogether until you have telepathy.
Braver and/or more experienced players can bring a container to place items in (ideally a bag) and a pet to steal the container back in order to speed up the process of re-acquiring sold items that the shopkeeper has identified. It is also possible to drop enough gold to cover your purchases and then teleport, jump or phase out after picking up your desired items, even without teleport control - unfortunately, this is not nearly as reliable early in the game, and most zen players acquire telepathy before any of these other methods become available. Selling items works as normal, and might be useful if you get burdened before acquiring telepathy.

History
Shops have been present in the game's code since the original release of Jay Fenlason's Hack, and make a proper first appearance in Hack 1.21, a variant of this first Hack. Hack 1.21 also included a shop at the beginning of the game, where characters purchased their starting items, rather than bringing their initial inventory with them into the dungeon.
Izchak and his lighting shop in Minetown were introduced in NetHack 3.2.0 as part of a tribute to late DevTeam member Izchak Miller.
In default installations of NetHack 3.4.3 and earlier versions, along with some variants based on those versions, prices are not displayed by default, and you must pick up items or #chat while standing on them to learn their price. Additionally, modifiers for unidentified items applied to identified items as well, and the lower price for sold items was applied per-sale - by repeatedly dropping an item, refusing the shopkeeper's offer, and picking it up again, you would eventually get two different quotes. A bug was also present in those versions that could prevent you from leaving a 2x2 size shop through normal means; saving and reloading the game while standing next to the shopkeeper may alleviate this bug in a semi-sane and perfectly legal fashion.
The health food store was introduced in NetHack 3.6.0. Beginning in 3.6.1, autopickup no longer picks up unpaid items - this prevents any mishaps involving a cursed scroll of scare monster.

Messages
You hear someone cursing shoplifters.You hear the chime of a cash register.
There is a shop on the level.
You hear Neiman and Marcus arguing!
As above, but you are hallucinating.
This shop appears to be deserted.
There is no shopkeeper in the shop.
Variants
Some variants may feature entirely different types of shops, in addition to adding more locations and/or functions.

A user has suggested improving this page or section as follows:
"Cover the rest of the variants eventually."

SLASH'EM
SLASH'EM adds pet stores, randomly generated light stores, tin shops, and music shops. SLASH'EM also has the black market, a special floor-wide shop with its own branch tended to by One-eyed Sam and his assistants. Shopkeepers are also much more powerful than in vanilla NetHack.
Shops can be additionally found in more locations as well - the Mall is a special level that contains several shops and can appear early in the dungeon.

UnNetHack
UnNetHack also contains pet stores, randomly generated light stores, tin shops, and music shops. The Town branch is a new addition that contains a few shops, including most of the newer ones.
UnNetHack also contains its own version of the black market, with the same layout as SLASH'EM - UnNetHack's One-eyed Sam is a woman, and there is a second possible map that instead splits the market into several independent shops with their own shopkeepers, while One-eyed Sam herself keeps watch.

References

↑ shk.c in NetHack 3.4.3, line 3033

↑ shk.c in NetHack 3.4.3, line 3043

↑ src/shk.c in NetHack 3.6.6, line 1407

↑ src/shk.c in NetHack 3.6.6, line 1420

↑ src/shk.c in NetHack 3.6.6, line 4580

↑ src/shk.c in NetHack 3.6.6, line 2134

↑ src/shk.c in NetHack 3.6.6, line 2128

↑ src/shk.c in NetHack 3.6.6, line 21g4

↑ src/shk.c in NetHack 3.6.6, line 3402

↑ src/shk.c in NetHack 3.6.6, line 2159

↑ src/shk.c in NetHack 3.6.6, line 3396

↑ mimic_hit_msg in mon.c: mimics give strange messages if healed while disguised

This page is based on a spoiler by Dylan O'Donnell. The original license is:
Redistribution, copying, and editing of these spoilers, with or without modification, are permitted provided that the following conditions are met:

The original contributors to any spoiler must continue to be credited.
Any modifications to the spoiler must be acknowledged and credited.