                          The Item Inheritable
                          written by Zaxan@Haven

This document details the different functions in the Nightmare IV LPC
Library's item inheritable. This document is divided into
many sections. Each section explains a different type of function
in the lib inheritable.

The following is the header of the item inheritable with what it
includes, inherits, and its definitions:

****************************************************************************
#include <lib.h>
#include <dirs.h>
#include <daemons.h>
#include <config.h>
#include <vendor_types.h>
#include "include/item.h"
 
inherit LIB_OBJECT;
inherit LIB_DROP;
inherit LIB_GET;
inherit LIB_KEY;
inherit LIB_MOVE;
inherit LIB_PERSIST;
inherit LIB_PUT;
inherit LIB_READ;
inherit LIB_STEAL;
inherit LIB_DETECT;
inherit LIB_WEAPON;
****************************************************************************

           ************************************************
                        Part 1: Events Section
           ************************************************

int eventMove(mixed dest);
This function is used to move the item around the player's inventory.

int eventRecieveDamage(object agent, int type, int amount, int unused, 
                       mixed limbs);
This function is used for when an item receives damage. The agent is the 
object doing the actual damage. The type is the damage type, the amount is 
how much damage is being done, the unused is so the function doesn't override 
any other lib functions, and mixed limbs are the limbs that it should affect.

void eventDeteriorate(int type);
This function controls the deterioration of items and weapons. It cuts
the value in half and makes it so it is unsellable. Type is used for
lib overriding purposes.

int eventBless(int amount, int time);
This function controls the blessing of objects. The amount is how much
blessing will be done, and the time is how long that it will be blessed.
If amount is negative, the item will be cursed.

void eventRemoveBlessing();
This function removes the bless or curse put on an object after
eventBless() is called.

varargs mixed eventShow(object who, string str, string on_id);
This function is used for when a player looks at an object.
Who is the person looking at the object. Str and on_id are
used for overriding purposes.

mixed eventThrow(object who, object target);
This function is the main beef for when 'who' throws something at
'target'. It controls the training of skills and the giving of damage to
the target.

mixed eventPoison(object who, object agent, int strength);
This function prints messages to people when 'who' puts poison on something
(agent). The strength is the amount of poison that should be added to
the thing being poisoned.

varargs mixed eventRepair(object who, int strength, int type);
When a person (who) repairs an item, it runs through this function to do
all of the calculations necessary for item repair. Who is the person that
is doing the repairing, strength is the amount of repairing being done, and
type is for overriding purposes.

           ************************************************
                     Part 2: Modal Methods Section
           ************************************************

mixed CanSteal(object who);
This function checks to see whether an item can be stolen. If it is worn,
it cannot be, otherwise it calls upon the steal lib to do further checks.
Who is the person that is trying to steal.

int CanSell();
This function determines whether an item can be sold or not. It
always returns 1 (the player can sell it).

varargs mixed CanThrow(object who, object target);
This function determines wether an item can be thrown. It always return 1.
Who is the person throwing the object and target is the thing it is being
thrown at.

mixed CanRepair(object who);
This function determines whether an item can be repaired. It checks to
make sure the item actually needs repairing or not. Who is the person
that is to be doing the repairing.

mixed CanEnter(object who, string what);
This function determines whether an item can be entered by a player. Who is
the person trying to enter, and what is the thing to be entered. It always
returns 0.

           ************************************************
                  Part 3: Data Manipulation Functions
           ************************************************

static int Destruct();
This causes an item to....destruct!

mapping SetRepairSkills(mapping mp);
This function sets what skills are necessary for a player to have and what
level they must have them at in order to repair a certain item.

string *GetRepairSkills();
This returns all of the repair skills and levels set in SetRepairSkills().

int GetRepairSkillLevel(string arg);
This returns the required level of the specified skill (arg) in an object
that uses that skill for repair purposes.

string array SetMaterial(string *arg);
This function sets what material an item is made out of. It is used for
repair purposes.

string array SetMaterials(string *arg);
This function is used if an object is made out of many different types
of materials.

string array GetMaterial();
This function returns all of the materials that an object is constructed
out of.

string GetWornDescription();
This function is used to describe what limb(s) an object is being worn
or wielded upon.

string GetItemCondition();
This function is used to describe to a person what condition the item is in
when a player looks at it. It helps people decide what items they may want
to keep or discard.

varargs string GetLong(string str);
This function compiles all of the different status functions for an item's
description such as GetWornDescription() and GetItemCondition() and the
normal GetLong() of an object to give a full description of an item to
a player when they look at it.

int SetRepairDifficulty(int x);
This function determines how difficult an item is to repair.

int GetRepairDifficulty();
This function returns the repair difficulty value set with
SetRepairDifficulty().

int SetMass(int x);
This function sets how heavy an item is.

int GetMass();
This returns how heavy an item is.

int AddMass(int x);
This function takes how much an item weighs currently and adds x to it to
return a new value.

int GetWeight();
This function takes into account the gravity of the environment that a person
is in and calculates a more accurate weight.

int SetDestroyOnSell(int x);
This function determines whether an item will self-destruct when someone tries
to sell it. Only 0 and 1 are valid values for x.

int GetDestroyOnSell();
This function returns whether an item will self-destruct when someone tries
to sell it.

int GetDeterioration();
This function returns the value at which a item has completely deteriorated.

int SetValue(int x);
This function uses x to set how much an item is valued at. The higher the
number x is, the more valuable that item is.

int GetValue();
This function returns how much an item is valued at.

int SetVendorType(int type);
This function defines what types of vendors will be able to sell or buy the
item. Valid vendor types are in /include/damage_types.h.

int GetDamageType();
This function returns what the damage type of an item is.

int SetDamagePoints(int x);
This function determines how many damage points an item has. In other words,
how much damage the item can take before beginning to deteriorate.

int GetDamagePoints();
This function returns how many damage points an item currently has.

int SetRetainOnDeath(int x);
This function determines whether an item will remain on the object in 
possession of it when it dies rather than being moved to the corpse. 
Valid values for x are 1 and 0.

int GetRetainOnDeath();
This function will return whether an item will remain on the object in
possession of it when it dies.

int SetUnique(int x);
This function is used to make an object a unique object in the game.
Valid values for x are 1 and 0.

int GetUnique();
This function returns whether an item is unique or not.

int SetBroken(int x);
If x is set to 1, the item is broken. On the other hand, if it is set to 0,
it is not broken.

int GetBroken();
This function returns whether an item is broken or not.

int AddPoison(int x);
This function adds x to the amount of poison that an object currently has
and comes up with a new value.

int GetPoison();
This function returns how much poison is in the object.

static mixed *AddSave(mixed *vars);
This function is used to determine what inside the item should be saved.
This is used for important values in objects such as mass, damage points, etc.
