Planeshift
npcoperations.h
Go to the documentation of this file.
1 /*
2 * npcoperations.h
3 *
4 * Copyright (C) 2007 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 __NPCOPERATIONS_H__
20 #define __NPCOPERATIONS_H__
21 
22 #include <psstdint.h>
23 
24 //=============================================================================
25 // Crystal Space Includes
26 //=============================================================================
27 #include <csgeom/vector3.h>
28 #include <csutil/csstring.h>
29 
30 struct iDocumentNode;
31 struct iSector;
32 
33 //=============================================================================
34 // Library Includes
35 //=============================================================================
36 #include "util/psconst.h"
37 #include "util/pspath.h"
38 #include "util/pspathnetwork.h"
39 #include <tools/celhpf.h>
40 #include "net/npcmessages.h"
41 #include "util/edge.h"
42 #include "util/mathscript.h"
43 
44 //=============================================================================
45 // Project Includes
46 //=============================================================================
47 #include "npc.h"
48 #include "reaction.h"
49 #include "perceptions.h"
50 
55 class NPC;
56 class gemNPCObject;
57 class gemNPCActor;
58 class MoveOperation;
59 class Waypoint;
60 class Behavior;
61 
70 {
71 public:
72  enum VelSource
73  {
78  };
79 
80  // Used to indicate the result of the Run and Advance operations.
82  {
86  };
87 
88  enum State
89  {
94  };
95 
96 protected:
98  // Start of instance temp variables. These dosn't need to be copied.
99  csString name;
100 
104 
106 
108 
110  // End of instance temp variables.
112 
114  // Start of shared values between operation
115 
116  // Failure handling
117  csString failurePerception;
118 
119  // Velocity is shared for all move operations
121  float vel;
122  float ang_vel;
123 
124  // Start Check Move OK parameters
125  // Configuration paramters. Set by using LoadCheckMoveOk
126  csString collision;
127  csString outOfBounds;
128  csString inBounds;
129  csString falling;
131  // End Check Move OK parameters
132 
133 
134  // End of shared values between operations
136 
138  int StartMoveTo(NPC* npc, const csVector3 &dest, iSector* sector, float vel,const char* action, float &angle);
139 
140  void TurnTo(NPC* npc,const csVector3 &dest, iSector* destsect, csVector3 &forward, float &angle);
141 
143  static void StopMovement(NPC* npc);
144 
145 public:
146 
147  ScriptOperation(const char* sciptName);
148  ScriptOperation(const ScriptOperation* other);
149  virtual ~ScriptOperation() {}
150 
151  virtual OperationResult Run(NPC* npc,bool interrupted)=0;
152  virtual OperationResult Advance(float timedelta,NPC* npc);
153 
154  virtual void InterruptOperation(NPC* npc);
155  virtual bool AtInterruptedPosition(const csVector3 &pos, const iSector* sector);
156  virtual bool AtInterruptedAngle(const csVector3 &pos, const iSector* sector, float angle);
157  virtual bool AtInterruptedPosition(NPC* npc);
158  virtual bool AtInterruptedAngle(NPC* npc);
159 
160  virtual void SetState(State state)
161  {
162  this->state = state;
163  }
164  virtual State GetState() const
165  {
166  return state;
167  }
168 
169 
170 private:
178  void SendCollitionPerception(NPC* npc);
179 
180 public:
187  virtual bool CheckMoveOk(NPC* npc, csVector3 oldPos, iSector* oldSector,
188  const csVector3 &newPos, iSector* newSector, int resultFromExtrapolate);
189 
196  virtual bool CheckEndPointOk(NPC* npc, const csVector3 &myPos, iSector* mySector,
197  const csVector3 &endPos, iSector* endSector);
198 
204  virtual const csString &GetCollisionPerception(NPC* npc);
205 
211  virtual const csString &GetOutOfBoundsPerception(NPC* npc);
212 
218  virtual const csString &GetInBoundsPerception(NPC* npc);
219 
225  virtual const csString &GetFallingPerception(NPC* npc);
226 
227  virtual bool Load(iDocumentNode* node);
228  virtual ScriptOperation* MakeCopy()=0;
229 
235  virtual float GetVelocity(NPC* npc);
236 
237  virtual float GetAngularVelocity(NPC* npc);
238  bool LoadVelocity(iDocumentNode* node);
239 
244  bool LoadCheckMoveOk(iDocumentNode* node);
245 
251  void CopyCheckMoveOk(ScriptOperation* source);
252 
264  void AddRandomRange(csVector3 &dest, float radius, float margin = 0.0);
265 
269  void SetAnimation(NPC* npc, const char* name);
270 
271  virtual const char* GetName() const
272  {
273  return name.GetDataSafe();
274  };
275 
280  virtual void Failure(NPC* npc);
281 
283  void SetParent(Behavior* behavior);
284 };
285 
286 //-----------------------------------------------------------------------------
287 
292 {
293 protected:
294 
295  // Instance variables
296  csRef<iCelHPath> path;
297 
298  // Cache values for end position
299  csVector3 endPos;
300  iSector* endSector;
301 
303 
304  // Operation parameters
305  csString action;
306 
307  // Constructor
308  MovementOperation(const MovementOperation* other);
309 
310 public:
311 
312  MovementOperation(const char* name);
313 
314  virtual ~MovementOperation() { }
315 
316  virtual bool Load(iDocumentNode* node);
317 
318  bool EndPointChanged(const csVector3 &endPos, const iSector* endSector) const;
319 
320  virtual bool GetEndPosition(NPC* npc, const csVector3 &myPos, const iSector* mySector,
321  csVector3 &endPos, iSector* &endSector) = 0;
322 
323  virtual bool UpdateEndPosition(NPC* npc, const csVector3 &myPos, const iSector* mySector,
324  csVector3 &endPos, iSector* &endSector) = 0;
325 
326  virtual OperationResult Run(NPC* npc,bool interrupted);
327 
328  virtual OperationResult Advance(float timedelta,NPC* npc);
329 
330  virtual void InterruptOperation(NPC* npc);
331 
332 };
333 
334 //---------------------------------------------------------------------------
335 // Following section contain specefix NPC operations.
336 // Ordered alphabeticaly, with exception for when needed
337 // due to inheritance. MoveOperation is out of order compared
338 // to the implementation file.
339 //---------------------------------------------------------------------------
340 
341 //-----------------------------------------------------------------------------
342 
348 {
349 protected:
353 public:
354 
356  virtual ~AssessOperation() {};
357  virtual OperationResult Run(NPC* npc,bool interrupted);
358  virtual bool Load(iDocumentNode* node);
359  virtual ScriptOperation* MakeCopy();
360 };
361 
362 //-----------------------------------------------------------------------------
363 
368 {
369 protected:
371 public:
372 
373  BuildOperation(): ScriptOperation("Build"),pickupable(false) {};
374  virtual ~BuildOperation() {};
375  virtual OperationResult Run(NPC* npc,bool interrupted);
376  virtual bool Load(iDocumentNode* node);
377  virtual ScriptOperation* MakeCopy();
378 };
379 
380 //-----------------------------------------------------------------------------
381 
386 {
387 protected:
388 public:
389 
391  virtual ~UnbuildOperation() {};
392  virtual OperationResult Run(NPC* npc,bool interrupted);
393  virtual bool Load(iDocumentNode* node);
394  virtual ScriptOperation* MakeCopy();
395 };
396 
397 //-----------------------------------------------------------------------------
398 
403 {
404 protected:
405  bool busy;
406 public:
407 
408  BusyOperation(bool busy): ScriptOperation(busy?"Busy":"Idle"),busy(busy) {};
409  virtual ~BusyOperation() {};
410  virtual OperationResult Run(NPC* npc,bool interrupted);
411  virtual bool Load(iDocumentNode* node);
412  virtual ScriptOperation* MakeCopy();
413 };
414 
415 //-----------------------------------------------------------------------------
416 
421 {
422 protected:
423  csString spell;
424  csString kFactor;
425 
432  CastOperation(const CastOperation* other);
433 
434 public:
435  CastOperation();
436  virtual ~CastOperation() {};
437  virtual OperationResult Run(NPC* npc,bool interrupted);
438  virtual bool Load(iDocumentNode* node);
439  virtual ScriptOperation* MakeCopy();
440 };
441 
442 //-----------------------------------------------------------------------------
443 
448 {
449 protected:
450  csString brain;
451 
459 
460 public:
462  virtual ~ChangeBrainOperation() {};
463  virtual OperationResult Run(NPC* npc,bool interrupted);
464  virtual bool Load(iDocumentNode* node);
465  virtual ScriptOperation* MakeCopy();
466 };
467 
468 //-----------------------------------------------------------------------------
469 
475 {
476 protected:
481  EID targetEID;
482  float offsetAngle;
483  csVector3 offsetDelta;
486 
487 
493  int type;
494  float searchRange;
495  float chaseRange;
496  csString offsetAttribute;
499  float sideOffset;
502 
503 
504  enum
505  {
510  TARGET
511  };
512  static const char* typeStr[];
513 
520  ChaseOperation(const ChaseOperation* other);
521 
522 public:
528  ChaseOperation();
529 
532  virtual ~ChaseOperation() {}
533 
541  csVector3 CalculateOffsetDelta(NPC* npc, const csVector3 &myPos, const iSector* mySector,
542  const csVector3 &endPos, const iSector* endSector,
543  float endRot) const;
544 
550  virtual bool GetEndPosition(NPC* npc, const csVector3 &myPos, const iSector* mySector,
551  csVector3 &endPos, iSector* &endSector);
552 
558  virtual gemNPCActor* UpdateChaseTarget(NPC* npc, const csVector3 &myPos, const iSector* mySector);
559 
565  virtual bool UpdateEndPosition(NPC* npc, const csVector3 &myPos, const iSector* mySector,
566  csVector3 &endPos, iSector* &endSector);
567 
573  virtual bool Load(iDocumentNode* node);
574 
578  virtual float GetOffset(NPC* npc) const;
579 
585  float AdaptivVelocity(NPC* npc, float distance);
586 
590  virtual float GetVelocity(NPC* npc);
591 
592 
598  virtual ScriptOperation* MakeCopy();
599 };
600 
601 
602 //-----------------------------------------------------------------------------
603 
608 {
609 protected:
610  csString source;
611  csString destination;
612  unsigned int flags;
613 public:
614 
615  CopyLocateOperation(): ScriptOperation("CopyLocate"), flags(NPC::LOCATION_ALL) {};
616  virtual ~CopyLocateOperation() {};
617  virtual OperationResult Run(NPC* npc,bool interrupted);
618  virtual bool Load(iDocumentNode* node);
619  virtual ScriptOperation* MakeCopy();
620 };
621 
622 //-----------------------------------------------------------------------------
623 
628 {
629 protected:
638 
639 public:
641  virtual ~DeleteNPCOperation() {};
642  virtual OperationResult Run(NPC* npc,bool interrupted);
643  virtual bool Load(iDocumentNode* node);
644  virtual ScriptOperation* MakeCopy();
645 };
646 
647 //-----------------------------------------------------------------------------
648 
653 {
654 protected:
655  csString action;
656  float duration;
657 
658  float angle;
659 
660  // Instance temp variables. These dosn't need to be copied.
661  float remaining;
662 
663  MoveOperation(const char* n): ScriptOperation(n),remaining(0.0f)
664  {
665  duration = 0;
666  ang_vel = 0;
667  angle = 0;
668  }
669 public:
670 
671  MoveOperation(): ScriptOperation("Move"),remaining(0.0f)
672  {
673  duration = 0;
674  ang_vel = 0;
675  angle = 0;
676  }
677  virtual ~MoveOperation() { }
678  virtual bool Load(iDocumentNode* node);
679  virtual ScriptOperation* MakeCopy();
680 
681  virtual OperationResult Run(NPC* npc,bool interrupted);
682  virtual OperationResult Advance(float timedelta,NPC* npc);
683  virtual void InterruptOperation(NPC* npc);
684 
685 };
686 
687 //-----------------------------------------------------------------------------
688 
693 {
694 protected:
695  csString types;
696  bool enable;
697 public:
698 
699  AutoMemorizeOperation(): ScriptOperation("AutoMemorize"), enable(false) { }
701  virtual bool Load(iDocumentNode* node);
702  virtual ScriptOperation* MakeCopy();
703 
704  virtual OperationResult Run(NPC* npc,bool interrupted);
705 };
706 
707 //-----------------------------------------------------------------------------
708 
713 {
714 protected:
715  float radius;
716 public:
717 
719  {
720  radius = 0.0f;
721  }
722  virtual ~CircleOperation() { }
723  virtual bool Load(iDocumentNode* node);
724  virtual ScriptOperation* MakeCopy();
725 
726  virtual OperationResult Run(NPC* npc,bool interrupted);
727 };
728 
729 //-----------------------------------------------------------------------------
730 
735 {
736 protected:
737  bool control; // Should this operation take or release control
738 public:
739 
740  ControlOperation(bool control): ScriptOperation("Control"), control(control) { }
741  virtual ~ControlOperation() { }
742  virtual bool Load(iDocumentNode* node);
743  virtual ScriptOperation* MakeCopy();
744 
745  virtual OperationResult Run(NPC* npc,bool interrupted);
746 };
747 
748 //-----------------------------------------------------------------------------
749 
754 {
755 protected:
756  int level;
757  csString exclusive;
758 
759 public:
760 
761  DebugOperation(): ScriptOperation("Debug"),level(0) {};
762  virtual ~DebugOperation() {};
763  virtual OperationResult Run(NPC* npc,bool interrupted);
764  virtual bool Load(iDocumentNode* node);
765  virtual ScriptOperation* MakeCopy();
766 };
767 
768 //-----------------------------------------------------------------------------
769 
774 {
775 protected:
776  csString slot;
777 
778 public:
779 
781  virtual ~DequipOperation() {};
782  virtual OperationResult Run(NPC* npc,bool interrupted);
783  virtual bool Load(iDocumentNode* node);
784  virtual ScriptOperation* MakeCopy();
785 };
786 
787 //-----------------------------------------------------------------------------
788 
799 {
800 protected:
801  csString type;
802  csString resource;
803 
804 public:
805 
807  virtual ~WorkOperation() {};
808  virtual OperationResult Run(NPC* npc,bool interrupted);
809  virtual bool Load(iDocumentNode* node);
810  virtual ScriptOperation* MakeCopy();
811 };
812 
813 //-----------------------------------------------------------------------------
814 
820 {
821 protected:
822  csString slot;
823 
824 public:
825 
827  virtual ~DropOperation() {};
828  virtual OperationResult Run(NPC* npc,bool interrupted);
829  virtual bool Load(iDocumentNode* node);
830  virtual ScriptOperation* MakeCopy();
831 };
832 
833 //-----------------------------------------------------------------------------
834 
843 {
844 protected:
845  csString resource;
846 
847 public:
848 
850  virtual ~EatOperation() {};
851  virtual OperationResult Run(NPC* npc,bool interrupted);
852  virtual bool Load(iDocumentNode* node);
853  virtual ScriptOperation* MakeCopy();
854 };
855 
856 //-----------------------------------------------------------------------------
857 
867 {
868 protected:
869  csString cmd;
870 
871 public:
872 
874  virtual ~EmoteOperation() {};
875  virtual OperationResult Run(NPC* npc,bool interrupted);
876  virtual bool Load(iDocumentNode* node);
877  virtual ScriptOperation* MakeCopy();
878 };
879 
880 //-----------------------------------------------------------------------------
881 
889 {
890 protected:
891  csString item;
892  csString slot;
893  int count; // Number of items to pick up from a stack
894 
895 public:
896 
897  EquipOperation(): ScriptOperation("Equip"),count(0) {};
898  virtual ~EquipOperation() {};
899  virtual OperationResult Run(NPC* npc,bool interrupted);
900  virtual bool Load(iDocumentNode* node);
901  virtual ScriptOperation* MakeCopy();
902 };
903 
904 //-----------------------------------------------------------------------------
905 
910 {
911 protected:
915  enum
916  {
917  MAX_HATE = 0x0001,
918  MIN_HATE = 0x0002,
919  ABS_HATE = 0x0004,
920  DELTA_HATE = 0x0008,
921  HATE_PERCEPTION = 0x0010
922  };
923 
924  unsigned int flags;
925  float maxHate;
926  float minHate;
927  float absoluteHate;
928  float deltaHate;
929 public:
930 
931  HateListOperation(): ScriptOperation("HateList"), flags(0),maxHate(0.0),minHate(0.0),absoluteHate(0.0),deltaHate(0.0) {};
932  virtual ~HateListOperation() {};
933  virtual OperationResult Run(NPC* npc,bool interrupted);
934  virtual bool Load(iDocumentNode* node);
935  virtual ScriptOperation* MakeCopy();
936 };
937 
938 
939 //-----------------------------------------------------------------------------
940 
945 {
946 public:
947 
949  virtual ~InvisibleOperation() {};
950  virtual OperationResult Run(NPC* npc,bool interrupted);
951  virtual bool Load(iDocumentNode* node);
952  virtual ScriptOperation* MakeCopy();
953 };
954 
955 //-----------------------------------------------------------------------------
956 
962 {
963 protected:
964  // Instance variables
967 
968  // Operation parameters
969  csString object;
970  float range;
972  bool random;
976  csString destination;
977 
978 
979 public:
980  LocateOperation();
981  LocateOperation(const LocateOperation* other);
982  virtual ~LocateOperation() { }
983 
985  Waypoint* CalculateWaypoint(NPC* npc, csVector3 located_pos, iSector* located_sector, float located_range);
986 
987  virtual OperationResult Run(NPC* npc,bool interrupted);
988  virtual bool Load(iDocumentNode* node);
989  virtual ScriptOperation* MakeCopy();
990 private:
991 };
992 
993 //-----------------------------------------------------------------------------
994 
1000 {
1001 public:
1003 
1004 public:
1005 
1007  {
1008  iterations=0;
1009  }
1010  virtual ~LoopBeginOperation() { }
1011 
1012  virtual OperationResult Run(NPC* npc,bool interrupted);
1013  virtual bool Load(iDocumentNode* node);
1014  virtual ScriptOperation* MakeCopy();
1015 };
1016 
1017 //-----------------------------------------------------------------------------
1018 
1024 {
1025 protected:
1027  int current;
1029 
1030 public:
1031 
1032  LoopEndOperation(int which,int iterations): ScriptOperation("LoopEnd")
1033  {
1034  loopback_op = which;
1035  this->iterations = iterations;
1036  current = 0;
1037  }
1038  virtual ~LoopEndOperation() { }
1039  virtual OperationResult Run(NPC* npc,bool interrupted);
1040  virtual bool Load(iDocumentNode* node);
1041  virtual ScriptOperation* MakeCopy();
1042 };
1043 
1044 //-----------------------------------------------------------------------------
1045 
1051 {
1052 protected:
1053  float seek_range, melee_range;
1058  csString attack_type;
1059  csString stance;
1061 public:
1064 
1066  attackInvisible(false),attackInvincible(false)
1067  {
1068  attacked_ent=NULL;
1069  seek_range=0;
1070  melee_range=0;
1071  }
1072  virtual ~MeleeOperation() {}
1073 
1074  virtual bool Load(iDocumentNode* node);
1075  virtual ScriptOperation* MakeCopy();
1076 
1077  virtual OperationResult Run(NPC* npc,bool interrupted);
1078  virtual OperationResult Advance(float timedelta,NPC* npc);
1079  virtual void InterruptOperation(NPC* npc);
1080 };
1081 
1082 //-----------------------------------------------------------------------------
1083 
1088 {
1089 protected:
1090 
1091 public:
1092 
1094  virtual ~MemorizeOperation() {};
1095  virtual OperationResult Run(NPC* npc,bool interrupted);
1096  virtual bool Load(iDocumentNode* node);
1097  virtual ScriptOperation* MakeCopy();
1098 };
1099 
1100 //-----------------------------------------------------------------------------
1101 
1102 // MoveOperation - Definition has been moved before the first user of this
1103 // class as a base class.
1104 
1105 //-----------------------------------------------------------------------------
1106 
1111 {
1112 protected:
1113  // Parameters
1114  csString anim;
1115  csString pathname;
1117 
1118  // Internal variables
1121 
1122 public:
1123 
1124  MovePathOperation(): ScriptOperation("MovePath"), direction(psPath::FORWARD), path(0), anchor(0) { }
1126  {
1127  delete anchor;
1128  }
1129  virtual bool Load(iDocumentNode* node);
1130  virtual ScriptOperation* MakeCopy();
1131 
1132  virtual OperationResult Run(NPC* npc,bool interrupted);
1133  virtual OperationResult Advance(float timedelta,NPC* npc);
1134  virtual void InterruptOperation(NPC* npc);
1135 };
1136 
1137 //-----------------------------------------------------------------------------
1138 
1144 {
1145 protected:
1146  csVector3 destPos;
1147  iSector* destSector;
1148 
1149  csString memoryCheck;
1150  csString action;
1151 public:
1152  MoveToOperation();
1153  MoveToOperation(const MoveToOperation* other);
1154  virtual ~MoveToOperation() { }
1155 
1156  virtual bool GetEndPosition(NPC* npc, const csVector3 &myPos, const iSector* mySector,
1157  csVector3 &endPos, iSector* &endSector);
1158 
1159  virtual bool UpdateEndPosition(NPC* npc, const csVector3 &myPos, const iSector* mySector,
1160  csVector3 &endPos, iSector* &endSector);
1161 
1162  virtual bool Load(iDocumentNode* node);
1163  virtual ScriptOperation* MakeCopy();
1164 };
1165 
1166 //-----------------------------------------------------------------------------
1167 
1173 {
1174 protected:
1175  csString action;
1177 
1178  float endAngle;
1179  iSector* endSector;
1180  csVector3 endPos;
1181 
1182 public:
1183 
1185 protected:
1186  NavigateOperation(const NavigateOperation* other);
1187 public:
1188  virtual ~NavigateOperation() {};
1189 
1190  virtual ScriptOperation* MakeCopy();
1191 
1192  virtual bool GetEndPosition(NPC* npc, const csVector3 &myPos, const iSector* mySector,
1193  csVector3 &endPos, iSector* &endSector);
1194 
1195  virtual bool UpdateEndPosition(NPC* npc, const csVector3 &myPos, const iSector* mySector,
1196  csVector3 &endPos, iSector* &endSector);
1197 
1198  virtual bool Load(iDocumentNode* node);
1199 };
1200 
1201 //-----------------------------------------------------------------------------
1202 
1207 {
1208 protected:
1209 public:
1210 
1212  virtual ~NOPOperation() {};
1213  virtual OperationResult Run(NPC* npc,bool interrupted);
1214  virtual bool Load(iDocumentNode* node);
1215  virtual ScriptOperation* MakeCopy();
1216 };
1217 
1218 //-----------------------------------------------------------------------------
1219 
1225 {
1226 protected:
1228  {
1232  TARGET
1233  };
1234 
1236  {
1237  protected:
1241  float maxRange;
1242 
1243  public:
1244  DelayedPerceptOperationGameEvent(int offsetTicks, NPC* npc, Perception &pcpt, TargetType target, float maxRange);
1245  virtual void Trigger(); // Abstract event processing function
1246  virtual csString ToString() const;
1247  };
1248 
1249  csString perception;
1250  csString type;
1252  float maxRange;
1253  csString condition;
1254  csString failedPerception;
1255  csString delayed;
1256 
1258 public:
1259 
1261  ScriptOperation("Percept"),
1262  target(SELF),
1263  maxRange(0.0),
1264  calcCondition(0)
1265  {
1266  }
1267  virtual ~PerceptOperation() {}
1268  virtual OperationResult Run(NPC* npc,bool interrupted);
1269  virtual bool Load(iDocumentNode* node);
1270  virtual ScriptOperation* MakeCopy();
1271  virtual bool CheckCondition(NPC* npc);
1272  static void TriggerEvent(NPC* npc, Perception &pcpt, TargetType target, float maxRange);
1273 };
1274 
1275 //-----------------------------------------------------------------------------
1276 
1282 {
1283 protected:
1284  csString object;
1285  csString slot;
1286  int count; // Number of items to pick up from a stack
1287 
1288 public:
1289 
1290  PickupOperation(): ScriptOperation("Pickup"),count(0) {};
1291  virtual ~PickupOperation() {};
1292  virtual OperationResult Run(NPC* npc,bool interrupted);
1293  virtual bool Load(iDocumentNode* node);
1294  virtual ScriptOperation* MakeCopy();
1295 };
1296 
1297 //-----------------------------------------------------------------------------
1298 
1303 {
1304 protected:
1306 public:
1307 
1309  virtual ~ReproduceOperation() {};
1310  virtual OperationResult Run(NPC* npc,bool interrupted);
1311  virtual bool Load(iDocumentNode* node);
1312  virtual ScriptOperation* MakeCopy();
1313 };
1314 
1315 //-----------------------------------------------------------------------------
1316 
1321 {
1322 protected:
1323 
1324 public:
1325 
1327  virtual ~ResurrectOperation() {};
1328  virtual OperationResult Run(NPC* npc,bool interrupted);
1329  virtual bool Load(iDocumentNode* node);
1330  virtual ScriptOperation* MakeCopy();
1331 };
1332 
1333 //-----------------------------------------------------------------------------
1334 
1345 {
1346 protected:
1347  csString resource;
1348  int count;
1349 
1350 public:
1351 
1352  RewardOperation(): ScriptOperation("Reward"), count(0) {};
1353  virtual ~RewardOperation() {};
1354  virtual OperationResult Run(NPC* npc,bool interrupted);
1355  virtual bool Load(iDocumentNode* node);
1356  virtual ScriptOperation* MakeCopy();
1357 };
1358 
1359 //-----------------------------------------------------------------------------
1360 
1366 {
1367 protected:
1368  enum
1369  {
1371  ROT_ABSOLUTE, // Rotate to this world angle
1372  ROT_RELATIVE, // Rotate delta angle from current npd heading
1373  ROT_TARGET, // Rotate to face target
1374  ROT_LOCATE_DESTINATION, // Rotate to face located destination
1375  ROT_LOCATE_ROTATION, // Rotate to face located rotatation
1376  ROT_RANDOM, // Rotate a random angle
1377  ROT_REGION, // Rotate to an angle within the region
1378  ROT_TRIBE_HOME // Rotate to an angle within tribe home
1379  };
1380  int op_type; // Type of rotation. See enum above.
1381  float min_range, max_range; // Min,Max values for random and region rotation
1382  float delta_angle; // Value to rotate for relative rotation
1383 
1384  float target_angle; // Calculated end rotation for every rotation and
1385  // input to absolute rotation
1386  float angle_delta; // Calculated angle that is needed to rotate to target_angle
1387 
1388  csString action; // Animation to use in the rotation
1389 
1390  // Instance temp variables. These dosn't need to be copied.
1391  float remaining;
1392 public:
1393 
1395  {
1396  vel=0;
1397  ang_vel=999;
1398  op_type=ROT_UNKNOWN;
1399  min_range=0;
1400  max_range=0;
1401  delta_angle=0;
1402  target_angle=0;
1403  angle_delta=0;
1404  remaining = 0.0;
1405  }
1406  virtual ~RotateOperation() { }
1407  virtual bool Load(iDocumentNode* node);
1408  virtual ScriptOperation* MakeCopy();
1409 
1410  virtual OperationResult Run(NPC* npc,bool interrupted);
1411  virtual OperationResult Advance(float timedelta,NPC* npc);
1412  virtual void InterruptOperation(NPC* npc);
1413 
1414  float SeekAngle(NPC* npc, float targetYRot); // Finds an angle which won't lead to a collision
1415 };
1416 
1417 //-----------------------------------------------------------------------------
1418 
1423 {
1424 protected:
1425 public:
1426 
1428  {
1429  }
1430  virtual ~VelSourceOperation() { }
1431  virtual bool Load(iDocumentNode* node);
1432  virtual ScriptOperation* MakeCopy();
1433  virtual OperationResult Run(NPC* npc,bool interrupted);
1434 };
1435 
1436 //-----------------------------------------------------------------------------
1437 
1447 {
1448 protected:
1449  csString scriptName;
1450 
1451  // Instance temp variables. These dosn't need to be copied.
1452 
1453 public:
1454 
1457  virtual OperationResult Run(NPC* npc,bool interrupted);
1458  virtual bool Load(iDocumentNode* node);
1459  virtual ScriptOperation* MakeCopy();
1460 };
1461 
1462 //-----------------------------------------------------------------------------
1463 
1468 {
1469 protected:
1470  enum // Sequence commands, should use same values as in the psSequenceMessage
1471  {
1472  UNKNOWN = 0,
1473  START = 1,
1474  STOP = 2,
1475  LOOP = 3
1476  };
1477 
1478  csString sequenceName;
1479  int cmd; // See enum above
1480  int count; // Number of times to run the sequence
1481 
1482 public:
1483 
1484  SequenceOperation(): ScriptOperation("Sequence"),cmd(UNKNOWN),count(0) {};
1485  virtual ~SequenceOperation() {};
1486  virtual OperationResult Run(NPC* npc,bool interrupted);
1487  virtual bool Load(iDocumentNode* node);
1488  virtual ScriptOperation* MakeCopy();
1489 };
1490 
1491 //-----------------------------------------------------------------------------
1492 
1497 {
1498 protected:
1499  enum // Sequence commands, should use same values as in the psSequenceMessage
1500  {
1501  NPC_BUFFER = 0,
1502  TRIBE_BUFFER = 1
1503  };
1504 
1505  csString buffer;
1506  csString value;
1507  int type;
1508 
1509 public:
1510 
1511  SetBufferOperation(): ScriptOperation("SetBuffer"), type(NPC_BUFFER) {};
1512  virtual ~SetBufferOperation() {};
1513  virtual OperationResult Run(NPC* npc,bool interrupted);
1514  virtual bool Load(iDocumentNode* node);
1515  virtual ScriptOperation* MakeCopy();
1516 };
1517 
1518 //-----------------------------------------------------------------------------
1519 
1524 {
1525 protected:
1526 
1527 public:
1528 
1529  ShareMemoriesOperation(): ScriptOperation("ShareMemories") {};
1531  virtual OperationResult Run(NPC* npc,bool interrupted);
1532  virtual bool Load(iDocumentNode* node);
1533  virtual ScriptOperation* MakeCopy();
1534 };
1535 
1536 //-----------------------------------------------------------------------------
1537 
1548 {
1549 protected:
1550  bool sit;
1551 
1552  // Instance temp variables. These dosn't need to be copied.
1553  float remaining;
1554 
1555 public:
1556 
1557  SitOperation(bool sit): ScriptOperation("Sit"), sit(sit), remaining(0.0) {};
1558  virtual ~SitOperation() {};
1559  virtual OperationResult Run(NPC* npc,bool interrupted);
1560  virtual bool Load(iDocumentNode* node);
1561  virtual OperationResult Advance(float timedelta,NPC* npc);
1562  virtual ScriptOperation* MakeCopy();
1563 };
1564 
1565 //-----------------------------------------------------------------------------
1566 
1572 {
1573 protected:
1575 
1576  csString talkText;
1577  TalkType talkType;
1578  bool talkPublic;
1579  bool target;
1580  csString command;
1581 
1582 public:
1583 
1584  TalkOperation(): ScriptOperation("Talk"),talkType(psNPCCommandsMessage::TALK_SAY),talkPublic(false),target(false) {};
1585  virtual ~TalkOperation() {};
1586  virtual OperationResult Run(NPC* npc,bool interrupted);
1587  virtual bool Load(iDocumentNode* node);
1588  virtual ScriptOperation* MakeCopy();
1589 };
1590 
1591 //-----------------------------------------------------------------------------
1592 
1597 {
1598 protected:
1599 
1600 public:
1601 
1603  virtual ~TeleportOperation() {};
1604  virtual OperationResult Run(NPC* npc,bool interrupted);
1605  virtual bool Load(iDocumentNode* node);
1606  virtual ScriptOperation* MakeCopy();
1607 };
1608 
1609 //-----------------------------------------------------------------------------
1610 
1616 {
1617 protected:
1618  csString item;
1619  int count;
1620  csString target;
1621 
1622 public:
1623 
1624  TransferOperation(): ScriptOperation("Transfer"), count(0) {};
1625  virtual ~TransferOperation() {};
1626  virtual OperationResult Run(NPC* npc,bool interrupted);
1627  virtual bool Load(iDocumentNode* node);
1628  virtual ScriptOperation* MakeCopy();
1629 };
1630 
1631 //-----------------------------------------------------------------------------
1632 
1637 {
1638 protected:
1639 
1640 public:
1641 
1643  virtual ~TribeHomeOperation() {};
1644  virtual OperationResult Run(NPC* npc,bool interrupted);
1645  virtual bool Load(iDocumentNode* node);
1646  virtual ScriptOperation* MakeCopy();
1647 };
1648 
1649 //-----------------------------------------------------------------------------
1650 
1655 {
1656 protected:
1657  csString tribeType;
1658 public:
1659 
1661  virtual ~TribeTypeOperation() {};
1662  virtual OperationResult Run(NPC* npc,bool interrupted);
1663  virtual bool Load(iDocumentNode* node);
1664  virtual ScriptOperation* MakeCopy();
1665 };
1666 
1667 //-----------------------------------------------------------------------------
1668 
1673 {
1674 public:
1675 
1677  virtual ~VisibleOperation() {};
1678  virtual OperationResult Run(NPC* npc,bool interrupted);
1679  virtual bool Load(iDocumentNode* node);
1680  virtual ScriptOperation* MakeCopy();
1681 };
1682 
1683 //-----------------------------------------------------------------------------
1684 
1691 {
1692 protected:
1693  csString duration;
1694  csString random;
1695  csString action;
1696 
1697  // Instance temp variables. These dosn't need to be copied.
1698  float remaining;
1699 
1700 public:
1701 
1702  WaitOperation(): ScriptOperation("Wait"),remaining(0.0f)
1703  {
1704  duration=0;
1705  }
1706  virtual ~WaitOperation() { }
1707 
1708  virtual OperationResult Run(NPC* npc,bool interrupted);
1709  virtual bool Load(iDocumentNode* node);
1710  virtual OperationResult Advance(float timedelta,NPC* npc);
1711  virtual ScriptOperation* MakeCopy();
1712 };
1713 
1714 //-----------------------------------------------------------------------------
1715 
1721 {
1722 protected:
1724  // Start of instance temp variables. These dosn't need to be copied.
1725 
1727  {
1728  public:
1730  virtual bool Filter(const Waypoint* waypoint) const;
1731  protected:
1733  };
1734 
1736 
1737  csList<Edge*> edgeList;
1738 
1739  csList<Edge*>::Iterator edgeIterator;
1745 // psPath::PathPointIterator pointIterator;
1746 
1747  // End of instance temp variables.
1749 
1751  // Start of operation parameters
1752  csString action;
1753  bool random;
1754  bool undergroundValid,underground;
1755  bool underwaterValid,underwater;
1756  bool privValid,priv;
1757  bool pubValid,pub;
1758  bool cityValid,city;
1759  bool indoorValid,indoor;
1760  bool pathValid,path;
1761  bool roadValid,road;
1762  bool groundValid,ground;
1763  // End of operation parameters
1765 
1770  bool StartMoveTo(NPC* npc, psPathPoint* point);
1771 
1776  bool MoveTo(NPC* npc, psPathPoint* point);
1777 
1783  OperationResult CalculateEdgeList(NPC* npc);
1784 
1785 
1788  void SetPathPointIterator(Edge::Iterator* iterator);
1789 
1790 public:
1791 
1792  WanderOperation();
1793  WanderOperation(const WanderOperation* other);
1794  virtual ~WanderOperation();
1795 
1796  virtual ScriptOperation* MakeCopy();
1797 
1798 
1802  {
1803  edgeList.DeleteAll();
1804  }
1805 
1811  Edge* GetNextEdge(NPC* npc);
1812 
1813 
1820  psPathPoint* GetNextPathPoint(NPC* npc, bool &teleport);
1821 
1825  psPathPoint* GetCurrentPathPoint(NPC* npc);
1826 
1827 
1828  /* Utility function to calcualte distance from npc to destPoint.
1829  */
1830  static float DistanceToDestPoint(NPC* npc, const csVector3 &destPos, const iSector* destSector);
1831 
1832 
1833  virtual OperationResult Run(NPC* npc,bool interrupted);
1834  virtual OperationResult Advance(float timedelta,NPC* npc);
1835  virtual void InterruptOperation(NPC* npc);
1836  virtual bool Load(iDocumentNode* node);
1837 };
1838 
1839 //-----------------------------------------------------------------------------
1840 
1845 {
1846 protected:
1847  float watchRange;
1848  int type;
1849  float searchRange;
1852 
1853  csWeakRef<gemNPCObject> watchedEnt;
1854 
1855  enum
1856  {
1861  TARGET
1862  };
1863  static const char* typeStr[];
1864 
1865 public:
1866 
1867  WatchOperation():ScriptOperation("Watch"),watchRange(0.0f),
1868  type(TARGET),searchRange(0.0f),watchInvisible(false),watchInvincible(false)
1869  {
1870  watchedEnt=NULL;
1871  }
1872  virtual ~WatchOperation() {}
1873 
1874  virtual bool Load(iDocumentNode* node);
1875  virtual ScriptOperation* MakeCopy();
1876 
1877  virtual OperationResult Run(NPC* npc,bool interrupted);
1878  virtual OperationResult Advance(float timedelta,NPC* npc);
1879  virtual void InterruptOperation(NPC* npc);
1880 
1881 private:
1882  bool OutOfRange(NPC* npc);
1883 };
1884 
1885 //-----------------------------------------------------------------------------
1886 
1897 {
1898 protected:
1899  csString type;
1900 
1901 public:
1902 
1904  virtual ~LootOperation() {};
1905  virtual OperationResult Run(NPC* npc,bool interrupted);
1906  virtual bool Load(iDocumentNode* node);
1907  virtual ScriptOperation* MakeCopy();
1908 };
1909 
1910 //-----------------------------------------------------------------------------
1911 
1914 #endif
TribeType will change the need set used by the npc.
The operation failed.
Definition: npcoperations.h:85
This is the base class for all operations in action scripts.
Definition: npcoperations.h:69
bool LoadVelocity(iDocumentNode *node)
Definition: manager.h:39
No Operation(NOP) Operation.
This embodies any perception an NPC might have, or any game event of interest.
Definition: perceptions.h:55
const T * GetOffset(const typename ElfClass::Ehdr *elf_header, typename ElfClass::Off offset)
Definition: elfutils-inl.h:39
csString random
A random duration to add to the duration.
csString locateOutsideRegion
Locate targets outside a region if a region exist. Default false.
csRef< iCelHPath > path
virtual ~RewardOperation()
Resurrect will make the npc to setup a spawn point here.
iSector * endSector
The sector of the target of the navigate.
Turn on and off auto remembering of perceptions.
gemNPCActor * attacked_ent
csString adaptivVelocityScript
Script to do adaptiv velocity adjustments.
Used to indicate that an operation will complete at a later stage.
Definition: npcoperations.h:83
Visible will make the npc visible.
Sequence will control a named sequence in the world.
virtual OperationResult Run(NPC *npc, bool interrupted)=0
virtual const csString & GetOutOfBoundsPerception(NPC *npc)
Return the Out of Bounds perception event name.
void AddRandomRange(csVector3 &dest, float radius, float margin=0.0)
Move a point somwhere random within radius of the orignial point.
virtual ~TeleportOperation()
virtual bool CheckMoveOk(NPC *npc, csVector3 oldPos, iSector *oldSector, const csVector3 &newPos, iSector *newSector, int resultFromExtrapolate)
Check if the move where ok.
csString command
Command to percept to target if target is a NPC.
float currentDistance
The distance to the current local destination.
csString attackOutsideRegion
Attack even outside region if a region is defined.
int StartMoveTo(NPC *npc, const csVector3 &dest, iSector *sector, float vel, const char *action, float &angle)
This function is used by MoveTo AND Navigate operations.
virtual ScriptOperation * MakeCopy()=0
void EdgeListClear()
Clear list of edges.
float chaseRange
Chase as long targets are within this range. < Chase forever if set to -1.
Locate is a very powerful function which will find the nearest object of the named tag...
virtual ~UnbuildOperation()
virtual const csString & GetCollisionPerception(NPC *npc)
Return the Collision perception event name.
A MathScript is a mini-program to run.
Definition: mathscript.h:442
csWeakRef< gemNPCObject > watchedEnt
virtual float GetVelocity(NPC *npc)
Return the velocity for the npc.
virtual ~SitOperation()
Definition: pspath.h:152
virtual ~LoopEndOperation()
virtual ~MeleeOperation()
virtual ~CastOperation()
virtual ~MoveToOperation()
virtual ~DebugOperation()
csString duration
The duration to wait before continue.
int type
The type of chase to perform.
csString collision
Perception names to use for collision detected by CheckMoveOk.
virtual ~TribeTypeOperation()
unsigned int flags
Flags.
csString outOfBounds
Perception names to use for out of bounds detected by CheckMoveOk.
iSector * destSector
Memorize will make the npc to setup a spawn point here.
virtual ~BuildOperation()
void CopyCheckMoveOk(ScriptOperation *source)
Copy CheckMoveOk paramters from the source script.
csList< Edge * > edgeList
virtual void InterruptOperation(NPC *npc)
csString cmd
The emote command.
Wait will simply set the mesh animation to something and sit there for the desired number of seconds...
csString action
The animation used during chase.
virtual ~ReproduceOperation()
Structure to hold located positions.
Definition: npc.h:132
csString delayed
If set this perception should be delayed.
Direction
Definition: pspath.h:156
Represents the Edge in a PathNetwork.
Definition: edge.h:39
float searchRange
Used for watch of type NEAREST_*.
psPathAnchor * anchor
float searchRange
Search for targets within this range.
A set of operations building a generic behavior for a NPC.
Definition: npcbehave.h:340
csVector3 offsetDelta
The actual delta relative to target.
Behavior * parent
void TurnTo(NPC *npc, const csVector3 &dest, iSector *destsect, csVector3 &forward, float &angle)
void SetParent(Behavior *behavior)
Set the parent behavior for this operation.
bool target
True if this is should go to the target of the NPC.
A waypoint is a specified circle on the map with a name, location, and a list of waypoints it is conn...
Definition: waypoint.h:81
float vel
Shared linear velocity, used by all that moves.
NPC::Locate storedStaticLocated
Watch operation will tell if the targt goes out of range.
virtual bool CheckEndPointOk(NPC *npc, const csVector3 &myPos, iSector *mySector, const csVector3 &endPos, iSector *endSector)
Check if the end point where ok.
psPathPoint * currentPathPoint
The current local destination.
virtual ~WorkOperation()
Implement the reward NPC script operation.
bool sit
True if sit false for stand.
virtual bool AtInterruptedAngle(const csVector3 &pos, const iSector *sector, float angle)
virtual ~MovementOperation()
csVector3 endPos
The end position of the target of the navigate.
csString resource
The name of the resource to work for.
TargetType target
Hold the target for the perception, default SELF.
csString exclusive
Reproduce will make the npc to setup a spawn point here.
virtual const csString & GetInBoundsPerception(NPC *npc)
Return the In Bounds perception event name.
Rotating requires storing or determining the angle to rotate to, and the animation action...
virtual ~AssessOperation()
csString type
The type value of the perception.
Drop will make the NPC drop whatever he is holding.
float currentDistance
The distance to the current local destination.
csString inBounds
Perception names to use for in bounds detected by CheckMoveOk.
csString type
Type of items to loot.
virtual ~HateListOperation()
Dequip will tell the npc to dequip a item.
Control another actor.
float ang_vel
Shared angular velocity, used by all that rotates.
virtual ~ProgressScriptOperation()
SitOperation(bool sit)
virtual ~RotateOperation()
virtual ~TransferOperation()
static void StopMovement(NPC *npc)
Utility function used by many operation to stop movement of an NPC.
virtual ~NavigateOperation()
virtual ~LootOperation()
Navigate moves the NPC to the position and orientation of the last located thing. ...
TribeHome will make the npc to setup a spawn point here.
virtual float GetAngularVelocity(NPC *npc)
Hate list modifications.
Sense Players and NPC&#39;s.
SetBuffer will set a buffer for tribe or npc.
Let the NPC change brain.
virtual ~MoveOperation()
csString perception
The perception name to send.
csString falling
Perception names to use for fall detected by CheckMoveOk.
Talk will tell the npc to communicate to a nearby entity.
float deltaHate
Added to hate if DELTA_HATE is set.
void SetAnimation(NPC *npc, const char *name)
This function will set an animation for the NPC, the animation will play once.
float maxRange
Is there a max range for this, 0.0 is without limit.
Sense only the owner.
csString destination
Alternate destination instead of "Active" locate.
Script will make the progression script run at server.
csString condition
A condition for when the perception should be fired.
Emote will make the NPC show an emotion.
virtual ~CopyLocateOperation()
csString magicalAssessmentPerception
csString resource
The Resource to be rewarded to the tribe.
Teleport will teleport the NPC to the target position.
virtual ~LoopBeginOperation()
Edge * currentEdge
The current edge.
TalkType talkType
What kind of talk, default say.
float adaptivVelScale
Scale of velocity for adaptive vel.
csString memoryCheck
Used to keep memory name in case coordinates are taken from there.
csString attackMostHatedTribeTarget
Melee operation "tribe" attribute. When set to true the < melee operation will use the most hated of ...
virtual OperationResult Advance(float timedelta, NPC *npc)
virtual ~WatchOperation()
virtual void SetState(State state)
Wander auto-navigates randomly between a network of waypoints specified in the DB.
This object represents each NPC managed by this superclient.
Definition: npc.h:126
csVector3 currentPointOffset
The offset used for current local dest.
csString scriptName
The name of the script to run.
float maxHate
Hate should have a max value if MAX_HATE is set.
iSector * interrupted_sector
Pickup will tell the npc to pickup a nearby entity (or fake it).
int count
The number of the resource to reward to the tribe.
csString failedPerception
A perception to fire if the condition fails.
WanderRouteFilter wanderRouteFilter
csString action
Moving to a spot entails a position vector, a linear velocity, and an animation action.
Abstract common class for Move operations that use paths.
virtual ~CircleOperation()
All parts of this operation has been completed.
Definition: npcoperations.h:84
virtual ~ResurrectOperation()
EID targetEID
The EID of the chased target.
virtual bool AtInterruptedPosition(const csVector3 &pos, const iSector *sector)
MoveOperation(const char *n)
virtual ~MovePathOperation()
virtual void Failure(NPC *npc)
Called when the run operation return OPERATION_FAILED.
Moving entails a circle with radius at a velocity and an animation action.
virtual ~PickupOperation()
virtual ~DropOperation()
virtual ~DequipOperation()
ShareMemories will make the npc share memoreis with tribe.
Iterator base class for Forward and Reverse Iterators.
Definition: edge.h:99
float offsetAngleMax
The maximum offset angle in radians.
Sense only NPC&#39;s.
LoopEnd operation will jump back to the beginning of the loop.
Transfer will transfer a item from the NPC to a target.
bool offsetRelativeHeading
Set to true will make the offset relative target heading.
virtual ~ChangeBrainOperation()
virtual ~EquipOperation()
bool locateInvisible
Locate invisible targets.
virtual ~BusyOperation()
csString kFactor
float endAngle
The angle of the target.
virtual const csString & GetFallingPerception(NPC *npc)
Return the Falling perception event name.
psPath::Direction direction
Will unbuild a tribe building.
csString overallAssessmentPerception
Sense Players and NPC&#39;s.
float absoluteHate
Hate should be set to this value if ABS_HATE is set.
Melee will tell the npc to attack the most hated entity within range.
csString resource
csString spell
float offsetAngle
The actual offset angle in radians.
virtual ~NOPOperation()
virtual ~DeleteNPCOperation()
Let the NPC delete it self.
Sit will make the NPC sit or stand.
Moving entails a velocity vector and an animation action.
virtual ~ControlOperation()
bool talkPublic
Should this be public or only to the target.
csVector3 interrupted_position
virtual ~PerceptOperation()
MathScript * calcAdaptivVelocity
This is the particular calculation for adaptiv velocity.
virtual ~WaitOperation()
Edge::Iterator * currentPathPointIterator
The current iterator for path points.
csString talkText
The text to send to the clients.
int consecCollisions
Shared by move functions. Used by CheckMoveOk to detect collisions.
virtual const char * GetName() const
virtual ~ChaseOperation()
Destructor for this operation.
BusyOperation(bool busy)
csString failurePerception
The Perception to fire when a operation return OPERATION_FAILED.
Debug will turn on and off debug for the npc.
virtual bool Load(iDocumentNode *node)
Invisible will make the npc invisible.
bool checkTribeHome
Set to true if the tribe home should be checked by CheckMoveOk.
csString physicalAssessmentPerception
virtual ~TalkOperation()
unsigned int flags
virtual ~EatOperation()
Work will make the NPC work for a resource.
virtual ~VisibleOperation()
float minHate
Hate should bave a min value if MIN_HATE is set.
float sideOffset
Add a offset to the side of the target.
Loot will make the NPC loot specified items.
csString attack_type
Template class for implementing waypoint filtering when calculating routes.
Definition: pspathnetwork.h:49
virtual ~InvisibleOperation()
Equip will tell the npc to equip a item.
csList< Edge * >::Iterator edgeIterator
bool locateInvincible
Locate invincible targets.
Vel set the velocity source of the brain to run or walk.
virtual ~SequenceOperation()
VelSource velSource
Source used for velocity.
All scheduled events must inherit from this class.
Definition: gameevent.h:36
Will Set the busy indicator for an NPC.
Eat will take a bite of a nearby dead actor and add resource to tribe wealth.
ScriptOperation(const char *sciptName)
virtual ~SetBufferOperation()
virtual ~AutoMemorizeOperation()
virtual State GetState() const
LoopBegin operation will only print LoopBegin for debug purpose.
virtual ~VelSourceOperation()
MathScript * calcCondition
This is the particular calculation for condition.
Represents a point on a path between two waypoints.
Definition: pspath.h:58
Sense only NPC&#39;s.
psNPCCommandsMessage::PerceptionTalkType TalkType
WanderRouteFilter(WanderOperation *parent)
virtual ~ScriptOperation()
virtual ~ShareMemoriesOperation()
MovePath specifies the name of a path and an animation action.
Send a custon perception from a behavior script.
virtual ~MemorizeOperation()
Let the NPC cast a spell.
The message sent from server to superclient after successful login.
Definition: npcmessages.h:198
virtual ~TribeHomeOperation()
virtual ~LocateOperation()
LoopEndOperation(int which, int iterations)
Will build a tribe building.
Detect and chase a target until reached o out of bound.
bool LoadCheckMoveOk(iDocumentNode *node)
Load attributes for the CheckMoveOk check.
ControlOperation(bool control)
virtual ~EmoteOperation()
Will send an assessment request to the server.
Will copy a locate.