Class to manager a characters quest details.
More...
#include <pscharquestmgr.h>
List of all members.
Detailed Description
Class to manager a characters quest details.
Definition at line 90 of file pscharquestmgr.h.
Constructor & Destructor Documentation
psCharacterQuestManager::~psCharacterQuestManager |
( |
| ) |
|
Destroy the manager and delete all the assigned quests.
Member Function Documentation
Assign a quest.
This assigns a quest to the character.
- Parameters:
-
quest | The quest object that will be assigned to the character. |
assignerId | The PID of the character that assigned the quest. |
- Returns:
- A QuestAssignement object for the quest.
bool psCharacterQuestManager::CheckQuestAssigned |
( |
psQuest * |
quest | ) |
|
Checks to see if a quest has been assigned.
- Parameters:
-
quest | The quest object to check if is assigned or not. |
- Returns:
- true if the quest status is PSQUEST_ASSIGNED
bool psCharacterQuestManager::CheckQuestAvailable |
( |
psQuest * |
quest, |
|
|
PID |
assignerId |
|
) |
| |
This incorrectly named function checks if the npc (assigner_id) is supposed to answer in the (parent)quest at this moment.
- Parameters:
-
quest | The quest object to check. |
assignerId | The character that assigned the quest. |
- Returns:
- True if the assigner is supposed to answer?
bool psCharacterQuestManager::CheckQuestCompleted |
( |
psQuest * |
quest | ) |
|
Checks to see if a quest has been completed.
- Parameters:
-
quest | The quest object to check if it has been completed or not. |
- Returns:
- true if the quest status is PSQUEST_COMPLETE
bool psCharacterQuestManager::CompleteQuest |
( |
psQuest * |
quest | ) |
|
Complete a quest.
This sets a quest as completed for this character.
- Parameters:
-
quest | The quest object that was completed. |
- Returns:
- true if the quest complete was successful, false otherwise.
void psCharacterQuestManager::DiscardQuest |
( |
QuestAssignment * |
q, |
|
|
bool |
force = false |
|
) |
| |
Discard a quest.
- Parameters:
-
q | The QuestAssignment object for the quest we want to discard. |
force | Force the quest to be discarded regardless of any conditions. |
bool psCharacterQuestManager::DiscardQuest |
( |
psQuest * |
quest, |
|
|
bool |
force = false |
|
) |
| |
Discard a quest.
- Parameters:
-
quest | The Quest object for the quest we want to discard. |
force | Force the quest to be discarded regardless of any conditions. |
int psCharacterQuestManager::GetAssignedQuestLastResponse |
( |
size_t |
i | ) |
|
Get the response of a particular quest.
- Parameters:
-
i | The index into the list of quests to look for response. |
- Returns:
- The last response ID for that quest or -1 if quest could not be found.
Create a network message for all the assigned quests.
- Parameters:
-
quests | The network message to populate with the current quest assignment information. |
cNum | The client number the network message is for. |
- Returns:
- The number of quests that have been assigned.
size_t psCharacterQuestManager::GetNumAssignedQuests |
( |
| ) |
[inline] |
Gets the number of currently assigned quests.
- Returns:
- The number of assigned quests.
Definition at line 167 of file pscharquestmgr.h.
void psCharacterQuestManager::Initialize |
( |
psCharacter * |
owner | ) |
|
Setup this manager for a character.
- Parameters:
-
owner | The character that this quest manager is for. |
Check to see if a quest is assigned.
- Parameters:
-
id | The unique database ID the quest has. |
- Returns:
- A valid QuestAssignment if the quest had been assigned. Otherwise will return NULL if the quest has not been assigned.
bool psCharacterQuestManager::LoadQuestAssignments |
( |
| ) |
|
Load the quests from the database.
Make sure that the owner has a valid PID before loading because it uses that to figure out what to load.
int psCharacterQuestManager::NumberOfQuestsCompleted |
( |
csString |
category | ) |
|
Checks to see how many quests complete.
- Parameters:
-
category | The category of quests to check against. |
- Returns:
- The number of quests that have been complete in the given category.
bool psCharacterQuestManager::SetAssignedQuestLastResponse |
( |
psQuest * |
quest, |
|
|
int |
response, |
|
|
gemObject * |
npc |
|
) |
| |
Set an assigned quest last response.
- Parameters:
-
quest | The quest object to set the last response for. |
response | The UID of the response used. |
npc | The gemObject of the npc that was used. |
- Returns:
- true if response could be set. false if it could not be.
bool psCharacterQuestManager::UpdateQuestAssignments |
( |
bool |
forceUpdate = false | ) |
|
Update the quest assignment list.
This updates the database to write the current quest assignment lists for the character.
- Parameters:
-
forceUpdate | If set to true, write the quest information even if it is not 'dirty' |
- Returns:
- true if the quest information successfully written to database.
The documentation for this class was generated from the following file: