OBJECT
	/std/skillmaster


LAST UPDATE
	Mateese, 05-Jun-94 19:00 MET


SYNOPSIS
	#include <skillmaster.h>

	inherit "/std/skillmaster";

DESCRIPTION
	This is a standard module implementing the basic functions of
	a skillmaster. It must not be used standalone or cloned, but
	instead has to be inherited into the actual skillmasters.
	Even the 'official' skillmaster SKILLMASTER (defined in
	<config.h>) is a child of this module.

	The skills are stored in one mapping 'skills', which is
	indexed by the skill names and contains SKX_MAX_SIZE entries
	per skill:

	  string SKX_STAT1      : the name of the first underlying stat, or 0.
	  mixed SKX_STAT1_FACTOR: the % factor for SKX_STAT1
	  string SKX_STAT2      : the name of the second underlying stat, or 0.
	  mixed SKX_STAT2_FACTOR: the % factor for SKX_STAT2
	  mixed SKX_SKILL_FACTOR: the % factor for the learned skill value
	  mixed SKX_LEARN_FACTOR: the factor for learning the skill
	  mixed SKX_MAX_VALUE   : the max value achievable by learning
	  mixed SKX_EXTRA       : for use of the inheriting skillmaster.


	The mapping is managed by these calls:

	  void create ()
	    The data mapping is initialized to be wide enough.
	    Also it is checked if the current object is neither a
	    clone nor inherited. If it is, an error is generated.

          void AddSkill ( string name
                        , string stat1, mixed stat1factor
                        , string stat2, mixed stat2factor
                        , mixed skillfactor
                        , mixed learnfactor
                        , mixed maxvalue
	                , mixed extra
                        )
	    Set or change the data for the skill 'name'.

          void RemoveSkill ( string name )
	    Remove the data for the skill 'name'.

	  mapping QuerySkills () 
	    Returns a copy of the current content of the data mapping.

	  string * QuerySkillNames ()
	    Returns an array with the name of all managed skills.

          mixed * SetSkill ( string name, mixed *data )
	    Set or change the 'data' for the skill 'name'.
	    The array 'data' is indexed using the SKX_indices.

	  mixed * QuerySkill (string name)
	    Returns an array with the data for skill 'name'.
	    If that skill is not found, 0 is returned.
	    The SKX_indices are valid for the returned array.

	  int      HasSkill (string name)
	    Returns non-zero if the server has a skill 'name',
	    zero if not.

	Two functions help in applying the skills.

	  mixed * ResolveSkill ( string name, void|object|string receiver)
	    Returns an array with the data for skill 'name', or 0 if
	    the skill is not found. Additionally, the factors in the
	    data array are reduced to that simple integer values which
	    are to be used for 'receiver'
	    'receiver' can be an object for which the skill is
	    queried (default is the caller), or is as string the name of
	    a guild for which the data is needed.

	  int ComputeSkill (string name, void|mixed * data, void|object obj)
	    Computes the effective value of skill 'name' as applied by
	    object 'obj' (default is the caller). Note that this
	    computation does not 'Use' the underlying stats.
	    If 'data' is given (which must be the result of a
	    ResolveSkill() call then), the computation is done using
	    the given values.


INHERITANCE TREE
	skillmaster


SEE ALSO
	skills(C), skillmaster(O)
