-
add_player_reported
int add_player_reported(string victim,
int value,
int when)
This function updates a player's quota values by adding the value of
a theft to the amount reported and removing the theft from the
items stolen but not yet reported. It is called by add_receipt.
- Parameters:
victim - name of player
value - value of the theft
when - the time the theft occured
- See also:
add_receipt()
-
add_player_stolen
void add_player_stolen(string player,
int val,
int when)
This function is called when a theft occurs to record
info on the theft used to determine theft quotas.
- Parameters:
player - name of theft victim
val - value of theft
when - time when theft occured
- See also:
query_player_stolen.c and query_player_valid
.c
-
add_receipt
int add_receipt(string thief,
string victim,
int value,
int when)
This function updates thief and player quotas when an NPC theft
occurs or when a theft receipt is turned in to the Guild.
- Parameters:
thief - name of thief
victim - name of theft victim
value - value of items stolen
when - time when theft occured
-
add_thief_debts
int add_thief_debts(string thief,
int debts)
This function is called to add the Guild cut of a theft reported to
the Guild to the thief's debts.
Also fines thief is value of theft causes them to exceed their
maximum theft quota.
- Parameters:
thief - name of thief
debts - value of theft reported to the Guild
- See also:
query_thief_debts() and query_thief_maxquota()
-
add_thief_fines
int add_thief_fines(string thief,
int fines)
This function updates the value of fines a thief owes
Mainly called by creators for handling errors.
- Parameters:
thief - name of thief
fines - value of fine to be added
-
add_thief_payed
int add_thief_payed(string thief,
int value)
This function updates the value of money a thief has paid to the guild.
Mainly called by creators for fixing errors.
- Parameters:
thief - name of thief
value - to be added to amount paid
-
calc_player_quota
void calc_player_quota(string player)
This function initializes new player theft quotas and calculates
quota values for players. It is called whenever there is a need to
check something against the players quota value.
- Parameters:
player - name of player
-
calc_thief_quota
void calc_thief_quota(string thief)
This function calculates a thief's quota values. It is called whenever
there is a need to check something against a thief's quota to make sure
the quota values are up to date. This function also handle new thieves
by calling the check_thief function.
- Parameters:
thief - name of thief
- See also:
check_thief()
-
check_player_reset
void check_player_reset(string player)
This function check to see if it is time to reset a players
theft quota.
- Parameters:
player - name of player
- See also:
player_reset()
-
check_thief
void check_thief(string thief)
This function is used to add a new thief to the quota mapping or to
remove a player who is no longer a thief from the mapping.
- Parameters:
thief - name of thief
-
check_thief_reset
void check_thief_reset(string thief)
This function checks to see whether it is time to reset a
thief's quota.
- Parameters:
thief - name of thief
- See also:
thief_reset()
-
crash_recover
void crash_recover(string player,
string type)
This function is used to estimate the time left until q quota resets
if the player did not log out normally last time they were on.
- Parameters:
player - name of player
type - "thief" or "player"
-
log_calls
void log_calls(string func)
-
login
void login(string player,
string type)
-
pay_player_quota
int pay_player_quota(string player,
int value)
This function is used to allow a player to prepay thier theft quota
to the Guild.
- Parameters:
player - name of player
amount - being paid.
- Returns:
value of any money left after quota has been paid
-
pay_thief_fines
int pay_thief_fines(string thief,
int value)
This function pays thief fines to the Guild. Used when a thief
is forced to pay fines.
- Parameters:
thief - name of thief
value - value of money used to pay fines
-
pay_thief_quota
int pay_thief_quota(string thief,
int value)
This function is used to handle payment of money to the Guild
by a thief. Fines are paid first followed by debts for theft.
- Parameters:
thief - name of thief
value - amount being paid
- Returns:
value of money left after payment is made
-
player_quit
varargs void player_quit(string player,
string type)
This function handles logging out from quota system (either leave of absence
for thieves or leaving game).
- Parameters:
player - name of player logging out
type - type of logout ("leave" is the only option that requires
special attention
-
player_reset
void player_reset(string player)
This function is called to reset a player's theft quota.
- Parameters:
player - name of player
-
query_player_quota
int query_player_quota(string victim)
This function is used to determine a non-thief's theft quota
- Parameters:
victim - name of player
- Returns:
value of player's theft quota
-
query_player_quota_data
string query_player_quota_data(string player)
This function returns all quota values for a non-thief player.
- Parameters:
player - name of player
- Returns:
0 or a string of player's quota
-
query_player_quota_exceeded
varargs int query_player_quota_exceeded(string player,
int value)
This function determines whether a given value will cause a player's
theft quota to be exceeded. Quota value is compared to value of
items already reported to the Guild as well as non-reported theft
in the last hour.
- Parameters:
player - name of player
value - value of theft to check against remaining quota
- Returns:
1 or 0
- See also:
query_player_valid() and query_player_reported()
-
query_player_reported
int query_player_reported(string victim)
This function calculates the value of items stolen from a player that
have been reported to the guild. This value is used to determine value
left to cover theft quota for the current quota period
- Parameters:
victim - player name
- Returns:
value of items stolen and reported to the guild
-
query_player_stolen
int query_player_stolen(string victim)
This function is used to calculate the value of items stolen from a player
that have not yet been reported to the guild
- Parameters:
victim - name of player
- Returns:
value of items stolen but not yet reported to guild
-
query_player_valid
int query_player_valid(string victim)
This function is used to calculate the value of items stolen from a player
in the last hour that have not been reported to the guild. This value is
used by theft commands to determine whether a thief can steal from a player
If this value plus that value of items already reported is greater than
the quota, theft is not allowed
- Parameters:
victim - player name
- Returns:
value of items stolen in last hour and not yet reported to guild
-
query_quota_data
class thief_quota_data query_quota_data(string thief)
-
query_thief_debts
int query_thief_debts(string thief)
This function determines the value of money a thief owes for thefts
in the current quota period.
- Parameters:
thief - name of thief
- Returns:
value of money owed for theft
-
query_thief_fines
int query_thief_fines(string thief)
This function determines the value of fines a thief owes to the Guild.
- Parameters:
thief - name of thief
- Returns:
value of fines owed to the Guild
-
query_thief_maxquota
int query_thief_maxquota(string thief)
This funtion determines a thief's maximum quota.
- Parameters:
thief - name of thief
return - value of maximum quota
-
query_thief_minquota
int query_thief_minquota(string thief)
This function determined a thief's minimum quota.
- Parameters:
thief - name of thief
- Returns:
value of minimum quota
-
query_thief_owes
int query_thief_owes(string thief)
This function determines the total value of money a thief owes
to the Guild. Includes Guild cut for theft and fines.
- Parameters:
thief - name of thief
- Returns:
value of all money thief owes
- See also:
query_thief_debts() and query_thief_owes()
-
query_thief_payed
int query_thief_payed(string thief)
This function determines the value of money a thief has paid to
the Guild in the current quota period.
- Parameters:
thief - name of thief
- Returns:
value of money paid to the guild
-
query_thief_quota_data
string query_thief_quota_data(string thief)
This function returns all quota values for a thief
- Parameters:
thief - name of thief
- Returns:
string of all quota values
-
query_thief_quota_exceeded
varargs int query_thief_quota_exceeded(string thief,
int value)
This function determines whether a thief's quota has been exceeded
or if a given value will cause it to be exceeded.
- Parameters:
thief - name of thief
value - optional value to check against quota
- Returns:
1 or 0
-
query_thief_quota_reached
varargs int query_thief_quota_reached(string thief,
int value)
This function determines whether a thief has reached the minimum
quota or if a given value will cause the minimum to be reached.
- Parameters:
thief - name of thief
value - optional value to be checked against quota
- Returns:
1 or 0
-
query_time_to_player_reset
int query_time_to_player_reset(string victim)
This function determines the amount of time left until a
non-thief's quota resets.
- Parameters:
victim - name of player
- Returns:
amount of time until quota resets
-
query_time_to_reset
int query_time_to_reset(string thief)
This function determines the time remaining until a thief's
quota resets.
- Parameters:
thief - name of thief
- Returns:
time until quota resets
-
query_total_stolen
int query_total_stolen(string thief)
This function determines the value of items a thief has stolen
in the current quota period.
- Parameters:
thief - name of thief
- Returns:
value of items stolen in current quota period
-
refresh_callback
void refresh_callback(mixed player,
int flag)
This function removes a player from both thief and player records.
Called by the refresh handler when a player refreshes or deletes.
- Parameters:
player - The player who refreshed or deleted
flag - total or partial refresh - we don't care much righ now
-
remove_player
int remove_player(string player)
This function is called to remove a former player from the player
theft quota mapping.
- Parameters:
player - name of player
-
remove_thief
int remove_thief(string thief)
This function is called to remove a former thief from the thief
quota mapping.
- Parameters:
thief - name of thief
-
save_info
void save_info(mapping list,
int i)
-
save_player_file
void save_player_file(string player)
-
save_players
void save_players()
-
save_thief_file
void save_thief_file(string thief)
-
save_thieves
void save_thieves()
-
thief_reset
void thief_reset(string thief)
This function is called to reset a thief's quota. Fines for
outstanding debts of for failing to reach minimum quota are added.
- Parameters:
thief - name of thief
-
thieves
string * thieves()
-
update_mappings
void update_mappings()
This function is called every 60 days to remove former thieves and
former players from the quota mappings.
- See also:
remove_thief() and remove_player()