20 #ifndef __PS_IMP_NPC_DIALOG__ 21 #define __PS_IMP_NPC_DIALOG__ 26 #include <iutil/comp.h> 27 #include <iutil/eventh.h> 28 #include <csutil/scf.h> 29 #include <cstool/collider.h> 30 #include <ivaria/collider.h> 52 struct iObjectRegistry;
79 if(strcmp(area,other.
area)<0)
101 void AddToSentence(
NpcTerm* next_word);
104 return terms.GetSize();
106 const csString &GetString();
141 void AddToHistory(
int playerID,
int responseID, csTicks when);
142 bool EverSaid(
int playerID,
int responseID, csTicks &howLongAgo,
int ×);
144 #define MAX_HISTORY_LEN 100 167 NpcResponse* FindResponse(csString &trigger,
const char* text,
int questID = -1);
168 NpcResponse* FindResponseWithAllPrior(
const char*
area,
const char* trigger,
int questID = -1);
171 void AddBadText(
const char* text,
const char* trigger);
174 void CleanPunctuation(
psString &str,
bool cleanQMark =
true);
187 csArray<int> &gen_terms,
int word);
197 bool Initialize(iDataConnection* db, PID npcID);
199 bool LoadKnowledgeAreas(PID npcID);
203 NpcResponse* FindXMLResponse(
Client* client, csString trigger,
int questID = -1);
205 bool AddWord(
const char* word);
206 bool AddSynonym(
const char* word,
const char* synonym);
207 bool AddKnowledgeArea(
const char* ka_name);
208 bool AddResponse(
const char*
area,
const char* words,
const char* response,
const char* minfaction);
209 bool AssignNPCArea(
const char* npcname,
const char* areaname);
211 void SubstituteKeywords(
Client* player, csString &response)
const;
276 int GetPriorID(
int internalID);
290 bool WriteToDatabase();
292 int InsertResponse(csString &response);
294 int InsertTrigger(
const char* trigger,
const char* area,
int maxAttitude,
295 int minAttitude,
int responseID,
int priorID,
int questID);
373 void Create(csRef<iDocumentNode> triggerNode,
int questID);
380 priorResponseID = id;
412 csString pronoun_him,
442 responseSet.givenID = ++responseID;
450 void Create(csRef<iDocumentNode> attitudeNode,
int questID);
psAttitudeBlock(psDialogManager *mgr)
static int responseID
Used to generate the internal id's.
csArray< int > triggerIDs
Keep track of the database id's of the triggers.
csString type
The trigger name.
This is an attitude class data that has the responses.
psDialogManager * manager
Main dialog manager.
csArray< DialogHistoryEntry > history
csString area
The knowledge area of this trigger.
This class right now holds a simple circular MRU list of responses, so the npc can tell if he is gett...
csArray< int > responseIDs
Keep track of the database id's of responses.
psTriggerBlock(psDialogManager *mgr)
bool operator==(KnowledgeArea &other)
int attMax
The max attitude required for this response.
A phrase recognized by the dialog system.
int givenID
The internal ID given by the dialog manager.
int questID
questID of trigger
int responseID
What response was said.
int databaseID
The actual databaseID.
psResponse responseSet
The response set for this attitude.
Any semi-autonomous object, either a player or an NPC.
DialogHistory dialogHistory
csString response
The response given.
int databaseID
Holds the real databaseID of this trigger.
int counter
Current location in circular buffer.
csStringArray responses
The response lists.
void SetPrior(int id)
This sets the prior responseID for this trigger data.
int maxAttitude
The max attitude that these responses are for.
This is used to handle <specificknowledge> and <specialresponse> tags.
This class collects data of a netclient.
void void Initialize(iObjectRegistry *object_reg)
csTicks when
Timestamp of response.
int questID
The questID of the response.
psDialogManager * manager
Main mangaer.
This class exists per NPC, and holds all dialog triggers, responses and scripts for this particular N...
This class holds several possible responses and an action script for the npc to run whenever an appro...
csStringArray phraseList
A list of phrases for this trigger.
csArray< psTriggerBlock * > triggers
A list of all the triggers.
csString str
String version built from array.
A KnowledgeArea is a set of triggers and answers the NPC can provide when asked.
int attMin
The min attitude required for this response.
int minAttitude
The min NPC attitude that these responses are for.
Sentence written by the user represented as sequence of known terms.
int playerID
Who was the response said to.
void operator=(NpcTriggerSentence &other)
int priorResponseID
Holds the prior responseID.
csArray< psSpecialResponse * > special
A list of all the special responses.
NpcTerm *& Term(size_t i)
csArray< NpcTerm * > terms
Not PArray because these ptrs are shared.
bool operator<(KnowledgeArea &other)
csArray< KnowledgeArea * > knowareas
csArray< psAttitudeBlock * > attitudes
The list of attitudes.