The .shp File

The .shp file contains all the myriad information necessary to make a working shop in a mud. Here is an example of a shop from the .shp file, followed by a line-by-line explanation.


#2200~
2000
2001
2002
0
0

1.2
0.8

5
9
0
0
0

%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


The explanation:

#2200~
The name of the shop. This field is not used by the mud for any purpose, and thus can be words or numbers.
2200
2001
2002
0
0
These are the vnums of the particular items the shop sells. Note the 0's for unused fields.
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.
5
9
0
0
0
These are the Item Types the shop buys. This example shop buys weapons and armour. Note the 0's for unused fields.
%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. These are better explained in the Shop Messages below.
1
0
These are the shopkeeper's tempers. See Tempers and Hours below.
2200
The vnum of the shopkeeper.
0
This field is unused at present. Merely place a zero here.
2200
The vnum of the room the shop will be.
8
12
13
17
The hours the shop is open. Please consult Tempers and Hours below.

Shop Messages

The shop messages section has 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.

The variable %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 And Hours

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.

Note the following messages are those included in the Dikudocs, and may not be the same from mud to mud.

Temper 1:
0 -- The shopkeeper spits at the player
1 -- The shopkeeper smokes a joint.
Temper 2:
0 -- The shopkeeper warns the player, and attacks!
1 -- The shopkeeper insults the player, and no combat takes place.

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 8am, closes at noon -- lunch? -- reopens at 1pm, and closes at 5pm.


Shop Archetype

#vnum~
<item sold vnum 1>
<item sold vnum 2>
<item sold vnum 3>
<item sold vnum 4>
<item sold vnum 5>
<multiple for selling items>
<multiple for buying items>
<item type bought 1>
<item type bought 2>
<item type bought 3>
<item type bought 4>
<item type bought 5>
<message 1>
<message 2>
<message 3>
<message 4>
<message 5>
<message 6>
<message 7>
<temper 1>
<temper 2>
<shopkeeper vnum>
0
<room vnum>
<open 1>
<close 1>
<open 2>
<close 2>

Tips And Observations


[Next] On to the next section
[Back] Back to the previous section
Back to the Builders' Handbook contents

[C.A.W.] Back to the C.A.W. Homepage

Alex Fletcher
Last modified: June 24th, 1996