*** 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 OB_CONSTRUCT 
     Set up any required object elements. Called from construct().

case OB_DESC      
     Print examine description. Called from examine().

case OB_COM 
     Attempt to execute user command. Called from exec_room_obj_com().

case OB_EVENTS 
     Do objects own stuff. Called from object_events().

case OB_DEATH
     Called from kill_object() when npc dies. Allows the npc to do things
     just before its inactivated. This is different to case OB_DESTRUCT below 
     in that its purely a game feature rather than an internal server
     necessity and is only for NPC's.

case OB_DESTRUCT
     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 
more important and less obvious 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 globals.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. This is unique to each object (apart from inactive objects
    where their id may get reused by a live object before they are 
    destructed). It is chosen by the get_new_obj_id() function.
    
time_t time_created - Time object was created. Note that for users this does
    *not* mean the first time their character logged in.

int ws - The weapon skill. This effects how much of a weapons damage a player
    or NPC can use. For zero weapon skill they only get 50% of the weapons
    power , for 100 skill they get 100%. For users weapon skill also determines
    whether they can wield certain weapons in the first place since for weapon
    items the ws field determines what ws the npc/user needs to be able to 
    wield it. NPCs ws defaults to 100 since they might as well be able to use
    all the weapons damage.

int dodge - The probability of a user/npc dodging a blow in a fight. If 0 then
    they get hit every time , if 100 then they dodge every blow , if 50 then
    they'll get hit 50% of the time.

int wdam - The maximum damage a weapon item can inflict. Not used with npcs
    and users and non weapon items.

int arm - If object is an npc or user then this gives their total armour
    rating from all the armour their wearing, if an item then it is the items 
    armour rating.

int arm_type - This can be HEAD, BODY, HAND, LEG, FOOT, SHIELD or MISCARM 
    armour. A user/npc can only wear one type of each (if their sub type is 
    the same) except for MISCARM which is unlimited as it could be a ring or
    pendant or amulet etc.

int arm_subtype - This is HARD or SOFT. A user/npc can wear 1 HARD and 1 SOFT
    item of the same main type of armour. eg: they could wear hard chainmail 
    and a soft cloak , both of which are BODY type.

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 (*method_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 clone - When YES then a wizard can clone this object. Default is YES
	unless its a user object.

int destroy - When YES then a wizard can purge this object. Default is YES
	unless its a user object.
    
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. Default is YES.

int will_form_corpse - If YES then an NPC when it dies will form a corpse
    else all its inventory will be put into the room. Default is YES.

int corpse_keep_inven - If YES then a corpse will keep hold of the dead NPCs
    inventory else the inventory will be placed in the room. Default is YES.

int will_gain_fight_exps - If YES then npc will gain exps whenever it hits
    its opponent in a fight based on the amount of damage it gave them.
    Default is NO.

int will_gain_death_exps - If YES then npc will gain all its opponents
    exps if it kills it. Default is NO.

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 will_see_writes - If YES then npcs and items will get the string from the 
    last write_user() call stored in their write_data array for 1 heartbeat.

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

int can_wear - If YES then the object can be worn as an item of clothing.
    Default is NO.

int can_take - If YES then the object can be picked up by a user. Default is
	YES.

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

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.
    Default is NO.

int see_thru - If this is set to YES users can see whats inside a closed 
    container It is intended for glass containers or cages for example. 
    Default is NO.

int inv_weight_pct - This is to create bags of holding / portable holes etc
    that can reduce the weight of the objects they carry. For example if
    this is set to 25 then all objects inside the bag will weigh 25% of
    what they would do outside of it, so a sword of weight 10 will only weigh
    2 (as casting from float to in always rounds down). Default is 100 , ie 
    things weigh the same inside as out.
