This document describes how skills work in CDlib.

Background
==========

Skills are all the pieces of knowledge of different things that a mortal may
gather to manage a long journey through a dangerous life.

Skills differ from stats in that they are not gained through experience, i.e.
indirectly. Skills are usually bought with money, as training courses, or
gained as rewards after solving a quest. Some races may also be born with
certain skills or have a special talent to learn them.

There is in theory no limit to the number of different skills in the game.
However, as all objects in the game should interpret skills in a similar way
there must be a standard. Therefore most skills must be registred in a central
place in the game.


Functionality and implementation
================================

A skill is simply a pair of two numbers. The skill number and the
value.  It is implemented as two lists in all living objects.

	All nonexistant skills are considered to have the value 0.

There are four routines for managing skills:

	set_skill(int skill_type, skill_value)
	query_skill(int skill_type)		/* Skill + bonus */
	query_base_skill(int skill_type) 	/* The real skill of player */
	query_skill_cost(int old_skillvalue, new_skillvalue)

The first two are merely for setting and querying the skill values. The
third is a standardized cost function that returns what the relative
cost for raising between two skill values should be.


Current list of skills
======================

The file /sys/ss_types.h holds a list of the current skills and the
#defined types. The full list of documented skills will be available
with 'man skill_list' or in the file /doc/man/general/skill_list

Most of the skills from the basic skill list are only partially
available to all players. To gain profience in the more specialized
skills a player will have to join a guild. The file 'guilds' has a
special chapter about this.

Guilds that you cannot join (read: rooms like the Adventurers Guild)
may not offer more than a total education of 250 skill levels from the
basic skill list below. Simply add all maximum training levels of all
skills you offer, and see if it is below 250. This leaves you free in
the choice of how many basic skills can be trained, and how high you
allow those basic skills to be trained, as long as you keep in mind the
list below.  A major guild may train skill levels 1-90. Skill levels 
91-100 are reserved for special training conditions. Examples of such
conditions are quests, duels, mobile and secretive masters etc.

The skills listed below here could be available in any guild up to the
stated level.

Generally available skill	max level	Description
=========================	=========	===========
SS_WEP_*                         30       All weapon skills
SS_UNARM_COMBAT                  30       Unarmed combat
SS_DEFENCE                       20       Defence 
SS_BLIND_COMBAT                  20       Blind combat 
SS_SPELLCRAFT                    20       General spellcraft
SS_ELEMENT_*                     20       All spell element skills 
SS_ALCHEMY                       20       Mix potions etc.  
SS_APPR_MON                      30       Appraise an opponent
SS_APPR_OBJ                      30       Find out properties of an obj
SS_APPR_VAL                      30       Value an object
SS_OPEN_LOCK                     20       Pick locks
SS_PICK_POCKET                   20       Pick pockets
SS_HERBALISM                     20       Find and identify herbs
SS_HIDE                          20       Hide inside rooms
SS_FR_TRAP                       20       Find and remove traps
SS_ACROBAT                       20       Acrobatic maneuvers
SS_SNEAK                         20       Sneak into rooms
SS_SWIM                          30       Swim
SS_CLIMB                         30       Climb
SS_ANI_HANDL                     30       Handle animals
SS_LOC_SENSE                     30       Know where you are
SS_TRACKING                      30       Track something in the wild
SS_HUNTING                       30       Hunt for a living
SS_LANGUAGE                      30       Speak other languages
SS_AWARENESS                     30       Be wary of backstab/sneak/hide
SS_TRADING                       30       Trade with profit
SS_RIDING                        30       Riding a steed

Skill decay
===========

When a skill is trained, it is implicitly maintained as long as the player
has access to places that train the skill to that level. Otherwise the skill
will decay. For more information, see "man skill_decay".
