20 #ifndef __PSCHARQUESTMGR_H__ 21 #define __PSCHARQUESTMGR_H__ 26 #include <csutil/weakref.h> 41 #define PSQUEST_DELETE 'D' 42 #define PSQUEST_ASSIGNED 'A' 43 #define PSQUEST_COMPLETE 'C' 107 bool LoadQuestAssignments();
136 bool CompleteQuest(
psQuest* quest);
151 bool DiscardQuest(
psQuest* quest,
bool force =
false);
161 bool SetAssignedQuestLastResponse(
psQuest* quest,
int response,
gemObject* npc);
169 return assignedQuests.GetSize();
178 int GetAssignedQuestLastResponse(
size_t i);
190 bool UpdateQuestAssignments(
bool forceUpdate =
false);
207 return assignedQuests;
216 bool CheckQuestAssigned(
psQuest* quest);
224 bool CheckQuestCompleted(
psQuest* quest);
234 bool CheckQuestAvailable(
psQuest* quest, PID assignerId);
242 int NumberOfQuestsCompleted(csString category);
247 csArray<QuestAssignment*> assignedQuests;
unsigned int completionOrder
In case this questassignment was completed it will contain the order of completion.
int quest_id
Quest ID saved in case quest gets nulled out from us.
PID assigner_id
Character id of player who assigned quest to this player. This is used to make sure you cannot get tw...
This class holds all information for one quest with its reference to parent quest, list of steps, lockoutime, sub quests, ...
csWeakRef< psQuest > & GetQuest()
Since "quest" member can be nulled without notice, this accessor function attempts to refresh it if N...
void SetQuest(psQuest *q)
int last_response
To avoid losing a chain of responses in a quest, last responses are stored per assigned quest...
char status
This status determines whether the quest was assigned, completed, or is marked for deletion...
size_t GetNumAssignedQuests()
Gets the number of currently assigned quests.
Class to manager a characters quest details.
Sends messages to the client listing the assigned quests for the player.
csWeakRef< psQuest > quest
Weak pointer to the underlying quest relevant here.
unsigned long lockout_end
When a quest is completed, often it cannot immediately be repeated. This indicate the time when it ca...
void void Initialize(iObjectRegistry *object_reg)
bool IsCompleted()
Checks if the quest(/step) assignment is marked as complete.
A gemObject is any solid, graphical object visible in PS with normal physics and normal collision det...
bool dirty
Dirty flag determines minimal save on exit.
This structure tracks assigned quests.
csArray< QuestAssignment * > & GetAssignedQuests()
Get a list of quests.
PID last_response_from_npc_pid
To avoid losing a chain of responses in a quest, last responses are stored per assigned quest...