23.1.7 Organizational Credit Sales

The credit sales system allows for a city or guild to sell credits to its
members without manually tracking and handling the sale.

Credit sales are configured by the organisation's leader. First by setting
aside a pool of credits available for purchase, and one or more rules which
define the amount and price of the credits. A valid sale requires a minimum of
one rule to be set.

The opening and closing of a sale, along with individual purchases will be
recorded in the organisation's logs. The details of the sale will also be
visible to all members of that organisation.

Gold collected from purchases is deposited into the city or guild coffers accordingly.

For most players, the following commands are all you need. Change CITY to GUILD
as required. The rest of this help file focuses on technical details for
organization leaders.

    CITY CREDITSALE STATUS
    CITY CREDITSALE BUY <amount> [UNBOUND]

Note: Bound and unbound credits are checked separately. If there are 5 bound credits and 5 unbound credits available for a group, individuals can purchase up to 10 credits total.


The Pool
--------

The pool is an allocation of credits which will be available for sale. In order
for a sale to be opened, it must be at least 200 credits and at most 50% of the
organisation's total credits.

Credits allocated to the pool are not removed from the organisation until they
are sold. During a sale, if there are no longer enough credits to cover the
pool, the sale will end. If the pool is emptied, the sale will also end.


Duration and Period
-------------------

The duration determines how long the sale should be open. Setting it to zero
(0) means it will run forever, until the pool is emptied. Otherwise, it can be
set from 1 to 365 days.

The period determines when to reset individual purchase logs (seen in <ORG>
CREDITSALE STATUS). This allows purchasing more credits within the same sale.
Setting it to zero (0) means it will reset when the sale ends.

If the period becomes higher than the duration, the reset happens when the sale
ends.

For example, you can setup a sale with a duration of 30 days and a period of 5
days. The sale will last 30 days (or until the pool is emptied), and every 5
days, individuals can purchase the max credits again.


Rules
-----

Rules specify the amount and price of credits available for purchase to various
"groups" within an organisation. You must have at least one rule to open a
sale, although the "default" rule itself is optional.

The lowest priced rule, from all the rules an individual matches, is the one
used for purchases. Bound and unbound credits are verified separately.

There is currently no method to exclude an individual specifically.


Syntax
------

You can view the syntax using CITY CREDITSALE or GUILD CREDITSALE. Most of these should be self-explanatory, aside from rule setup.

The general syntax for rules (used with the <ORG> CREDITSALE RULE command) is:

    <group> [bound N at M] [unbound N at M]

Specifying the group by itself (i.e. CITY CREDITSALE RULE MINISTER) clears the
rule.

Some examples:

    CITY CREDITSALE RULE LEADER
    Clears the 'Leader' rule, if it exists.

    CITY CREDITSALE RULE MINISTERS BOUND 5 AT 4000
    Allows city ministers to purchase up to 5 bound credits for 4000 gp each.

    CITY CREDITSALE RULE RANK 3 UNBOUND 10 AT 5000
    Allows members of rank 3 and above to purchase up to 10 unbound credits for
    5000 gp each.

    CITY CREDITSALE RULE DEFAULT BOUND 5 AT 2000 UNBOUND 5 AT 3000
    Allows anyone to purchase up to 5 bound credits and up to 5 unbound
    credits.

The available groups are:

    DEFAULT or EVERYONE     Matches all members of the organisation.
    LEADER                  City/council leader or guildmaster.
    COUNCIL                 City or council ruling member.
    SECRETARY               Guild secretary.
    MINISTER[S]             Any ministers (cities or councils).
    AIDE[S]                 Any aides (cities or councils).
    POSITION <slug>         Guild positions.
    MILITIA <rank#>         City militia rank.
    RANK <#>                Rank <#> or above. Minimum 2.
    NOVICE or NEWBIE        Novices.


Examples
--------

Here are some basic examples of how to setup a sale in your organization.

A sale which never ends, allowing anyone to purchase 5 bound credits for 5000
gp each, every two weeks:

    CITY CREDITSALE POOL 2000
    CITY CREDITSALE DURATION 0
    CITY CREDITSALE PERIOD 14
    CITY CREDITSALE RULE EVERYONE BOUND 5 AT 5000
    CITY CREDITSALE OPEN

An example sale similar to the above, where individuals can purchase up to 10
credits (5 bound and 5 unbound) total:

    CITY CREDITSALE POOL 2000
    CITY CREDITSALE DURATION 0
    CITY CREDITSALE PERIOD 14
    CITY CREDITSALE RULE EVERYONE BOUND 5 AT 5000 UNBOUND 5 AT 6000
    CITY CREDITSALE OPEN

A sale which lasts a month and never resets. It allows anyone of rank 2 and
above, as well as discounted unbound credits for ministers. In this case, any
rank 1 members are unable to purchase credits.

    CITY CREDITSALE POOL 2000
    CITY CREDITSALE DURATION 30
    CITY CREDITSALE PERIOD 0
    CITY CREDITSALE RULE MINISTERS UNBOUND 5 AT 4500
    CITY CREDITSALE RULE RANK 2 BOUND 5 AT 5000
    CITY CREDITSALE OPEN