[Package Index | Mudlib Index | Effect Index]
Written by Pinkfish
Started Thu Feb 5 15:39:57 CST 1998
.
int check_open(object player, string type)This method checks to see if the shop is open or not. It will setup the default fail message if this is what is needed.
int do_browse(object * obs)This function browses through the current selected list of items.
int do_buy(object * obs, int force)This method will attempt to buy an object from the shops inventory.
int do_change(object * obs, string change)This function changes the list price of an object.
int do_change_name(object * obs, string new_name)This function changes the list name of an object.
int do_collect()This method collects any royalties the current player is owed.
int do_delete(string id)This method will delete a list entry without the owner getting paid.
int do_list()This method will list the current set of objects which are available to buy.
int do_royalties()This method shows any royalties that you might be able to collect.
int do_sell(object * obs)This method sells an object into the craft shop.
int do_sell_id(object * obs, string id, int force)This method tries to sell an object as a name that already exists in the shop.
void inform_of_buy(int value, object * obs, object player, string * sellers, string * names, string * cats, int * values)This method is called when something is bought and tells us how much has been spent.
int is_able_to_change(object ob)This allows the system to override this for player run shops so the owner can discount peoples items.
int is_allowed_to_sell(object * obs, string name, string * sellable_names)This method checks to see if this item is allowed to be sold in this shop. It assumes it is called from a add_command() method and sets up fail messages accordingly.
function query_allowed_to_sell()This method returns the function used to check to see if an object is able to be sold here or not.
int query_always_ask_price()This method returns the flag on this object that tells us if the shop will always ask for a price
object query_controller()This method returns the current value of the controller.
string query_craft_shop_save_dir()This method returns the file name of the save file.
int query_cut()This method queries the current cut defined for this shop.
string query_extra_price_information(string person, object * obs)This method returns any extra information about prices that the shop wants to display before entering a cost. This can be overridden in higher inherits to control this more effectively.
function query_extra_sell_check()This method returns the extra sell check function.
int query_max_sell_per_person()This methods returns the maximum number of allowed objects to be sold by each person into the shop.
int query_maximum_sale_value(string person, object * obs)This method will return the maximum price this item is allowed to be sold for. This will return 0 if there is no maximum price
int query_minimum_cost()This method returns the minimum allowed cost for an item in the shop inventory.
int query_no_royalty_commands()This method returns the flagt the removes the royalty commands from the shop.
int query_use_name()This method returns the flag for the use name of this shop.
function query_when_sold_function()This method returns the when sold function.
void reload_shop()This method allows you to cause the shop to load itself up.
void set_allowed_to_sell(function func)This method sets the function to use to check to see if the object is able to be sold here or not. The function will be called with one parameter, that is the object being check for buyability.
void set_always_ask_price(int ask_price)This method sets the flag which makes the shop always ask for a price when it attempts to save something.
void set_controller(string name)This method sets the controller object for this shop.
void set_cut(int new_cut)This method sets the cut for the object.
void set_extra_sell_check(function func)This method sets the extra sell function for the shop. The extra sell function is called after the sell process is almost finished. It can check for extra things needed in the sell process, like which page of the book to browse.
void set_max_sell_per_person(int num)This method sets the maxium allowed number of objects to be sold by each person into the shop.
void set_minimum_cost(int cost)This method sets the minimum allowed cost for the item in the shop inventory.
void set_no_royalty_commands(int flag)This method sets the flag that removes the royalty commands from the shop, if the royalty stuff is be handled somewhere else.
void set_save_dir(string fname)This method sets the save file associated with the controller. The save file should actually be a directory, the name of the directory plus a .o will be used for the save files. The directory must exist or weird errors will occur. This should always be set in the setup function of the room.
void set_use_name(int flag)This method sets the flag which makes the shop use the name of the item as the sell type always.
void set_when_sold_function(function func)This method sets the function to be called on all the objects when they are sold. For instance this can be used to close all books etc.
// Close the book when it is sold. set_when_sold_function( (: $1->set_open_page(0) :) );
int value_from_string(string str, string place)This attempts to figure out how much the person is telling us the item costs.
int check_sell_name(string name)This method makes sure a name is not too long and contains no colour codes.
void complete_sale(int value, string name, object * sellable, string category)This method is called to complete the sale completely. It is split up into a second function to allow the extra sell stuff to work neatly.
void confirm_sale(string answer, int value, string name, object * sellable, string category)This method confirms the sale after the cost and name have been determined.
void confirm_sell_name_choice(string answer, string name, object * sellable)This method is used to confirm the choice of name to use when selling the object.
void determine_cost(string cost, string name, object * sellable)This method figured out the cost of the item based on the value they type in.
void do_confirm_sale(int value, string name, object * sellables)This method will ask the person to confirm the sale. It will check the extra_sell_check function and then call the extra sale thing.
string do_read_file(int type, string fname)This method handles the reading of the file to the disk.
void do_save_file(int type, mixed value, string fname)This method handles the saving of the file to the disk.
void sell_choice(string answer, object * sellables, string * names)This method is used when there is a list of object already listed. It will check to see if the choice entered is valid and then use that name when selling the object if it is.
void sell_name(string name, object * sellable)This method determines the name to list the object under. This is called when a new name is used.