Planeshift
dictionary.h
Go to the documentation of this file.
1 /*
2  * dictionary.h
3  *
4  * Copyright (C) 2001 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 #ifndef PS_DICTIONARY_
20 #define PS_DICTIONARY_
21 
22 //=============================================================================
23 // Crystal Space Includes
24 //=============================================================================
25 #include <csutil/csstring.h>
26 //#include <csutil/ref.h>
27 #include <csutil/refcount.h>
28 #include <csutil/parray.h>
29 #include <csutil/hash.h>
30 #include <csutil/redblacktree.h>
31 
32 //=============================================================================
33 // Project Includes
34 //=============================================================================
35 #include "rpgrules/psmoney.h"
36 
37 #include "../tools/wordnet/wn.h"
38 
39 //=============================================================================
40 // Local Includes
41 //=============================================================================
42 #include "psquestprereqops.h"
43 
44 class NpcTerm;
46 class NpcTrigger;
47 class NpcResponse;
48 class NpcDialogMenu;
49 class psSkillInfo;
50 class gemNPC;
51 class gemActor;
52 class Client;
53 class psQuest;
54 class psCharacter;
55 class MathScript;
56 
57 struct iDocumentNode;
58 struct Faction;
59 
64 #define MAX_RESP 5
65 
66 template<typename K, typename K2> class NpcTriggerOrdering : public CS::Container::RedBlackTreeOrderingTotal<NpcTrigger,NpcTrigger>
67 {
68 public:
69  NpcTriggerOrdering(NpcTrigger* const &a, NpcTrigger* const &b) : CS::Container::RedBlackTreeOrderingTotal<NpcTrigger,NpcTrigger>(*a,*b)
70  {
71  }
72 };
73 
75 {
76 protected:
77  typedef csRedBlackTree<NpcTrigger*, CS::Container::DefaultRedBlackTreeAllocator<NpcTrigger*>, NpcTriggerOrdering> NpcTriggerTree;
78  csHash<NpcTerm*, csString> phrases;
79  csHash<NpcTriggerGroupEntry*, csString> trigger_groups;
80  csHash<NpcTriggerGroupEntry*> trigger_groups_by_id;
81  NpcTriggerTree triggers;
82  csHash<NpcTrigger*> trigger_by_id;
83  csHash<NpcResponse*> responses;
84  csHash<bool, csString> disallowed_words;
85  csHash<csString,csString> knowledgeAreas;
86 
88  csHash<NpcDialogMenu*,csString> initial_popup_menus;
89  csHash<NpcDialogMenu*> initial_popup_menus_by_quest_id;
90 
92 
93  bool LoadSynonyms(iDataConnection* db);
94  bool LoadTriggerGroups(iDataConnection* db);
95  bool LoadTriggers(iDataConnection* db);
96  bool LoadResponses(iDataConnection* db);
97  bool LoadDisallowedWords(iDataConnection* db);
98 
101  void AddWords(csString &trigger);
102 
108  NpcTerm* AddTerm(const char* term);
109 
110  int AddTriggerGroupEntry(int id,const char* txt, int equivID);
111  csArray<NpcTrigger*> ParseMultiTrigger(NpcTrigger* parsetrig);
112 
113 public:
114  NPCDialogDict();
115  virtual ~NPCDialogDict();
116 
117  bool Initialize(iDataConnection* db);
118 
119  bool FindKnowledgeArea(const csString &name);
120 
122  NpcTerm* FindTerm(const char* term);
123 
125  NpcTerm* FindTermOrSynonym(const csString &term);
126 
127  NpcResponse* FindResponse(gemNPC* npc,
128  const char* area,
129  const char* trigger,
130  int faction,
131  int priorresponse,
132  Client* client,
133  int questID = -1);
134 
136  NpcResponse* FindResponse(int responseID);
137 
139  bool AddTrigger(iDataConnection* db, int databaseID, int responseID);
140 
142  bool CheckForTriggerGroup(csString &trigger);
143 
145  void AddResponse(iDataConnection* db, int databaseID);
146 
148  NpcResponse* AddResponse(const char* response_text,
149  const char* pronoun_him,
150  const char* pronoun_her,
151  const char* pronoun_it,
152  const char* pronoun_them,
153  const char* npc_name,
154  int &new_id,
155  psQuest* quest,
156  const char* audio_path);
157 
159  NpcResponse* AddResponse(const char* script);
160 
161  NpcTrigger* AddTrigger(const char* k_area,
162  const char* mytrigger,
163  int prior_response,
164  int trigger_response);
165 
166  void DeleteTriggerResponse(NpcTrigger* trigger, int responseID);
167 
169  NpcDialogMenu* FindMenu(const char* name);
170 
172  void AddMenu(const char* name, NpcDialogMenu* menu);
173 
178  void AddMenu(NpcDialogMenu* menu);
179 
188  void DeleteMenusForQuest(psQuest* quest);
189 
190  void RemoveEmptyMenu(NpcDialogMenu* menu);
191 
195  void Print(const char* area);
196 };
197 
202 class NpcTerm
203 {
204  SynsetPtr hypernymSynNet;
205 
206  csArray<const char*> hypernyms;
207 
208  void BuildHypernymList();
209 
210 public:
211 
215  csString term;
216 
226 
227 
231  NpcTerm(const char* term)
232  {
233  synonym = NULL;
234  hypernymSynNet = NULL;
235  this->term = term;
236  this->term.Downcase();
237  }
239  {
240  if(hypernymSynNet)
241  free_syns(hypernymSynNet);
242  }
243 
244  const char* GetInterleavedHypernym(size_t which);
245 
246  bool IsNoun();
247 
251  void Print();
252 };
253 
255 {
256 public:
257  int id;
258  csString text;
260 
261  NpcTriggerGroupEntry(int i,const char* txt,NpcTriggerGroupEntry* myParent=0)
262  {
263  id = i;
264  text = txt;
265  parent = myParent;
266  }
267 };
268 
270 {
271 public:
272  int id;
273  csString area;
274  csString trigger;
276  csArray<int> responseIDlist;
277  // int questID;
278 
280  bool Load(iResultRow &row);
281 
283  bool HaveAvailableResponses(Client* client, gemNPC* npc, NPCDialogDict* dict, csArray<int>* availableResponseList = NULL, int questID = -1);
284 
286  int GetRandomResponse(const csArray<int> &availableResponseList);
287 
289  bool operator==(const NpcTrigger &other) const;
290 
292  bool operator<=(const NpcTrigger &other) const;
293 };
294 
295 
301 {
302 protected:
303  csString name;
304 public:
305  virtual ~ResponseOperation() {};
306  virtual bool Load(iDocumentNode* node) = 0;
307  virtual csString GetResponseScript() = 0;
308  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber) = 0;
312  const char* GetName()
313  {
314  return name;
315  }
316  virtual bool IsPublic()
317  {
318  return false;
319  }
320 };
321 
326 {
327 protected:
329  {
330  unsigned int triggerID;
331  csString menuText;
332  csString trigger;
334  csRef<psQuestPrereqOp> prerequisite;
335 
336  /* returns the quest title
337  * @return the quest title if quest is set, otherwise "unknown"
338  */
339  csString GetQuestTitle();
340 
341  DialogTrigger() : quest(NULL) {}
342  };
343 
344 public:
345 
346  csArray<DialogTrigger> triggers;
347 
351  NpcDialogMenu();
352 
361  void AddTrigger(const csString &menuText, const csString &trigger, psQuest* quest, psQuestPrereqOp* script=NULL);
367  void Add(NpcDialogMenu* add);
373  void DeleteAllMenusOfQuest(psQuest* quest);
379  void ShowMenu(Client* client,csTicks delay, gemNPC* npc);
386  void SetPrerequisiteScript(psQuestPrereqOp* script);
387 };
388 
395 {
396 public:
397  int id;
398  csString response[MAX_RESP];
399 
401  csString him,her,it,them;
402  csString triggerText;
403  csString voiceAudioPath[MAX_RESP];
404  int type;
407  csTicks timeDelay;
408  csPDelArray<ResponseOperation> script;
409  csRef<psQuestPrereqOp> prerequisite;
411 
412  enum
413  {
415  ERROR_RESPONSE
416  };
417 
418  NpcResponse();
419  virtual ~NpcResponse();
420 
421  bool Load(iResultRow &row);
422 
423  void SetActiveQuest(int max);
425  {
426  return active_quest;
427  }
428 
429  const char* GetResponse(int &number);
431  const char* GetResponse()
432  {
433  int number = 0;
434  return GetResponse(number);
435  }
436 
438  const char* GetVoiceFile(int &number)
439  {
440  return voiceAudioPath[number];
441  }
442 
444  bool HasPublicResponse();
445  bool ParseResponseScript(const char* xmlstr,bool insertBeginning=false);
446 
450  csTicks ExecuteScript(gemActor* player, gemNPC* target);
451  csString GetResponseScript();
452 
453  // This is used so that the popup menu and the subsequent response can share the same filtering criteria
455  {
456  return prerequisite;
457  }
458 
464  bool ParsePrerequisiteScript(const char* xmlstr,bool insertBeginning=false);
465 
473  bool AddPrerequisite(psQuestPrereqOp* op, bool insertBeginning = false);
474 
481  bool CheckPrerequisite(psCharacter* character);
482 };
483 
490 {
491 public:
493  bool saypublic;
495  csString* sayWhat;
496 
497  SayResponseOp(const char* name, bool is_public)
498  {
499  sayWhat=NULL;
500  saypublic = is_public;
501  this->name = name;
502  }
503  virtual ~SayResponseOp()
504  {
505  if(sayWhat) delete sayWhat;
506  }
507  virtual bool Load(iDocumentNode* node);
508  virtual csString GetResponseScript();
509  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
510  virtual bool IsPublic()
511  {
512  return saypublic;
513  }
514 };
515 
521 {
522 protected:
523  bool actionMy,actionNarrate;
526  csString anim;
527  csString* actWhat;
528 public:
529  ActionResponseOp(const char* actionName, bool my,bool narrate, bool is_public)
530  {
531  actionMy = my;
532  actionNarrate=narrate;
533  name = actionName;
534  actionpublic = is_public;
535  actWhat = NULL;
536  }
538  {
539  if(actWhat) delete actWhat;
540  }
541  virtual bool Load(iDocumentNode* node);
542  virtual csString GetResponseScript();
543  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
544  virtual bool IsPublic()
545  {
546  return actionpublic;
547  }
548 };
549 
557 {
558 protected:
559  csString cmd;
560 public:
562  {
563  name = "npccmd";
564  }
565  virtual ~NPCCmdResponseOp() {};
566  virtual bool Load(iDocumentNode* node);
567  virtual csString GetResponseScript();
568  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
569 };
570 
571 class psQuest;
572 
579 {
580 protected:
582  csString error_msg;
583 
584 public:
586  {
587  name="verifyquestcompleted";
588  quest=NULL;
589  }
591  virtual bool Load(iDocumentNode* node);
592  virtual csString GetResponseScript();
593  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
594 };
595 
596 
603 {
604 protected:
605  csString variableName;
606  csString variableValue;
607 
608 public:
611  {
612  name = "setvariable";
613  }
614 
617 
622  virtual bool Load(iDocumentNode* node);
623 
628  virtual csString GetResponseScript();
629 
639  virtual bool Run(gemNPC* who, gemActor* target, NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
640 
641 };
642 
643 
650 {
651 protected:
652  csString variableName;
653 
654 public:
655 
658  {
659  name = "unsetvariable";
660  }
661 
664 
669  virtual bool Load(iDocumentNode* node);
670 
675  virtual csString GetResponseScript();
676 
686  virtual bool Run(gemNPC* who, gemActor* target, NpcResponse* owner, csTicks &timeDelay, int &voiceNumber);
687 };
688 
689 
696 {
697 protected:
699  csString error_msg;
700 
701 public:
703  {
704  name="verifyquestassigned";
705  quest=NULL;
706  }
709  virtual bool Load(iDocumentNode* node);
710  virtual csString GetResponseScript();
711  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
712 };
713 
714 /*
715 class FireEventResponseOp : public ResponseOperation
716 {
717 protected:
718  csString event;
719 public:
720  FireEventResponseOp() { name="fireevent"; }
721  virtual ~FireEventResponseOp() {};
722  virtual bool Load(iDocumentNode *node);
723  virtual csString GetResponseScript();
724  virtual bool Run(gemNPC *who, Client *target,NpcResponse *owner,csTicks& timeDelay, int& voiceNumber);
725 };
726 */
727 
734 {
735 protected:
737  csString error_msg;
738 
739 public:
741  {
742  name="verifyquestnotassigned";
743  quest=NULL;
744  }
747  virtual bool Load(iDocumentNode* node);
748  virtual csString GetResponseScript();
749  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
750 };
751 
757 {
758 protected:
759  psQuest* quest[MAX_RESP];
760  csString timeout_msg;
762 
763 public:
765  {
766  name="assign";
767  quest[0]=NULL;
768  }
770  virtual bool Load(iDocumentNode* node);
771  virtual csString GetResponseScript();
772  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
773  const char* GetTimeoutMsg()
774  {
775  return timeout_msg;
776  }
778  {
779  return quest[n];
780  }
782  {
783  return num_quests;
784  }
785 };
786 
794 {
795 protected:
797 
798 public:
800  {
801  name = "questselect";
802  quest_op = questop;
803  }
804  virtual ~AssignQuestSelectOp() {};
805  virtual bool Load(iDocumentNode* node)
806  {
807  return true;
808  }
809  virtual csString GetResponseScript();
810  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
811 };
812 
813 
821 {
822 protected:
824 
825 public:
827  {
828  name = "checkquesttimeout";
829  quest_op = questop;
830  }
831  virtual ~CheckQuestTimeoutOp() {};
832  virtual bool Load(iDocumentNode* node)
833  {
834  return true;
835  }
836  virtual csString GetResponseScript();
837  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
838 };
839 
845 {
846 protected:
848  csString error_msg;
849 
850 public:
852  {
853  name="complete";
854  quest=NULL;
855  }
857  virtual bool Load(iDocumentNode* node);
858  virtual csString GetResponseScript();
859  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
860 };
861 
867 {
868 protected:
870  csString error_msg;
871 
872 public:
874  {
875  name="uncomplete";
876  quest=NULL;
877  }
879  virtual bool Load(iDocumentNode* node);
880  virtual csString GetResponseScript();
881  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
882 };
883 
884 class psItemStats;
885 
891 {
892 protected:
894  int count;
895  float quality;
896 
897 public:
898  GiveItemResponseOp(): itemstat(NULL), count(1), quality(0)
899  {
900  name="give";
901  }
902  virtual ~GiveItemResponseOp() {};
903  virtual bool Load(iDocumentNode* node);
904  virtual csString GetResponseScript();
905  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
906 };
907 
908 
913 {
914 protected:
916  int value;
917 
918 public:
920  {
921  name="faction";
922  }
923  virtual ~FactionResponseOp() {};
924  virtual bool Load(iDocumentNode* node);
925  virtual csString GetResponseScript();
926  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
927 };
928 
936 {
937 protected:
938  csString scriptname;
939  csString bindingsText;
941 
942 public:
944  {
945  name = "run";
946  bindings = NULL;
947  }
948  virtual ~RunScriptResponseOp();
949  virtual bool Load(iDocumentNode* node);
950  virtual csString GetResponseScript();
951  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
952 };
953 
959 {
960 protected:
961  csString scriptname;
963 
964 public:
966  {
967  name="train";
968  }
969  virtual ~TrainResponseOp() {};
970  virtual bool Load(iDocumentNode* node);
971  virtual csString GetResponseScript();
972  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
973 };
974 
980 {
981 protected:
982  int karma;
983 public:
985  {
986  name = "guild_award";
987  }
988  virtual ~GuildAwardResponseOp() {};
989  virtual bool Load(iDocumentNode* node);
990  virtual csString GetResponseScript();
991  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
992 };
993 
999 {
1000 protected:
1001  typedef enum
1002  {
1008  HIRE_COMMAND_RELEASE
1009  } HireCommand;
1010 
1011  HireCommand hireCommand;
1012  csString typeName;
1013  csString typeNPCType;
1015 public:
1017  hireCommand(HIRE_COMMAND_START)
1018  {
1019  name = "hire";
1020  }
1021  virtual ~HireResponseOp() {};
1022  virtual bool Load(iDocumentNode* node);
1023  virtual csString GetResponseScript();
1024  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
1025 };
1026 
1028 {
1030  int count;
1031  float quality;
1032 };
1033 
1039 {
1040 protected:
1041  csArray<QuestRewardItem> offer;
1042 public:
1044  {
1045  name = "offer";
1046  }
1048  virtual bool Load(iDocumentNode* node);
1049  virtual csString GetResponseScript();
1050  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
1051 };
1052 
1058 {
1059 protected:
1061 
1062 public:
1064  {
1065  name = "money";
1066  }
1067  virtual ~MoneyResponseOp() {};
1068  virtual bool Load(iDocumentNode* node);
1069  virtual csString GetResponseScript();
1070  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
1071 };
1072 
1077 {
1078 protected:
1079  csString targetName;
1080 public:
1082  {
1083  name = "introduce";
1084  }
1085  virtual ~IntroduceResponseOp() {};
1086  virtual bool Load(iDocumentNode* node);
1087  virtual csString GetResponseScript();
1088  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
1089 };
1090 
1095 {
1096 protected:
1097  csString origCommandString, modifiedCommandString;
1098 public:
1100  {
1101  name = "doadmincmd";
1102  }
1104  virtual bool Load(iDocumentNode* node);
1105  virtual csString GetResponseScript();
1106  virtual bool Run(gemNPC* who, gemActor* target,NpcResponse* owner,csTicks &timeDelay, int &voiceNumber);
1107 };
1108 
1111 #endif
virtual bool Load(iDocumentNode *node)
Definition: dictionary.h:805
csString area
Definition: dictionary.h:273
Pure virtual base quest prerequisite operator class.
This script operation send a perception/command to the npc client.
Definition: dictionary.h:556
VerifyQuestAssignedResponseOp()
string with npc declining to proceed because player does not have quest
Definition: dictionary.h:702
virtual ~GiveItemResponseOp()
Definition: dictionary.h:902
int GetActiveQuest()
Definition: dictionary.h:424
virtual ~CompleteQuestResponseOp()
Definition: dictionary.h:856
This script operation makes an npc offer a list of possible rewards that the player can chose from (u...
Definition: dictionary.h:1038
virtual bool IsPublic()
Definition: dictionary.h:316
csString error_msg
ptrs to cachemanager entries for quests. must have at least one.
Definition: dictionary.h:582
csString trigger
actual trigger text
Definition: dictionary.h:332
virtual ~MoneyResponseOp()
Definition: dictionary.h:1067
Represents a skill an NPC, player or pet can learn.
Definition: psskills.h:72
csRef< psQuestPrereqOp > prerequisite
prerequisite for this Response to be available
Definition: dictionary.h:409
NpcTriggerGroupEntry * parent
Definition: dictionary.h:259
csString bindingsText
Definition: dictionary.h:939
This script operation makes an npc do an action, like greet or bow, as part of his response to a play...
Definition: dictionary.h:520
virtual ~DoAdminCommandResponseOp()
Definition: dictionary.h:1103
This script operation adjust a given faction.
Definition: dictionary.h:912
VerifyQuestCompletedResponseOp()
string with npc declining to play ball if quest is not completed
Definition: dictionary.h:585
csHash< NpcDialogMenu * > initial_popup_menus_by_quest_id
Definition: dictionary.h:89
csString * actWhat
Definition: dictionary.h:527
NpcTerm(const char *term)
Constructor for the term.
Definition: dictionary.h:231
virtual bool IsPublic()
Definition: dictionary.h:510
This script operation makes an npc give an item to a player, as part of his response to a player even...
Definition: dictionary.h:890
A MathScript is a mini-program to run.
Definition: mathscript.h:442
const char * GetTimeoutMsg()
Definition: dictionary.h:773
virtual ~ActionResponseOp()
Definition: dictionary.h:537
This script operation makes an npc complete a quest for a player, as part of his response to a player...
Definition: dictionary.h:844
CheckQuestTimeoutOp(AssignQuestResponseOp *questop)
Definition: dictionary.h:826
csString timeout_msg
ptrs to cachemanager entries for quests. must have at least one.
Definition: dictionary.h:760
This script operation makes an npc give money to the player.
Definition: dictionary.h:1057
virtual ~SayResponseOp()
Definition: dictionary.h:503
csString term
The recognized phrase/term.
Definition: dictionary.h:215
This script operation is a pre operation to the AssingQuestResponseOp that is inserted at the start o...
Definition: dictionary.h:820
psSkillInfo * skill
Definition: dictionary.h:962
NpcTerm * synonym
Pointer to a synonym term.
Definition: dictionary.h:225
This class holds all information for one quest with its reference to parent quest, list of steps, lockoutime, sub quests, ...
Definition: psquest.h:67
This script operation makes an npc manage hires as part of his response to a player event...
Definition: dictionary.h:998
virtual ~HireResponseOp()
Definition: dictionary.h:1021
AssignQuestResponseOp * quest_op
Definition: dictionary.h:823
SayResponseOp(const char *name, bool is_public)
Definition: dictionary.h:497
This script operation makes an npc uncomplete a quest for a player, as part of his response to a play...
Definition: dictionary.h:866
VerifyQuestNotAssignedResponseOp()
string with npc declining to proceed because player does not have quest
Definition: dictionary.h:740
csString variableValue
The value of the variable to be set.
Definition: dictionary.h:606
csString them
Definition: dictionary.h:401
csHash< NpcTriggerGroupEntry *, csString > trigger_groups
Definition: dictionary.h:79
psQuest * quest
quest that the trigger refers to
Definition: dictionary.h:333
This script operation is used to unset character variables from npc dialogs.
Definition: dictionary.h:649
virtual ~VerifyQuestCompletedResponseOp()
Definition: dictionary.h:590
int id
xref from trigger response
Definition: dictionary.h:397
This script operation is used to set character variables from npc dialogs.
Definition: dictionary.h:602
const char * GetResponse()
Used for when a response number is unneeded (debug printf around in psnpcdialog)
Definition: dictionary.h:431
NpcDialogMenu * menu
List of possible player trigger replies for this response, for display to the player.
Definition: dictionary.h:410
virtual ~CheckQuestTimeoutOp()
Definition: dictionary.h:831
virtual ~AssignQuestSelectOp()
Definition: dictionary.h:804
A phrase recognized by the dialog system.
Definition: dictionary.h:202
virtual ~GuildAwardResponseOp()
Definition: dictionary.h:988
NpcTriggerOrdering(NpcTrigger *const &a, NpcTrigger *const &b)
Definition: dictionary.h:69
This script operation chooses randomly between the responses specified in the response columns and ca...
Definition: dictionary.h:489
virtual ~ResponseOperation()
Definition: dictionary.h:305
virtual ~VerifyQuestAssignedResponseOp()
Definition: dictionary.h:708
int active_quest
which one should be run. this is actually set by check quest avail op
Definition: dictionary.h:406
csHash< csString, csString > knowledgeAreas
Definition: dictionary.h:85
csString scriptname
Definition: dictionary.h:961
Definition: wn.h:179
~NpcTerm()
Definition: dictionary.h:238
Any semi-autonomous object, either a player or an NPC.
Definition: gem.h:1170
This script operation checks to make sure a named quest has not been assigned to a player...
Definition: dictionary.h:733
csArray< DialogTrigger > triggers
list of menu items
Definition: dictionary.h:346
const char * GetName()
only used for output in error messages while parsing the script in NpcResponse
Definition: dictionary.h:312
This script operation executes an admin command.
Definition: dictionary.h:1094
iDataConnection * db
Global connection to the Database. Set from the psDatabase class.
psQuest * GetQuest(int n)
Definition: dictionary.h:777
NpcTriggerTree triggers
Definition: dictionary.h:81
virtual ~FactionResponseOp()
Definition: dictionary.h:923
virtual ~NPCCmdResponseOp()
Definition: dictionary.h:565
csString trigger
Definition: dictionary.h:274
csString variableName
The name of the variable to be set.
Definition: dictionary.h:652
psQuest * quest
Quest that this respons is part of.
Definition: dictionary.h:405
UnSetVariableResponseOp()
Constructor. Practically does nothing.
Definition: dictionary.h:657
This script operation makes an npc do an action, like greet or bow, as part of his response to a play...
Definition: dictionary.h:979
This script operation introduces an npc.
Definition: dictionary.h:1076
virtual ~UnSetVariableResponseOp()
Destructor.
Definition: dictionary.h:663
AssignQuestSelectOp(AssignQuestResponseOp *questop)
Definition: dictionary.h:799
bool saypublic
Indicates whether the response dialog should be said publicly or /tell in private.
Definition: dictionary.h:493
NpcTriggerGroupEntry(int i, const char *txt, NpcTriggerGroupEntry *myParent=0)
Definition: dictionary.h:261
AssignQuestResponseOp()
how many of the quests are valid.
Definition: dictionary.h:764
virtual bool Load(iDocumentNode *node)
Definition: dictionary.h:832
This script operation checks to make sure a named quest has been completed by a player, and stops the script if not, issuing the specified error_msg dialog.
Definition: dictionary.h:578
csHash< NpcTriggerGroupEntry * > trigger_groups_by_id
Definition: dictionary.h:80
virtual ~UncompleteQuestResponseOp()
Definition: dictionary.h:878
virtual ~SetVariableResponseOp()
Destructor.
Definition: dictionary.h:616
csHash< NpcResponse * > responses
Definition: dictionary.h:83
int type
record the type of response
Definition: dictionary.h:404
csHash< bool, csString > disallowed_words
Definition: dictionary.h:84
virtual bool IsPublic()
Definition: dictionary.h:544
bool operator<=(long lhs, const GmpInt &rhs)
Definition: GmpInt.h:136
void free_syns(SynsetPtr)
bool actionpublic
Indicates whether the response action should be shown publicly or in private.
Definition: dictionary.h:525
csString triggerText
This is the text that triggered the response.
Definition: dictionary.h:402
This class collects data of a netclient.
Definition: client.h:95
This script operation makes an npc assign one out of a list of quest to a player, as part of his resp...
Definition: dictionary.h:756
This script operation invokes the progression manager to start training as part of his response to a ...
Definition: dictionary.h:958
void void Initialize(iObjectRegistry *object_reg)
This script operation is a pre operation to the AssignQuestResponseOp that is inserted at the start o...
Definition: dictionary.h:793
virtual ~IntroduceResponseOp()
Definition: dictionary.h:1085
#define max(x, y)
Definition: xdelta3.h:314
Definition: gem.h:1910
csRef< psQuestPrereqOp > prerequisite
Definition: dictionary.h:334
csString variableName
The name of the variable to be set.
Definition: dictionary.h:605
csString error_msg
ptrs to cachemanager entries for quests. must have at least one.
Definition: dictionary.h:699
csString * sayWhat
Optional specific string to say, used by quest_scripts.
Definition: dictionary.h:495
unsigned int triggerID
internal trigger identifier
Definition: dictionary.h:330
This script operation checks to make sure a named quest has been assigned to a player, and stops the script if not, issuing the specified error_msg dialog.
Definition: dictionary.h:695
csHash< NpcTerm *, csString > phrases
Definition: dictionary.h:78
csArray< QuestRewardItem > offer
Definition: dictionary.h:1041
This class holds several possible responses and an action script for the npc to run whenever an appro...
Definition: dictionary.h:394
csTicks timeDelay
This tracks the current time delay for chat msgs in the responses, so a single script can have a sequ...
Definition: dictionary.h:407
Holds the trigger menu, if it exists, for a given location in a dialog.
Definition: dictionary.h:325
csString typeNPCType
Definition: dictionary.h:1013
AssignQuestResponseOp * quest_op
Definition: dictionary.h:796
This huge class stores all the properties of any object a player can have in the game.
Definition: psitemstats.h:463
psItemStats * itemstat
Definition: dictionary.h:893
virtual ~TrainResponseOp()
Definition: dictionary.h:969
ActionResponseOp(const char *actionName, bool my, bool narrate, bool is_public)
Definition: dictionary.h:529
NPCDialogDict * dict
csString typeName
Definition: dictionary.h:1012
bool operator==(T *p, const scoped_ptr< T > &b)
Definition: scoped_ptr.h:134
virtual ~AssignQuestResponseOp()
Definition: dictionary.h:769
csHash< NpcDialogMenu *, csString > initial_popup_menus
Collection of all referenced knowledge areas.
Definition: dictionary.h:88
psQuestPrereqOp * GetPrerequisiteScript()
Definition: dictionary.h:454
int num_quests
string with npc declinign to give quest
Definition: dictionary.h:761
HireCommand hireCommand
Definition: dictionary.h:1011
csArray< int > responseIDlist
Definition: dictionary.h:276
csRedBlackTree< NpcTrigger *, CS::Container::DefaultRedBlackTreeAllocator< NpcTrigger * >, NpcTriggerOrdering > NpcTriggerTree
Definition: dictionary.h:77
csString error_msg
ptrs to cachemanager entries for quests. must have at least one.
Definition: dictionary.h:737
csPDelArray< ResponseOperation > script
list of ops in script to execute when triggered
Definition: dictionary.h:408
An ingame faction group.
Definition: factions.h:41
Possible actions scriptable in the quest engine all inherit from this class.
Definition: dictionary.h:300
virtual ~OfferRewardResponseOp()
Definition: dictionary.h:1047
csHash< NpcTrigger * > trigger_by_id
Definition: dictionary.h:82
const char * GetVoiceFile(int &number)
Returns the VFS path to the audio file which represents this response on the server, or NULL if one was not specified.
Definition: dictionary.h:438
int priorresponseID
Definition: dictionary.h:275
psItemStats * itemstat
Definition: dictionary.h:1029
Faction * faction
Definition: dictionary.h:915
MathScript * bindings
Definition: dictionary.h:940
SetVariableResponseOp()
Constructor. Practically does nothing.
Definition: dictionary.h:610
This script operation invokes the progression manager to run a script, as part of his response to a p...
Definition: dictionary.h:935
#define MAX_RESP
Definition: dictionary.h:64
csString menuText
text of the menu entry
Definition: dictionary.h:331