19 #ifndef __QUESTMANAGER_H__ 20 #define __QUESTMANAGER_H__ 40 struct QuestRewardOffer;
55 csPDelArray<QuestRewardOffer>
offers;
73 void CutOutParenthesis(csString &response, csString &within,
char start_char,
char end_char)
const;
75 bool GetResponseText(csString &block,csString &response,csString &file_path,
76 csString &him, csString &her, csString &it, csString &them)
const;
92 bool ParseItemList(
const csString &input, csString &parsedItemList);
109 int &last_response_id,
psQuest* quest,
110 csString &him, csString &her, csString &it, csString &them, csString &file_path);
121 bool AddTrigger(
const csString ¤t_npc,
const char* trigger,
127 csString &response_requireop,
128 bool quest_assigned_already,
133 size_t &which_trigger,
134 csString ¤t_npc,
135 csStringArray &pending_triggers);
138 csString &response_requireop,
139 csString &substep_requireop,
142 bool &quest_assigned_already,
198 bool operator<(
const TaskEntry &other)
const 202 if(completionOrder != other.completionOrder)
204 return completionOrder > other.completionOrder;
208 return questOrder > other.questOrder;
254 return lastError.GetData();
bool BuildTriggerList(csString &block, csStringArray &list) const
bool Uncomplete(psQuest *quest, Client *who, csTicks timeDelay=0)
Discards the requested step this is used by dictionary.
bool AddTrigger(const csString ¤t_npc, const char *trigger, int prior_response_id, NpcResponse *trig_response, psQuest *quest, const psString &postfix)
Adds a Trigger for a NpcResponse to the dict (global var)
csPDelArray< QuestRewardOffer > offers
void Assign(psQuest *quest, Client *who, gemNPC *assigner, csTicks timeDelay=0)
bool GiveRewardToPlayer(Client *who, QuestRewardItem &reward)
CacheManager * cacheManager
This class holds all information for one quest with its reference to parent quest, list of steps, lockoutime, sub quests, ...
The structure of 1 queue entry (pointer to a message)
bool ParseQuestScriptMenu(const csString &block, const csStringArray &triggers, psQuest *quest, NpcDialogMenu *menu) const
Parse QuestScript entries from a string.
void GetNextScriptLine(psString &scr, csString &block, size_t &start, int &line_number)
void CutOutParenthesis(csString &response, csString &within, char start_char, char end_char) const
bool Complete(psQuest *quest, Client *who, csTicks timeDelay=0)
void OfferRewardsToPlayer(Client *who, csArray< QuestRewardItem > &offer, csTicks &timeDelay)
bool GetResponseText(csString &block, csString &response, csString &file_path, csString &him, csString &her, csString &it, csString &them) const
bool HandlePlayerAction(csString &block, size_t &which_trigger, csString ¤t_npc, csStringArray &pending_triggers)
void MergeTriggerMenus(NpcDialogMenu *pending_menu, const csString ¤t_npc)
int ParseQuestScript(int id, const char *script)
Parase a new quest script.
csString ParseRequireCommand(csString &block, bool &result, psQuest *mainQuest)
Parses a require command inner part.
WordArray is class that parses text command (e.g.
bool LoadQuestScripts()
Load all scripts from db.
This class collects data of a netclient.
This class holds several possible responses and an action script for the npc to run whenever an appro...
bool operator<(long lhs, const GmpInt &rhs)
int ParseCustomScript(int id, const csString ¤t_npc, const char *script)
Parase a new custom script.
This huge class stores all the properties of any object a player can have in the game.
int GetNPCFromBlock(WordArray words, csString ¤t_npc)
This class manages the caching of data that is unchanging during server operation.
bool HandleScriptCommand(csString &block, csString &response_requireop, csString &substep_requireop, NpcResponse *last_response, psQuest *mainQuest, bool &quest_assigned_already, psQuest *quest)
int PreParseQuestScript(psQuest *mainQuest, const char *script)
Does a first parsing of the script.
bool ParseItem(const char *text, psStringArray &xmlItems, psMoney &money)
void HandleQuestReward(MsgEntry *pMsg, Client *client)
QuestManager(CacheManager *cachemanager)
bool LoadQuestScript(int id)
NpcResponse * AddResponse(const csString ¤t_npc, const char *response_text, int &last_response_id, psQuest *quest, csString &him, csString &her, csString &it, csString &them, csString &file_path)
Adds a NpcResponse to the dict (global var)
void AutocompleteQuestName(csString &questname, psQuest *mainQuest)
Checks if the quest name is existant, if it isn't it attemps to complete it with the name of the pass...
A slightly improved version of csStringArray, sporting the handy FormatPush method.
This class handles quest management for the player, tracking who has what quests assigned, etc.
bool ParseItemList(const csString &input, csString &parsedItemList)
csString lastError
Last error message to send to client on loadquest.
bool PrependPrerequisites(csString &substep_requireop, csString &response_requireop, bool quest_assigned_already, NpcResponse *last_response, psQuest *mainQuest)
bool HandleRequireCommand(csString &block, csString &response_requireop, psQuest *mainQuest)
Parses a require command.
void HandleQuestInfo(MsgEntry *pMsg, Client *client)
Provides a manager to facilitate subscriptions.