[ Package Index | Mudlib Index | Effect Index ]

File /obj/peddler.c

This is the peddler object, it acts as a walking talking item shop. Added event_enter so to stop food from decaying when the peddler sells it. Siel, October 2001

Inherits

This class inherits the following classes /obj/monster.c and /std/shops/inherit/clone_on_demand.c

Includes

This class includes the following files /include/money.h, /include/move_failures.h, /include/armoury.h, /include/virtual.h and /include/shops/bank.h

Method index

 o cost_string(object, string, object)
This method returns the costs of the item as a string.
 o do_browse(mixed, string, string, string *)
The main entrace to the browse for things command.
 o do_buy(mixed, string, string, string *)
The main entrace to the buy things command.
 o do_list()
The main entrace to the list stuff command.
 o event_enter(object, string, object)
 o event_exit(object, string, object)
 o query_cost(object, object)
This method returns the cost of the specified item to the buyer.
 o sell_thing(object, object)
The main entrace to the sell stuff command.
 o set_all_out_mess(string)
Overrides the default chat of the item being out of stock when a player tries to buy it
 o set_busy_mess(string)
Overrides the default chat of the peddler being busy selling something already.
 o set_dont_sell_mess(string)
Overrides the default chat of the peddler not selling an item
 o set_in_combat_mess(string)
Overrides the default chat of the peddler being in combat and hence unable to sell his wares!
 o set_list_item_mess(string)
Overrides the default chat of listing a stock item's price and stock
 o set_list_mess(string)
Overrides the default chat to announcing the stock list
 o set_missing_punter_mess(string)
Overrides the default chat to the player having wandered off
 o set_no_stock_mess(string)
Overrides the default reply to having no listable stock
 o set_none_left_mess(string)
Overrides the default reply to having none left
 o set_out_of_item_mess(string)
Overrides the default chat of being out of an item that is browsed
 o set_show_item_mess(string)
Overrides the default chat of showing an item to a player
 o set_too_heavy_mess(string)
Overrides the default chat of the player being too burdened to carry an item
 o set_too_poor_mess(string)
Overrides the default chat of the player being too poor to buy an item

Public Functions

These are functions that everyone can access.

.
 * cost_string
string cost_string(object thing,
                   string place,
                   object buyer)
This method returns the costs of the item as a string.

Parameters:
thing - the thing to buy
place - the money area it is being bought in
buyer - the person who is buying the object
Returns:
the string money value
 * do_browse
int do_browse(mixed indirect_obs,
              string dir_match,
              string indir_match,
              string * words)
The main entrace to the browse for things command.

Returns:
1 on success, 0 on failure
 * do_buy
int do_buy(mixed indirect_obs,
           string dir_match,
           string indir_match,
           string * words)
The main entrace to the buy things command.

Returns:
1 on success, 0 on failure
 * do_list
int do_list()
The main entrace to the list stuff command.

Returns:
1 on success, 0 on failure
 * event_enter
void event_enter(object ob,
                 string mess,
                 object from)
 * event_exit
void event_exit(object ob,
                string message,
                object to)
 * query_cost
int query_cost(object thing,
               object buyer)
This method returns the cost of the specified item to the buyer.

Parameters:
thing - the thing to cost
buyer - who is buying it
Returns:
the cost of the item
 * sell_thing
void sell_thing(object player,
                object thing)
The main entrace to the sell stuff command.

Returns:
1 on success, 0 on failure
 * set_all_out_mess
void set_all_out_mess(string s)
Overrides the default chat of the item being out of stock when a player tries to buy it

Parameters:
s - the chat to replace the default with. Must include $item$, which will be replaced by the item short.
 * set_busy_mess
void set_busy_mess(string s)
Overrides the default chat of the peddler being busy selling something already.

Parameters:
s - the chat to replace the default with
 * set_dont_sell_mess
void set_dont_sell_mess(string s)
Overrides the default chat of the peddler not selling an item

Parameters:
s - the chat to replace the default with. Must include $item$, which will be replaced by the item short.
 * set_in_combat_mess
void set_in_combat_mess(string s)
Overrides the default chat of the peddler being in combat and hence unable to sell his wares!

Parameters:
s - the chat to replace the default with
 * set_list_item_mess
void set_list_item_mess(string s)
Overrides the default chat of listing a stock item's price and stock

Parameters:
s - the chat to replace the default with. Must include $num_left$, $display$ and $cost$, which will be replaced by the appropriate strings.
 * set_list_mess
void set_list_mess(string s)
Overrides the default chat to announcing the stock list

Parameters:
s - the chat to replace the default with
 * set_missing_punter_mess
void set_missing_punter_mess(string s)
Overrides the default chat to the player having wandered off

Parameters:
s - the chat to replace the default with
 * set_no_stock_mess
void set_no_stock_mess(string s)
Overrides the default reply to having no listable stock

Parameters:
s - the chat to replace the default with
 * set_none_left_mess
void set_none_left_mess(string s)
Overrides the default reply to having none left

Parameters:
s - the chat to replace the default with
 * set_out_of_item_mess
void set_out_of_item_mess(string s)
Overrides the default chat of being out of an item that is browsed

Parameters:
s - the chat to replace the default with. Must include $item$, which will be replaced by the item short.
 * set_show_item_mess
void set_show_item_mess(string s)
Overrides the default chat of showing an item to a player

Parameters:
s - the chat to replace the default with. Must include $item$ and $cost$, which will be replaced by the item short and the cost of the item respectively.
 * set_too_heavy_mess
void set_too_heavy_mess(string s)
Overrides the default chat of the player being too burdened to carry an item

Parameters:
s - the chat to replace the default with. Must include $item$, which will be replaced by the item short.
 * set_too_poor_mess
void set_too_poor_mess(string s)
Overrides the default chat of the player being too poor to buy an item

Parameters:
s - the chat to replace the default with. Must include $item$, which will be replaced by the item short.

Discworld MUD's distribution world wide web pages.
brought to you by
Cut Me Own Throat Dibbler's Sensational Sausages; buy one while they are hot.
File last modified: Tue, 14 Oct 2003 18:16:35 GMT

Lost? Try Discworld's home page.