Shop Overview

The File

The .shp file contains all the information necessary to make a working shop in a mud. It seems to be the most difficult type of file.

Below you will find first an archetype with comments, an example, explanations, a "clean" archetype, and finally comments, tips, and suggestions.

#vnum~ any number appears to work
<item sold vnum 1> Be sure to GIVE one of each of the items to the shopkeeper in the zone file.
Items not given but listed will only be sold after the shopkeeper has it in his possession, while given but not listed will only be sold once.
<item sold vnum 2>
<item sold vnum 3>
<item sold vnum 4>
<item sold vnum n> Max of about 10 different items to stock
-1 Note: -1 tells mud code "End of list"
<multiple for selling items> This is the "mark up".  If the value of an item is 10 and the markup is 1.2, the item will sell for 12 coins.
<multiple for buying items> This is the discount.  If the value of an item is 10 and the discount is .8, the shopkeeper will pay a player 8 coins for the item.
<item type bought 1> Note: the "type" refers to the object type as in the .obj file weapons are 5 potions are 10
<item type bought 2>
<item type bought 3>
<item type bought 4>
<item type bought n>
-1 (End of list)
%s<message 1>~ Out of stock
%s<message 2>~ Player trying to sell item he doesn't have
%s<message 3>~ Shopkeeper doesn't buy item type
%s<message 4>~ Shopkeeper out of cash
%s<message 5>~ Player not enough gold
%s<message 6>~ Sells player something
%s<message 7>~ Buys from player
<temper 1> Player can't afford (1=calm 0=fight)
<temper 2> Player attacks shopkeeper
<shopkeeper vnum>
0 Always a 0 (zero)
<room vnum> Your mob will only sell in this room.
<open 1>                            
<close 1>
<open 2>                      
<close 2>                          .
#99999 These two lines go at the end of the entire file.

    

$~

                             

Here's the example from the original docs:

---example follows this line---
#2000~
2000
2001
2002
-1
1.2
0.8
5
9
-1
%s I don't have any of those!~
%s Are you sure you have one?~
%s Sorry--I don't buy those!~
%s I can't afford that... sorry.~
%s You can't quite afford that yet... sorry.~
%s That will be %d coins.~
%s Here's %d coins for that.~
1
0
2000
0
2000
8
12
13
17
---example precedes this line---

The explanation:
************************** SHOP VNUM ********************************
#2000~

The vnum of the shop. This number is not used by the mud for any
purpose, however.
   
************************** ITEMS FOR SALE VNUMS *********************
2000
...
-1

These are the vnums of the particular items the shop sells. A -1 tells the mud to stop reading this part of the file. Vnums are of course from your .obj file. The shopkeeper can only stock 10 items from start


***************** SELLING PRICE VS. BUYING PRICE MULTIPLIER **********

1.2
0.8

The first number is the multiple of the markup in price for selling, the second the multiple for buying from the players. With the above values, if you defined an object as being worth 100, the player will be able to sell it to a willing shopkeeper for 80, and the next player can buy it for 120.

*********************** ITEMS BOUGHT *********************************
5
9
-1

These are the item types the shop buys. (See list of object types.) This example shop buys weapons and armor). A -1 tells the mud to stop reading this part of the file. The shop doesn't have to buy anything. The -1 is required even in this case to tell the mud this value has been read.



********************** SHOPKEEPER'S MESSAGES TO PLAYER ************

%s I don't have any of those!~
%s Are you sure you have one?~
%s Sorry--I don't buy those!~
%s I can't afford that... sorry.~
%s You can't quite afford that yet... sorry.~
%s That will be %d coins.~
%s Here's %d coins for that.~


These are all the messages the shopkeeper will say in particular situations. There are seven different slots for messages. They range as follows (in order):

What the shopkeeper says when...

1)... he doesn't have that object to sell.
2)... the player doesn't have that object to sell.
3)... he doesn't buy that type of item.
4)... he doesn't have enough money to buy an object.
5)... the player doesn't have enough money to buy an object.
6)... he sells an object.
7)... he buys an object.

%s should precede the message (for say), and %d may also be used for the price of an object. Note each message ends with a tilde (~).

*********************** Tempers ******************************

1
0

A shop keeper's temper is controlled by two fields, the first for when the player can't afford the item, the second for when a player is attempting to kill the shopkeeper.

Temper 1:
Value [0] The shopkeeper spits at the player
Value [1] The shopkeeper smokes a joint.

Temper 2:
Value [0] The shopkeeper warns the player, and attacks!
Value [1] The shopkeeper insults the player, and no combat takes
place.


*********************** Shopkeeper ******************************

2200

The vnum of the shopkeeper. You CANNOT use the same shopkeeper VNUM in two different shops ... But you CAN duplicate the mob in the mob file and give the second one a different VNUM, so that to the player, it will seem like the same shopkeeper. You can also have more than one instance of a particular mob, and only one of them will be the shopkeeper. For example, in the Elysium Faire zone, there are two "Ribbon Sellers" near the entrance to the Faire, but only one of them actually sells ribbons. Both may be killed.

Shopkeepers don't have to be stationary (SENTINEL), however they will ONLY sell their items when they are in the room identified as their shop. Otherwise, the shop is closed!
   
*********************** ZERO *************************************   

0

This field is unused at present. Merely place a zero here.

**************************** SHOP Location*******************************

2200

The vnum of the room the shop will be.
You can not have two shops in the same room.

**************************** SHOP HOURS OF OPERATION *************

8
12
13
17

The hours fields are fairly simple. The first two are the opening and closing hours of the shop, in 24 hour time. The third and fourth are ALSO the opening and closing times of the shop. Thus, a shop can open and close more than once each day, as in our example:

8
12
13
17

(the example shop opens at 8 am, closes at noon -- lunch? -- reopens at 1 pm, and closes at 5 pm).



***************** TIPS and OBSERVATIONS****************

* Any stationary mob can be a shopkeeper... this can advance the plot of a particular area no end if used cleverly. The shopkeeper doesn't have to be indoors, in a "shop".
* Shopkeepers don't have to buy anything. Or sell anything...
* If you make shopkeepers very hard to kill, please don't make them aggressive or scavengers.

WB00711_.gif (889 bytes)

If it doesn't work check the following:

Does every message begin with %s and end with ~
The shopkeeper VNUM (from the mob file) comes first, then the shop
location VNUM (from the wld file)
Did you give each shopkeeper one each of each of their items that
they sell?
Is the shopkeeper's vn unique? (for example, you can have two
beer-sellers, but each must have his own number)
Shops can handle a max of about 10 items in regular stock (i.e. in
the .shp file) although they can handle a lot more if players sell them
or give them to them to sell.