#SHOPS Section

This page describes how to code shops within an area file.
<< Back to #RESETS Section Forward to #SPECIALS Section >>

The #SHOPS section of an area file specifies which mobs are shopkeepers, what they sell, and other information.

The #SHOPS section consists of the #SHOPS header, one or more shop definition lines and the #SHOPS ender line 0 (zero) as shown here:
#SHOPS
shop definition line
0

The function and structure of the shop definition lines will be explained below. It's very simple! But first, some things of note about shops:


How to Set Up Shop

As in real life, opening a shop is not a trivial task and involves substantial preparation. Only the final part of setting up a shopkeeper for business is done in the #SHOPS section. Most of the detail work takes place in preceding sections, as follows:
#MOBILES
You can't start a shop without a shopkeeper. A shopkeeper starts out as an ordinary mobile that must be coded in the #MOBILES section. Here are some important points to note:

#OBJECTS
Like all other objects, objects which you want in the shop's stock must be coded. You code them the same as any other objects, except possibly with a little more attention to their price.

#ROOMS

#RESETS
Two shop-relevant functions are accomplished in the #RESETS section:


Once our homework is done in all the preceding sections, we can finally put our shopkeepers into operation. This requires one line in the #SHOPS section as follows:

Shop Item Line
Mob
vnum
Item
type
1
Item
type
2
Item
type
3
Item
type
4
Item
type
5
Sale
markup
Buy
back
rate
First
open
hour
Last
open
hour
* Comment: name of shopkeeper mob

Here's what the fields mean:

Mob vnum
The vnum of the shopkeeper mob

Item type
The types of items the shop is authorized to buy (from players). These items may be different from the items the shop sells, but exercise some realistic good sense. A baker should not buy weapons, for example. For the encoding of the valid item types, see the Shop Item Type Table.

A shop can not buy more than 5 different types of items. This is the limit imposed by the fixed number of 5 slots for item types in this line.

A shop need not buy exactly 5 item types. Code as many item types as you are willing for the shop to accept, and 0 for the remainder out of the 5 total.

A shop need not buy any items. Code a 0 in all 5 item type fields and the shop will reject anything offered.

There is a new shop item type in Dizzy which is not shown in the Shop Item Type Table because it's not really an item type. Coding 999 in the first shop item type slot for a shop indicates that the shopkeeper will sell (and buy) quest items, i.e. items which are sold and bought only for Quest Points. The (program internal) name of this flag is ITEM_QUESTSHOP. The only objects eligible for this kind of trade are those having an object flag of ITEM_QUESTSELL. See the #OBJECTS Section and the Object Flag Table for details.
A so-called Quest Shopkeeper will buy and sell only for quest points, and will buy only quest items. If you code the 999 in the first field, this makes the shopkeeper a Quest Shopkeeper; the other 4 slots will be ignored but should be coded as 0 for clarity and future compatibility.
Quest Shopkepers do not HAGGLE, i.e. they sell only according to the object's value and buy for the object's value times its condition as a percentage, with both numbers modified as normal by the Sale Markup and Buyback Rate. Current DizzyMUD policy prescribes a Sale Markup of 100 and a Buyback Rate of 35.

Sale markup
The percentage of the object's nominal value (as coded into the value field of the object) at which the shop will sell the item. Code 130 if you want the shop to make a 30 percent profit. A general guideline is that the sale markup should not be less than 125 percent.

Note that the HAGGLE skill may allow some players to get better prices than those you establish here.

Do not code a percent sign! And never code a value less than 100!

Buyback rate
The percentage of the object's nominal value at which the shop will buy such an item if a player SELLs it to the shop. A general guideline is that the buyback value should not be more than 75 percent.

Note that the HAGGLE skill may allow some players to get better prices than those you establish here.

Do not code a percent sign! And never code a value greater than 100!

First Open hour
Last Open hour
The first and last hour of the Theran day at which the shop is open. The shop will open at the beginning of the first open hour and close after the end of the last open hour. Legal values for both fields are numbers from 0 (midnight) to 23 (the last hour before midnight). For a shop to be open all the time, code 0 and 23.

Do not forget the final 0 (zero) at the end of the #SHOPS section!


If you do not have a #SPECIALS or #MOBPROGS section in your area file, your area file is finished at this point. If so, do not forget the #$ at the end of your file to terminate your area file. The #$ must come on a line by itself and be followed by at least one or more empty lines. Leaving off this file termination or getting it wrong cause the MUD to crash at load time without even issuing an error message!

SHOPS example
(excerpted from the actual area file of midgaard)

#SHOPS
3000  2  3  4 10  0    105  15   0 23    * the wizard
3001  0  0  0  0  0    110 100   0 23    * the baker
3002  1  8 13 15 19    150  40   0 23    * the grocer
3004  9  0  0  0  0    100  50   0 23    * the armorer
0


<< Back to #RESETS Section Forward to #SPECIALS Section >>

  This page was last updated May 15, 2001