LPC MANUAL --- SKILL DECAY
==========================

Contents:

    1. introduction
    2. maximum levels
    3. guild interface

1. INTRODUCTION
===============

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. Players are always
assumed to have access to the mudlib skills to the level as offered by the
adventurers guilds. Other guilds can offer higher skills. Whenever a player
loses access to skill traiing, the skill will slowly decay to a level that
they do have access to. This to ensure that a guild doesn't remove a skill
that a player has access to elsewhere.

/Mercade

2. MAXIMUM LEVELS
=================

Skill decay does not affect domain specific guild skills, but mudlib skills
only. For general skills (that is all skills with a number < 100000) the
decay limit is defined as the maximum of two values:

- the value defined in "man skills", listed in 5th column in SS_SKILL_DESC
- the highest skill offered by a guild the player is a member of.

If a player has a skill value higher than these two maximums, then with an
interval of SKILL_DECAY_INTERVAL seconds, the skill will decay until it is
at the highest of these two maximums.

3. GUILD INTERFACE
==================

The routine mixed query_guild_trainer_<guild>() is used to interface with
the guilds of the player with <guild> = occ/lay/race/craft.

The guild shadow shall define that routine to return the references to the
guild trainers of that guild. It may be a single string, object, or an array
of those. The trainers are the items that define the actual skill raising
abilities of the guild, i.e. those items inheriting /lib/skill_raise.c, be
it the guild training hall or a trainer NPC.

    mixed
    query_guild_trainer_occ()    [ or _lay _race _craft ]
    {
        return MY_GUILD_TRAINING_ROOM;
    }

In each trainer the routine int sk_query_max(int skill, int silent) is
called (with silent = 1) to find out the maximum available for the player
by that guild. The sk_query_max is defined in /lib/skill_raise.c but a
guild may redefine it to e.g. limit certain skill limits to categories of
members, or a guru quest, et cetera.

    int
    sk_query_max(int skill, int silent)
    {
        /* Allow a guru limit if the guru quest is completed. */
        if (MY_GUILD_GURU_QUEST(this_player(), skill))
        {
            return MY_GUILD_GURU_SKILL_LEVEL;
        }

        /* Fall through to default behaviour. */
        return ::sk_query_max(skill, silent);
    }

