Currency Area File Changes

This is the place to discuss building questions, ideas, and suggestions.
Post Reply
User avatar
Everybody
Needs Help
Posts: 542
Joined: Wed Jan 08, 2003 2:14 am
Location: Madison, WI
Contact:

Currency Area File Changes

Post by Everybody »

The currency file changes consist of three parts, all of which can be safely left out of any area file without detriment. These are: describing a new currency, telling a shopkeeper to use an alternate currency or rate, and telling type money objects to be in a different currency.

First, describing a new currency:
This is the longest, as it acts just like any other section in an area file (ROOMS, OBJECTS, MOBILES, AREA, etc.).

To begin the section:
#CURRENCY

Then, each entry as follows:
Line A: #<vnum>
As with ROOMS, etc., this tells the mud the id number of the currency. Start with the first one you've been assigned (which will match the first room, first object, first mob...), and continue by adding one for each further.

Line B: <name>~
This tells the mud what keywords can be used to reference this currency. You can have more than one word, as with the other name lists. Because of how we had to code split to work, you SHOULD include the vnum again as the final keyword in that list. If you don't, we will add it for you during proofing. Make sure to include keywords for both singular and plural versions of your currency. Don't forget the tilde at the end of the line.

Line C: <description>~
This is the description that's used to display this currency anytime only one of them is being referenced. You should not include any articles with it (i.e. "a", "an", "the", etc.). Again, don't forget the tilde at the end.

Line D: <plural description>~
This is how the currency is shown anytime more than one is being referenced. As above, do not include articles, and don't forget the tilde at the end.

Line E: <exchange rate>
This is a single integer on a line all by itself, representing what the global exchange rate between this currency and gold is. In other words, how many gold coins each one item is worth in this currency.

At this point, you can start the next currency item by repeating line A, or you can close the section with #0.

All together, it looks like this (using sample data):
#CURRENCY
#101
small blued chit chits iron 101~
small chit of blued iron~
small chits of blued iron~
45
#102
etc. etc.
#0

Second, telling shopkeepers to use the new currency fields:
This is an addition in the #SHOPS portion of the area file. The existing lines look like:
<mnum> <type0> <type1> <type2> <type3> <type4> <%sells> <%buys> <open> <close>
If you want your shopkeeper to accept any currency other than gold, immediately following this existing line add:
C <currency vnum> <rate>
Where currency vnum is the id number of the currency you want that shopkeeper to take, and rate is the percentage of the global rate at which the keeper takes that particular currency.

If you want them to take more than one currency, simply repeat the C <vnum> <rate> up to 5 times (total) on that same line. Note that shops will not automatically take gold once you tell them to take at least one currency. Moneychangers are a special case of shopkeeper - they have item type MONEY (type 20) used as one of the item types they sell.

This looks like (again using sample data):
101 5 0 0 0 0 100 80 0 23
102 20 0 0 0 0 120 50 0 23
C 1 100 C 3 50 C 4 300 C 7 75 C 25 1
103 2 0 0 0 0 100 100 0 23
C 2 35

This means that mob 101 sells weapons at 100% cost, buys at 80% cost, is open from 0 to 23, and only deals in gold (at 100% global rate).
Mob 102 is a money changer (buys/sells money) selling money items at 120%, buying at 50%, open from 0 to 23, and deals in currency #1 at 100%, #3 at 50%, #4 at 300%, #7 at 75% and #25 at 1%. Buy and sell % rates do not affect currency exchange, only actually buying or selling type money objects.
Mob 103 sells and buys scrolls at 100%, is open from 0 to 23, and only deals in currency #2, which it values at 35% of the global rate.

Third, to define a type money object as being a different currency:
Item type money's values have changed to be:
0 0 0 <currency vnum>

Where that vnum matches a defined currency in game. If it fails to match, it will default to gold. If it is found, the game will automatically adjust the amount of money provided based on the object's cost and the global exchange rate for that currency.

Sorry about how long this is, but I figured it would be good to have it noted.
-EB
Your local know-it-all. ;)
Post Reply