home » builders » builder's lessons » general shops

General shops

Shops need to be set up in the #SHOPS section of the area file and what they sell set up in the #RESETS section of the file. The #SHOPS section only determines what a shop will BUY and that the mobile is a shop. It will set the opening and closing hours, and the profit from buying and profit from selling percentages. Shops are determined by the mobile and not the room. If the mobile moves, so then does the shop. The shops section starts with #SHOPS and finishes with a 0.

A sample shop - The Gentlemens Emporium in Waterdeep, where Danillo Thann is the shop-keeper. Note that when Danilo moves away then he technically takes the shops inventory with him and nothing can be bought from the room alone.

#SHOPS
8000 ITEM_TYPE_ARMOR ITEM_TYPE_TREASURE ITEM_TYPE_CONTAINER ITEM_TYPE_NONE ITEM_TYPE_NONE
150  50  7 19    ; Danilo in Gentlemens Emporium
0

Lets break the code above down into each part:

8000 - This is the vnum of the shopkeeper. You would need to make the shop-keeper in the #MOBILES section of your area. When creating the area this would be QQ00.

ITEM_TYPE_ARMOR ITEM_TYPE_TREASURE ITEM_TYPE_CONTAINER ITEM_TYPE_NONE ITEM_TYPE_NONE - This is what the shop will BUY not sell. What is sells is determined by what you give the shopkeeper in its inventory in the #RESETS section. A shop can buy up to 5 item types. For a list of all possible types look at the item types list. The shop in the sample above will buy armour, treasure and containers from characters. Once he has bought that stuff from them, it is available for resale. So make sure you are going to be happy with what the shop-keeper is reselling. For instance, if your shop-keeper is a specialist jeweller, then hes not going to want to buy furniture or armour, he will likely only buy ITEM_TYPE_TREASURE.

150 50 - This is the profit-buy and profit-sell. This is a markup for characters buying the item from the shop-keeper, in percentage points. The markup is taken from the actual value of the item. 100 is nominal price; 150 is 50% markup, and so on. The 'profit-sell' number is a markdown for players selling the item, in percentage points. 100 is nominal price; 75 is a 25% markdown, and so on. The buying markup should be at least 120, and the selling markdown should be at most 80. Common shops in Forgotten Kingdoms are set to 150 buy and 50 sell.

7 19 - This is the open-hour and close-hour. These numbers define the hours when the shopkeeper will do business. For a 24-hour shop, these numbers would be 0 and 23. This particular shop opens at 7 am and stays open till 7 pm. On Forgotten Kingdoms we want realistic trading hours. Most of the shops around Waterdeep are only open during the day. Innkeepers who are also shops have much longer trading hours only shutting in the wee hours of the morning. If you are making a large city or township, it is a good idea to have a tavern or two open late to trade food and drink to characters.

; Danilo in Gentlemens Emporium - This is the comment which starts with a ; All your shops should have comments, as it makes the area far easier to read and edit when they do.

Note that there is no room number for a shop. Just load the shopkeeper mobile into the room of your choice in resets, and make it a sentinel. Or, for a roving shopkeeper, just make it non-sentinel. Lets at what else we need to make our shop work. First we need to make the actual mobile and put it in the #MOBILES section of our area file.

#8000
danilothannmob thann~
{70}Danilo~
{70}Danilo Thann gives you a wicked grin.
~
He is a handsome man, dressed to the hilt in the finest of clothes.
He is from one of the most wealthy families of Waterdeep.
Actually he looks like a bit of a dandy.
~
U 45 CLASS_BARDS RACE_HUMAN SEX_MALE POS_STANDING DEITY_NONE
ACT_SENTINEL|ACT_NOSHOVE|ACT_CITIZEN
0
ARMOR_TYPE_LEATHER MATERIAL_LEATHER
d6+1 1000
13 13 13 18 13 18 13
0 0 0 0 0
LANG_COMMON|LANG_ELVEN
LANG_COMMON|LANG_ELVEN
RIS_NONE RIS_NONE RIS_NONE

Our shop-keeper is flagged sentinel so that he will remain in the room that is his shop. If he was a wandering merchant we would not put the sentinel flag on him and allow him to wander the area. If you wanted the shop to only wander a particular sector type then you would use ACT_NOWANDER, and if you wanted him to stay within your area you would use ACT_STAY_AREA.

The objects a shopkeeper sells are those loaded by 'G' reset commands for that shopkeeper. These items replenish automatically. If a player sells an object to a shopkeeper, the shopkeeper will keep it for resale if they do not already have an identical object. Items sold to shops do not replenish. To limit the stock that a shop-keeper has of an item you would set a maximum number of the item in the game in the RESETS. It is not defined in the #SHOPS section of the code. Let us look at our examples resets. More information on resets are available in the resets section of the lessons page.

M 0  8000   1  8089;                   Danilo in Gentlemen's Emporium
G 1  8022  30 ;  blue velveteen breeches
G 1  8023  30 ;       a purple silk robe
G 1  8025  30 ;    a maroon leather belt
G 1  8026  30 ;      green silk slippers
G 1  8229 30 ; green velvet cape
G 1  8079 100 ; a fine cotton undershirt
G 1  8087 100 ;a pair of fine wool socks
G 1  8230 20 ; jade green coat
G 1  8231 20 ; jade green trousers
G 1  8234 30 ; ivory ring

Danilo is loaded into room 8089 and there is only 1 of him. He sells alot of clothing. It is easy to see what he sells because the resets have been well commented. If there are 30 blue velveteen breeches in the game already, then while the characters see this item on list, Danilo will be out of stock when they go to buy the item. This is a good way to limit some rarer items you might have for sale that you do not want to see on every character in the game. Note that if Danilo was equipped with clothing and weapons with the E reset, he would not sell these items. He only sells what is given to him with a G reset.