From the NannyMUD documentation

LAST CHANGE

2001-01-13

NAME

        questd - questd.c - the quest daemon

FUNCTIONS

QUERY FUNCTIONS

	Not all functions are listed here, but all those that can be of
        interest to other objects that the quest daemon. The descriptions
        here are very short; be careful and read the long descriptions below
        before you use them.

	query_can_wiz		- Can the player wiz?
	query_last_solved	- When was a quest last solved this reboot?
	query_maintainer	- Who is the maintained of the quest?
	query_nr_closed_quests	- How many quests are considered closed?
	query_nr_open_quests	- How many quests are considered open?
	query_nr_quests		- How many quests are there in the daemon?
	query_open		- Is this quest open or closed?
	query_ps_closed		- Percent of closed quests QP solved?
	query_ps_open		- Percent of open quests QP solved?
	query_ps_solved		- Percent of all quests QP solved?
	query_qps		- Gives the mapping names-qps.
	query_quest_names	- Names of quests, sorted vs qps.
	query_quest_values	- Qps of quests, sorted.
	query_solved		- Is this quest solved this reboot?
	query_solved_closed_qp	- Total qps for closed quests for a player.
	query_solved_open_qp	- Total qps for open quests for a player.
	query_solved_qp		- Total qps for a player.
	query_total_closed_qps	- The nr of qps of closed quests.
	query_total_open_qps	- The nr of qps of open quests.
	query_total_qps		- The total nr of qps.

DESCRIPTION

	This is the quest daemon. It keeps tracks of such things as what
        quests are open, what quests are closed, what QPs does a quest have,
        how many times it has been solved the last reboot, etc.

	INCLUDED FILES

	level.h
	tune.h

FUNCTION


NAME

        query_nr_quests - How many quests are there in the daemon?

SYNTAX

int query_nr_quests()

DESCRIPTION

	This function returns the total number of quests in the system closed
        as well as open ones.

FUNCTION


NAME

        query_nr_open_quests - How many quests are considered open?

SYNTAX

int query_nr_open_quests()

DESCRIPTION

	This function returns the number of quests that are considered open.

FUNCTION


NAME

        query_nr_closed_quests - How many quests are considered closed?

SYNTAX

int query_nr_closed_quests()

DESCRIPTION

	This function returns the number of quests that have been closed but
        still give QPs.

FUNCTION


NAME

        query_quest_names - Names of quests, sorted vs qps.

SYNTAX

string *query_quest_names()

DESCRIPTION

	This function returns a list of quest names, sorted by QP. It
        includes those closed quests that still give QPs in the list.

FUNCTION


NAME

        query_quest_values - query_quest_values

SYNTAX

int *query_quest_values()

DESCRIPTION

	This function returns a sorted list of the quest points.

FUNCTION


NAME

        query_qps - Gives the mapping names-qps.

SYNTAX

int query_qps(string q_name)

DESCRIPTION

	If given a string as an argument, this function returns the QPs of
        the quest with that name. If No argument is given, the a copy of the
        whole quest-to-qp mapping is returned.

FUNCTION


NAME

        query_open - Is this quest open or closed?

SYNTAX

int query_open(string q_name)

DESCRIPTION

	If given a string as an argument, the function returns 1 if the quest
        with that name is open, or 0 if the quest is closed. If given no
        argument, a copy of the mapping describing the open status is
        returned. In that mapping, the value -1 indicates open.

FUNCTION


NAME

        query_solved - Is this quest solved this reboot?

SYNTAX

int query_solved(string q_name)

DESCRIPTION

	If given a string as an argument, the number of times the quest with
        that name has been solved is returned. If given no argument, a copy
        of the mapping with all this data is returned.

FUNCTION


NAME

        query_last_solved - When was a quest last solved this reboot?

SYNTAX

int query_last_solved(string q_name)

DESCRIPTION

	This works just like query_solved(), but gives the last time the
        quest was solved this reboot.

FUNCTION


NAME

        query_maintainer - Who is the maintained of the quest?

SYNTAX

string query_maintainer(string q_name)

DESCRIPTION

	With a string as an argument, tis function returns the name of the
        maintainer of the quest 'q_name'. If no argument is given, a copy of
        the whole mapping with this data is returned.

FUNCTION


NAME

        query_total_qps - The total nr of qps.

SYNTAX

int query_total_qps()

DESCRIPTION

	This function returns the total number of QPs, summed over both open
        quests, and closed quests that still give QPs.

FUNCTION


NAME

        query_total_open_qps - The nr of qps of open quests.

SYNTAX

int query_total_open_qps()

DESCRIPTION

	This function returns the sum of the QPs for open quests.

FUNCTION


NAME

        query_total_closed_qps - This function returns the sum of the QPs for closed quests.

SYNTAX

int query_total_closed_qps()

DESCRIPTION

	This function returns the sum of the QPs for closed quests.

FUNCTION


NAME

        query_solved_qp - Total qps for a player.

SYNTAX

varargs int query_solved_qp(object player)

DESCRIPTION

	This function returns the total qps solved by the player object given
        as an argument, including both open quests and closed quests that
        still give QPs. If no argument is given, the calling object is used.

FUNCTION


NAME

        query_solved_open_qp - Total qps for open quests for a player.

SYNTAX

varargs int query_solved_open_qp(object player)

DESCRIPTION

	This function returns the qps solved by the player object given as an
        argument, taking only open quests into account. If no argument is
        given, the calling object is used.

FUNCTION


NAME

        query_solved_closed_qp - Total qps for closed quests for a player.

SYNTAX

varargs int query_solved_closed_qp(object player)

DESCRIPTION

	This function returns the qps solved by the player object given as an
        argument, taking only closed quests into account. If no argument is
        given, the calling object is used.

FUNCTION


NAME

        query_can_wiz - Can the player wiz?

SYNTAX

varargs int query_can_wiz(object player)

DESCRIPTION

	Given a player object (or else using the calling object), this
        function tells if the player can become wizard, taking into account
        such things as the constants defined in  and the players
        total QPs.

FUNCTION


NAME

        query_ps_solved - Percent of all quests QP solved?

SYNTAX

varargs int query_ps_solved(object player)

DESCRIPTION

	Treating the player object given as an argument, or the calling
        object, this function returns the percentage of the total QPs
        available that the player has solved. This takes into account both
        open quests and closed quests that still gives QP.

FUNCTION


NAME

        query_ps_open - Percent of open quests QP solved?

SYNTAX

varargs int query_ps_open(object player)

DESCRIPTION

	Treating the player object given as an argument, or the calling
        object, this function returns the percentage of the open QPs
        available that the player has solved. This takes into account only
        open quests.

FUNCTION


NAME

        query_ps_closed - Percent of closed quests QP solved?

SYNTAX

varargs int query_ps_closed(object player)

DESCRIPTION

	Treating the player object given as an argument, or the calling
        object, this function returns the percentage of the closed QPs
        available that the player has solved. This takes into account only
        closed quests that still gives QP.