[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/handlers/library.c</h2>
The library is a sort of information center.
Currently it supports only the recording on stories about players and
recording the quests that they have done.<p><b>See also:</b><br>/include/library.h
<br /><p>Written by Furball<h2>Includes</h2>
This class includes the following files /include/player.h, /include/move_failures.h, /include/player_handler.h, /include/playtesters.h and /include/quest_handler.h<h2>Class Index</h2>
<ul><li><a href="#class_qinfo">qinfo</a>
</ul><h2>Method index</h2>
<ul>
<li><a href="#calculate_quest_points">calculate_quest_points</a>(string)<li><a href="#delete_player_quest_info">delete_player_quest_info</a>(string, string)<br/>
This method deletes all quest info for a quest for the specific player.
<li><a href="#flush_cache">flush_cache</a>(string)<li><a href="#get_most_recent_quest">get_most_recent_quest</a>(string)<br/>
This method returns the most recently completed quest by the player.
<li><a href="#get_most_recent_time">get_most_recent_time</a>(string)<br/>
This method get sthe most recent time a quest was complete by the
player.
<li><a href="#query_active_quest_points">query_active_quest_points</a>(string)<br/>
This method returns the current number of quest points gathered
by the player for active quests.
<li><a href="#query_all_player_quest_info">query_all_player_quest_info</a>(string)<br/>
This method returns all the quest information for a player.
<li><a href="#query_inactive_quest_points">query_inactive_quest_points</a>(string)<br/>
This method returns the current number of quest points gathered
by the player for inactive quests.
<li><a href="#query_player_quest_info">query_player_quest_info</a>(string, string)<br/>
This method returns the quest info for a specific quest.
<li><a href="#query_quest_done">query_quest_done</a>(string, string)<br/>
This method tells us if the player has completed the quest.
<li><a href="#query_quest_points">query_quest_points</a>(string)<br/>
This method returns the current number of quest points gathered
by the player for both active and inactive quests.
<li><a href="#query_quest_time">query_quest_time</a>(string, string)<br/>
This method returns the time at which a quest is completed.
<li><a href="#query_quests">query_quests</a>(string)<br/>
This method returns the set of currently completed quests by the
player.
<li><a href="#query_story">query_story</a>(string)<br/>
This method returns the story associated with the player.
<li><a href="#query_title">query_title</a>(string)<br/>
This method returns the players current title.
<li><a href="#restart">restart</a>(mixed)<br/>
This method is called when a player refreshes totaly so they can
start again from scratch.
<li><a href="#save_them">save_them</a>(object)<br/>
This method causes the player to be saved.
<li><a href="#set_player_quest_info">set_player_quest_info</a>(string, string, mixed)<br/>
This method  sets the information related to the players quest.
<li><a href="#set_quest">set_quest</a>(string, string, int)<br/>
This method sets the player as having done the quest and if we
should give them xp for it
This function should be called when a quest is finished.
<li><a href="#unset_quest">unset_quest</a>(string, string, int)<br/>
This method removes a quest from the players list of completed quests.
<li><a href="#unset_quests">unset_quests</a>(string, string *, int)<br/>
This method removes a set of quests from the players list of completed
quests.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="calculate_quest_points">
calculate_quest_points</a><pre class="autodocfuncdef">
void calculate_quest_points(string name)
</pre>
<dt class="autodocfuncname"><a name="delete_player_quest_info">
delete_player_quest_info</a><pre class="autodocfuncdef">
mixed delete_player_quest_info(string pl_name,
                               string qu_name)
</pre><dd><br />
This method deletes all quest info for a quest for the specific player.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
pl_name - the player name<br />
qu_name - the quest name<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="flush_cache">
flush_cache</a><pre class="autodocfuncdef">
void flush_cache(string name)
</pre>
<dt class="autodocfuncname"><a name="get_most_recent_quest">
get_most_recent_quest</a><pre class="autodocfuncdef">
string get_most_recent_quest(string name)
</pre><dd><br />
This method returns the most recently completed quest by the player.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - the player name<br />
<br />
<dd><b>Returns:</b>
<br />the most recently completed quest
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="get_most_recent_time">
get_most_recent_time</a><pre class="autodocfuncdef">
int get_most_recent_time(string name)
</pre><dd><br />
This method get sthe most recent time a quest was complete by the
player.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - the name of the player<br />
<br />
<dd><b>Returns:</b>
<br />the time of the most recently completed quest
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_active_quest_points">
query_active_quest_points</a><pre class="autodocfuncdef">
int query_active_quest_points(string name)
</pre><dd><br />
This method returns the current number of quest points gathered
by the player for active quests.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - the player<br />
<br />
<dd><b>Returns:</b>
<br />the current number of inactive quest points<br /><br />
<dd><b>See also:</b>
<br /><a href="obj.handlers.query_handler.c.shtml#query_quest_level">/obj/handlers/query_handler->query_quest_level()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_all_player_quest_info">
query_all_player_quest_info</a><pre class="autodocfuncdef">
mapping query_all_player_quest_info(string pl_name)
</pre><dd><br />
This method returns all the quest information for a player.
This information is used for quests which have several parts to them
and information needs to be stored about the player as they attempt
to complete it.  The keys of the mapping are the quest names and the
values are the information associated with the quest.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
pl_name - the name of the player<br />
<br />
<dd><b>Returns:</b>
<br />the mapping containing all the quest info
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_inactive_quest_points">
query_inactive_quest_points</a><pre class="autodocfuncdef">
int query_inactive_quest_points(string name)
</pre><dd><br />
This method returns the current number of quest points gathered
by the player for inactive quests.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - the player<br />
<br />
<dd><b>Returns:</b>
<br />the current number of inactive quest points<br /><br />
<dd><b>See also:</b>
<br /><a href="obj.handlers.query_handler.c.shtml#query_quest_level">/obj/handlers/query_handler->query_quest_level()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_player_quest_info">
query_player_quest_info</a><pre class="autodocfuncdef">
mixed query_player_quest_info(string pl_name,
                              string qu_name)
</pre><dd><br />
This method returns the quest info for a specific quest.
This information is used for quests which have several parts to them
and information needs to be stored about the player as they attempt
to complete it.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
pl_name - the player name<br />
qu_name - the quest name<br />
<br />
<dd><b>Returns:</b>
<br />the information associated with the quest
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_quest_done">
query_quest_done</a><pre class="autodocfuncdef">
int query_quest_done(string player,
                     string quest)
</pre><dd><br />
This method tells us if the player has completed the quest.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
player - the name of the player<br />
quest - the quest name<br />
<br />
<dd><b>Returns:</b>
<br />1 if the quest has been done, 0 if it has not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_quest_points">
query_quest_points</a><pre class="autodocfuncdef">
int query_quest_points(string name)
</pre><dd><br />
This method returns the current number of quest points gathered
by the player for both active and inactive quests.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - the player<br />
<br />
<dd><b>Returns:</b>
<br />the current number of quest points<br /><br />
<dd><b>See also:</b>
<br /><a href="obj.handlers.query_handler.c.shtml#query_quest_level">/obj/handlers/query_handler->query_quest_level()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_quest_time">
query_quest_time</a><pre class="autodocfuncdef">
int query_quest_time(string name,
                     string qu_name)
</pre><dd><br />
This method returns the time at which a quest is completed.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - the name of the player to get the time for<br />
qu_name - the name of the quest<br />
<br />
<dd><b>Returns:</b>
<br />the time at which it is completed
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_quests">
query_quests</a><pre class="autodocfuncdef">
string * query_quests(string name)
</pre><dd><br />
This method returns the set of currently completed quests by the
player.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - the name of the player<br />
<br />
<dd><b>Returns:</b>
<br />the array of completed quests
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_story">
query_story</a><pre class="autodocfuncdef">
string query_story(string name)
</pre><dd><br />
This method returns the story associated with the player.   This is
created from all the information about the quests they have done
joined together into a neato story.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - the player name<br />
<br />
<dd><b>Returns:</b>
<br />the story of the player<br /><br />
<dd><b>See also:</b>
<br /><a href="obj.handlers.quest_handler.c.shtml#query_quest_story">/obj/handlers/quest_handler->query_quest_story()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_title">
query_title</a><pre class="autodocfuncdef">
string query_title(string name)
</pre><dd><br />
This method returns the players current title.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - the name of the player<br />
<br />
<dd><b>Returns:</b>
<br />their current title, 0 if no title<br /><br />
<dd><b>See also:</b>
<br />/obj/handlers/quest_handler.c
<br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="restart">
restart</a><pre class="autodocfuncdef">
int restart(mixed name)
</pre><dd><br />
This method is called when a player refreshes totaly so they can
start again from scratch.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - the player name<br />
<br />
<dd><b>Returns:</b>
<br />0 if they do not exists, 1 if they do
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="save_them">
save_them</a><pre class="autodocfuncdef">
void save_them(object thing)
</pre><dd><br />
This method causes the player to be saved.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the player to save
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_player_quest_info">
set_player_quest_info</a><pre class="autodocfuncdef">
void set_player_quest_info(string pl_name,
                           string qu_name,
                           mixed details)
</pre><dd><br />
This method  sets the information related to the players quest.
This information is used for quests which have several parts to them
and information needs to be stored about the player as they attempt
to complete it.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
pl_name - the name of the player<br />
qu_name - the quest name<br />
details - the information associated with the quest.
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_quest">
set_quest</a><pre class="autodocfuncdef">
int set_quest(string pl_name,
              string qu_name,
              int no_xp)
</pre><dd><br />
This method sets the player as having done the quest and if we
should give them xp for it
This function should be called when a quest is finished.  It will then
call the quest_completed function on the quest handler and do all
assorted modifications to the player object etc.  The name should be the
players name and the quest should be the name of the quest that is
stored in the quest handler.
<p>
The include file <library.h> should be used for calls to this
handler.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
pl_name - name of the player<br />
qu_name - name of the quest<br />
no_xp - do not give out xp<br />
<br />
<dd><b>Returns:</b>
<br />0 if the quest is already completed<br /><br />
<dd><b>See also:</b>
<br /><a href="obj.handlers.quest_handler.c.shtml#quest_completed">/obj/handlers/quest_handler->quest_completed()</a><br /><br /><dd><b>Example:</b>
<br/><pre>// Set the player as completing the womble friend quest, they get
// xp for it.
LIBRARY->set_quest(this_player()->query_name(), "womble friend", 0);
</pre><br /></dl>

<dt class="autodocfuncname"><a name="unset_quest">
unset_quest</a><pre class="autodocfuncdef">
varargs int unset_quest(string pl_name,
                        string qu_name,
                        int reset_info)
</pre><dd><br />
This method removes a quest from the players list of completed quests.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
pl_name - the player name<br />
qu_name - the quest name<br />
reset_info - If true quest info for the quests will be reset<br />
<br />
<dd><b>Returns:</b>
<br />0 if they have not done the quest, 1 if they habe<br /><br />
<dd><b>See also:</b>
<br />/obj/handlers/quest_handler.c
<br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="unset_quests">
unset_quests</a><pre class="autodocfuncdef">
varargs int * unset_quests(string pl_name,
                           string * qu_names,
                           int reset_info)
</pre><dd><br />
This method removes a set of quests from the players list of completed
quests.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
pl_name - the player name<br />
qu_names - the quest names<br />
reset_info - If true quest info for the quests will be reset<br />
<br />
<dd><b>Returns:</b>
<br />An array of corresponding 0 if they have not done the quest, 1 if
they have<br /><br />
<dd><b>See also:</b>
<br />/obj/handlers/quest_handler.c
<br /><br /><br /></dl>

</dl>
<h2>Classes</h2>
These are nice data types for dealing with...  Data!<p>
<ul>
<li><a name="class_qinfo">
qinfo</a><pre>
class qinfo {
              string * quests;
              int * times;
              mapping quest_info;
}

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

