shop.doc
1 /* ************************************************************************ 2 * Copyright (C) 1990, 1991 - see 'license.doc' for complete information. * 3 ************************************************************************* */ 4 5 6 NEW FORMAT: 7 CircleMUD v3.0 now has a new shop file format. Since the old format 8 is still compatible, I've kept the old documetation at the end of 9 this file. If you'd like to convert shop files in the old format to that 10 of the new format, compile and run the utility shopconv. When writing new 11 files, you need to tell CircleMUD that the shopfile is in the new format 12 by including the following line BEFORE any shops in the file: 13 14 CircleMUD v3.0 Shop File~ 15 16 The rest of the file is formatted as follows: 17 18 #<num>~ 19 Shop Number (Used only for display purposes) 20 21 22 <num 1> 23 <num 2> 24 <num 3> 25 . 26 . 27 . 28 <num n> 29 -1 30 These numbers refer to the objects the shop produces. The numbers are 31 virtual numbers. The list MUST end with a -1. 32 33 <Profit when selling> 34 The object value is multiplied by this value when sold. This is a 35 floating point value. Must be >= 1.0 36 37 <Profit when buying> 38 The object value is multiplied by this value when bought. This is a 39 floating point value. Must be <= 1.0 40 41 <type 1> [namelist 1] 42 <type 2> [namelist 2] 43 <type 3> [namelist 3] 44 . 45 . 46 . 47 <type n> [namelist n] 48 -1 49 These lines contain the types of items that the shop will buy. The first 50 argument, called "type" is the type of item (see dbsup.doc). Numerical, 51 or english forms are valid (5 or WEAPON, 9 or ARMOR, etc) In addition, 52 you can provide optional keywords to give specific keywords that must 53 be present on the item. For further details on these expressions, see the 54 notes following the new file format. This list must be terminated by a -1. 55 56 <Message When Item to buy is non existing>~ 57 <Message When item trying to sell is non existing>~ 58 <Message When shop does not buy offered item>~ 59 <Message when shop can't afford item>~ 60 <Message when player can't afford item>~ 61 <Message when buying an item>~ 62 Price is %d 63 <Message when selling an item>~ 64 Price is %d 65 66 <Temper> 67 When player can't afford an item, the shopkeeper tells them they 68 can't afford the item and then: 69 0 - The shopkeeper pukes on the player. 70 1 - The shopkeeper smokes his joint. 71 other - No action besides message above. 72 73 <Bitvector> 74 Allows you to set certain values for the shop. 75 WILL_START_FIGHT 1 /* Players can attack shopkeeper */ 76 WILL_BANK_MONEY 2 /* Shopkeeper puts money > 15000 77 into the bank */ 78 79 A brief note: Shopkeepers should be hard (if even possible) to kill. 80 The benefits players can receive from killing them is enough to unbalance 81 most non monty-haul campaigns. 82 83 <Shop Keeper Mobile Number> 84 Virtual number of the shopkeeper. 85 86 <With Who> 87 Designate certain alignments or classes that the shop will not 88 trade with. To determine this value, choose all elements on 89 the list below that you do not want sold to, and add their values. 90 91 TRADE_NOGOOD 1 92 TRADE_NOEVIL 2 93 TRADE_NONEUTRAL 4 94 TRADE_NOMAGIC_USER 8 95 TRADE_NOCLERIC 16 96 TRADE_NOTHIEF 32 97 TRADE_NOWARRIOR 64 98 99 <Room 1> 100 <Room 2> 101 <Room 3> 102 . 103 . 104 . 105 <Room n> 106 -1 107 The virtual numbers the mobile must be in for the shop to be effective. 108 (So trans'ed shopkeepers can't sell in the desert). The list must be 109 terminated by a -1. 110 111 <Time when open start 1> 112 <Time when open end 1> 113 The hours between which the shop is open. 114 115 <Time when open start 2> 116 <Time when open end 2> 117 The hours between which the shop is open. 118 119 120 ITEM NAME LISTS: 121 122 Name lists are formed by boolean expressions. The following operators 123 are available: 124 125 ',^ = Not *, & = And +, | = Or 126 127 The precedence is Parenthesis, Not, And, Or. For example, the following line: 128 129 WEAPON [sword & long|short | warhammer | ^golden & bow] & magic 130 131 This shop will buy the following items of type WEAPON: 132 1) sword long magic 133 2) short magic (the first & is done before the first | ) 134 3) warhammer magic 135 4) ^golden bow magic 136 137 Note that the ^ in front of golden affects ONLY golden, and nothing else 138 in the listing. Basically, the above expression could be written in 139 english as: 140 141 [(sword and long) or short or warhammer or (not golden and bow)] and magic 142 143 If I wanted the shop to only buy "short magic" only if they were also swords, 144 I would have to change the expression to: 145 146 WEAPON [sword & (long|short) | warhammer | ^golden & bow] & magic 147 ^-Changes--^ 148 149 You can also include object extra flags (listed in dbsup.doc). The previous 150 example used "magic" as a keyword that had to be on the object. If we wanted 151 to make it so that the MAGIC flag had to be set on the item, we would change 152 "magic" to "MAGIC." Similar changes could be made to add other flags such as 153 "HUM" or "GLOW." It should be noted that these expressions are case sensitive 154 and that all keywords should appear in lower-case, while the flag names should 155 be in all caps. 156 157 158 OLD FORMAT: 159 Default DIKU shop files have the following format: 160 161 #<xx>~ 162 Shop Number (Used only for display purposes) 163 164 <num1> 165 <num2> 166 <num3> 167 <num4> 168 <num5> 169 These numbers refer to the objects the shop produces. 170 The numbers are virtual numbers. 171 172 <Profit when selling> 173 The object value is multiplied by this value when sold. This is a 174 floating point value. Must be >= 1.0 175 176 <Profit when buying> 177 The object value is multiplied by this value when bought. This is a 178 floating point value. Must be <= 1.0 179 180 <num1> 181 <num2> 182 <num3> 183 <num4> 184 <num5> 185 These five numbers are the item-types traded with by the shop. 186 See dbsup.doc. 187 188 <Message When Item to buy is non existing>~ 189 <Message When item trying to sell is non existing>~ 190 <Message When wrong item-type sold>~ 191 <Message when shop can't afford item>~ 192 <Message when player can't afford item>~ 193 <Message when buying an item>~ 194 Price is %d 195 <Message when selling an item>~ 196 Price is %d 197 198 <Temper> 199 When player can't afford an item, the shopkeeper tells them they 200 can't afford the item and then: 201 0 - The shopkeeper pukes on the player. 202 1 - The shopkeeper smokes his joint. 203 other - No action besides message above. 204 205 <Bitvector> 206 Allows you to set certain values for the shop: 207 WILL_START_FIGHT 1 /* Players can attack shopkeeper */ 208 WILL_BANK_MONEY 2 /* Shopkeeper puts money > 15000 209 into the bank */ 210 211 A brief note: Shopkeepers should be hard (if even possible) to kill. 212 The benefits players can receive from killing them is enough to unbalance 213 most non monty-haul campaigns. 214 215 <Shop Keeper Mobile Number> 216 Virtual number of the shopkeeper. 217 218 <With Who> 219 Designate certain alignments or classes that the shop will not 220 trade with. To determine this value, choose all elements on 221 the list below that you do not want sold to, and add their values. 222 223 TRADE_NOGOOD 1 224 TRADE_NOEVIL 2 225 TRADE_NONEUTRAL 4 226 TRADE_NOMAGIC_USER 8 227 TRADE_NOCLERIC 16 228 TRADE_NOTHIEF 32 229 TRADE_NOWARRIOR 64 230 231 232 <Shop Room Number> 233 The virtual number the mobile must be in for the shop to be effective. 234 (So trans'ed shopkeepers can't sell in the desert). 235 236 <Time when open start 1> 237 <Time when open end 1> 238 The hours between which the shop is open. 239 240 <Time when open start 2> 241 <Time when open end 2> 242 The hours between which the shop is open. 243