You may create your own money by simply inheriting or cloning the
object "/std/coins.c". This object can then be modified to give the
description you would like. If you have a room or an object that
handles money, like a shop for instance, and you would like to handle
mixed denominations you should include the file "/sys/money.h". This
file contains routines for converting CP to a set of mixed
denominations and vice versa.

Copper Coin (cc)
================

This is the smallest denomination available and equals about one krona
in value ($1 = ca 6 kr for conversion purposes). All values stored in
objects are given in cc. The cc weighs 18 grams and is 2 cm^3 in
volume.

Silver Coin (sc)
================

An sc is worth 12 cc. The sc weighs 21 grams and is 2 cm^3 in volume.

Gold Coin (gc)
==============

A gc is worth 12 sc. The gc weighs 19 grams and is 1 cm^3 in volume.

Platinum Coin (pc)
==================

A pc is worth 12 gc. The pc weighs 21 grams and is 1 cm^3 in volume.


General management of coins (heap objects)
------------------------------------------

Coins are an example of 'heaps'. This is a special form of object that
represents a countable amount of separate objects. It means that no matter
how many identical coins you have you still carry only one object.

You have one object for each type of coins. That is if you have: 4 gc, 13sc
and 123 cc, you carry three objects, one for each type of coins.

The lfun move() is adapted to handle heaps. This means that move() sees to
it that heaps are joined appropriately.

When a part of a heap is to be moved a special lfun is first called in the
heap object: 
	
	heap_ob->split_heap(int amount)
	heap_ob->move(new_dest);

This moves 'amount' pieces of the heap to the new destination.

To create a new heap of a certain size you do:

	heap_ob = clone_object(heap_file);  /* could be /std/coins */
	heap_ob->set_heap_size(100);
	heap_ob->move(new_dest);

This creates a new heap of size 100 and moves it to some destination.

In /std/coins.c there is a function for setting the type called: set_coin_type

To simplify this for coins there is four macros in /sys/money.h that
returns an object which is the right type and amount of coins.

MONEY_MAKE_CC(num)      /* Returns a heap object of 'num' copper coins */
MONEY_MAKE_SC(num)      /* Returns a heap object of 'num' silver coins */
MONEY_MAKE_GC(num)      /* Returns a heap object of 'num' gold coins */
MONEY_MAKE_PC(num)      /* Returns a heap object of 'num' platinum coins */

There are a number of other useful routines in /sys/global/money.c which
are documented there and can be used either through macros in /sys/money.h
or as direct calls using the filename, ie MONEY_FN->func_call(params);

Among others are routines for moving coins in a simple fashion.

Money in NPC's and containers
-----------------------------

To add money to NPC's, simply use the OBJ_M_HAS_MONEY property (see there).
This will save memory, and clone the money only when it is actually needed.

If you use OBJ_M_HAS_MONEY to add money to a treasury chest or so, then you
may need to use the macro EXPAND_MONEY() to create the actual coins when a
person opens the chest, for example.
