[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/living/money.c</h2>
This file has all the functions to deal with living objects and
money.<p><b>See also:</b><br>/obj/money.c and /obj/handlers/money_handler.c
<br /><p>Written by Pinkfish<h2>Includes</h2>
This class includes the following files /include/shops/bank.h and /include/money.h<h2>Method index</h2>
<ul>
<li><a href="#adjust_money">adjust_money</a>(mixed, string)<br/>
This method adjusts the amount ofmoney the player has.
<li><a href="#give_money">give_money</a>(int, int, string)<br/>
This method is used to give some startup money to the npc.
<li><a href="#pay_money">pay_money</a>(mixed, string)<br/>
This method makes the player make a payment.
<li><a href="#query_money">query_money</a>(string)<br/>
This method returns all of the money of a certain type on the
money object.
<li><a href="#query_money_array">query_money_array</a>()<br/>
This method returns the money array associated with the money on
the player object.
<li><a href="#query_money_object">query_money_object</a>(int)<br/>
This method returns the money object for the player.
<li><a href="#query_value">query_value</a>()<br/>
This method returns the value of the money as an integer.
<li><a href="#query_value_in">query_value_in</a>(string)<br/>
This method returns the value of the money as in integer in the specified
place.
<li><a href="#set_money_array">set_money_array</a>(mixed *)<br/>
This method sets the money array associated with the player.
<li><a href="#setup_money">setup_money</a>(int, string)<br/>
This method provides a way to automatically distribute an amount of
money in a particular currency, rather than adding each element seperately.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="adjust_money">
adjust_money</a><pre class="autodocfuncdef">
varargs void adjust_money(mixed amount,
                          string type)
</pre><dd><br />
This method adjusts the amount ofmoney the player has.
It redirects the call off the the money object and calls the
adjust_money() function on it.  The amount can be a money
array, in which case it will adjust the size by the members
of the money array.
<p>If the money object doesn't exist yet, this function
might create a new money object.  The exception is that if
the amount argument is 0, nothing happens.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
amount - the amount to adjust the money by<br />
type - the type of coin to adjust
<br />
<br />
<dd><b>See also:</b>
<br /><a href="obj.money.c.shtml#adjust_money">/obj/money->adjust_money()</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="give_money">
give_money</a><pre class="autodocfuncdef">
int give_money(int base,
               int rand,
               string type)
</pre><dd><br />
This method is used to give some startup money to the npc.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
base - the base amount ofmoney to give (fixed)<br />
rand - the random amount ofmoney to give<br />
type - the type of money to give (default: "copper")<br />
<br />
<dd><b>Returns:</b>
<br />the return value of adjust_money()<br /><br />
<dd><b>See also:</b>
<br />/std/living/money.c
<br /><br /><dd><b>Example:</b>
<br/><pre>ob = clone_object(CLUCKY_CHICKEN);
// This will give the chicken 10 + random(10) royals.
// It is a royal chicken
ob->give_money(10, 10, "royal");</pre><br /></dl>

<dt class="autodocfuncname"><a name="pay_money">
pay_money</a><pre class="autodocfuncdef">
varargs void pay_money(mixed m_array,
                       string where)
</pre><dd><br />
This method makes the player make a payment.  This is used for
shops and things.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
m_array - the money to pay<br />
where - the money area to make the payment in<br />
<br />
<dd><b>See also:</b>
<br /><a href="obj.handlers.money_handler.c.shtml#make_payment">/obj/handlers/money_handler->make_payment()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_money">
query_money</a><pre class="autodocfuncdef">
int query_money(string type)
</pre><dd><br />
This method returns all of the money of a certain type on the
money object.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
type - the type of money to return<br />
<br />
<dd><b>Returns:</b>
<br />the number of those money items<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_value">query_value()</a> and <a href="#query_value_in">query_value_in()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_money_array">
query_money_array</a><pre class="autodocfuncdef">
mixed * query_money_array()
</pre><dd><br />
This method returns the money array associated with the money on
the player object.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the money array on the player object<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_money_array">set_money_array()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_money_object">
query_money_object</a><pre class="autodocfuncdef">
object query_money_object(int force)
</pre><dd><br />
This method returns the money object for the player.  If the force
flag is set then the object will be created if it does not
exist.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
force - make the money object exist
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_value">
query_value</a><pre class="autodocfuncdef">
int query_value()
</pre><dd><br />
This method returns the value of the money as an integer.  This is
an absolute value of their worth.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />an integer value of their money<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_value_in">query_value_in()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_value_in">
query_value_in</a><pre class="autodocfuncdef">
int query_value_in(string where)
</pre><dd><br />
This method returns the value of the money as in integer in the specified
place.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
where - the place in which to determine the money from<br />
<br />
<dd><b>Returns:</b>
<br />the integer value of money<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_value">query_value()</a> and <a href="#query_money">query_money()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_money_array">
set_money_array</a><pre class="autodocfuncdef">
void set_money_array(mixed * new_array)
</pre><dd><br />
This method sets the money array associated with the player.   THis
will overwrite any current money on the player.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
new_array - the new money array for the player<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_money_array">query_money_array()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="setup_money">
setup_money</a><pre class="autodocfuncdef">
void setup_money(int value,
                 string area)
</pre><dd><br />
This method provides a way to automatically distribute an amount of
money in a particular currency, rather than adding each element seperately.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
value - The value of currency to give, as per set_value<br />
<br />
<br /></dl>

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

