-
add_wizard
int add_wizard(string order,
string wizard)
Add a wizard to an order. This will not add a wizard to the guild.
- Parameters:
order - the short form of the order name.
wizard - the wizard's name
- Returns:
0 on failure, 1 on success.
-
fill_vacancies
void fill_vacancies(string order)
This will fill the spaces cleaned out by the cleanup functions. It will
move the array of wizards upwards to fill the empty spots and place those
who were on the top on the bottom of the list.
occupancies is an array of the number of spots available in the given order
- Parameters:
order - the short form of the order name.
- See also:
query_occupancies
.c
-
find_wizard
mixed * find_wizard(string wizard)
This function will find any wizard regardless of which order they are in.
It is an expensive function since it may have to check many orders and hence
load several data files. It is used by the wizards guild object to find a
wizard who was once inactive but who has returned ie. it's called fairly
infrequently.
- Parameters:
wizard - The name of a wizard
- Returns:
a mixed array of the wizards order and level in the order
-
get_data_file
int get_data_file(string order)
Checks to see if the order entered is a valid order.
If not, writes an error to the log file. If it is a
valid order, the order's data file is loaded.
- Parameters:
order - short form of the order name
- Returns:
true or false
-
init_data
void init_data(string order)
Called by get_data_file
resets the values of wizard_details and clears the cache of
wizards remembered to make typing 'who wizards' less memory
intensive.
Each element of wizard_details contains the details for the
corresponding wizard. These details are:
wizard's level, a number from 0 to 7
wizard's time of advancement, a number
wizard's rating, a number
- Parameters:
order - Short form of the order name
-
query_capacities
int * query_capacities(string order)
List how many spots are availible for wizards to occupy in a
given order.
- Parameters:
order - the short form of the order name.
- Returns:
capacities array of capacities wizards level 7-4 decending.
-
query_capacity
int query_capacity(string order,
int which)
List how many spots are availible for wizards to occupy in a given
order, at a given level.
- Parameters:
order - the short form of the order name.
which - The level to return the capacity for.
- Returns:
int the number of spots at that level.
-
query_hedge
int query_hedge(string order)
Return whether this is a hedge order or a UU order.
- Parameters:
order - the short form of the order name.
- Returns:
int 1 if it's a hedge order 0 if not.
-
query_occupancies
int * query_occupancies(string order)
This method returns the number of wizards at each level in a given order
- Parameters:
order - the short form of the order name.
- Returns:
an array of integers containing the number of wizards at each level.
-
query_occupiers
string * query_occupiers(string order,
int level)
This method returns the wizards by name at the specified level in a given
order.
- Parameters:
order - the short form of the order name.
level - the order level (4 - 8) in question.
- Returns:
string * an array of the occupiers.
-
query_order_name
string query_order_name(string order)
Function to find out the full name of an order.
- Parameters:
order - the short form of the order name.
- Returns:
Full name of the order
-
query_order_room
string query_order_room(string order)
An order can have a room that is informed when a wizard is promoted or
demoted. This function returns the filename of that room if there is one.
- Parameters:
order - the short form of the order name.
- Returns:
string the filename of the order room.
-
query_orders
string * query_orders()
List all the orders.
- Returns:
string* a list of the current orders.
-
query_wizard_details
mixed * query_wizard_details(string order)
Displays the contents of the wizard_details array.
- Parameters:
order - the short form of the order name.
- Returns:
wizard_details an array of wizard details
- See also:
get data file.c and create
.c
-
query_wizard_level
int query_wizard_level(string order,
string wizard)
Returns the wizard's order level if you know the order and the wizard
- Parameters:
order - the short form of the order name
wizard - the wizard's name
- Returns:
int the level of that wizard.
-
query_wizard_rating
int query_wizard_rating(string order,
string wizard)
Returns the wizard's rating with the order and the wizard
- Parameters:
order - short form of the order name
wizard - the wizard's name.
- Returns:
the wizard's rating.
-
query_wizard_time
int query_wizard_time(string order,
string wizard)
Returns the time at which the wizard last died or was demoted.
- Parameters:
order - the short form of the order name
wizard - the name of the wizard.
- Returns:
int the time.
-
query_wizards
string * query_wizards(string order)
Lists all the wizards in an order.
- Parameters:
order - the short form of the order name.
- Returns:
string array of all the wizards in the order.
- See also:
get_data_file
.c
-
remove_wizard
int remove_wizard(string order,
string wizard)
Remove a wizard from an order. This will be called by cleanup also
This will happen if the player refreshes, gets deleted, etc.
- Parameters:
order - the short form of the order name.
wizard - the wizard's name
- Returns:
0 on failure, 1 on success.
- See also:
get_data_file.c
-
save_data_file
void save_data_file(string order)
Saves the data file for the order.
- Parameters:
order - the short form of the order name.
- See also:
get_data_file
.c
-
set_capacity
void set_capacity(string order,
int which,
int number)
Change the number of spots availible for wizards to occupy in a given
order.
- Parameters:
order - the short form of the order name.
which - the level to set the capacity for.
number - the number of spots.
-
set_hedge
void set_hedge(string order,
int new_hedge)
Set if the order is a hedge or UU order.
- Parameters:
order - the short form of the order name.
new_order_room - the filename of the new order room
- See also:
query_hedge
.c
-
set_order_name
void set_order_name(string order,
string new_full_name)
Set the full name of the order.
- Parameters:
order - the short form of the order name.
new_full_name - the new full name of the order.
- Example:
set_order_name("silver_star", "the Brothers of the Silver Star");
-
set_order_room
void set_order_room(string order,
string new_order_room)
Set the orders room.
- Parameters:
order - the short form of the order name.
new_order_room - the filename of the new order room
- See also:
query_order_room
.c
-
set_wizard_level
int set_wizard_level(string order,
string wizard,
int level)
Sets the wizards level up to a maximum of 4. This is used to advance
the wizards up to lvl 4.
-
set_wizard_rating
void set_wizard_rating(string order,
string wizard,
int rating)
Set the rating of a given wizard.
- Parameters:
order - short form of the order name
wizard - the wizard's name.
the - wizard's new rating.
-
tidy_order
void tidy_order(string order,
int i)
This function is called by create() to tidy the order. It calls itself on
a delayed callout gradually working through each wizard in each order and
demoting those that need demoting.
- Parameters:
order - the order currently being tidied
i - the index in the order's array of which wizard to look at next.
-
wizard_died
void wizard_died(string order,
string wizard)
Clean up function!
Demotes the wizard at death, for inactivity, removes them if they're
no longer wizards, or have become creators. Writes errors to the log file.
Contains debugging tools.
- Parameters:
order - the short form of the order name
wizard - the wizard's name