[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /std/npc/surface_decorator.c</h2>
 This is a inheritable for playerhousing surface decorating npcs.
 
 With this you can add carpets, wood panelling, beams or anything your 
 little heart desires to npcs that will then go out and make the world a    
 prettier place.

 If you want to add a surface to an npc that he will be able to 
 decorate, use eg:
 
 add_allowed_surface( "floor" );    

 If you want to add a type of decoration that the npc can install, use eg:
 
 add_fitted_surface( "plush blue carpet", "covered with plush "
 "blue carpet", <cost> );

 @September 3rd, 2002
 @authors Una and Dasquian

<h2>Inherits</h2>
This class inherits the following classes <a href="obj.monster.c.shtml">/obj/monster.c</a><h2>Includes</h2>
This class includes the following files <a href="include.money.h.shtml">/include/money.h</a> and /include/shops/bank.h<h2>Method index</h2>
<ul>
<li><a href="#add_allowed_domain">add_allowed_domain</a>(string)<br/>
Adds a string to the list of domains to be checked by the npc when it 
moves to see if it's allowed to be in that room, eg.
<li><a href="#add_allowed_surface">add_allowed_surface</a>(string)<br/>
Allows the npc to work on a specific surface in a room, eg.
<li><a href="#add_fitted_surface">add_fitted_surface</a>(string, string, int)<br/>
Adds a new decoration that the npc can use to his stock list

<li><a href="#check_domain">check_domain</a>()<br/>
Called every time the npc moves.
<li><a href="#do_ask">do_ask</a>(string, string)<br/>
Does all the necessary checks to see if he can decorate the requested 
surface with the requested decor, handles payment and starts the work.
<li><a href="#do_hire">do_hire</a>()<br/>
Sets him to follow the player and marks that player as his current 
employer

<li><a href="#do_list">do_list</a>()<br/>
Causes the surface decorator to give a list of the surfaces he decorates
and what he can decorate them with, or says that he has no stock.
<li><a href="#finish_work">finish_work</a>(string, string, object)<br/>
Called by do_ask(), this finishes decorating the surface

<li><a href="#query_allowed_domains">query_allowed_domains</a>()<li><a href="#query_allowed_surfaces">query_allowed_surfaces</a>()<li><a href="#query_employer">query_employer</a>()<li><a href="#query_fitted_surfaces">query_fitted_surfaces</a>()<li><a href="#query_responses">query_responses</a>()<li><a href="#query_under_construction_mess">query_under_construction_mess</a>()<li><a href="#query_work_time">query_work_time</a>()<li><a href="#remove_all_fitted_surfaces">remove_all_fitted_surfaces</a>()<br/>
Removes all decorations from the npc's stock list

<li><a href="#remove_fitted_surface">remove_fitted_surface</a>(string)<br/>
Removes a decoration whose short matches the argument given

<li><a href="#set_employer">set_employer</a>(object)<br/>
Sets the current player employer

<li><a href="#set_responses">set_responses</a>(string *)<br/>
Sets custom responses.
<li><a href="#set_under_construction_mess">set_under_construction_mess</a>(string)<br/>
Sets what a surface looks like while the npc is working on it.
<li><a href="#set_work_time">set_work_time</a>(int)<br/>
Sets the time it takes to finish the work.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_allowed_domain">
add_allowed_domain</a><pre class="autodocfuncdef">
void add_allowed_domain(string domain)
</pre><dd><br />
Adds a string to the list of domains to be checked by the npc when it 
moves to see if it's allowed to be in that room, eg. "/d/guilds" or 
"Bes_Pelargic"
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
domain - the name of the domain to be added
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="add_allowed_surface">
add_allowed_surface</a><pre class="autodocfuncdef">
void add_allowed_surface(string surface)
</pre><dd><br />
Allows the npc to work on a specific surface in a room, eg. floor, ceiling
If the argument passed is "wall", they will be able to work on all walls,
eg. north wall, east wall, south wall, etc.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
surface - the name of the surface to be added
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="add_fitted_surface">
add_fitted_surface</a><pre class="autodocfuncdef">
void add_fitted_surface(string short,
                        string long,
                        int cost)
</pre><dd><br />
Adds a new decoration that the npc can use to his stock list
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
short - the short description used in the stock list and for ordering<br />
long - the long description actually used for the new decoration in 
the room<br />
cost - the cost of installing this decoration
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="check_domain">
check_domain</a><pre class="autodocfuncdef">
void check_domain()
</pre><dd><br />
Called every time the npc moves.  This function checks that the file name 
of its new environment contains at least one of the allowed domains.  If
it does, it will store the current room as being its last good location.  
Otherwise, it will move it to its last good location.
<br />
<br /><dl>
<dd><b>See also:</b>
<br />go_back
.c<br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="do_ask">
do_ask</a><pre class="autodocfuncdef">
int do_ask(string surface,
           string decor)
</pre><dd><br />
Does all the necessary checks to see if he can decorate the requested 
surface with the requested decor, handles payment and starts the work. 
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
surface - the surface to be decorated <br />
decor - the short name of the decor to be used, eg. green carpet
<br />
<br />
<dd><b>See also:</b>
<br />finish_work
.c<br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="do_hire">
do_hire</a><pre class="autodocfuncdef">
int do_hire()
</pre><dd><br />
Sets him to follow the player and marks that player as his current 
employer
<br />

<dt class="autodocfuncname"><a name="do_list">
do_list</a><pre class="autodocfuncdef">
int do_list()
</pre><dd><br />
Causes the surface decorator to give a list of the surfaces he decorates
and what he can decorate them with, or says that he has no stock.
<br />

<dt class="autodocfuncname"><a name="finish_work">
finish_work</a><pre class="autodocfuncdef">
void finish_work(string surface,
                 string long,
                 object where)
</pre><dd><br />
Called by do_ask(), this finishes decorating the surface
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
surface - the surface to be decorated<br />
long - the long description of the decorated surface, eg. carpeted   
with plush green carpet
<br />
<br />
<dd><b>See also:</b>
<br />do_ask
.c<br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_allowed_domains">
query_allowed_domains</a><pre class="autodocfuncdef">
string * query_allowed_domains()
</pre>
<dt class="autodocfuncname"><a name="query_allowed_surfaces">
query_allowed_surfaces</a><pre class="autodocfuncdef">
string * query_allowed_surfaces()
</pre>
<dt class="autodocfuncname"><a name="query_employer">
query_employer</a><pre class="autodocfuncdef">
object query_employer()
</pre>
<dt class="autodocfuncname"><a name="query_fitted_surfaces">
query_fitted_surfaces</a><pre class="autodocfuncdef">
mapping query_fitted_surfaces()
</pre>
<dt class="autodocfuncname"><a name="query_responses">
query_responses</a><pre class="autodocfuncdef">
string * query_responses()
</pre>
<dt class="autodocfuncname"><a name="query_under_construction_mess">
query_under_construction_mess</a><pre class="autodocfuncdef">
string query_under_construction_mess()
</pre>
<dt class="autodocfuncname"><a name="query_work_time">
query_work_time</a><pre class="autodocfuncdef">
int query_work_time()
</pre>
<dt class="autodocfuncname"><a name="remove_all_fitted_surfaces">
remove_all_fitted_surfaces</a><pre class="autodocfuncdef">
void remove_all_fitted_surfaces()
</pre><dd><br />
Removes all decorations from the npc's stock list
<br />

<dt class="autodocfuncname"><a name="remove_fitted_surface">
remove_fitted_surface</a><pre class="autodocfuncdef">
void remove_fitted_surface(string short)
</pre><dd><br />
Removes a decoration whose short matches the argument given
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
short - the short description of the surface to remove
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_employer">
set_employer</a><pre class="autodocfuncdef">
void set_employer(object player)
</pre><dd><br />
Sets the current player employer
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
player - the player object currently using the npc
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_responses">
set_responses</a><pre class="autodocfuncdef">
void set_responses(string * the_responses)
</pre><dd><br />
Sets custom responses.  The array size must match the existing one or the  
call will be disregarded.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
the_responses - the array of responses to be used
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_under_construction_mess">
set_under_construction_mess</a><pre class="autodocfuncdef">
void set_under_construction_mess(string mess)
</pre><dd><br />
Sets what a surface looks like while the npc is working on it.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
mess - the description to replace the surface's appearance in the 
room while it is being worked on
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_work_time">
set_work_time</a><pre class="autodocfuncdef">
void set_work_time(int time)
</pre><dd><br />
Sets the time it takes to finish the work.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
time - the time (in seconds) taken to complete the work
<br />
<br />
<br /></dl>

</dl>
[an error occurred while processing this directive]

