Creating Shops and Repair Shops

By

Tank the Life Bringer at Dawn of Demise

(tdod.org 4000)

Shops and Repair shops are specific functions Assigned to Mobs. A mob must be set as a shop or repair shop before it will sell the items in its inventory or repair an item.

There three important commands used in creating or editing existing shops:

MAKESHOP

SHOPSET

SHOPSTAT

Repair shops use:

MAKEREPAIR

REPAIRSET

REPAIRSTAT

 

Shops

MAKESHOP

Syntax: makeshop <mobile vnum>

Creates a new shop and assigns it to an existing mobile (the mobile must exist before it can become a shop or repair shop).

 

SHOPSET

Syntax: shopset <mobile vnum> <field> <value>

Sets field values for the shop or repairshop. (see Shop Field Values below)

 

SHOPSTAT

Syntax: shopstat <mobile vnum>

Shows statistics on a specific mobile's shop. Must use Vnum

Ex. shopstat 21016

Keeper: 21016 Duncan, the Weaponsmith

buy0 [weapon] buy1 [none] buy2 [none] buy3 [none] buy4 [none]

Profit: buy 150% sell 70%

Hours: open 0 close 23

 

SHOPS

Syntax: shops

This command displays statistics on all the shops in the MUD.

Ex. shops

Keeper: 10343 Buy: 120 Sell: 90 Open: 0 Close: 23 Buy: 0 0 0 0 0

Keeper: 10357 Buy: 120 Sell: 90 Open: 0 Close: 23 Buy: 0 0 0 0 0

Keeper: 21001 Buy: 150 Sell: 70 Open: 0 Close: 23 Buy: 3 4 0 0 0

Keeper: 21003 Buy: 150 Sell: 70 Open: 0 Close: 23 Buy: 26 10 0 0 0

**Buy: values are buy0, buy1, buy2, buy3, and buy4 respectively.

