
Tax: the one basic rule governing major guilds
==============================================

	Major guilds charge a certain percentage of all gained xp
	in a 'guild tax'. The actual %tax should depend on the
	advantages gained through the guild.

Taxes are based on three things: combat aid, skills trained, and additional
abilites or objects offered by the guild. Besides following the details for
the calculation of the tax as laid down in this file, the guild must also
be balanced as a whole when taking all benefits and costs together. 

Tax values listed below are subject to change. If they are modified, guild
taxes will have to be adjusted accordingly. 


- Combat Aid:

With %aid in combat is meant that a given player with the helping features
fight that much better than without help. Having 100% aid in combat
therefore means that the fighting capability is doubled, it does not mean
that monsters fall dead instantly.

For every 6% of combat aid, 1% tax has to be charged.

The tax is calculated according to the maximal potential combat aid a
player can get. In most cases this means, you should assume stats and
skills of about 100. 

Combat aid is rather hard to calculate exactly, but you can always try to
make an estimate. The calculation of the combat aid has to be explained
in the guild documents in /d/Domain/open/GUILD/.

Two examples:

Let us assume a special attack which disables an opponent for three combat
rounds. The special attack can be used every ten combat rounds, with a
probablity of success of 50%. Thus, you would have a combat aid of about
15% (3/10 * 50%). 
 
Or, a special attack hurting an opponent, which can be used every four
combat rounds. The pen value depends on strength, and the guild stat is
used as skill: F_PENMOD(str/4, guild_stat). For strength and guild stat of
100, this gives 200. The best 'normal', ie non-magical weapons have a pen
value of 40: F_PENMOD(40, 100) = 280. Thus the combat aid is 18% 
(25% * 200/280). 

If a feature giving combat aid to a guild member requires the training of a
special, guild defined skill, the tax may be reduced by up to 50%. 

An occupational guild may give up to 100% combat aid (16.7% tax).

A layman guild may give up to 50% combat aid (8.3% tax).

A race guild may give up to 25% combat aid (4.2% tax).


- Skills:

Each major guild will train skills. Most of those skills will be mudlib
defined skills, as listed in /sys/ss_types.h. In addition, a guild can
define guild specific special skills, like 'bash' as a special attack of a
fighter guild.

Mudlib defined skills are taxed with 1% tax for every 60 levels a guild
member can train over the maximum values that can be trained in open 
(adventurers') guilds. These maximum values are listed in 'man skills'. The
tax is increased by 50% (to 1.5% / 60 levels) if the skill is either a
weapon skill or a specialized fighting skill (see /sys/ss_types.h for a
list of specialized fighting skills).

Guild specific skills are taxed according to the guidelines mentioned above
under 'combat aid', if the skills and the corresponding abilites help the
guild members in combat.

Other guild specific skills are taxed according to the benefits guild
members gain from those skills. The tax should not be lower than for mudlib
defined skills. 

At the end of this files you will find an example of the tax calculation
for a guild.

- Additional features:

Here follows a list of %costs for typical guild features. This list is
neither complete nor final. 

        Tell lines in occupational mage and cleric guilds:
        Member to member tell:         2% tax + 10 mana.
        Member to non-member tell:     2% tax + 20 mana.
        Member to all members line:    2% tax +  5 mana for each receiver.
        The tax is additive, so that eg for a member to member tell and a
        member to non-member tell, the guild has to charge 4% tax.

        Tell lines in all other occupational and layman guilds:
        Member to member tell:         4% tax + 10 mana.
        Member to non-member tell:    10% tax + 20 mana.
        Member to all members line:    8% tax +  5 mana for each receiver.
        If a guild offers both 'tell' between members and a guild line,
        there is a 2% tax discount so that the total tax is 10%.

        Race guilds may not offer a tell line.

        The mana has to be paid by the sender of the message for each
        message and receiver. A 'tell' command from a guild member to a
        non-member may not enable the non-member to reply to the message.

        Tell lines have to be coded as spells, including a skill check for
        an appropriate skill and a chance of failure.

        The tax for member to non-member 'tell' in all guilds except 
        occupational mage and cleric guilds has been set on purpose to the
        hopefully prohibitively high value. There will be no discounts.

        Special bargains:
        1%	If your guild has a shop, bank, pub and other places money
                is in use, where the members have advantages they won't
                normally find. Like, better trade for members at a shop. 
                Add 1% for each such location. 

        Weapon racks:
        10%     If your guild has a weapon rack, where members can deposit
                weapons or armours for the use of fellow guild members, if
                the contents of the weapon rack are stored in a reboot.
                This value can be reduced if there are disadvantages for
                guild members using the rack. A lower tax has to be
                approved by the arch of balance or a Keeper.

        Magic spells:
        Every magic spell has to be taxed. The tax values will be listed in
        the documentation of the magic system.

        Extra abilities: 
        Extra abilities which help in combat are taxed according to 'combat
        aid'. Other extra abilities are taxed according to 'skills', if
        they require a guild specific skill. If they do not, the tax has to
        be fixed according to the benefit the ability has for the guild
        members.

        Tax reductions:
        If a guild imposes heavy restraints on the guild members, tax
        reductions are possible. This does not include restraints that
        balance special features, but restraints that handicap a guild
        member considerably compared to other players.
        Possible examples might be to make guild members incapable of
        drinking alcohol or of making it impossible for them to wield
        anything but non-magical knives while the unarmed combat skill
        is set permanently to 0.
        The maximum possible tax reduction is 2%, all in all.
        The tax reduction has to be documented in
        /d/Domain/open/GUILD/.

- Total tax

When you sum up for the tax, an occupational guild may have a max of 35% in
tax, layman 20% as max and race 10%. That would make a player that has
joined three types of guilds with max tax, paying 65% of his experience
gained as tax, both quest experience as well as combat exp.


Implementation
==============

Basically guilds are coded with autoloading shadows. Shadows are pieces of
code that are added to the object in runtime and replace the original
objects functions. So if a shadow defines 'query_title' and it shadows a
player, then when 'query_title' is called in the player, it gets called in
the shadow instead. There is a number of functions that a shadow can not
define, these are the functions defined 'nomask' in the object that is to
be shadowed. Functions like 'query_wiz_level' for example :-)

There are some examples in the /doc/examples/guild/ directory.

To implement the 'tax', you must set the corresponding guild pref, much
like the learn prefs. When a player joins the guild a starting value will
be set according to the query_tax() function. If you want to change the tax
the player pays later, you must call set_guild_pref() in the player. When
you do stat on a player you will see what tax he pays to different types of
guilds. 


The layman branch of an occupational guild
==========================================

If a guild has both an occupational branch and a layman branch, the
following has to be taken into consideration. As mentioned in the first
paragraph, the layman guild is the everyman version of the occupational
guild, which is the professional part. Layman members may train the same
skills and abilitities as the occupational part of the guild. However, they
may not be able to be as good as those whose profession it is. There is one
standard rule:

	The average effective ability of layman members may (per ability)
	not exceed 60 per cent of the everage effective ability of the
	occupational members (in that ability).

In simple words, this means that if you have an attack that does 100 damage
each 10 rounds, the layman version may be 60 damage each 10 rounds or 100
damage each 16.7 rounds. This rule does not only apply to special attacks,
but also to other major guild-abilities, whichever form they take.

How this is implemented, is up to the guildmaster. It may be in the formulae
used or in the maximum skills trainable. Remember, however, that if you
limit the training facility to layman members, you must reduce the skills
in the player if he leaves the occupational branch for the layman branch. If
the player later re-joins occupational, (s)he has to re-train the skills.

