Planeshift
|
This class holds all information for one quest with its reference to parent quest, list of steps, lockoutime, sub quests, ... More...
#include <psquest.h>
Classes | |
struct | TriggerResponse |
Public Member Functions | |
bool | Active () |
Check if the quest is active (and also it's parents). More... | |
void | Active (bool state) |
Sets activation status of the quest. More... | |
bool | AddPrerequisite (csString prerequisitescript) |
bool | AddPrerequisite (csRef< psQuestPrereqOp > op) |
void | AddSubQuest (int id) |
Adds a pointer to a menu. More... | |
void | AddTriggerResponse (NpcTrigger *trigger, NpcResponse *response) |
Adds a set of pointers to a trigger and a response. More... | |
const csString & | GetCategory () const |
int | GetID () const |
The id can be defined by the database or dynamically created. More... | |
const char * | GetImage () const |
const char * | GetName () const |
psQuest * | GetParentQuest () const |
unsigned int | GetPlayerLockoutTime () const |
csRef< psQuestPrereqOp > & | GetPrerequisite () |
Return the prerequisite for this quest. More... | |
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). More... | |
const char * | GetTask () const |
bool | HasInfinitePlayerLockout () const |
bool | hasTaskText () |
Gets if the task (quest description/note) contains some text. More... | |
bool | Load (iResultRow &row) |
loads the quest information from a supplied result set More... | |
bool | PostLoad () |
parses the prerequisite string and caches the result More... | |
psQuest (int id=0, const char *name="") | |
default constructor More... | |
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 More... | |
csString | image |
bool | infinitePlayerLockout |
csString | name |
unique quest name More... | |
psQuest * | parent_quest |
parent quest of this quest (or NULL if there is none) More... | |
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 More... | |
csArray< int > | subquests |
list of IDs of the subquests of this quest More... | |
csString | task |
csArray< TriggerResponse > | triggerPairs |
list of trigger-response pairs added for the quest More... | |
This class holds all information for one quest with its reference to parent quest, list of steps, lockoutime, sub quests, ...
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 |
|
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.
|
inline |
bool psQuest::AddPrerequisite | ( | csString | prerequisitescript | ) |
bool psQuest::AddPrerequisite | ( | csRef< psQuestPrereqOp > | op | ) |
|
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 |
|
inline |
The id can be defined by the database or dynamically created.
Dynamic creation takes place in CacheManager::AddDynamicQuest
|
inline |
|
inline |
csString psQuest::GetPrerequisiteStr | ( | ) |
|
inline |
|
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
|
protected |
quest id - either as stored in the database or as assigned by CacheManager::AddDynamicQuest
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |