[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 /obj/misc/quest_info_utils.c</h2>
Quest info utils.
General inheritable for use by anything really.  Using quest_info stuff is a
bit of a pain.  This is just syntactic sugar to make it a lot more friendly.
Quest info is saved as a mapping, so you can index any info you like under
named keys.<p>Written by Dek<p>Started March 2001
<h2>Includes</h2>
This class includes the following files <a href="include.library.h.shtml">/include/library.h</a><h2>Method index</h2>
<ul>
<li><a href="#clear_quest_info">clear_quest_info</a>(mixed)<br/>
Clears all the quest info associated with a player for this quest.
<li><a href="#query_quest_done">query_quest_done</a>(mixed)<br/>
This tests if the quest has been done by a given player.
<li><a href="#query_quest_param">query_quest_param</a>(mixed, string)<br/>
Gets the quest info value addressed by a given key.
<li><a href="#set_quest">set_quest</a>(mixed)<br/>
This awards a player with the quest.
<li><a href="#set_quest_name">set_quest_name</a>(string)<br/>
Sets the name of the quest this item applies to.
<li><a href="#set_quest_param">set_quest_param</a>(mixed, string, mixed)<br/>
Sets the quest info value addressed by a certain key.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="clear_quest_info">
clear_quest_info</a><pre class="autodocfuncdef">
void clear_quest_info(mixed player)
</pre><dd><br />
Clears all the quest info associated with a player for this quest.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
player - The player object, or the name of the player, whose info to
clear<br />
<br />
<dd><b>Example:</b>
<br/><pre> if( player->query_al() > 500 ) {
    pig->do_death();
    clear_quest_info( player );
 }
</pre><br /></dl>

<dt class="autodocfuncname"><a name="query_quest_done">
query_quest_done</a><pre class="autodocfuncdef">
int query_quest_done(mixed player)
</pre><dd><br />
This tests if the quest has been done by a given player.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
player - The player object, or the name of the player, to check for
having done the quest<br />
<br />
<dd><b>Returns:</b>
<br />1 if they have done the quest, 0 if they haven't<br /><br />
<dd><b>Example:</b>
<br/><pre> if( query_quest_done( this_player() ) )
    write( "Having already taken care of pigs, you have no desire to do so "
             "again.\n" );
</pre><br /></dl>

<dt class="autodocfuncname"><a name="query_quest_param">
query_quest_param</a><pre class="autodocfuncdef">
mixed query_quest_param(mixed player,
                        string key)
</pre><dd><br />
Gets the quest info value addressed by a given key.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
player - The player object, or the name of the player, whose info to
find<br />
key - The keyword to get the value for<br />
<br />
<dd><b>Returns:</b>
<br />The value associated with the key<br /><br />
<dd><b>Example:</b>
<br/><pre> string name = query_quest_param( player, "pig name" );
 if( name != pig->pig_name() )
    tell_object( player, "This isn't your pig!  You're supposed to look "
             after " + name + "!\n" );
</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_quest">
set_quest</a><pre class="autodocfuncdef">
int set_quest(mixed player)
</pre><dd><br />
This awards a player with the quest.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
player - The player object, or the name of the player, to award with the
quest<br />
<br />
<dd><b>Returns:</b>
<br />-1 if the player specified was invalid, 0 if the quest couldn't be
awarded, and 1 if it was successfully awarded<br /><br />
<dd><b>Example:</b>
<br/><pre> if( pig->query_happiness() > 10 )
    set_quest( this_player() );
</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_quest_name">
set_quest_name</a><pre class="autodocfuncdef">
void set_quest_name(string quest_name)
</pre><dd><br />
Sets the name of the quest this item applies to.  Call this function in
setup().  This is making the assumption that one item only deals with one
quest, but it's a fairly safe assumption.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
quest_name - The name of the quest this object deals with<br />
<br />
<dd><b>Example:</b>
<br/><pre> set_quest_name( "pig caretaker" );
</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_quest_param">
set_quest_param</a><pre class="autodocfuncdef">
void set_quest_param(mixed player,
                     string key,
                     mixed value)
</pre><dd><br />
Sets the quest info value addressed by a certain key.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
player - The player object, or the name of the player, whose info to
change<br />
key - The keyword to set info for<br />
value - The value to set the info to.  Can be of any type<br />
<br />
<dd><b>Example:</b>
<br/><pre> set_quest_param( this_player(), "pig name", "Horace" );
 set_quest_param( this_player(), "fed pig", 1 );
</pre><br /></dl>

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

