[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/basic/item_chat.c</h2>-*- LPC -*-
This class handles atmospheric chat messages.
<h2>Includes</h2>
This class includes the following files <a href="include.room.h.shtml">/include/room.h</a><h2>Method index</h2>
<dl><ul>
<li><a href="#chat_off">chat_off</a>()<br/>
This stops the object chatting.
<li><a href="#chat_on">chat_on</a>()<br/>
This starts the object chatting.
<li><a href="#check_chat">check_chat</a>()<br/>
This method makes sure that we are chatting if we should be.
<li><a href="#fix_saved_chat">fix_saved_chat</a>(string)<br/>Fixes saved chats

<li><a href="#item_chat">item_chat</a>(mixed *)<br/>
This method adds atmospheric chat messages to the object.
<li><a href="#make_chat">make_chat</a>()<br/>
This method does the actual chat, it prints a message
and figures that stuff out.
<li><a href="#query_chats">query_chats</a>()<br/>
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="chat_off">
chat_off</a><pre>
void chat_off()
</pre></br>
This stops the object chatting.  This is done automaticly when leaving
the prescence of all interactive objects.
<br/><ul>
<li><b>See also:</b>
<br/><a href="#chat_on">chat_on()</a> and <a href="#item_chat">item_chat()
</a></dl>

<ul><a name="chat_on">
chat_on</a><pre>
void chat_on()
</pre></br>
This starts the object chatting.  This is done automaticly when entering
the presence of an interactive object
<br/><ul>
<li><b>See also:</b>
<br/><a href="#item_chat">item_chat()</a> and <a href="#chat_off">chat_off()
</a></dl>

<ul><a name="check_chat">
check_chat</a><pre>
void check_chat()
</pre></br>
This method makes sure that we are chatting if we should be.
<br/><ul>
<li><b>See also:</b>
<br/><a href="#chat_on">chat_on()</a>, <a href="#item_chat">item_chat()</a> and <a href="#make_chat">make_chat()
</a></dl>

<ul><a name="fix_saved_chat">
fix_saved_chat</a><pre>
string fix_saved_chat(string chat)
</pre></br>Fixes saved chats


<ul><a name="item_chat">
item_chat</a><pre>
void item_chat(mixed * args)
</pre></br>
This method adds atmospheric chat messages to the object.
The array which is passed into the object has three 
elements, the first element is the minimum time between chats, the second
parameter is the maximum time bewteen chats and the third parameter
is the list of actual chats.
<p>
Item chats are strings which are printed at (semi) random
intervals to living objects holding or in the same room as
someone holding the object. Currently they will not be
heard outside containers. They are used to add
atmosphere to an Item. A chat will be picked at random
from the array of chats with a frequency controlled by the
times min and max. ie. one will be picked every n seconds
where is varies between min and max seconds. Please
don't make the values for min and max too small or the
messages just become annoying! 
<p>
Currently, there's a maximum on the min/max values, every
value higher than 320 seconds is treated as that.
<p>
The chats can contain one of $a_short$, $the_short$ and
$poss_short$ which will be replaced with the
corresponding value. 
<p>
To call a function defined on the item in place of a chat message
use "#function_name" in place of a chat string.
<p>
To use languages in item chats you start the string with a
'%%'.  Then the language, followed by another '%%'.  After
that should be two more strings, first being the start message the
second being the string to mangle.
<p>
To use item chats, the object needs to inherit
"/std/basic/item_chat" and if the object defines an init()
function, that function should also call ::init()
<p>
To make the chatting object save the values, it's necessary
to define a couple of supporting functions in the item: 
<pre>
mapping query_dynamic_auto_load() {
  mapping tmp;

  tmp = ([ "::" : object::query_dynamic_auto_load(),
           "chat" : item_chat::query_dynamic_auto_load(), ]);
  return tmp;
} /* query_dynamic_auto_load() */

void init_dynamic_arg(mapping map) {
  if (map["::"])
    object::init_dynamic_arg(map["::"]);
  if (map["chat"])
    item_chat::init_dynamic_arg(map["chat"]);
} /* init_dynamic_arg() */

</pre>
Use object in the previous if the object is inheriting /std/object, if not,
then use whatever it's inheriting from instead. 
<br/><ul>
<li><b>Example:</b>
<br/><pre>item_chat( ({ 120, 240,
           ({ "A revolting smell drifts from $the_short$.",
             "Something rustles in $the_short$." }) }) );
</pre></dl>

<ul><a name="make_chat">
make_chat</a><pre>
void make_chat()
</pre></br>
This method does the actual chat, it prints a message
and figures that stuff out.
<br/><ul>
<li><b>See also:</b>
<br/><a href="#item_chat">item_chat()</a>, <a href="#chat_on">chat_on()</a> and <a href="#chat_off">chat_off()
</a></dl>

<ul><a name="query_chats">
query_chats</a><pre>
mixed * query_chats()
</pre></br>
<br/><ul>
<li><b>Returns:</b>
<br/>The raw data telling us what to chat and when

</dl>


[an error occurred while processing this directive]

