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

There are three types of guilds supported with this guild shadow,
occupational, layman and race guilds. Each type has it's own guild shadow
file to inherit. Occuptaional guild shadows shall inherit guild_occ_sh.c,
layman guild_lay_sh.c and races inherit guild_race_sh. These files all
inherit guild_base.c. The base shadow contains the functions that are
common for these types of guilds. Each specialized guild shadow contains
the functions that need to differ.

Most of these functions are nomask and not for you to change but there are
six functions you would most likely want to change:

int
query_guild_tax_occ()
    This function should return the tax a player pays for the guild.

string
query_guild_style_occ()
    This function should return the style of the guild. The style must be
    one of the styles allowed in the <man guilds> document.

string
query_guild_name_occ()
    This function should return the name of the guild.

string
query_guild_title_occ()
    This function should return the title a player gets if he is in the
    guild.

int
query_guild_not_allow_join_occ()
    This function is called with when a new guild shadow tries to shadow
    the player with the type of guild, the style and the name of the new
    guild. If the function returns 1 we do not allow the player to join
    that guild.

int
query_guild_keep_player()
    This function is called every time the shadow autoloads. You can check
    if the player is still to be considered a member of the guild, i.e.
    players can change their race if they die. As it is now, the shadows
    autoload when a player enters the game, from login or from the "body
    shop" after a player died. Thus is is easy for a race guild to check
    if the player changed race.

The type of a guild is 'occupational', 'layman' or 'race'. Note that the
previously mentioned functions end with _occ() for an occupational guild,
on _lay() for a layman guild and on _race() for a racial guild.

If your guild is a racial guild, and the guild-title is really a family
name rather than a guild-title as other guilds would give it, you should
also redefine the following function:

int
query_guild_family_name()
    This function should return true if the name returned by the function
    query_guild_title_race() returns the family name of the player rather
    than a guild-title like other guilds would give it. Note that this
    function is only used for racial guilds.

NOTE: when you redefine query_guild_not_allow_join_occ(s, s, s), remember
to check if the type of guild is the one you are, i.e. we do not want a
player joining two occupational guilds. That check is made in the original
so you could use ::query_guild_not_allow_join_occ() and test the result.

BTW. Did I say that guild shadows were auto loading? If you make a change
in your guild shadow, be sure it loads properly, otherwise membership can
be a mess. When the guild shadows autoloads a test will be performed to see
if all those shadows can stand eachothers, if not, messages will be written
and guild shadows are removed. It is important that if you do a lot of
testing in your guild shadow if you allow other guilds, make sure you do
all these test before you let the player join your guild. Otherwise we'll
get a strange situation and possible errors when a player logs on and the
shadows load.

For more information on guilds, read "man guilds", "man skills", examine
the examples in /doc/examples/guild and as last possibility, read the
sourcecode in the directory /std/guild/*.
