[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/quest_handler.c

This class keeps track of the current set of quests availabe in the game.

Written by Furball

Includes

This class includes the following files /include/player_handler.h, /include/quest_handler.h and /include/library.h

Method index

Public Functions

These are functions that everyone can access.

add_area
int add_area(string area,
             string parent)
add_quest
int add_quest(string name,
              int level,
              string title,
              string story)

This method adds a new quest into the system. You only need to call this ONCE. The name of the quest must be unique. The story is what can be seen in the players books about the player.

Parameters:
name - the name of the quest
title - the title for finishing the quest, 0 for none
story - the story about the quest

Returns:
1 if successful, 0 if not

See also:
delete_quest(), query_quest_level(), query_quest_title() and query_quest_story()


all_quest_data
mixed * all_quest_data(string name)
change_quest_status
int change_quest_status(string name)

Change the status of a quest from active to inactive and vice versa.

Parameters:
the - name of a quest.


compare_quests
void compare_quests(string name)

This method queries the factors that make up the quest points.

Parameters:
name - the name of the quest or the domain. Blank for all quests.

Returns:
the level of the quest, -1 on failure

See also:
add_quest()


delete_quest
int delete_quest(string name)

This method removes the given quest from the system.

Returns:
0 on failure, 1 on success

See also:
name the name of the quest to remove.c and add_quest()


find_quest_by_name
int find_quest_by_name(string name)
print_some_stats
void print_some_stats()

This method prints out a lot of quest stats. For debugging purposes only.
query_activated
int query_activated(string name)
query_active_quests
string * query_active_quests()
query_all_area_children
string * query_all_area_children(string area)
query_all_hints
class quest_hints query_all_hints(string name)
query_area_children
string * query_area_children(string area)
query_area_parents
string * query_area_parents(string area)
query_areas
mapping query_areas()
query_cre_solution
string query_cre_solution(string name)
query_domains
string * query_domains(string name)
query_fame_str
string query_fame_str(string name)

This method returns a string associated with the fame level of the player.

Parameters:
name - the name of the player

Returns:
the fame string

See also:
query_player_fame() and query_player_story()


query_full_solution
string query_full_solution(string name)
query_hints
string * query_hints(string name)
query_item_hints
string * query_item_hints(string name)
query_items
string * query_items(string name)
query_location_hints
string * query_location_hints(string name)
query_locations
string * query_locations(string name)
query_new_quest
int query_new_quest(string quest)
query_new_quests
string * query_new_quests()
query_npc_hints
string * query_npc_hints(string name)
query_npcs
string * query_npcs(string name)
query_player_fame
int query_player_fame(string name)

This method returns the fame of the player. Gets the fame percentage of the player. Quest points / total quest points

Parameters:
name - the name of the player

Returns:
the fame as a percentage (0-100)

See also:
query_player_story(), query_fame_string() and query_total_qp()


query_player_story
string * query_player_story(string name)

This method lists the stories for the quests the player has done.

Parameters:
name - the name of the player

Returns:
the story of the player

See also:
query_fame_string() and query_player_fame()


query_quest_done
string query_quest_done(string name)

This method returns the name of the last person to complete the quest.

Parameters:
name - thre name of the quest

Returns:
the last person to complete the quest

See also:
quest_completed(), add_quest() and query_quest_times()


query_quest_factors
int * query_quest_factors(string name)

This method queries the factors that make up the quest points.

Parameters:
name - the name of the quest

Returns:
The quest point factors

See also:
add_quest()


query_quest_level
int query_quest_level(string name)

This method returns the level of the quest.

Parameters:
name - the name of the quest

Returns:
the level of the quest, -1 on failure

See also:
add_quest()


query_quest_levels
int * query_quest_levels()

This method returns the levels of all the quests.

Returns:
the levels of all the quests

See also:
add_quest() and delete_quest()


query_quest_names
string * query_quest_names()

This method returns the names of all the quests.

Returns:
the names of all the quests

See also:
add_quest() and delete_quest()


query_quest_status
int query_quest_status(string name)

This method returns the status of a quest.

Parameters:
the - name of a quest

Returns:
1 for active, 0 for inactive.


query_quest_stories
string * query_quest_stories()

This method returns the stories of all the quests.

Returns:
the stories of all the quests

See also:
add_quest() and delete_quest()


query_quest_story
string query_quest_story(string name)

This method returns the story associated with the quest.

Parameters:
name - of the quest

Returns:
the story of the quest

See also:
add_quest() and set_quest_story()


query_quest_time_done
int query_quest_time_done(string name)

This method returns the time of the last time the quest was completed.

Parameters:
name - the name of the quest

Returns:
the last time the quest was completed

See also:
quest_completed(), add_quest() and query_quest_times()


query_quest_times
int query_quest_times(string name)

This method returns the number of times the quest has been completed.

Parameters:
name - thre name of the quest

Returns:
the number of times completed

See also:
quest_completed(), add_quest() and query_quest_done()


query_quest_title
string query_quest_title(string name)

This method returns the title associated with the quest.

Parameters:
name - of the quest

Returns:
the title of the quest

See also:
add_quest() and set_quest_title()


query_quest_titles
string * query_quest_titles()

This method returns the titles of all the quests.

Returns:
the titles of all the quests

See also:
add_quest() and delete_quest()


query_quests
class quest * query_quests()
query_total_qp
int query_total_qp()

This returns the current total gp for all of the current quests.

Returns:
the total gp


quest_completed
void quest_completed(string name,
                     string quest,
                     object prev_ob)

This method should be called in the code when a quest is complete.

Parameters:
name - name of the player
quest - the quest completed
prev_ob - the object which completed the quest

See also:
add_quest() and delete_quest()


recalc_quest_level
int recalc_quest_level(string name)

This method recalculates the level of the quest.

Parameters:
name - the name of the quest

Returns:
the 1 if it succeeds, 0 if it fails

See also:
add_quest()


remove_area
int remove_area(string area)
rename_area
int rename_area(string area,
                string new_name)
set_cre_solution
int set_cre_solution(string name,
                     string solution)
set_domains
int set_domains(string name,
                string * domains)
set_full_solution
int set_full_solution(string name,
                      string solution)
set_hints
int set_hints(string name,
              string * hints)
set_item_hints
int set_item_hints(string name,
                   string * hints)
set_items
int set_items(string name,
              string * items)
set_level_factor
int set_level_factor(string name,
                     int factor,
                     int num)

This sets a given quest level factor of a given quest.

Parameters:
name - The name of the quest to set
factor - Which factor to change
num - The value to set the factor to

Returns:
1 for success, 0 for failure


set_location_hints
int set_location_hints(string name,
                       string * hints)
set_locations
int set_locations(string name,
                  string * locs)
set_npc_hints
int set_npc_hints(string name,
                  string * hints)
set_npcs
int set_npcs(string name,
             string * npcs)
set_quest_area
int set_quest_area(string name,
                   int num)

This method sets the quest points awarded for the dangerousness of the area the quest is set in. Can be 0-2.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0 on failure, 1 on success

See also:
add_quest() and query_quest_level()


set_quest_guild
int set_quest_guild(string name,
                    int num)

This method sets the quest points awarded for any cross-guild involvement involved to complete the quest. Can be 0-1.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0 on failure, 1 on success

See also:
add_quest() and query_quest_level()


set_quest_level
int set_quest_level(string name,
                    int level)

This method sets the level of the quest. This is deprecated. Set the level factors instead.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0

See also:
add_quest(), set_level_factor() and query_quest_level()


set_quest_money
int set_quest_money(string name,
                    int num)

This method sets the quest points awarded for the amount of money required to complete the quest. Can be 0-2.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0 on failure, 1 on success

See also:
add_quest() and query_quest_level()


set_quest_npcs
int set_quest_npcs(string name,
                   int num)

This method sets the quest points awarded for the dangerousness of the npcs that needs to be killed specifically to complete the quest. Can be 0-2.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0 on failure, 1 on success

See also:
add_quest() and query_quest_level()


set_quest_people
int set_quest_people(string name,
                     int num)

This method sets the quest points awarded for the amount of people involved to complete the quest. Can be 0-1.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0 on failure, 1 on success

See also:
add_quest() and query_quest_level()


set_quest_randomness
int set_quest_randomness(string name,
                         int num)

This method sets the quest points awarded for the amount of randomness of the quest. Can be 0-3.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0 on failure, 1 on success

See also:
add_quest() and query_quest_level()


set_quest_skills
int set_quest_skills(string name,
                     int num)

This method sets the quest points awarded for the amount of skills required to complete the quest. Can be 0-2.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0 on failure, 1 on success

See also:
add_quest() and query_quest_level()


set_quest_steps
int set_quest_steps(string name,
                    int num)

This method sets the quest points awarded for the amount of steps of the quest. Can be 0-3.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0 on failure, 1 on success

See also:
add_quest() and query_quest_level()


set_quest_story
int set_quest_story(string name,
                    string story)

This method sets the story associated with the quest.

Parameters:
name - of the quest
story - the new story of the quest

See also:
add_quest() and query_quest_story()


set_quest_time
int set_quest_time(string name,
                   int num)

This method sets the quest points awarded for any time factor involved to complete the quest. Can be 0-1.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0 on failure, 1 on success

See also:
add_quest() and query_quest_level()


set_quest_title
int set_quest_title(string name,
                    string title)

This method sets the title associated with the quest.

Parameters:
name - of the quest
title - the new title of the quest

See also:
add_quest() and query_quest_title()


set_quest_travel
int set_quest_travel(string name,
                     int num)

This method sets the quest points awarded for the amount of travel involved to complete the quest. Can be 0-2.

Parameters:
name - the name of the quest
level - the level of the quest

Returns:
0 on failure, 1 on success

See also:
add_quest() and query_quest_level()