Valarin
Builder's Tutorial: Building Shops

8. Building Shops

8 . A

Shop Commands

All of these commands may not be available depending on the level of the builder.
sedit <shop vnum>
Bring up the sedit screen for the shop that you've specified by its vnum.
sedit list
List all the shops in the zone you are currently building.
sedit list <zone num>
List all the shops in the given zone.
sedit list <start vnum> <end vnum>
List all the shops between the start and end vnums given.
sedit save
Saves all shop changes in your zone to the mud database.
sedit save <zone num>
Saves all shop changes in the zone number specified.
show shops
Shows all the shops in the game, with some information (prices, who they tade with) for each one.
8 . B

Sample Sedit Screen

-- Shop Number : [200]
0) Keeper      : [202] Bobby Boucher
1) Open 1      :    0          2) Close 1     :   28
3) Open 2      :    0          4) Close 2     :    0
5) Sell rate   : 1.00          6) Buy rate    : 1.00
7) Keeper no item : %s Sorry, I only stock the purest water.
8) Player no item : %s You don't seem to have any pure water.
9) Keeper no cash : %s I won't pay that much for something that impure.
A) Player no cash : %s You'll need more than you have for pure H20.
B) Keeper no buy  : %s Your water isn't pure enough.
C) Buy sucess     : %s That'll be %d coins, thanks.
D) Sell sucess    : %s I'll give you %d coins for that.
E) No Trade With  : NOBITS 
F) Shop flags     : NOBITS 
R) Rooms Menu
P) Products Menu
T) Accept Types Menu
Q) Quit
8 . C

Building your First Shop

sedit is the command to edit shops. Shops are places in the MUD where players can buy or sell goods. You are allowed to edit shops XX00 through XX99, though you will probably never need that many.

As a general rule, try to match the virual number of the shop to the virtual number of the room that you'll be putting the shop in, just to make your life a little easier.

Editing shops is more complicated than any other type of editing that you'll have to do, but it isn't too bad. Unfortunately we cannot build a shop without attaching it somewhere, so the best time to look at this part of the tutorial is when you actually need to build a shop.

When you need a shop for a room, type in sedit XXYY where YY is the number of the room you are going to place the shop in.

First off, your shop needs a keeper, a mob dedicated to being the shopkeeper. It is a good idea to create this mob beforehand, though you can leave the keeper field blank for the time being and fill it in later when you create the shopkeeper. Shopkeepers should always be anti-charm, by the way. Give your shop a keeper when you have one ready.
NOTE: shopkeepers must be loaded into the room with the shop using zedit commands. sedit doesn't load shopkeepers for you.

Next up are the two open and close fields. These let you set when the shop opens and when it closes. If the shop only has one open and close time use only the first two fields. If the shop has two (ie the shop closes for lunch and reopens in the afternoon) then use all four fields to set up the time. Shops that are open all the time should have the values 0 and 28 in their open and close fields, respectively.

The sell rate and the buy rate are the multipliers for the prices of the object (set in the oedit screen) when the shopkeeper sells and buys goods. The sell rate should generally be >=1.00 and the buy rate should be <=1.00 so the shopkeeper sells things at greater than their value and buys things at less than their value.

Next up are the seven messages the shopkeeper can use in various situations. These are fairly straightforward. Eash message should be preceeded by a %s. The buy and sell success lines can also use %d to represent the price, in coins of the object being bought from or sold to the shopkeeper.

Then we have the no trade with flags. These tell who the shopkeeper will or will not trade with. Your choices are:

 1) Good                    2) Evil                   
 3) Neutral                 4) Magic User             
 5) Cleric                  6) Thief                  
 7) Warrior                 8) Hunter                 
 9) Shaman                 10) Human                  
11) Elf                    12) Dwarf                  
13) Gnome                  14) Half-Elf               
15) Halfling               16) Wolfen
17) Drow
You can add people the shop won't trade as with other flags (the can be more than one type of charater the shop won't trade with). Remove unwanted flags by typing in the number again.

Now we have the shop flags. There are two of these:

