Home

[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/wizard_orders.c

Each element of wizard_details contains the details for the corresponding wizard. These details are: wizard's level, a number from 0 to 8 wizard's time of advancement, a number wizard's rating, a number This will initialize the variables in the handler and tidy the orders

See also:
tidy_order .c

Inherits

This class inherits the following classes /std/object.c

Method index

  • add_wizard(string, string)
    Add a wizard to an order.
  • fill_vacancies(string)
    This will fill the spaces cleaned out by the cleanup functions.
  • find_wizard(string)
    This function will find any wizard regardless of which order they are in.
  • get_data_file(string)
    Checks to see if the order entered is a valid order.
  • init_data(string)
    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.
  • query_capacities(string)
    List how many spots are availible for wizards to occupy in a given order.
  • query_capacity(string, int)
    List how many spots are availible for wizards to occupy in a given order, at a given level.
  • query_occupancies(string)
    This method returns the number of wizards at each level in a given order
  • query_occupiers(string, int)
    This method returns the wizards by name at the specified level in a given order.
  • query_order_name(string)
    Function to find out the full name of an order.
  • query_order_room(string)
    An order can have a room that is informed when a wizard is promoted or demoted.
  • query_orders()
    List all the orders.
  • query_wizard_details(string)
    Displays the contents of the wizard_details array.
  • query_wizard_level(string, string)
    Returns the wizard's order level if you know the order and the wizard
  • query_wizard_rating(string, string)
    Returns the wizard's rating with the order and the wizard
  • query_wizard_time(string, string)
    Returns the time at which the wizard last died or was demoted.
  • query_wizards(string)
    Lists all the wizards in an order.
  • remove_wizard(string, string)
    Remove a wizard from an order.
  • save_data_file(string)
    Saves the data file for the order.
  • set_capacity(string, int, int)
    Change the number of spots availible for wizards to occupy in a given order.
  • set_order_name(string, string)
    Set the full name of the order.
  • set_order_room(string, string)
    Set the orders room.
  • set_wizard_rating(string, string, int)
    Set the rating of a given wizard.
  • tidy_order(string, int)
    This function is called by create() to tidy the order.
  • wizard_died(string, string)
    Clean up function!

Public Functions

These are functions that everyone can access.

.

    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 Valid entries are: "silver_star", "venerable_seers", "unbroken_circle", "djinn_diviners", "scintillating_scarab", "dynastic_crescent",
                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 8 wizard's time of advancement, a number wizard's rating, a number
                • Parameters:
                  order - Short form of the order name Valid entries are: "silver_star", "venerable_seers", "unbroken_circle", "djinn_diviners", "scintillating_scarab", "dynastic_crescent",
                    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 8-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_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_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_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
Valid HTML 4.01 Transitional
Valid CSS!
Read More