Planeshift
pscharacter.h
Go to the documentation of this file.
1 /*
2  * pscharacter.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 
20 #ifndef __PSCHARACTER_H__
21 #define __PSCHARACTER_H__
22 //=============================================================================
23 // Crystal Space Includes
24 //=============================================================================
25 #include <csutil/sysfunc.h>
26 
27 //=============================================================================
28 // Project Includes
29 //=============================================================================
30 #include "util/poolallocator.h"
31 #include "util/psconst.h"
32 #include "util/scriptvar.h"
33 #include "util/skillcache.h"
34 #include "util/slots.h"
35 
36 #include "net/charmessages.h"
37 
38 #include "../icachedobject.h"
39 #include "../playergroup.h"
40 #include "rpgrules/factions.h"
41 
42 //=============================================================================
43 // Local Includes
44 //=============================================================================
45 #include "buffable.h"
46 #include "psskills.h"
47 #include "psstdint.h"
48 #include "pscharinventory.h"
49 #include "psinventorycachesvr.h"
50 #include "psitemstats.h"
51 #include "servervitals.h"
52 #include "psguildinfo.h"
53 #include "psattackqueue.h"
54 #include "pscharquestmgr.h"
55 
56 class psServerVitals;
57 class MsgEntry;
58 class psItemStats;
59 class psItem;
60 class psQuest;
61 
62 struct psRaceInfo;
63 class psSectorInfo;
64 
65 class ExchangeManager;
66 class MathScript;
67 class NpcResponse;
68 class gemActor;
69 struct psGuildLevel;
70 class psGuildMember;
71 class psLootMessage;
72 class psMerchantInfo;
73 class psQuestListMessage;
74 class psSpell;
76 class psTradeProcesses;
77 class psTrainerInfo;
78 struct psTrait;
79 class psWorkGameEvent;
80 
81 struct Result;
82 struct Faction;
83 
89 csString NormalizeCharacterName(const csString &name);
90 
92 
94 {
102 } ;
103 
104 #define PSCHARACTER_BULK_COUNT INVENTORY_BULK_COUNT
105 #define PSCHARACTER_BANK_BULK_COUNT 16
106 
111 {
112 protected:
113  psCharacter* self;
114 public:
115  CharacterAttribute(psCharacter* character) : self(character) { }
116 };
117 
118 // Remember to update the translation table in GetModeStr when adding modes.
120 {
134 };
135 
137 {
144 };
145 
148 {
151 };
152 
153 
154 
159 {
165  csArray<int> completedEventIDsAsGM;
167  csArray<int> completedEventIDs;
168 };
169 
175 {
180 };
181 
182 
184 #define PSCHARACTER_EQUIPMENTFLAG_AUTOATTACK 0x00000001
185 #define PSCHARACTER_EQUIPMENTFLAG_SINGLEATTACK 0x00000002
187 #define PSCHARACTER_EQUIPMENTFLAG_ATTACKIFEMPTY 0x00000004
189 
190 //-----------------------------------------------------------------------------
191 
196 {
197 public:
198  struct Buddy
199  {
200  csString name;
201  PID playerId;
202  };
203 
209  void Initialize(PID charID)
210  {
211  characterId = charID;
212  }
213 
220  bool AddBuddy(PID buddyID, csString &name);
221 
227  void RemoveBuddy(PID buddyID);
228 
235  bool IsBuddy(PID buddyID);
236 
242  void AddBuddyOf(PID buddyID);
243 
249  void RemoveBuddyOf(PID buddyID);
250 
257  bool LoadBuddies(Result &myBuddies, Result &buddyOf);
258 
259 
260  csArray<psBuddyManager::Buddy> GetBuddyList()
261  {
262  return buddyList;
263  }
264  csArray<PID> GetBuddyOfList()
265  {
266  return buddyOfList;
267  }
268 
269 private:
270 
271  csArray<psBuddyManager::Buddy> buddyList;
272  csArray<PID> buddyOfList;
273 
274  PID characterId;
275 };
276 
277 
278 //-----------------------------------------------------------------------------
279 
280 // Need to recalculate Max HP/Mana/Stamina and inventory limits whenever stats
281 // change (whether via buffs or base value changes).
283 {
284 public:
286  {
287  chr = c;
288  }
289 protected:
290  virtual void OnChange();
292 };
293 
294 // When base stats change, we also need to recalculate skill training costs.
295 // However, since training ignores buffs, we don't need to for all changes.
297 {
298 public:
299  void SetBase(int x);
300 };
301 
303 
305 {
306 public:
307  StatSet(psCharacter* self);
308 
309  CharStat &Get(PSITEMSTATS_STAT attrib);
310  CharStat &operator [](PSITEMSTATS_STAT which)
311  {
312  return Get(which);
313  }
314 
315 protected:
317 };
318 
322 struct Skill
323 {
324  unsigned short z;
325  unsigned short y;
327 
328  unsigned short zCost;
329  unsigned short yCost;
330  unsigned short zCostNext;
331  unsigned short yCostNext;
332  bool dirtyFlag;
333 
335 
337  {
338  Clear();
339  }
340  void Clear()
341  {
342  z=y=0;
343  zCost=yCost=0;
344  info = NULL;
345  dirtyFlag = false;
346  }
347 
348  void CalculateCosts(psCharacter* user);
349 
352  bool CanTrain()
353  {
354  return y < yCost;
355  }
356 
365  void Train(int yIncrease);
366 
379  bool CheckDoRank(psCharacter* user);
380 
397  bool Practice(unsigned int amount, unsigned int &actuallyAdded, psCharacter* user);
398 };
399 
400 
408 {
409 protected:
410  csArray<Skill> skills;
411 
412 public:
418  SkillSet(psCharacter* self);
419 
427  void SetSkillInfo(PSSKILL which, psSkillInfo* info, bool recalculatestats = true);
428 
437  void SetSkillPractice(PSSKILL which, int z_value);
438 
448  void SetSkillKnowledge(PSSKILL which, int y_value);
449 
460  void SetSkillRank(PSSKILL which, unsigned int rank, bool recalculatestats = true);
461 
465  void Calculate();
466 
476  bool CanTrain(PSSKILL skill);
477 
485  void CheckDoRank(PSSKILL skill);
486 
487 
497  void Train(PSSKILL skill, int yIncrease);
498 
499 
506  SkillRank &GetSkillRank(PSSKILL which);
507 
514  unsigned int GetSkillKnowledge(PSSKILL skill);
515 
522  unsigned int GetSkillPractice(PSSKILL skill);
523 
534  bool AddToSkillPractice(PSSKILL skill, unsigned int val, unsigned int &added);
535 
539  int AddSkillPractice(psSkillInfo* skill, unsigned int val);
540 
544  int AddSkillPractice(PSSKILL skill, unsigned int val);
545 
552  unsigned int GetBestSkillSlot(bool withBuff);
553 
554  Skill &Get(PSSKILL skill);
555 };
556 
557 #define ALWAYS_IMPERVIOUS 1
558 #define TEMPORARILY_IMPERVIOUS 2
559 
560 
561 //-----------------------------------------------------------------------------
562 
563 struct Stance
564 {
565  unsigned int stance_id;
566  csString stance_name;
573 };
574 
583 {
584 public:
585  csString name;
586  csString value;
587  bool dirty;
589 
590 
592  {
593  return intBuff;
594  }
595 
596  charVariable() : dirty(false) {}
597  charVariable(csString name, csString value) : name(name), value(value), dirty(false)
598  {
599  intBuff.SetBase(strtoul(value.GetDataSafe(),NULL,0));
600  }
601  charVariable(csString name, csString value, bool dirty) : name(name), value(value), dirty(dirty)
602  {
603  intBuff.SetBase(strtoul(value.GetDataSafe(),NULL,0));
604  }
605 };
606 
607 class OverridableRace : public Overridable<psRaceInfo*>
608 {
609 public:
610 
617 
621  virtual ~OverridableRace() { }
622 
628  void SetCharacter(psCharacter* psChar)
629  {
630  character = psChar;
631  }
632 
633 protected:
634 
640  virtual void OnChange();
641 
643 };
644 
645 //-----------------------------------------------------------------------------
646 
648 {
649 public:
651  {
656  STORING
657  };
658 
659  struct st_location
660  {
662  csVector3 loc;
663  float loc_yrot;
665  };
666 
667  psCharacter();
668 
669  virtual ~psCharacter();
670 
671  bool Load(iResultRow &row);
672 
673  bool IsStatue()
674  {
675  return isStatue;
676  }
677 
679  {
680  return inventory;
681  }
682 
684  {
685  return money;
686  }
687 
689  {
690  return bankMoney;
691  }
692 
693  void SetMoney(psMoney m);
694 
702  void SetMoney(psItem* &moneyObject);
703 
712  void SetMoney(psItemStats* MoneyObject, int amount);
713 
714  void AdjustMoney(psMoney m, bool bank);
715 
716  void SaveMoney(bool bank);
717 
718  void ResetStats();
719 
720 
722  bool NeedsHelpEvent(int which)
723  {
724  return (helpEventFlags & (1 << which))==0;
725  }
726 
728  void CompleteHelpEvent(int which)
729  {
730  helpEventFlags |= (1 << which);
731  }
732 
735  {
736  guildinfo = g;
737  }
740  {
741  return guildinfo;
742  }
744  psGuildLevel* GetGuildLevel();
746  psGuildMember* GetGuildMembership();
747 
750  {
751  return (joinNotifications & PSCHARACTER_JOINNOTIFICATION_GUILD);
752  }
755  {
756  return (joinNotifications & PSCHARACTER_JOINNOTIFICATION_ALLIANCE);
757  }
759  void SetGuildNotifications(bool enabled)
760  {
761  if(enabled) joinNotifications |= PSCHARACTER_JOINNOTIFICATION_GUILD;
762  else joinNotifications &= ~PSCHARACTER_JOINNOTIFICATION_GUILD;
763  }
765  void SetAllianceNotifications(bool enabled)
766  {
767  if(enabled) joinNotifications |= PSCHARACTER_JOINNOTIFICATION_ALLIANCE;
768  else joinNotifications &= ~PSCHARACTER_JOINNOTIFICATION_ALLIANCE;
769  }
770 
773  {
774  return joinNotifications;
775  }
777  void SetNotifications(int notifications)
778  {
779  joinNotifications = notifications;
780  }
781 
783  {
784  return skills;
785  }
786 
791  {
792  return &skillCache;
793  }
794 
798  void GetSkillValues(MathEnvironment* env);
799  void GetSkillBaseValues(MathEnvironment* env);
800 
801  // iCachedObject Functions below
802  virtual void ProcessCacheTimeout() {}
803  virtual void* RecoverObject()
804  {
805  return this;
806  }
807  virtual void DeleteSelf()
808  {
809  delete this;
810  }
811 
812 
813 
815  bool QuickLoad(iResultRow &row, bool noInventory);
816 
817  void LoadIntroductions();
818 
819  void LoadActiveSpells();
820  void AddSpell(psSpell* spell);
821  bool Store(const char* location,const char* slot,psItem* what);
822 
823  void SetPID(PID characterID)
824  {
825  pid = characterID;
826  }
827  PID GetPID() const
828  {
829  return pid;
830  }
831 
832  PID GetMasterNPCID() const
833  {
834  return npcMasterId ? npcMasterId : pid;
835  }
836 
837  void SetAccount(AccountID id)
838  {
839  accountid = id;
840  }
841  AccountID GetAccount() const
842  {
843  return accountid;
844  }
845 
846  void SetName(const char* newName)
847  {
848  SetFullName(newName,lastname.GetData());
849  }
850  void SetLastName(const char* newLastName)
851  {
852  SetFullName(name.GetData(),newLastName);
853  }
854  void SetFullName(const char* newFirstName, const char* newLastName);
855  void SetOldLastName(const char* oldLastName)
856  {
857  this->oldlastname = oldLastName;
858  }
859 
860  const char* GetCharName() const
861  {
862  return name.GetData();
863  }
864  const char* GetCharLastName() const
865  {
866  return lastname.GetData();
867  }
868  const char* GetCharFullName() const
869  {
870  return fullName.GetData();
871  }
872  const char* GetOldLastName() const
873  {
874  return oldlastname.GetData();
875  }
876 
877  // Introductions
879  bool Knows(PID charid);
881  {
882  return (c ? Knows(c->GetPID()) : false);
883  }
885  bool Introduce(psCharacter* c);
887  bool Unintroduce(psCharacter* c);
888 
889  unsigned int GetCharType() const
890  {
891  return characterType;
892  }
893  void SetCharType(unsigned int v)
894  {
895  CS_ASSERT(v < PSCHARACTER_TYPE_COUNT);
896  characterType = v;
897  }
898  const char* GetCharTypeName()
899  {
900  return characterTypeName[characterType];
901  }
902 
906  void SetLastLoginTime();
907 
911  csString GetLastLoginTime() const;
912 
916  void SetPetElapsedTime(double elapsedTime);
917 
921  double GetPetElapsedTime() const;
922 
926  void SetSpouseName(const char* name);
927 
933  const char* GetSpouseName() const
934  {
935  return spouseName.GetData();
936  }
937  void SetIsMarried(bool married)
938  {
939  isMarried = married;
940  }
941  bool GetIsMarried() const
942  {
943  return isMarried;
944  }
945 
954  void SetRaceInfo(psRaceInfo* rinfo);
955 
961  psRaceInfo* GetRaceInfo();
962 
968  OverridableRace &GetOverridableRace();
969 
976  float GetScale();
977 
985  float GetScaleValue();
986 
992  bool AddExploredArea(PID explored);
993 
999  bool HasExploredArea(PID explored);
1000 
1002  {
1003  return factions;
1004  }
1005 
1006  void SetLootCategory(int id)
1007  {
1008  lootCategoryId = id;
1009  }
1010  int GetLootCategory() const
1011  {
1012  return lootCategoryId;
1013  }
1014 
1024  psItem* RemoveLootItem(int id);
1025 
1035  csArray<psItem*> RemoveLootItems(csArray<csString> categories = csArray<csString>());
1036 
1042  void AddLootItem(psItem* item);
1043  void AddLootMoney(int money)
1044  {
1045  lootMoney += money;
1046  }
1047  size_t GetLootItems(psLootMessage &msg, EID entity, int cnum);
1048 
1050  int GetLootMoney();
1051 
1053  void ClearLoot();
1054 
1057  {
1058  return lastResponse;
1059  }
1060  void SetLastResponse(int response)
1061  {
1062  lastResponse=response;
1063  }
1064  bool CheckResponsePrerequisite(NpcResponse* resp);
1065 
1066  void CombatDrain(int);
1067 
1074  bool HasVariableDefined(const csString &name);
1075 
1082  csString GetVariableValue(const csString &name);
1083 
1092  Buffable<int> &GetBuffableVariable(const csString &name, const csString &value = "0");
1093 
1100  void SetVariable(const csString &name, const csString &value);
1101 
1108  void SetVariable(const csString &name);
1109 
1114  void UnSetVariable(const csString &name);
1115 
1119  csHash<charVariable, csString>::ConstGlobalIterator GetVariables() const;
1120 
1121  unsigned int GetExperiencePoints(); // W
1122  void SetExperiencePoints(unsigned int W);
1123  unsigned int AddExperiencePoints(unsigned int W);
1124  unsigned int AddExperiencePointsNotify(unsigned int W);
1125  unsigned int CalculateAddExperience(PSSKILL skill, unsigned int awardedPoints, float modifier = 1);
1126  unsigned int GetProgressionPoints(); // X
1127  void SetProgressionPoints(unsigned int X,bool save);
1128  void UseProgressionPoints(unsigned int X);
1129 
1131  int GetMaxAllowedRealm(PSSKILL skill);
1133  {
1134  return skills.GetSkillRank(skill);
1135  }
1136 
1137  void KilledBy(psCharacter* attacker)
1138  {
1139  deaths++;
1140  if(!attacker) suicides++;
1141  }
1142  void Kills(psCharacter* target)
1143  {
1144  kills++;
1145  }
1146 
1147  unsigned int GetKills() const
1148  {
1149  return kills;
1150  }
1151  unsigned int GetDeaths() const
1152  {
1153  return deaths;
1154  }
1155  unsigned int GetSuicides() const
1156  {
1157  return suicides;
1158  }
1159 
1170  void DropItem(psItem* &item, csVector3 pos = 0, const csVector3 &rot = csVector3(0), bool guarded = true, bool transient = true, bool inplace = false);
1171 
1172  float GetHP();
1173  float GetMana();
1174  float GetStamina(bool pys);
1175 
1176  void SetHitPoints(float v);
1177  void SetMana(float v);
1178  void SetStamina(float v, bool pys);
1179 
1180  void AdjustHitPoints(float adjust);
1181  void AdjustMana(float adjust);
1182  void AdjustStamina(float adjust, bool pys);
1183 
1184  VitalBuffable &GetMaxHP();
1185  VitalBuffable &GetMaxMana();
1186  VitalBuffable &GetMaxPStamina();
1187  VitalBuffable &GetMaxMStamina();
1188 
1189  VitalBuffable &GetHPRate();
1190  VitalBuffable &GetManaRate();
1191  VitalBuffable &GetPStaminaRate();
1192  VitalBuffable &GetMStaminaRate();
1193 
1194  void SetStaminaRegenerationNone(bool physical = true, bool mental = true);
1195  void SetStaminaRegenerationWalk(bool physical = true, bool mental = true);
1196  void SetStaminaRegenerationSitting();
1197  void SetStaminaRegenerationStill(bool physical = true, bool mental = true);
1198  void SetStaminaRegenerationWork(int skill);
1199 
1203  void CalculateMaxStamina();
1204 
1208  unsigned int GetStatsDirtyFlags() const;
1209 
1213  void SetAllStatsDirty();
1214 
1218  void ClearStatsDirtyFlags(unsigned int dirtyFlags);
1219 
1220  const char* GetHelmGroup()
1221  {
1222  return helmGroup.GetData();
1223  }
1224  const char* GetBracerGroup()
1225  {
1226  return BracerGroup.GetData();
1227  }
1228  const char* GetBeltGroup()
1229  {
1230  return BeltGroup.GetData();
1231  }
1232  const char* GetCloakGroup()
1233  {
1234  return CloakGroup.GetData();
1235  }
1236 
1237  void SetHelmGroup(const char* Group)
1238  {
1239  helmGroup = Group;
1240  }
1241  void SetBracerGroup(const char* Group)
1242  {
1243  BracerGroup = Group;
1244  }
1245  void SetBeltGroup(const char* Group)
1246  {
1247  BeltGroup = Group;
1248  }
1249  void SetCloakGroup(const char* Group)
1250  {
1251  CloakGroup = Group;
1252  }
1253 
1254  size_t GetAssignedGMEvents(psGMEventListMessage &gmevents, int clientnum);
1255  void AssignGMEvent(int id, bool playerIsGM);
1256  void CompleteGMEvent(bool playerIsGM);
1257  void RemoveGMEvent(int id, bool playerIsGM=false);
1258 
1262  void UpdateRespawn(csVector3 pos, float yrot, psSectorInfo* sector, InstanceID instance);
1263 
1264 
1268  bool UpdateFaction(Faction* faction, int delta);
1269 
1273  bool CheckFaction(Faction* faction, int value);
1274 
1278  void StartSong();
1279 
1286  void EndSong(csTicks bonusTime);
1287 
1291  csTicks GetSongStartTime() const
1292  {
1293  return songExecutionTime;
1294  }
1295 
1299  bool IsBanker() const
1300  {
1301  return banker;
1302  }
1303 
1309  bool IsStorage() const
1310  {
1311  return IsBanker();
1312  }
1313  void RecalculateStats();
1314 
1315  bool IsNPC()
1316  {
1317  return characterType == PSCHARACTER_TYPE_NPC;
1318  }
1319 
1325  bool IsPlayer()
1326  {
1327  return characterType == PSCHARACTER_TYPE_PLAYER;
1328  }
1329 
1331  bool IsPet()
1332  {
1333  return (characterType == PSCHARACTER_TYPE_PET || characterType == PSCHARACTER_TYPE_MOUNTPET);
1334  }
1336  bool IsMount()
1337  {
1338  return (characterType == PSCHARACTER_TYPE_MOUNT || characterType == PSCHARACTER_TYPE_MOUNTPET);
1339  }
1340  PID GetFamiliarID(size_t id)
1341  {
1342  return familiarsId.GetSize() > id ? familiarsId.Get(id) : 0;
1343  }
1344  void SetFamiliarID(PID v);
1346  {
1347  return familiarsId.GetSize();
1348  }
1350  {
1351  return canSummonFamiliar.Current() > 0;
1352  }
1354  {
1355  return canSummonFamiliar;
1356  }
1357  const char* GetAnimalAffinity()
1358  {
1359  return animalAffinity.GetDataSafe();
1360  }
1361  void SetAnimialAffinity(const char* v)
1362  {
1363  animalAffinity = v;
1364  }
1366  {
1367  return ownerId;
1368  }
1369  void SetOwnerID(PID v)
1370  {
1371  ownerId = v;
1372  }
1373  bool IsHired()
1374  {
1375  return hired;
1376  }
1377  void SetHired(bool hired)
1378  {
1379  this->hired = hired;
1380  }
1381 
1382  bool UpdateStatDRData(csTicks now);
1383  bool SendStatDRMessage(uint32_t clientnum, EID eid, int flags, csRef<PlayerGroup> group = NULL);
1384 
1391  bool GetSlotAttackable(INVENTORY_SLOT_NUMBER slot);
1392 
1393  bool GetSlotAutoAttackable(INVENTORY_SLOT_NUMBER slot);
1394  bool GetSlotSingleAttackable(INVENTORY_SLOT_NUMBER slot);
1395  void ResetSwings(csTicks timeofattack);
1396  void TagEquipmentObject(INVENTORY_SLOT_NUMBER slot,int eventId);
1397  int GetSlotEventId(INVENTORY_SLOT_NUMBER slot);
1398 
1400  //float GetAttackValue(psItem *slotitem);
1401  //float GetAttackValueForWeaponInSlot(int slot);
1402  float GetTargetedBlockValueForWeaponInSlot(INVENTORY_SLOT_NUMBER slot);
1403  float GetUntargetedBlockValueForWeaponInSlot(INVENTORY_SLOT_NUMBER slot);
1404  float GetTotalTargetedBlockValue();
1405  float GetTotalUntargetedBlockValue();
1406  float GetCounterBlockValueForWeaponInSlot(INVENTORY_SLOT_NUMBER slot);
1407  float GetDodgeValue();
1408 
1410  {
1411  return attackModifier;
1412  }
1414  {
1415  return defenseModifier;
1416  }
1417 
1419  void PracticeArmorSkills(unsigned int practice, INVENTORY_SLOT_NUMBER attackLocation);
1420  void PracticeWeaponSkills(unsigned int practice);
1421  void PracticeWeaponSkills(psItem* weapon, unsigned int practice);
1422 
1423  void SetTraitForLocation(PSTRAIT_LOCATION location,psTrait* trait);
1424  psTrait* GetTraitForLocation(PSTRAIT_LOCATION location);
1425 
1426  void GetLocationInWorld(InstanceID &instance,psSectorInfo* &sectorinfo,float &loc_x,float &loc_y,float &loc_z,float &loc_yrot);
1427  void SetLocationInWorld(InstanceID instance,psSectorInfo* sectorinfo,float loc_x,float loc_y,float loc_z,float loc_yrot);
1428  void SaveLocationInWorld();
1429 
1431  void MakeTextureString(csString &textureString);
1432 
1434  void MakeEquipmentString(csString &equipmentString);
1435 
1437  unsigned int GetCharLevel(bool physical);
1438 
1439  bool IsMerchant()
1440  {
1441  return (merchantInfo != NULL);
1442  }
1444  {
1445  return merchantInfo;
1446  }
1447  bool IsTrainer()
1448  {
1449  return (trainerInfo != NULL);
1450  }
1452  {
1453  return trainerInfo;
1454  }
1456  {
1457  return trainer;
1458  }
1459  void SetTrainer(psCharacter* trainer)
1460  {
1461  this->trainer = trainer;
1462  }
1463 
1473  bool CanTrain(PSSKILL skill);
1474 
1484  void Train(PSSKILL skill, int yIncrease);
1485 
1490  void SetSkillRank(PSSKILL which, unsigned int rank);
1491 
1492  psSpell* GetSpellByName(const csString &spellName);
1493  psSpell* GetSpellByIdx(int index);
1494  csArray<psSpell*> &GetSpellList()
1495  {
1496  return spellList;
1497  }
1498 
1499 
1501  {
1502  return merchant;
1503  }
1505  {
1506  return tradingStatus;
1507  }
1508  void SetTradingStatus(TradingStatus trading, psCharacter* merchant)
1509  {
1510  tradingStatus = trading;
1511  this->merchant = merchant;
1512  }
1513 
1515  {
1516  return actor;
1517  }
1518  void SetActor(gemActor* actor);
1519 
1520  bool SetTradingStopped(bool stopped);
1521 
1522  bool ReadyToExchange();
1523 
1526  {
1527  return (csGetTicks() - startTimeThisSession)/1000;
1528  }
1529 
1531  unsigned int GetTotalOnlineTime()
1532  {
1533  return timeconnected + GetOnlineTimeThisSession();
1534  }
1535 
1536 
1537  unsigned int GetTimeConnected()
1538  {
1539  return timeconnected;
1540  }
1541 
1546  const char* GetDescription();
1547 
1552  void SetDescription(const char* newValue);
1553 
1558  const char* GetOOCDescription();
1559 
1564  void SetOOCDescription(const char* newValue);
1565 
1570  const char* GetCreationInfo();
1571 
1576  void SetCreationInfo(const char* newValue);
1577 
1583  bool GetFactionEventsDescription(csString &factionDescription);
1584 
1589  const char* GetLifeDescription();
1590 
1595  void SetLifeDescription(const char* newValue);
1596 
1598  double GetProperty(MathEnvironment* env, const char* ptr);
1599  double CalcFunction(MathEnvironment* env, const char* functionName, const double* params);
1600  const char* ToString()
1601  {
1602  return fullName.GetData();
1603  }
1604 
1607  {
1608  return killExp;
1609  }
1610  void SetKillExperience(int newValue)
1611  {
1612  killExp=newValue;
1613  }
1614 
1615  void SetImperviousToAttack(int newValue)
1616  {
1617  imperviousToAttack=newValue;
1618  }
1620  {
1621  return imperviousToAttack;
1622  }
1623 
1624  void CalculateEquipmentModifiers();
1625  float GetStatModifier(PSITEMSTATS_STAT attrib);
1626 
1627  bool AppendCharacterSelectData(psAuthApprovedMessage &auth);
1628 
1629  // NPC based functions - should these go here?
1631  {
1632  return npcSpawnRuleId;
1633  }
1635  {
1636  npcSpawnRuleId=v;
1637  }
1638 
1640  {
1641  return buddyManager;
1642  }
1644  {
1645  return questManager;
1646  }
1647 
1649  void* operator new(size_t);
1651  void operator delete(void*);
1652 
1657  AccountID GetAccountId()
1658  {
1659  return accountid;
1660  }
1661 
1667  {
1668  return spawnLoc;
1669  }
1670 
1676  {
1677  return location;
1678  }
1679 
1683  psAttackQueue* GetAttackQueue() { return attackQueue; }
1684  friend class psCharacterLoader;
1685 
1686 protected:
1687 
1688  bool LoadSpells(PID use_id);
1689  bool LoadAdvantages(PID use_id);
1690  bool LoadSkills(PID use_id);
1691  bool LoadTraits(PID use_id);
1692  bool LoadRelationshipInfo(PID pid);
1693  bool LoadBuddies(Result &myBuddy, Result &buddyOf);
1694  bool LoadMarriageInfo(Result &result);
1695  bool LoadFamiliar(Result &pet, Result &owner);
1697  bool LoadFactions(PID pid);
1699  void UpdateFactions();
1700 
1705  bool LoadVariables(PID pid);
1706 
1710  void UpdateVariables();
1711 
1712  bool LoadExploration(Result &exploration);
1713  bool LoadGMEvents();
1714 
1719  csSet<PID> acquaintances;
1721  unsigned int deaths;
1722  unsigned int kills;
1723  unsigned int suicides;
1724  bool loaded;
1727 
1728  csRef<psMerchantInfo> merchantInfo;
1730 
1733 
1735  PID pid;
1736  AccountID accountid;
1737 
1738  csRef<psTrainerInfo> trainerInfo;
1740 
1741  csString description;
1742  csString oocdescription;
1743  csString creationinfo;
1744  csString lifedescription;
1745 
1746  int killExp;
1747 
1750 
1752 
1753  csString name;
1754  csString lastname;
1755  csString fullName;
1756  csString oldlastname;
1757 
1758  csString spouseName;
1760 
1762 
1764 
1766 
1768 
1770  unsigned int helpEventFlags;
1771 
1774 
1776 
1779 
1782 
1783  csString animalAffinity;
1784  PID ownerId;
1785  csArray<PID> familiarsId;
1787 
1789  unsigned int timeconnected;
1791 
1792  csString lastLoginTime;
1795 
1798 
1799  csArray<psSpell*> spellList;
1800 
1801  csHash<charVariable, csString> charVariables;
1802 
1805  csArray<PID> exploredAreas;
1806 
1809 
1810  float overrideMaxHp,overrideMaxMana;
1811 
1813  static const char* characterTypeName[];
1814 
1815  // see enum PSCHARACTER_TYPE for list of types
1816  unsigned int characterType;
1817 
1819  csArray<psItem*> lootPending;
1825  bool isStatue;
1826 
1827  //The attack queue
1828  csRef<psAttackQueue> attackQueue;
1829 private:
1830  void CalculateArmorForSlot(INVENTORY_SLOT_NUMBER slot, float &heavy_p, float &med_p, float &light_p);
1831  bool ArmorUsesSkill(INVENTORY_SLOT_NUMBER slot, PSITEMSTATS_ARMORTYPE skill);
1832 
1833  int FindGlyphSlot(const csArray<glyphSlotInfo> &slots, psItemStats* glyphType, int purifyStatus);
1834 
1835  csTicks songExecutionTime;
1836 
1841  csString helmGroup;
1842 
1847  csString BracerGroup;
1848 
1853  csString BeltGroup;
1854 
1859  csString CloakGroup;
1860 
1861  bool banker;
1862 
1863  bool hired;
1864 
1866  static PoolAllocator<psCharacter> characterpool;
1867 };
1868 
1871 #endif
1872 
1873 
virtual void * RecoverObject()
Definition: pscharacter.h:803
bool IsNPC()
Definition: pscharacter.h:1315
csHash< charVariable, csString > charVariables
Used to store character variables for this character.
Definition: pscharacter.h:1801
PID GetFamiliarID(size_t id)
Definition: pscharacter.h:1340
csTicks startTimeThisSession
Definition: pscharacter.h:1790
void SetGuild(psGuildInfo *g)
Set the active guild for the character.
Definition: pscharacter.h:734
void SetCharType(unsigned int v)
Definition: pscharacter.h:893
uint32 InstanceID
Definition: psconst.h:64
void SetOldLastName(const char *oldLastName)
Definition: pscharacter.h:855
int GetLootCategory() const
Definition: pscharacter.h:1010
void KilledBy(psCharacter *attacker)
Definition: pscharacter.h:1137
This class controls loading and saving Characters and Character specific data to and from an iDatabas...
This class handles the details behind a character&#39;s inventory system.
Structure for assigned GM Events.
Definition: pscharacter.h:158
const char * GetBeltGroup()
Definition: pscharacter.h:1228
csArray< psSpell * > spellList
Definition: pscharacter.h:1799
float overrideMaxMana
These values are loaded from base_hp_max,base_mana_max in the db and < should prevent normal HP calcu...
Definition: pscharacter.h:1810
Buffable< int > & GetBuffable()
Definition: pscharacter.h:591
bool IsMount()
Used to determine if this NPC is a mount.
Definition: pscharacter.h:1336
void Initialize(PID charID)
Setup the buddy manager.
Definition: pscharacter.h:209
void SetImperviousToAttack(int newValue)
Definition: pscharacter.h:1615
psSectorInfo * loc_sector
Definition: pscharacter.h:661
csArray< PID > exploredAreas
A bitfield which contains the notifications the player will get if a guild or alliance member login/l...
Definition: pscharacter.h:1805
virtual ~OverridableRace()
Destructor.
Definition: pscharacter.h:621
gemActor * GetActor()
Definition: pscharacter.h:1514
psGuildInfo * guildinfo
Definition: pscharacter.h:1716
This class holds the master list of all trade transformatations possible in the game.
Definition: pstrade.h:101
Represents a skill an NPC, player or pet can learn.
Definition: psskills.h:72
csArray< Skill > skills
Array to store all the skills.
Definition: pscharacter.h:410
psSkillInfo * info
Database information about the skill.
Definition: pscharacter.h:334
psSkillCache skillCache
Definition: pscharacter.h:1803
bool IsStatue()
Definition: pscharacter.h:673
void SetAllianceNotifications(bool enabled)
Sets if the client should receive notifications about alliance members logging in.
Definition: pscharacter.h:765
SkillStatBuffable SkillRank
Definition: pscharacter.h:302
csString stance_name
Definition: pscharacter.h:566
csString oldlastname
Definition: pscharacter.h:1756
csArray< psSpell * > & GetSpellList()
Definition: pscharacter.h:1494
A specific MathEnvironment to be used in a MathScript.
Definition: mathscript.h:188
csArray< psItem * > lootPending
Array of items waiting to be looted.
Definition: pscharacter.h:1819
bool IsGettingAllianceNotifications()
Returns if the client should receive notifications about alliance members logging in...
Definition: pscharacter.h:754
A MathScript is a mini-program to run.
Definition: mathscript.h:442
Overridables.
Definition: buffable.h:70
Buffable< int > & GetCanSummonFamiliar()
Definition: pscharacter.h:1353
Buffable< int > canSummonFamiliar
Definition: pscharacter.h:1786
int runningEventID
Player Running GM Event.
Definition: pscharacter.h:163
OverridableRace race
Holds the race of this character and it&#39;s overriden values.
Definition: pscharacter.h:1761
PSCHARACTER_MODE
Definition: pscharacter.h:119
st_location GetSpawnLocation()
Get the character spawn location.
Definition: pscharacter.h:1666
void SetIsMarried(bool married)
Definition: pscharacter.h:937
void SetCharacter(psCharacter *psChar)
Sets which character owns this overridableRace.
Definition: pscharacter.h:628
gemActor * actor
The current game entity object this characater is attached to.
Definition: pscharacter.h:1734
unsigned int timeconnected
Total number of seconds online. Updated at logoff.
Definition: pscharacter.h:1789
GMEventsAssignment assignedEvents
Definition: pscharacter.h:1804
csString progressionScriptText
flat string loaded from the DB.
Definition: pscharacter.h:1765
const char * GetBracerGroup()
Definition: pscharacter.h:1224
This class holds all information for one quest with its reference to parent quest, list of steps, lockoutime, sub quests, ...
Definition: psquest.h:67
Holds data for a guild.
Definition: psguildinfo.h:159
bool dirty
Says if the variable was modified.
Definition: pscharacter.h:587
INVENTORY_SLOT_NUMBER
Holds a list of the possible socket identifiers that items can be attached to.
Definition: slots.h:32
SkillSet skills
Definition: pscharacter.h:1718
bool IsPlayer()
Used to determine if this character is a player.
Definition: pscharacter.h:1325
A special form of buffable that is clamped to always return a positive number.
Definition: buffable.h:278
csArray< int > completedEventIDs
completed GM events
Definition: pscharacter.h:167
unsigned short z
Practice value.
Definition: pscharacter.h:324
A queue to hold attacks in order of execution.
Definition: psattackqueue.h:41
psCharacter * self
Definition: pscharacter.h:113
unsigned int kills
Definition: pscharacter.h:1722
csArray< psBuddyManager::Buddy > GetBuddyList()
Definition: pscharacter.h:260
float stamina_drain_P
Definition: pscharacter.h:567
int runningEventIDAsGM
GM controlling running GM Event.
Definition: pscharacter.h:161
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
work event class
Definition: workmanager.h:708
SkillSet & Skills()
Definition: pscharacter.h:782
Multiplier & AttackModifier()
Definition: pscharacter.h:1409
This class is a set of faction structures.
Definition: factions.h:68
unsigned int GetSuicides() const
Definition: pscharacter.h:1155
psServerVitals * vitals
Definition: pscharacter.h:1773
Message sent from server to client if login was valid.
Definition: messages.h:697
st_location spawnLoc
Definition: pscharacter.h:1751
const char * GetHelmGroup()
Definition: pscharacter.h:1220
int killExp
Kill Exp.
Definition: pscharacter.h:1746
psBuddyManager buddyManager
Definition: pscharacter.h:1725
SkillRank & GetSkillRank(PSSKILL skill)
Definition: pscharacter.h:1132
FactionSet * factions
Definition: pscharacter.h:1763
unsigned int deaths
Definition: pscharacter.h:1721
int GetKillExperience()
The exp to be handed out when this actor dies.
Definition: pscharacter.h:1606
Multiplier defenseModifier
Defense value is multiplied by this.
Definition: pscharacter.h:1749
csString name
Character name of buddy.
Definition: pscharacter.h:200
psSkillCache * GetSkillCache()
Returns a pointer to the skill cache for this character.
Definition: pscharacter.h:790
CharacterAttribute(psCharacter *character)
Definition: pscharacter.h:115
void Clear()
Definition: pscharacter.h:340
csRef< psAttackQueue > attackQueue
Definition: pscharacter.h:1828
csString value
The value assigned to this variable.
Definition: pscharacter.h:586
PSITEMSTATS_STAT
Definition: psitemstats.h:69
PSCHARACTER_JOINNOTIFICATION
enum containing the notification status (a bitfield)
Definition: pscharacter.h:147
psTrainerInfo * GetTrainerInfo()
Definition: pscharacter.h:1451
bool isStatue
Says if this npc is a statue.
Definition: pscharacter.h:1825
Defines a level inside a guild.
Definition: psguildinfo.h:99
PID playerId
The PID of the player that is the buddy.
Definition: pscharacter.h:201
const char * GetCharLastName() const
Definition: pscharacter.h:864
psCharacter * trainer
The current character that is being trained?
Definition: pscharacter.h:1739
PSTRAIT_LOCATION
Define the player controled base customization that their model can have.
Definition: charmessages.h:24
void SetBeltGroup(const char *Group)
Definition: pscharacter.h:1245
Buffables for vitals, which automatically update the dirty flag as necessary.
Definition: servervitals.h:43
csString lastname
Definition: pscharacter.h:1754
void SetPID(PID characterID)
Definition: pscharacter.h:823
Defines a guild member in a guild.
Definition: psguildinfo.h:124
unsigned int stance_id
Definition: pscharacter.h:565
SkillRank rank
Skill rank (buffable)
Definition: pscharacter.h:326
Defines characteristics of a race associated to an NPC, player or pet.
Definition: psraceinfo.h:58
psMoney & BankMoney()
Definition: pscharacter.h:688
csSet< PID > acquaintances
Definition: pscharacter.h:1719
Represent a visual feature of character customization like hair style, color of eyes, skin color, ...
Definition: pstrait.h:41
void SetAccount(AccountID id)
Definition: pscharacter.h:837
csString oocdescription
Player OOC description.
Definition: pscharacter.h:1742
void SetLastResponse(int response)
Definition: pscharacter.h:1060
Server side of the character vitals manager.
Definition: servervitals.h:81
const char * GetOldLastName() const
Definition: pscharacter.h:872
bool IsTrainer()
Definition: pscharacter.h:1447
virtual void DeleteSelf()
Definition: pscharacter.h:807
The psSkillCache class implements the skill cache both on the server and on the client.
Definition: skillcache.h:158
bool IsHired()
Definition: pscharacter.h:1373
Any semi-autonomous object, either a player or an NPC.
Definition: gem.h:1170
const char * ToString()
Definition: pscharacter.h:1600
csTicks GetSongStartTime() const
Gets the starting time of the song that the player is currently playing.
Definition: pscharacter.h:1291
PID pid
Current PID for this characater ( or is it the above entity? )
Definition: pscharacter.h:1735
int joinNotifications
Definition: pscharacter.h:1808
unsigned short yCostNext
Cost in y points of next level.
Definition: pscharacter.h:331
Class to handle buddies.
Definition: pscharacter.h:195
void SetNotifications(int notifications)
sets the notification bitfield directly: to be used only by the loader functon
Definition: pscharacter.h:777
unsigned short yCost
Cost in y points.
Definition: pscharacter.h:329
csRef< psMerchantInfo > merchantInfo
Character&#39;s merchant info.
Definition: pscharacter.h:1728
csArray< PID > familiarsId
Definition: pscharacter.h:1785
A structure that holds the knowledge/practice/rank of each player skill.
Definition: pscharacter.h:322
Class to manager a characters quest details.
bool IsPet()
Used to determine if this NPC is a pet.
Definition: pscharacter.h:1331
void NPC_SetSpawnRuleID(int v)
Definition: pscharacter.h:1634
void SetTradingStatus(TradingStatus trading, psCharacter *merchant)
Definition: pscharacter.h:1508
Multiplier attackModifier
Attack value is multiplied by this.
Definition: pscharacter.h:1748
int GetLastResponse()
The last_response given by an npc to this player.
Definition: pscharacter.h:1056
psMerchantInfo * GetMerchantInfo()
Definition: pscharacter.h:1443
psCharacterQuestManager questManager
Definition: pscharacter.h:1726
bool IsGettingGuildNotifications()
Returns if the client should receive notifications about guild members logging in.
Definition: pscharacter.h:749
PSSKILL
Definition: psskills.h:44
Sends messages to the client listing the assigned quests for the player.
Definition: messages.h:1869
TradingStatus tradingStatus
See the enum for the various status.
Definition: pscharacter.h:1732
csString name
Definition: factions.h:43
void SetBase(T x)
Definition: buffable.h:172
void SetHelmGroup(const char *Group)
Definition: pscharacter.h:1237
int GetImperviousToAttack()
Definition: pscharacter.h:1619
bool dirtyFlag
Flag if this was changed after load from database.
Definition: pscharacter.h:332
Holds information about the skills a character (usually NPC) can teach.
Definition: pstrainerinfo.h:50
psGuildInfo * GetGuild()
Return the active guild, if any for this character.
Definition: pscharacter.h:739
unsigned int helpEventFlags
Bitfield for which help events a character has already encountered.
Definition: pscharacter.h:1770
unsigned int suicides
Definition: pscharacter.h:1723
int npcSpawnRuleId
NPC specific data. Should this go here?
Definition: pscharacter.h:1778
PSCHARACTER_TYPE
Definition: pscharacter.h:93
psCharacterInventory & Inventory()
Definition: pscharacter.h:678
csString lifedescription
Custom life events informations.
Definition: pscharacter.h:1744
st_location GetLocation() const
Get the character location.
Definition: pscharacter.h:1675
Represents a spell.
Definition: psspell.h:74
csString spouseName
Definition: pscharacter.h:1758
void SetName(const char *newName)
Definition: pscharacter.h:846
PID GetMasterNPCID() const
Definition: pscharacter.h:832
This is used to char a charVariable.
Definition: pscharacter.h:582
csString lastLoginTime
String value copied from the database containing the last login time.
Definition: pscharacter.h:1792
psBuddyManager & GetBuddyMgr()
Definition: pscharacter.h:1639
bool IsStorage() const
Check if the character is a storage.
Definition: pscharacter.h:1309
Sends messages to the client listing the available loot on a mob.
Definition: messages.h:1844
This is a wrapper class for result sets which makes syntax for getting at the data easier and also us...
Definition: psdatabase.h:132
int lootMoney
Amount of money ready to be looted.
Definition: pscharacter.h:1823
Multipliers.
Definition: buffable.h:229
unsigned short zCostNext
Cost in Z points of next level.
Definition: pscharacter.h:330
csArray< PID > GetBuddyOfList()
Definition: pscharacter.h:264
int lootCategoryId
Id of Loot category to use if this char has extra loot.
Definition: pscharacter.h:1781
void Kills(psCharacter *target)
Definition: pscharacter.h:1142
bool GetIsMarried() const
Definition: pscharacter.h:941
bool tradingStopped
Definition: pscharacter.h:1731
void SetCloakGroup(const char *Group)
Definition: pscharacter.h:1249
unsigned int GetTimeConnected()
Definition: pscharacter.h:1537
TradingStatus GetTradingStatus()
Definition: pscharacter.h:1504
bool Knows(psCharacter *c)
Definition: pscharacter.h:880
psCharacterQuestManager & GetQuestMgr()
Definition: pscharacter.h:1643
PID GetPID() const
Definition: pscharacter.h:827
void SetAnimialAffinity(const char *v)
Definition: pscharacter.h:1361
unsigned int characterType
Definition: pscharacter.h:1816
void CompleteHelpEvent(int which)
Sets a bit field complete for a specified flag from the enum in tutorialmanager.h.
Definition: pscharacter.h:728
psMoney Money()
Definition: pscharacter.h:683
csString name
The name of the variable.
Definition: pscharacter.h:585
OverridableRace(psRaceInfo *race)
Constructor, wants a.
Definition: pscharacter.h:616
psCharacter * merchant
The merchant this charcter trade with.
Definition: pscharacter.h:1729
void SetGuildNotifications(bool enabled)
Sets if the client should receive notifications about guild members logging in.
Definition: pscharacter.h:759
PSCHARACTER_WORKSTATE
This enumeration and structure tracks the players trade skill efforts.
Definition: pscharacter.h:174
unsigned int GetTotalOnlineTime()
Number of seconds online ever including this session in seconds.
Definition: pscharacter.h:1531
psMoney money
Current cash set on player.
Definition: pscharacter.h:1796
StatSet modifiers
Definition: pscharacter.h:1717
A list of skills.
Definition: pscharacter.h:407
const char * GetAnimalAffinity()
Definition: pscharacter.h:1357
size_t GetNumFamiliars()
Definition: pscharacter.h:1345
void SetBracerGroup(const char *Group)
Definition: pscharacter.h:1241
void SetHired(bool hired)
Definition: pscharacter.h:1377
unsigned int GetCharType() const
Definition: pscharacter.h:889
csString animalAffinity
Definition: pscharacter.h:1783
psCharacter * chr
Definition: pscharacter.h:291
charVariable(csString name, csString value)
Definition: pscharacter.h:597
psAttackQueue * GetAttackQueue()
Get the attack queue.
Definition: pscharacter.h:1683
PSITEMSTATS_ARMORTYPE
Definition: psitemstats.h:60
int NPC_GetSpawnRuleID()
Definition: pscharacter.h:1630
unsigned short y
Knowledge Level.
Definition: pscharacter.h:325
This class holds several possible responses and an action script for the npc to run whenever an appro...
Definition: dictionary.h:394
void SetLootCategory(int id)
Definition: pscharacter.h:1006
virtual void ProcessCacheTimeout()
required for iCachedObject but not used here
Definition: pscharacter.h:802
unsigned int GetKills() const
Definition: pscharacter.h:1147
float defense_avoid_mod
Definition: pscharacter.h:571
PID GetOwnerID()
Definition: pscharacter.h:1365
int lastResponse
Last response of an NPC to this character (not saved)
Definition: pscharacter.h:1821
This huge class stores all the properties of any object a player can have in the game.
Definition: psitemstats.h:463
bool IsMerchant()
Definition: pscharacter.h:1439
charVariable(csString name, csString value, bool dirty)
Definition: pscharacter.h:601
float attack_damage_mod
Definition: pscharacter.h:570
This class holds the master list of all trade processes possible in the game.
Definition: pstrade.h:230
bool CanSummonFamiliar()
Definition: pscharacter.h:1349
csRef< psTrainerInfo > trainerInfo
Character&#39;s trainer information.
Definition: pscharacter.h:1738
void SetOwnerID(PID v)
Definition: pscharacter.h:1369
csString name
Definition: pscharacter.h:1753
void SetKillExperience(int newValue)
Definition: pscharacter.h:1610
csString description
Player description.
Definition: pscharacter.h:1741
float defense_absorb_mod
Definition: pscharacter.h:572
psCharacter * GetTrainer()
Definition: pscharacter.h:1455
csArray< int > completedEventIDsAsGM
completed GM events as the GM.
Definition: pscharacter.h:165
csString creationinfo
Creation manager informations.
Definition: pscharacter.h:1743
float stamina_drain_M
Definition: pscharacter.h:568
int GetNotifications()
gets the notification bitfield directly: to be used only by the save functon
Definition: pscharacter.h:772
FactionSet * GetFactions()
Definition: pscharacter.h:1001
const char * GetCharFullName() const
Definition: pscharacter.h:868
Buffable< int > intBuff
A buffable interpretation of the variable.
Definition: pscharacter.h:588
st_location location
Definition: pscharacter.h:1772
csString fullName
Definition: pscharacter.h:1755
AccountID GetAccount() const
Definition: pscharacter.h:841
GM Event List Message.
Definition: messages.h:5769
Contains information about sectors from the server perspective.
Definition: pssectorinfo.h:46
bool NeedsHelpEvent(int which)
Checks the bit field for a bit flag from the enum in TutorialManager.h.
Definition: pscharacter.h:722
psCharacterInventory inventory
Character&#39;s inventory handler.
Definition: pscharacter.h:1715
double petElapsedTime
Definition: pscharacter.h:1793
Base class for several other classes which hold character attributes of different sorts...
Definition: pscharacter.h:110
bool IsBanker() const
Check if the character is a banker.
Definition: pscharacter.h:1299
This class retrieves the merchant categories for an NPC.
double lastSavedPetElapsedTime
Store time for when the petElapsedTime was last saved to db.
Definition: pscharacter.h:1794
unsigned int GetDeaths() const
Definition: pscharacter.h:1151
Multiplier & DefenseModifier()
Definition: pscharacter.h:1413
const char * GetCharName() const
Definition: pscharacter.h:860
float attack_speed_mod
Definition: pscharacter.h:569
An ingame faction group.
Definition: factions.h:41
void Initialize(psCharacter *c)
Definition: pscharacter.h:285
psCharacter * GetMerchant()
Definition: pscharacter.h:1500
const char * GetSpouseName() const
Gets Spouse Name of a character.
Definition: pscharacter.h:933
PSCHARACTER_CUSTOM
Definition: pscharacter.h:136
const char * GetCharTypeName()
Definition: pscharacter.h:898
AccountID GetAccountId()
Get the account ID that this character is attached to.
Definition: pscharacter.h:1657
void SetLastName(const char *newLastName)
Definition: pscharacter.h:850
unsigned int GetOnlineTimeThisSession()
Number of seconds online this session in seconds.
Definition: pscharacter.h:1525
int imperviousToAttack
Definition: pscharacter.h:1767
const char * GetCloakGroup()
Definition: pscharacter.h:1232
bool CanTrain()
Checks to see if this skill can be trained any more at the current rank.
Definition: pscharacter.h:352
void SetTrainer(psCharacter *trainer)
Definition: pscharacter.h:1459
psMoney bankMoney
Money stored in the players bank account.
Definition: pscharacter.h:1797
AccountID accountid
Account ID that this characater is attached to.
Definition: pscharacter.h:1736
This class embodies item instances in the game.
Definition: psitem.h:238
unsigned short zCost
Cost in Z points.
Definition: pscharacter.h:328
csString NormalizeCharacterName(const csString &name)
"Normalizes" name of character i.e.
psCharacter * character
Pointer to the psCharacter owning this overridable class.
Definition: pscharacter.h:642
void AddLootMoney(int money)
Definition: pscharacter.h:1043