WILL_FIGHT    Players can to try to kill shopkeeper.
USES_BANK     Shopkeeper will put money over 15000 coins in the bank.
Feel free to add or remove these items. Note that shopkeepers should be difficult, if not nearly impossible to kill.

Now we come to the rooms menu. This is a listing of all the rooms that a shop will operate in. In other words, if a shopkeeper is not in one of these rooms players will not be able to buy from him/her. You can have as many rooms as you want, but generally one room per shop, with the same virtual numbers, is the norm. The rooms menu looks like this:

##     VNUM     Room

 0 - [  205] - H2O 4 U

A) Add a new room.
D) Delete a room.
C) Compact Display.
Q) Quit
The options are pretty straightforward and will not be discussed here.

Next we have the Products menu, here you can add, by using the virtual numbers of the objects, the objects that this shop will sell. Add as many objects as you want. The Products menu looks like this:

##     VNUM     Product
 0 - [ 2400] - Brokken's Loincloth

A) Add a new product.
D) Delete a product.
Q) Quit

Finally, to end off you shops, you have to edit the items that the shop will purchase. The Accept types menu looks like this:

##              Type   Namelist


A) Add a new entry.
D) Delete an entry.
Q) Quit
Adding new entries to this menu can be quite tricky. Here is a quick runthrough of what you need to add the entries properly. First off, for each entry, you have to specify the type of item you're accepting, be it a weapon, armor, whatever. That's the easy part, now you need to list the names that you will accept of that type of item (ie golden, magical pearl, etc).

The following is what the CircleMUD builder's manual has to say about namelists for the accept types menu:

Name lists are formed by boolean expressions. The following operators are 
available:

                ',^ = Not      *, & = And     +, | = Or

The precedence is Parenthesis, Not, And, Or. Take the following line for an 
example:

[sword & long|short | warhammer | ^golden & bow] & magic

This shop will buy the following items of type WEAPON: 

    1.sword long magic 
    2.short magic (the first & is done before the first | ) 
    3.warhammer magic 
    4.^golden bow magic 

Note that the ^ in front of golden affects ONLY golden, and nothing else 
in the listing. Basically, the above expression could be written in English as:

[(sword and long) or short or warhammer or (not golden and bow)] and magic

If you want the shop to only buy ``short magic'' only if they were also swords,
you could change the expression to:

[sword & (long|short) | warhammer | ^golden & bow] & magic
         ^-Changes--^ 

You can also include object extra flags). The previous example used ``magic'' 
as a keyword that had to be on the object. If we wanted to make it so that the
MAGIC flag had to be set on the item, we would change ``magic'' to ``MAGIC.'' 
Similar changes could be made to add other flags such as ``HUM'' or ``GLOW.'' 
It should be noted that these expressions are case sensitive and that all 
keywords should appear in lower-case, while the flag names should be in all 
caps.
This is quite a bit different from the namelists used in other parts of olc.
NOTE: Namelists are optional. If you want your store to buy all weapons, set the type bought to WEAPON and leave the namelist empty.

And that's it for editing shops, not too hard, really, just a bit of work required to get everything the way you want it.

8 . D

Getting A Shop to Work

There are a couple of things you have to do in order to get a shop to actually sell the items that you've listed in the products menu.

First of all, the shopkeeper you've indicated in sedit must be loaded into the rooms where the shop operates, the shop will not work without a shopkeeper. Shopkeepers, by the way, should be sentinel, you want them to stay in the room(s) you've designated as shops.

Next up, the shopkeeper must have one of every item in the products list in his inventory. If the shopekeeper doesn't have an item in his inventory, he won't sell it. This means loading all the items your shop will sell using zedit, right after you've loaded the shopkeeper. The shopkeeper will sell unlimited numbers of any item in the shop's product list. But he will only sell as many items as he has of any item he posesses that isn't in the product list for the shop.

Finally, the items being sold must have a cost set for them. There is no selling free items.

Once these things are done, you should have a fully functioning shop.

Previous Chapter | Table of Contents | Next Chapter
Builder's Information | Home