Planeshift
|
This class holds the master list of all quests available in the game. More...
#include <psquest.h>
Classes | |
struct | TriggerResponse |
Public Member Functions | |
bool | Active () |
Check if the quest is active (and also it's parents). | |
void | Active (bool state) |
Sets activation status of the quest. | |
bool | AddPrerequisite (csRef< psQuestPrereqOp > op) |
bool | AddPrerequisite (csString prerequisitescript) |
void | AddSubQuest (int id) |
Adds a pointer to a menu. | |
void | AddTriggerResponse (NpcTrigger *trigger, NpcResponse *response) |
Adds a set of pointers to a trigger and a response. | |
const csString & | GetCategory () const |
int | GetID () const |
The id can be defined by the database or dynamically created. | |
const char * | GetImage () const |
const char * | GetName () const |
psQuest * | GetParentQuest () const |
unsigned int | GetPlayerLockoutTime () const |
csRef< psQuestPrereqOp > & | GetPrerequisite () |
Return the prerequisite for this quest. | |
csString | GetPrerequisiteStr () |
unsigned int | GetQuestLastActivatedTime () const |
unsigned int | GetQuestLockoutTime () const |
int | GetStep () const |
csArray< int > & | GetSubQuests () |
Returns an ordered list of the subquests of this quest (so it's steps). | |
const char * | GetTask () const |
bool | HasInfinitePlayerLockout () const |
bool | hasTaskText () |
Gets if the task (quest description/note) contains some text. | |
bool | Load (iResultRow &row) |
loads the quest information from a supplied result set | |
bool | PostLoad () |
parses the prerequisite string and caches the result | |
psQuest (int id=0, const char *name="") | |
default constructor | |
void | SetParentQuest (psQuest *parent) |
void | SetQuestLastActivatedTime (unsigned int when) |
void | SetTask (csString mytask) |
virtual | ~psQuest () |
Protected Attributes | |
bool | active |
csString | category |
int | flags |
int | id |
quest id - either as stored in the database or as assigned by CacheManager::AddDynamicQuest | |
csString | image |
bool | infinitePlayerLockout |
csString | name |
unique quest name | |
psQuest * | parent_quest |
parent quest of this quest (or NULL if there is none) | |
unsigned int | player_lockout_time |
csRef< psQuestPrereqOp > | prerequisite |
csString | prerequisiteStr |
unsigned int | quest_last_activated |
unsigned int | quest_lockout_time |
int | step_id |
natoka: never used, though i suppose it was ment for the substep number | |
csArray< int > | subquests |
list of IDs of the subquests of this quest | |
csString | task |
csArray< TriggerResponse > | triggerPairs |
list of trigger-response pairs added for the quest |
This class holds the master list of all quests available in the game.
psQuest::psQuest | ( | int | id = 0 , |
const char * | name = "" |
||
) |
default constructor
id | questID - either from the database, or dynamically created |
name | is a unique string |
virtual psQuest::~psQuest | ( | ) | [virtual] |
bool psQuest::Active | ( | ) | [inline] |
Check if the quest is active (and also it's parents).
A quest to be active must be active itself and, if so, also it's parents (most probably earlier steps) must be active themselves so check back to them if this quest is active else return as not active directly.
void psQuest::Active | ( | bool | state | ) | [inline] |
bool psQuest::AddPrerequisite | ( | csRef< psQuestPrereqOp > | op | ) |
bool psQuest::AddPrerequisite | ( | csString | prerequisitescript | ) |
void psQuest::AddSubQuest | ( | int | id | ) | [inline] |
Adds a pointer to a menu.
This is needed for deallocation at desctruction time.
menu | created by the quests questscript Register a quest as a subquest of this quest. |
Subquests are normally generated when parsing quest_scripts.
id | of the subquest to register. |
void psQuest::AddTriggerResponse | ( | NpcTrigger * | trigger, |
NpcResponse * | response | ||
) |
Adds a set of pointers to a trigger and a response.
This is needed for deallocation at desctruction time.
trigger | created by the quests questscript |
response | created by the quests questscript |
int psQuest::GetID | ( | ) | const [inline] |
The id can be defined by the database or dynamically created.
Dynamic creation takes place in CacheManager::AddDynamicQuest
const char* psQuest::GetName | ( | ) | const [inline] |
csRef<psQuestPrereqOp>& psQuest::GetPrerequisite | ( | ) | [inline] |
csString psQuest::GetPrerequisiteStr | ( | ) |
bool psQuest::hasTaskText | ( | ) | [inline] |
bool psQuest::Load | ( | iResultRow & | row | ) |
loads the quest information from a supplied result set
row | result set to store in this object |
bool psQuest::PostLoad | ( | ) |
parses the prerequisite string and caches the result
bool psQuest::active [protected] |
csString psQuest::category [protected] |
int psQuest::flags [protected] |
int psQuest::id [protected] |
quest id - either as stored in the database or as assigned by CacheManager::AddDynamicQuest
csString psQuest::image [protected] |
bool psQuest::infinitePlayerLockout [protected] |
csString psQuest::name [protected] |
psQuest* psQuest::parent_quest [protected] |
unsigned int psQuest::player_lockout_time [protected] |
csRef<psQuestPrereqOp> psQuest::prerequisite [protected] |
csString psQuest::prerequisiteStr [protected] |
unsigned int psQuest::quest_last_activated [protected] |
unsigned int psQuest::quest_lockout_time [protected] |
int psQuest::step_id [protected] |
csArray<int> psQuest::subquests [protected] |
csString psQuest::task [protected] |
csArray<TriggerResponse> psQuest::triggerPairs [protected] |