*** Objects ***

All users , items and npcs in Ogham are all objects. They all use the same
structure type but with differing data values. The structure is defined in
globals.h and is called obj_struct. The objects are all contained in a linked
list of these dynamically allocated structures and only the start and end
pointers of this list are defined - *obj_first and *obj_last. To find anything
else in the list you have to go through it sequentially. 
	All objects except for user types have a control function which is called
every heartbeat and at other times to allow the object to interact with the 
rest of the mud. The functions are divided into seperate parts which are
called at specific times based upon an interger value passed to the function.
A switch statement normally makes the selection...

case 0 - Set up any required object elements. Called from construct().
case 1 - Print examine description. Called from examine().
case 2 - Attempt to execute user command. Called from exec_room_obj_com().
case 3 - Do objects own stuff. Called from object_events().
case 4 - Called from kill_object() when npc dies. Allows the npc to do things
         just before its inactivated. This is different to case 5 below in 
         that its purely a game feature rather than an internal server
         necessity and is only for NPC's.
case 5 - Called before object is destructed. Basically I put this in to allow
         the object to free any malloc'ed memory else this memory may become
         orphaned. Called from destruct().

Look at the code examples to get a better idea of how they work.

As far as the object structure is concerned there are a lot of elements so
I'm not going to describe what all of them do but I'll make a note of the 
important and less obvious ones ones.

char *art - Definite or indefinite article to proceed name 
    eg a, an, the .. etc

char *name, *desc - Name and description of object.

int type - Either USER, NPC or ITEM (see defs.h). Self explanatory.

int inactive - If this is > 0 then the object is no longer active and is
    awaiting deletion. This system is used so that objects are not 
    destructed immediately in case another part of the software is
    referencing their structure address in which case a wild pointer would 
    result with the usual consequences. This gives other elements a chance to 
    check this flag and alter their pointers as appropriate. The flag counts
    down from 2 so there is a 2 heartbeats grace before the memeory is freed.

int id - Object id. Unique to each object and once object is destroyed it is
    not reused. Admittedly the id_count variable which is used to get an id
    number will eventually wrap round but 2^32 is a huge number and will
    never be reached. If 1000 ids a day are used up then it will still take
    11767 years to wrap id_count :)
    
time_t time_created - Time object was created. Note that for users this does
    *not* mean the first time their character logged in.

int stam, stam_gain, stam_gain_freq - The objects stamina will recover (unless
    its an item) based on stam_gain (how much will be added to it) and
    stam_gain_freq (how many often stam_gain gets added - per heartbeats)
    So if stam_gain is 4 and stam_gain_freq is 3 then the object gets 4
    added to its stamina every 3 heartbeats.

int max_stam - This is the maximum the npcs stamina can go up to. You could use
    this to make a very strong monster (eg stren = 90) but only with a max_stam
    of 5 so one hard blow will kill it or it can be used for diseases.

int align - Objects alignment. Only used for USER and NPC types and comes
    into play in fights (the further apart the objects are in alignment the
    harder they hit each other). It goes from 0 -> 100 with 0 being evil
    and 100 being angelic.

struct { } event[MAX_OBJ_EVENTS] - This stores event functions which are 
    called for all objects. These can be used by the mud designer for either
    good or ill uses. See mushroom.c in the items directory for an example of
    their use.

int (*misc_func)() - If this is not null the function will be called and
    the servers exec_com() call bypassed. Basically using this you can 
    bypass the servers own built in "shell" and make your own. See the object
    items/term.c for an example of how to do this. 

struct { } skill[MAX_USER_SKILLS] - Stores skill commands which exec_com 
    trys to match to command input.

int (*obj_func)() - This is the control function pointer for the NPC and 
    ITEM type objects. This the most important element in the structure for
    these 2 types.
    
int will_regen - When an NPC is created this is automatically set to 1 so 
    that when the NPC is killed it will be placed on the regeneration list
    which you can look at using the "listreg" command. If you dont want it to
    automatically be regenerated eg if you want the room to decide when to next
    create it then you set this to 0.

int regen_delay - Assuming the NPC will regenerate this is the length of time
    in seconds before the server automatically reclones it in its start_room.

int start_room - The room in which the object was created.

int container - If this is set then items can be put inside the item in
    question and this item can be closed.

int closed - If an item is closed then you cannot take anything from it.
    Only this flag is built into the server , not the commands and code to
    actually open or close an object since there is more flexibility in 
    allowing the object itself to contain its own opening/closing code.