(see buy<#> above for values)

Shopset Field Values

BUY<#> (not required)

Syntax: shopset <mobile vnum> buy# <value>

Sets the types of objects the shopkeeper will buy. A shopkeeper can buy up to 5 different types of objects, each buy# will be for each object type the shopkeeper that will buy (buy0, buy1, buy2, buy3 and buy4). This field is only necessary if a mob will buy items from players.

The <value> can be the number or name of items listed below.

 

  1. None

  2. Light

  3. Scroll

  4. Wand

  5. Staff

  6. Weapon

  7. **Fireweapon

  8. Missile

  9. Treasure

  10. Armor

  11. Potion

  12. **Worn

  13. Furniture

  14. Trash

  15. **Oldtrap

  16. Container

  17. Note

  18. Drink_con

  19. Key

  20. Food

  21. Money

  22. Pen

  23. Boat

  24. Corpse_npc

  25. Corpse_pc

  26. Fountain

  27. Pill

  28. Blood

  29. Bloodstain

  30. Scraps

  31. Pipe

  32. Herb_con

  33. Herb

  34. Incense

  35. Fire

  36. Book

  37. Switch

  38. Lever

  39. Pullchain

  40. Button

  41. Dial

  42. **Rune

  43. **Runepouch

  44. **Match

  45. Trap

  46. Map

  47. **Portal

  48. Paper

  49. Tinder

  50. **Lockpick

  51. **Spike

  52. **Disease

  53. **Oil

  54. **Fuel

  55. **Short_bow

  56. **Long_bow

  57. **Crossbow

  58. Projectile

  59. Quiver

  60. **Shovel

  61. Salve

** (Not all are implemented)

Example: shopset 1000 buy0 8

Shopset 1000 buy0 treasure

 

 

BUY (Not Required)

Syntax: shopset <mob> buy <Number>

Percentage of item's cost the shopkeeper will pay for that object. Buy# field must be set to use this field.

The <number> is the percentage. (On DoD shops will buy an item at 50% of its cost, unless Minex or Tank approve any other value)

Ex. shopset 1000 buy 90 [Shop pays 90% of object’s cost to BUY]

 

 

 

 

SELL (Required)

Syntax: shopset <mob> sell <number>

This is the percentage of an object's value that a mob will charge for an object. The <number> is the percentage of the object’s cost the shopkeeper will charge for that object. (On DoD shops will sell objects at 150% of cost, unless Minex or Tank approve any other value)

Ex. shopset 1000 sell 130 [Shop makes 30% profit]

**In order for a shopkeeper to sell objects the shopkeeper MUST have the object in its inventory AND the object must have the field ‘Cost’ set with a value and the object must be visible to the keeper.

Shop keepers can not sell prototype flaged objects**

The levels of the items in a shop will repop randomly based on item type and the recommended, or soft, level of the area:

Item Type | Level Range

Pill |rand(min, max)

Potion |rand(min, max)

Wand |rand(min+4, max+1)

Staff |rand(min+9, max+5)

Armor |rand(min+4, max+1)

Weapon |rand(min+4, max+1)

Scrolls |object’s V0

min = lower bound of Recommended, or soft, level range

max = upper bound of Recommended, or soft, level range (if the max is greater than the min + 15 levels then max will = min+15)

Ex. shop repop levels for an area with a Recommended level range of 20 to 30.

min = 20 and max = 35

Pill 20 to 35

Potion 20 to 35

Wand 24 to 36

Staff 29 to 40

Armor 24 to 36

Weapon 24 to 36

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OPEN (Not Reguired)

Syntax: shopset <mob> open <time>

This is the time of day the shop opens for business. The <time> is in military time.

Ex. shopset 1000 open 8 [Shop opens at 8am]

 

 

CLOSE (Not Required)

Syntax: shopset <mob> open <time>

This is the time of day the shop closes from business. The <time> is in military time.

Ex. shopset 1000 close 21 [Shop closes at 9pm]

 

KEEPER (Not Required)

Syntax: shopset <mob> keeper

Not really sure how or why this is used.

 

Repair Shops

When equipment gets damaged it needs to be repaired, and when wands/staves get used they may be recharged. Repair shops can only repair objects OR recharge wands/staves they can't do both.

 

MAKEREPAIR

Syntax: makerepair <mobvnum>

Automatically gives the mobile the ability to repair damaged equipment.

Use 'repairset' to set the parameters by which the shop will function.

 

REPAIRSET

Syntax : repairset <mobile vnum> <field> <value>

This command allows you to set the field values for a repair shop.

Fields being fix0, fix1, fix2, profit, type, open, close, and keeper

 

REPAIRSTAT

Syntax: repairstat <mobile vnum>

Shows field values for a specific repair shop.

Keeper: 21002 Orun, the Blacksmith

fix0 [weapon] fix1 [armor] fix2 [container]

Profit: 100% Type: 1

Hours: open 0 close 23

 

REPAIRSHOPS

Syntax: repairshops

Displays current field values for all the repair shops in the MUD.

Keeper: 21002 Profit: 100 Type: 1 Open: 0 Close: 23 Fix: 5 9 15

Keeper: 10047 Profit: 150 Type: 1 Open: 0 Close: 23 Fix: 5 9 0

Keeper: 10049 Profit: 125 Type: 1 Open: 1 Close: 23 Fix: 5 9 0

**Fix: values are fix0, fix1, and fix2 respectively.

(see fix<#> below for values)

 

Repairset Field Values

 

 

repairset 1000 open 13 [Mob opens shop at 1pm ]

repairset 1000 close 0 [Mob closes shop at 12am ]

 

FIX<#> (Required)

Syntax: repairset <mobs vnum> fix<#> <object type>

This field sets the types of items the keeper will fix or recharge. A repair shop can fix or recharge up to three different types of objects. (fix0, fix1, and fix2)

See buy<#> above for item types. Again the number or name of the object type can be used.

Ex. repairset 1000 fix1 armor (Mob will repair armor)

Ex. repairset 1000 fix1 9 (Mob will repair armor)

**Not all Items can be repaired. Armor, weapon, drink_con, light, wand, and staff are the ones I know work**

 

PROFIT (Not Required)

Syntax: repairset <mobs vnum> profit <number percent>

This raises or lowers the cost of repairing an object. If not repairset differently, this will default to 100%

Ex. repairset 1000 profit 125 [Mob charges 25% more than default]

The cost of repairing an item is based upon 10% of the cost of the object being repaired multiplied by the <number percent>.

Example:

V = ‘Cost’ field value of object to be repaired

P = ‘Profit’ field value of repair shop

Cost of Repair = (V * 10%)*P%

 

TYPE (Required for recharge)

Syntax: repairset 1000 type <type>

This sets which type of repair shop we are making. Valid type is being either 1 for repair or 2 for recharge.

Default is type 1.

Ex. repairset 1000 type 1 [Mob performs repairs]

 

 

OPEN (Not Required)

Syntax: repairset <mob> open <time>

This is the time of day the shop opens for business. The <time> is in military time.

Ex. repairset 1000 open 8 [Shop opens at 8am]

 

 

CLOSE (Not Required)

Syntax: repairset <mob> open <time>

This is the time of day the shop closes from business. The <time> is in military time.

Ex. repairset 1000 close 21 [Shop closes at 9pm]

 

KEEPER

Syntax: repairset <mob> keeper

Not really sure how or why this is used.

 

Understanding the Text File (<area>.are)

#SHOPS

(This section is still under development)

All of the data in an area file (even the section headers) consists of series of values. Each value has a specific type. The server parses the file by reading in data values one at a time according to the types it expects.

Blank characters (spaces, tabs, new lines, and carriage returns) at the beginning of a data value are always ignored (this includes strings). Thus, you can format the area files whatever way suits your taste and your needs.

The individual types are 'letter', 'word', 'string', 'number', and 'to_eol'.

A 'letter' is a single non-blank character.

A 'word' is a sequence of non-blank characters terminated by a blank.

A 'string' is a seqence of non-tilde characters terminated by a tilde. A tilde is this character: '~'. Thus, strings may contain blanks, and may be multiple lines long. There is no limit on the length of an individual string; however, all strings go into a common memory pool whose size is fixed when the server is compiled.

A 'number' is a decimal number with an optional leading '-' or '+'. The '|' character may be used in any number: '1|64|1048576' has the value 1048641. The individual values separated by '|' are added together, so '5|6' is 11, not 7.

The components need not be powers of 2. This feature is extremely useful for defining bit vectors, such as the ACT_* and AFF_* bits for mobiles, but is not restricted to bit vectors: any number may use the '|' construction.

A 'to_eol' is all the characters from the current position to the end of the current input line. It is used for parsing comments at the ends of lines.

In the syntax description below, <value:type> indicates a value to be read of the indicated type. A backslash '\' indicates that the file format itself has only one line, but several lines are used in this description to fit within 80 columns.

Braces '{ }' are used to enclose elements. They are NOT literal parts of the file format, but a way of indicating that the enclosed elements may be repeated zero or more times. Braces at the same level of indentation indicate that the parallel elements may be present in any order.

All other characters in the syntax description are literal characters.

Mobiles, objects, and rooms are identified by vnum (virtual number). Vnum's must be unique (for that particular kind of vnum). Vnums do not have to be in increasing order.

Typically an area uses the same range of vnum's for mobile vnum's, object vnum's, and room vnum's, starting with a multiple of 100. This facilitates adding the area into an existing set of areas.

#SHOPS

{

<keeper:number> \

<trade-0:number> <trade-1:number> <trade-2:number> \

<trade-3:number> <trade-4:number> \

<profit-buy:number> <profit-sell:number> \

<open-hour:number> <close-hour:number> \

<comment:to_eol>

}

0

Like the #RESETS section, the #SHOPS section has one command per line.

The 'keeper' is the vnum of the mobile who is the shopkeeper. All mobiles with that vnum will be shopkeepers.

The 'trade-0' through 'trade-5' numbers are item types which the shopkeeper will buy. Unused slots should have a '0' in them. For instance, a shopkeeper who doesn't buy anything would have five zeroes.

The 'profit-buy' number is a markup for players buying the item, in percentage points. 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 100, and the selling markdown should be at most 100.

The 'open-hour' and 'close-hour' numbers define the hours when the shopkeeper will do business. For a 24-hour shop, these numbers would be 0 and 23.

Everything beyond 'close-hour' to the end of the line is taken to be a comment.

Note that there is no room number for a shop. Just load the shopkeeper mobile into the room of your choice, and make it a sentinel. Or, for a roving shopkeeper, just make it non-sentinel.

The objects a shopkeeper sells are exactly 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 he, she, or it doesn't already have an identical object. These items do not replenish.

 

 

CREDITS

I really thank Herne the Hunter for the original help files that I used to create my own help.

Thanks to Kelson – Implementor at Mysts of Time MUD (nitrogen.hypergate.org 4000) for the repair shop profit information, and shop inventory repop level clarification.

Thanks to Shogar ( moodyg@erols.com )at Dragon Bane (moodyg.erols.com 4000), For the link to Kelson.

And Tank, the original author of this document.Tank, the original author of this document.

All samples and tips have been provided by myself, and other members of the mudding community. If you have any samples or tips you would like to contribute, please send them to minex@tdod.org .

If you would like credit please state the name you want credited, a link to a webpage , email, a mud where you build, and/or its telnet address. You may use any combination you desire. Samples and tips without this information will be listed as anonymous.