forked from macroquest/eqlib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPcClient.h
1606 lines (1426 loc) · 68.1 KB
/
PcClient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* MacroQuest: The extension platform for EverQuest
* Copyright (C) 2002-2022 MacroQuest Authors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#pragma once
#include "Common.h"
#include "Constants.h"
#include "Containers.h"
#include "CXStr.h"
#include "Achievements.h"
#include "Items.h"
#include "PlayerClient.h"
#include "Spells.h"
#include "EQData.h"
#include "PcProfile.h"
// This is the home of all things related to what used to be called CHARINFO
// plus a few extra things until they find a home of their own.
//
// Class hierarchy:
//
// CHARINFO:
// PcClient -> PcZoneClient -> PcBase, CharacterZoneClient, [SomeOtherClass]
// PcBase -> CharacterBase
namespace eqlib {
class CharacterBase;
class CharacterZoneClient;
class HateListEntry;
class PcBase;
class PcClient;
class PcZoneClient;
class ProfileManager;
//============================================================================
// Enums
//============================================================================
enum EAreaCorner
{
eAC_None = -1,
eAC_TopLeftCorner,
eAC_TopRightCorner,
eAC_BottomLeftCorner,
eAC_BottomRightCorner,
};
enum ELockoutCharacterReason
{
LCR_AllowNormalPlay,
LCR_InvalidWornItem,
LCR_Something,
};
enum eXTSlotStatus
{
eXTSlotEmpty,
eXTSlotCurrentZone,
eXTSlotDifferentZone,
eXTSlotUnknown
};
constexpr int MAX_BLOCKED_SPELLS = 40;
constexpr int MAX_BLOCKED_SPELLS_PET = 40;
constexpr int EQSKILL_HIDE = 29;
//============================================================================
// Structs
//============================================================================
struct [[offsetcomments]] ALCHEMYBONUSSKILLDATA
{
FORCE_SYMBOLS;
/*0x00*/ int SkillID;
/*0x04*/ int BonusPoints;
/*0x08*/
};
enum eGroupRoles
{
GroupRoleNone,
GroupRoleTank,
GroupRoleAssist,
GroupRolePuller,
GroupRoleMarkNPC,
GroupRoleMasterLooter,
MaxGroupRoles
};
//============================================================================
// CGroupMember
//============================================================================
// Real name is CGroupMemberClient, but we will use CGroupMember for short since
// we only ever deal with the client.
class CGroupMember;
class [[offsetcomments]] CGroupMemberBase
{
public:
/*0x08*/ CXStr Name;
/*0x10*/ short Type; // player type (EQP_PC, EQP_NPC, etc)
/*0x18*/ CXStr OwnerName;
/*0x20*/ int Level;
/*0x24*/ bool bIsOffline;
/*0x28*/ uint32_t UniquePlayerID;
/*0x2c*/ bool bRoleStates[MaxGroupRoles];
/*0x34*/ uint32_t CurrentRoleBits; // (Roles & 0x1) = MainTank, 0x2 = MainAssist, 0x4 = Puller 0x8 = Mark NPC 0x10 = Master Looter
/*0x38*/ eqtime_t OnlineTimestamp;
/*0x40*/
CGroupMemberBase();
virtual ~CGroupMemberBase();
virtual void* GetUnknownPtr() { return nullptr; }
virtual void* GetUnknownPtr2() { return nullptr; }
virtual void* GetUnknownPtr3() { return nullptr; }
virtual CharacterZoneClient* GetCharacter() { return nullptr; }
virtual CGroupMember* AsMemberClient() { return nullptr; }
virtual void RemovedFromGroup(uint32_t id) = 0;
inline bool IsOffline() const { return bIsOffline; }
inline eqtime_t GetOnlineTimestamp() const { return OnlineTimestamp; }
inline bool GetRole(eGroupRoles role) const { return bRoleStates[role]; }
inline const char* GetName() const { return Name.c_str(); }
inline const char* GetOwnerName() const { return OwnerName.c_str(); }
inline int GetLevel() const { return Level; }
inline bool IsMainTank() const { return GetRole(GroupRoleTank); }
inline bool IsMainAssist() const { return GetRole(GroupRoleAssist); }
inline bool IsPuller() const { return GetRole(GroupRolePuller); }
inline bool IsMarkNPC() const { return GetRole(GroupRoleMarkNPC); }
inline bool IsMasterLooter() const { return GetRole(GroupRoleMasterLooter); }
// Compat wrappers for old member types/names
__declspec(property(get = getPName)) CXStr* pName;
DEPRECATE("CGroupMemberBase: Use Name instead of pName")
inline CXStr* getPName() { return &Name; }
__declspec(property(get = getPOwner)) CXStr* pOwner;
DEPRECATE("CGroupMemberBase: Use OwnerName instead of pOwner")
inline CXStr* getPOwner() { return &OwnerName; }
// Compat wrapper for Mercenary
__declspec(property(get = getMercenary)) uint8_t Mercenary;
DEPRECATE("CGroupMemberBase: Use Type instead of Mercenary")
inline uint8_t getMercenary() { return (uint8_t)Type; }
ALT_MEMBER_GETTER(bool, bIsOffline, Offline);
ALT_MEMBER_GETTER(uint32_t, CurrentRoleBits, Roles);
__declspec(property(get = IsMainTank)) bool MainTank;
__declspec(property(get = IsMainAssist)) bool MainAssist;
__declspec(property(get = IsPuller)) bool Puller;
__declspec(property(get = IsMarkNPC)) bool MarkNpc;
__declspec(property(get = IsMasterLooter)) bool MasterLooter;
private:
void ClearRoles();
};
class [[offsetcomments]] CGroupMember : public CGroupMemberBase
{
public:
/*0x40*/ CharacterZoneClient* pCharacter;
/*0x48*/ PlayerClient* pPlayer;
/*0x50*/ int GroupIndex;
/*0x54*/
CGroupMember();
virtual ~CGroupMember();
virtual CharacterZoneClient* GetCharacter() override { return pCharacter; }
virtual CGroupMember* AsMemberClient() override { return this; }
PlayerClient* GetPlayer() { return pPlayer; }
ALT_MEMBER_GETTER(PlayerClient*, pPlayer, pSpawn);
};
inline namespace deprecated {
using GROUPMEMBER DEPRECATE("Use CGroupMember instead of GROUPMEMBER") = CGroupMember;
using PGROUPMEMBER DEPRECATE("Use CGroupMember* instead of PGROUPMEMBER") = CGroupMember*;
}
//============================================================================
// CGroupClient
//============================================================================
// This class holds information about the members of the group. Technically it
// stores CGroupMemberBase, but since this is the client, these will always be
// instances of CGroupMember, so we'll just skip the type casts and use
// the type instead.
class [[offsetcomments]] CGroupBase
{
public:
CGroupBase();
virtual ~CGroupBase();
// other virtuals not mapped out
CGroupMember* GetGroupLeader() const { return m_groupLeader; }
EQLIB_OBJECT CGroupMember* GetGroupMember(int index) const;
inline uint32_t GetID() const { return m_id; }
// iterator support for stl containers and algorithms
inline auto begin() { return std::begin(m_groupMembers); }
inline auto begin() const { return std::cbegin(m_groupMembers); }
inline auto cbegin() const { return std::cbegin(m_groupMembers); }
inline auto end() { return std::end(m_groupMembers); }
inline auto end() const { return std::cend(m_groupMembers); }
inline auto cend() { return std::cend(m_groupMembers); }
ALT_MEMBER_GETTER_ARRAY_DEPRECATED(CGroupMember*, MAX_GROUP_SIZE, m_groupMembers, pMember,
"CGroupBase: Use Group->GetGroupMember instead of accessing pMembers");
ALT_MEMBER_GETTER(CGroupMember*, m_groupLeader, pLeader);
protected:
/*0x08*/ CGroupMember* m_groupMembers[MAX_GROUP_SIZE];
/*0x38*/ CGroupMember* m_groupLeader;
/*0x40*/ uint32_t m_id;
/*0x44*/
};
class [[offsetcomments]] CGroup : public CGroupBase
{
public:
using CGroupBase::GetGroupMember;
// Get the mercenary member for the given owner name.
EQLIB_OBJECT CGroupMember* GetMercenary(std::string_view ownerName) const;
// Get the group member for the given name or index
EQLIB_OBJECT CGroupMember* GetGroupMember(std::string_view name) const;
// Retrieve a group member by some criteria
EQLIB_OBJECT CGroupMember* GetGroupMember(PlayerClient* pPlayer) const;
EQLIB_OBJECT CGroupMember* GetGroupMemberByRole(eGroupRoles role) const;
// Retrieve a group member by its position (skipping holes)
EQLIB_OBJECT CGroupMember* GetNthGroupMember(int position) const;
// Get the number of group members
EQLIB_OBJECT uint32_t GetNumberOfMembers(bool includeOffline = true) const;
EQLIB_OBJECT uint32_t GetNumberOfPlayerMembers(bool includeOffline = true) const;
EQLIB_OBJECT uint32_t GetNumberOfMembersExcludingSelf(bool includeOffline = true) const;
// What is the index of this group member? Returns -1 if not found. Returns ARRAY INDEX. (counts blank slots)
EQLIB_OBJECT int GetGroupMemberIndex(CGroupMember* pMember) const;
// Returns the VISUAL INDEX of the group member. That is, what position they are in the list, ignoring blank slots.
EQLIB_OBJECT int GetGroupMemberVisualIndex(CGroupMember* pMember) const;
EQLIB_OBJECT bool IsGroupMember(PlayerClient* pPlayer) const;
EQLIB_OBJECT bool IsGroupLeader(PlayerClient* pPlayer) const;
private:
/*0x48*/ int GroupSelectID;
/*0x4c*/
};
inline namespace deprecated {
using GROUPINFO DEPRECATE("Use CGroup instead of GROUPINFO") = CGroup;
using PGROUPINFO DEPRECATE("Use CGroup* instead of PGROUPINFO") = CGroup*;
}
using CGroupClient = CGroup;
//============================================================================
//============================================================================
// size 0x4c 12-25-09 - ieatacid
struct [[offsetcomments]] ExtendedTargetSlot
{
/*0x00*/ DWORD xTargetType;
/*0x04*/ eXTSlotStatus XTargetSlotStatus;
/*0x08*/ uint32_t SpawnID;
/*0x0c*/ char Name[EQ_MAX_NAME];
/*0x4c*/
};
inline namespace deprecated {
using XTARGETSLOT DEPRECATE("Use ExtendedTargetSlot instead of PXTARGETSLOT") = ExtendedTargetSlot;
using PXTARGETSLOT DEPRECATE("Use ExtendedTargetSlot* instead of XTARGETSLOT") = ExtendedTargetSlot*;
}
DEPRECATE("The number of extended targets is not hard coded. Use GetNumSlots() to get the right value.")
constexpr int MAX_EXTENDED_TARGETS = 23;
class [[offsetcomments]] ExtendedTargetList
{
public:
using TargetSlotArray = ArrayClass<ExtendedTargetSlot>;
int GetNumSlots() const { return m_targetSlots.GetLength(); }
// will return null if slot is out of bounds. If not performing a bounds check,
// its probably a good idea to do a null check on the response.
EQLIB_OBJECT ExtendedTargetSlot* GetSlot(int slot);
bool GetAutoAddHaters() const { return m_autoAddHaters; }
virtual void SetAutoAddHaters(bool autoAdd) { m_autoAddHaters = autoAdd; }
auto begin() { return m_targetSlots.begin(); }
auto cbegin() const { return m_targetSlots.cbegin(); }
auto end() { return m_targetSlots.end(); }
auto cend() const { return m_targetSlots.cend(); }
EQLIB_OBJECT const char* ExtendedTargetRoleName(uint32_t xTargetType);
private:
/*0x08*/ TargetSlotArray m_targetSlots;
/*0x20*/ bool m_autoAddHaters;
/*0x24*/ int CurrentSlot;
/*0x28*/ int ContextSlot;
/*0x2c*/
public:
ALT_MEMBER_GETTER(TargetSlotArray, m_targetSlots, XTargetSlots);
ALT_MEMBER_GETTER(bool, m_autoAddHaters, bAutoAddHaters);
};
EQLIB_API DEPRECATE("GetXtargetType() is deprecated. Use pLocalPC->pExtendedTargetList->ExtendedTargetRoleName() instead")
const char* GetXtargetType(DWORD type);
struct [[offsetcomments]] MailItemData
{
/*0x00*/ UINT SendTime;
/*0x08*/ CXStr SenderName;
/*0x10*/ CXStr Note;
/*0x18*/
};
struct [[offsetcomments]] PCAdventureThemeStats
{
/*0x00*/ int SucceededNormal;
/*0x04*/ int FailedNormal;
/*0x08*/ int SucceededHard;
/*0x0c*/ int FailedHard;
/*0x10*/ int AdventureTotalPointsEarned;
/*0x14*/
};
struct [[offsetcomments]] PCAdventureData
{
/*0x00*/ int AdventureLastAdventureDefinitionSeen[5];
/*0x18*/ eqtime_t AdventureLastAdventureDefinitionSeenTime[5];
/*0x40*/ int AdventureActiveAdventureId;
/*0x44*/ int AdventureActiveAdventureTheme;
/*0x48*/ int AdventureActiveAdventureRisk;
/*0x4c*/ int AdventureSafeReturnZoneId;
/*0x50*/ float AdventureSafeReturnX;
/*0x54*/ float AdventureSafeReturnY;
/*0x58*/ float AdventureSafeReturnZ;
/*0x5c*/ int AdventureStatAccepted;
/*0x60*/ int AdventureStatRejected;
/*0x64*/ int AdventureStatEntered;
/*0x68*/ int AdventureStatFailedEnter;
/*0x6c*/ int AdventurePointsAvailable;
/*0x70*/ int AdventurePointsAvailableMax;
/*0x78*/ eqtime_t AdventureLastSuccessTime;
/*0x80*/ PCAdventureThemeStats ThemeStats[6];
/*0xf8*/
};
struct [[offsetcomments]] PCTaskStatus
{
/*0x00*/ int TaskID;
/*0x04*/ int MovingStartTime;
/*0x08*/ int InitialStartTime;
/*0x0c*/ bool ElementActive[0x14];
/*0x20*/ int CurrentCounts[0x14];
/*0x70*/
};
struct [[offsetcomments]] MonsterMissionTemplate
{
/*0x00*/ int TemplateID;
/*0x04*/ int Min;
/*0x08*/ int Max;
/*0x0c*/ int NumSelected;
/*0x10*/ bool CanSelect;
/*0x11*/ char TemplateName[0x40];
/*0x54*/
};
struct [[offsetcomments]] PCSharedTaskData
{
/*0x00*/ int ActiveSharedTaskID;
/*0x04*/ bool bIsMonsterMission;
/*0x08*/ PCTaskStatus Status; // size 0x70
/*0x78*/ ArrayClass<MonsterMissionTemplate> Templates; // size is 0x10
/*0x90*/ float RewardAdjustment;
/*0x94*/
};
struct [[offsetcomments]] TaskTimerData
{
/*0x00*/ int GroupID;
/*0x04*/ int TimerSeconds;
/*0x08*/ UINT TimerExpiration;
/*0x0c*/ int TimerType;
/*0x10*/ int OrigTaskID;
/*0x18*/ TaskTimerData *pNext;
/*0x20*/
};
class [[offsetcomments]] PendingReward
{
FORCE_SYMBOLS;
public:
/*0x00*/ void* vfTable;
/*0x08*/ int ID;
/*0x0c*/ int SetID;
/*0x10*/ float RewardAdjustment;
/*0x14*/ char RewardTitle[0x80];
/*0x94*/
};
class [[offsetcomments]] PendingRewardList : public DoublyLinkedList<PendingReward*>
{
public:
/*0x38*/ int NextUID;
/*0x3c*/ int MaxPending;
/*0x40*/ int ZoneMaxPending;
/*0x44*/
};
struct [[offsetcomments]] Point
{
/*0x00*/ UINT PointType;
/*0x04*/ UINT PointSubtype;
/*0x08*/ UINT CurrentCount;
/*0x0c*/ UINT TotalEver;
/*0x10*/
};
struct [[offsetcomments]] PointNamesEntry
{
/*0x00*/ UINT PointTypeId;
/*0x04*/ UINT PointSubtypeId;
/*0x08*/ int DBStringId;
/*0x0c*/ int PointItemId;
/*0x10*/ int ImageId;
/*0x14*/ int MaxStackSize;
/*0x18*/ bool bStationCashRelated;
/*0x1c*/
};
class [[offsetcomments]] PointSystemBase
{
public:
/*0x00*/ void* vfTable;
/*0x08*/ ArrayClass<PointNamesEntry*> PointNameEntries;
/*0x20*/
};
class [[offsetcomments]] CPlayerPointManager
{
public:
EQLIB_OBJECT unsigned long GetAltCurrency(unsigned long, unsigned long b = 1);
/*0x00*/ void* vfTable;
/*0x08*/ ArrayClass<Point*> Points;
/*0x20*/
};
using PlayerPointManager = CPlayerPointManager;
struct [[offsetcomments]] ProgressionExperience
{
/*0x00*/ int ProgressionID;
/*0x08*/ double ProgressionExp;
/*0x10*/
};
struct [[offsetcomments]] PCCompletedQuest
{
/*0x00*/ int QuestID;
/*0x04*/ int ElementBitmask;
/*0x08*/ eqtime_t TimeCompleted;
/*0x10*/
};
struct [[offsetcomments]] PCQuestHistoryData
{
/*0x000*/ PCCompletedQuest Quests[50];
/*0x320*/
};
struct [[offsetcomments]] PvPKill
{
/*0x00*/ char VictimName[EQ_MAX_NAME];
/*0x40*/ int VictimLevel;
/*0x44*/ int Unknown0x44;
/*0x48*/ int Unknown0x48;
/*0x4c*/ int VictimRace;
/*0x50*/ int VictimClass;
/*0x54*/ int ZoneID;
/*0x58*/ int Lastkilltime;
/*0x5c*/ int PointsEarned;
/*0x60*/
};
struct [[offsetcomments]] PvPDeath
{
/*0x00*/ char KillerName[EQ_MAX_NAME];
/*0x40*/ int KillerLevel;
/*0x44*/ int KillerRace;
/*0x48*/ int KillerClass;
/*0x4c*/ int ZoneID;
/*0x50*/ int LastDeathTime;
/*0x54*/ int PointsLost;
/*0x58*/
};
struct PvPKill24HourData : public PvPKill
{
//nothing here?
};
struct [[offsetcomments]] TradeskillRecipeCount
{
FORCE_SYMBOLS;
/*0x00*/ int SkillID;
/*0x04*/ int RecipeCount;
/*0x08*/
};
class [[offsetcomments]] StatCounter
{
public:
/*0x00*/ uint64_t Value;
/*0x08*/
};
class [[offsetcomments]] StatElapsedTime
{
public:
/*0x00*/ eqtime_t StartTick;
/*0x08*/ uint32_t ElapsedTotal;
/*0x0c*/ bool bCurrentState;
/*0x10*/
};
class [[offsetcomments]] PCStatistics
{
public:
enum eStatisticType
{
S_TotalExpEarned,
S_GroupExpEarned,
S_ExpRaidEarned,
S_ExpSoloEarned,
S_NonExpKills,
S_ExpKills,
S_ZonesVisited,
S_ChatShouts,
S_ChatOOCs,
S_ChatSays,
S_ChatGroup,
S_ChatTells,
S_Deaths,
S_Resurrections,
S_PlatEarned,
S_TradeskillCombines,
S_Forages,
S_Quests,
S_LastStat,
};
/*0x000*/ StatElapsedTime StatTimeSession;
/*0x010*/ StatElapsedTime StatTimeLFG;
/*0x020*/ StatElapsedTime StatTimeGrouped;
/*0x030*/ StatElapsedTime StatTimeSolo;
/*0x040*/ StatElapsedTime StatTimeRaid;
/*0x050*/ StatElapsedTime StatTimeInBazaar;
/*0x060*/ StatCounter Statistics[S_LastStat];
/*0x0f0*/ eqtime_t LastUpdateTime;
/*0x0f8*/ char PlayerName[EQ_MAX_NAME];
/*0x138*/ char PlayerStationID[EQ_MAX_STATION_ID];
/*0x158*/ int PlayerLevel;
/*0x15c*/ int PlayerRace;
/*0x160*/ int PlayerClass;
/*0x164*/ uint32_t UniquePlayerID;
/*0x168*/
};
class [[offsetcomments]] GroupMemberStats
{
public:
enum eStatisticType
{
S_Mez,
S_Root,
S_Charmed,
S_Stunned,
S_Slowed,
S_FirstAgro,
S_DmgMelee,
S_DmgRanged,
S_DmgSpell,
S_DmgDot,
S_DmgPet,
S_DmgTaken,
S_DmgHealed,
S_ExpTotalEarned,
S_Deaths,
S_ExpKills,
S_NonExpKills,
S_ManaUsed,
S_EnduranceUsed,
S_LastStat,
};
/*0x000*/ char PlayerName[EQ_MAX_NAME];
/*0x040*/ int PlayerLevel;
/*0x044*/ int PlayerRace;
/*0x048*/ int PlayerClass;
/*0x04c*/ uint32_t UniquePlayerId;
/*0x050*/ uint32_t LastMemberUpdateTime;
/*0x058*/ CXStr StationID;
/*0x060*/ int64_t PlayerGuild;
/*0x068*/ int BuffIDs[NUM_LONG_BUFFS];
/*0x110*/ StatCounter Statistics[S_LastStat];
/*0x1a8*/
};
class [[offsetcomments]] MercenaryAbilityInfo
{
public:
/*0x00*/ int Index;
/*0x04*/ int Cost;
/*0x08*/
};
//============================================================================
// CHARINFO a.k.a. PcClient
//============================================================================
class PcClient;
using CHARINFO = PcClient;
using PCHARINFO = PcClient*;
// This type is DEPRECATED. Nothing should be using it. Use CHARINFO or PcClient
using CHARINFONEW DEPRECATE("Use PcClient instead of CHARINFONEW") = PcClient;
inline namespace deprecated
{
struct BANKARRAY
{
ItemClient* Bank[NUM_BANK_SLOTS];
};
struct SHAREDBANKARRAY
{
ItemClient* SharedBank[NUM_SHAREDBANK_SLOTS];
};
}
//============================================================================
// EQ_PC
//============================================================================
struct [[offsetcomments]] ItemContainingRealEstate
{
FORCE_SYMBOLS;
/*0x00*/ int RealEstateID;
/*0x04*/ ItemGlobalIndex ItemLocation;
/*0x10*/
};
//============================================================================
// CharacterBase
//============================================================================
enum GameFeatures
{
GameFeature_AA = 0,
GameFeature_Level = 1,
GameFeature_CharacterSlot = 2,
GameFeature_SpellRank = 3,
GameFeature_InventorySlots = 4,
GameFeature_Platinum = 5,
GameFeature_Mail = 6,
GameFeature_Parcel = 7,
GameFeature_Loyalty = 8,
GameFeature_Mercenary = 9,
GameFeature_Housing = 10,
GameFeature_SharedBank = 11,
GameFeature_Quests = 12,
GameFeature_CreateGuild = 13,
GameFeature_Bazaar = 14,
GameFeature_Barter = 15,
GameFeature_Chat = 16,
GameFeature_Petition = 17,
GameFeature_Advertising = 18,
GameFeature_UseItem = 19,
GameFeature_StartingCity = 20,
GameFeature_Ornament = 21,
GameFeature_HeroicCharacter = 22,
GameFeature_AutoGrantAA = 23,
GameFeature_MountKeyRingSlots = 24,
GameFeature_IllusionKeyRingSlots = 25,
GameFeature_FamiliarKeyRingSlots = 26,
GameFeature_FamiliarAutoLeave = 27,
GameFeature_HeroForgeKeyRingSlots = 28,
GameFeature_DragonHoardSlots = 29,
#if IS_EXPANSION_LEVEL(EXPANSION_LEVEL_TOL)
GameFeature_TeleportKeyRingSlots = 30,
#endif
GameFeature_Max,
GameFeature_Invalid = -1,
eSpellRankFeature DEPRECATE("Use GameFeature_SpellRank instead of eSpellRankFeature") = GameFeature_SpellRank,
};
class IFreeToPlayInfo
{
public:
virtual int GetGameFeature(GameFeatures feature) const = 0;
virtual int GetMembershipLevel() const = 0;
};
enum eCharacterStatus : uint8_t {
eCharStatusNormal = 0,
eCharStatusStunned,
eCharStatusFrozen,
eCharStatusUnconcious,
eCharStatusDead,
};
// .rdata:00000001408BA038 const PcClient::`vbtable'{for `CharacterZoneClient'} dd -8
// .rdata:00000001408BA038 ; DATA XREF: PcClient::PcClient(void)+2A↑o
// .rdata:00000001408BA03C dd 6C0h
// .text:00000001402FBF8A lea rax, const PcClient::`vbtable'{for `CharacterZoneClient'}
// .text:00000001402FBF91 mov [rcx+2818h], rax
// this is the offset of CharacterZoneClient + virtual base table:
// CharacterZoneClient starts at 0x2818 and we add 0x6C0 to give us 0x2ED8
class [[offsetcomments(0x2ed8)]] CharacterBase : public IFreeToPlayInfo
{
// +0: vftable
public:
/*0x2ee0*/ ProfileManager ProfileManager;
/*0x2ef0*/ uint8_t languages[MAX_LANGUAGES];
/*0x2f10*/ float X;
/*0x2f14*/ float Y;
/*0x2f18*/ float Z;
/*0x2f1c*/ float Heading;
/*0x2f20*/ char Name[EQ_MAX_NAME];
/*0x2f60*/ char Lastname[EQ_MAX_LASTNAME];
/*0x2f80*/ char Title[128];
/*0x3000*/ char VehicleName[64];
/*0x3040*/ eCharacterStatus Status;
/*0x3044*/ EQZoneIndex currentZoneId;
/*0x3048*/ uint8_t standstate;
/*0x304c*/ RaidData raidData;
/*0x3128*/ int ExpansionFlags;
/*0x312c*/ bool bSuperPKILL;
/*0x312d*/ bool bUnclone;
/*0x312e*/ bool bDead;
/*0x3130*/ int LD_Timer;
/*0x3134*/ int SpellInterruptCount;
/*0x3138*/ bool bAutoSplit;
/*0x3139*/ bool bTellsOff;
/*0x313a*/ bool bGmInvis;
/*0x313c*/ int KillMe;
/*0x3140*/ bool CheaterLdFlag; // likely this is int SoulMarkCount instead.
/*0x3141*/ bool NoRent;
/*0x3142*/ bool Corpse;
/*0x3143*/ bool ClientGmFlagSet;
/*0x3144*/ int BankSharedPlat;
/*0x3148*/ int BankPlat;
/*0x314c*/ int BankGold;
/*0x3150*/ int BankSilver;
/*0x3154*/ int BankCopper;
/*0x3158*/ int STR;
/*0x315c*/ int STA;
/*0x3160*/ int CHA;
/*0x3164*/ int DEX;
/*0x3168*/ int INT;
/*0x316c*/ int AGI;
/*0x3170*/ int WIS;
/*0x3174*/ int LCK;
/*0x3178*/ int SavePoison;
/*0x317c*/ int SaveMagic;
/*0x3180*/ int SaveDisease;
/*0x3184*/ int SaveCorruption;
/*0x3188*/ int SaveFire;
/*0x318c*/ int SaveCold;
/*0x3190*/ int SavePhysical;
/*0x3194*/ int UncappedStr;
/*0x3198*/ int UncappedSta;
/*0x319c*/ int UncappedCha;
/*0x31a0*/ int UncappedDex;
/*0x31a4*/ int UncappedInt;
/*0x31a8*/ int UncappedAgi;
/*0x31ac*/ int UncappedWis;
/*0x31b0*/ int UncappedResistPoison;
/*0x31b4*/ int UncappedResistMagic;
/*0x31b8*/ int UncappedResistDisease;
/*0x31bc*/ int UncappedResistCorruption;
/*0x31c0*/ int UncappedResistFire;
/*0x31c4*/ int UncappedResistCold;
/*0x31c8*/ int UncappedResistPhysical;
/*0x31cc*/ int NoBuffStr;
/*0x31d0*/ int NoBuffSta;
/*0x31d4*/ int NoBuffCha;
/*0x31d8*/ int NoBuffDex;
/*0x31dc*/ int NoBuffInt;
/*0x31e0*/ int NoBuffAgi;
/*0x31e4*/ int NoBuffWis;
/*0x31e8*/ int NoBuffResistPoison;
/*0x31ec*/ int NoBuffResistMagic;
/*0x31f0*/ int NoBuffResistDisease;
/*0x31f4*/ int NoBuffResistCorruption;
/*0x31f8*/ int NoBuffResistFire;
/*0x31fc*/ int NoBuffResistCold;
/*0x3200*/ int NoBuffResistPhysical;
/*0x3204*/
virtual void Copy(const CharacterBase& other) {}
virtual ~CharacterBase() {}
ALT_MEMBER_GETTER(int8_t, Status, Stunned);
uint16_t get_instance() const { return currentZoneId >> 16; }
__declspec(property(get = get_instance)) uint16_t instance;
uint16_t get_zoneId() const { return currentZoneId & 0x7fff; }
__declspec(property(get = get_zoneId)) uint16_t zoneId;
// Verified
EQLIB_OBJECT int IsExpansionFlag(int);
EQLIB_OBJECT int GetMemorizedSpell(int index) { return GetCurrentBaseProfile().GetMemorizedSpell(index); }
// Items
EQLIB_OBJECT ItemPtr GetItemByGlobalIndex(const ItemGlobalIndex& GlobalIndex) const;
EQLIB_OBJECT ItemPtr GetItemByGlobalIndex(const ItemGlobalIndex& GlobalIndex, ItemContainer::CheckDepthOptions Option) const;
//EQLIB_OBJECT bool IsValidGlobalIndex(const ItemGlobalIndex& globalIndex) const;
//EQLIB_OBJECT /*virtual*/ ItemContainer* GetItemContainerByGlobalIndex(const ItemGlobalIndex& index) const;
inline ItemIndex CreateItemIndex(int slot0, int slot1 = -1, int slot2 = -1) const { return GetCurrentBaseProfile().CreateItemIndex(slot0, slot1, slot2); }
inline ItemGlobalIndex CreateItemGlobalIndex(int slot0, int slot1 = -1, int slot2 = -1) const { return GetCurrentBaseProfile().CreateItemGlobalIndex(slot0, slot1, slot2); }
inline ItemPtr GetItemPossession(const ItemIndex& lIndex) { return GetCurrentBaseProfile().GetItemPossession(lIndex); }
inline ItemContainer& GetItemPossessions() { return GetCurrentBaseProfile().GetItemPosessions(); }
inline ItemPtr GetInventorySlot(int lIndex) { return GetCurrentBaseProfile().GetInventorySlot(lIndex); }
inline BaseProfile& GetCurrentBaseProfile() { return *ProfileManager.GetCurrentProfile(); }
inline const BaseProfile& GetCurrentBaseProfile() const { return *ProfileManager.GetCurrentProfile(); }
// Fix Typo
inline ItemContainer& GetItemPosessions() { return GetItemPossessions(); }
// Accessors
int GetRace() const { return GetCurrentBaseProfile().GetRace(); }
int GetClass() const { return GetCurrentBaseProfile().GetClass(); }
int GetStrength() const { return STR; }
int GetStamina() const { return STA; }
int GetCharisma() const { return CHA; }
int GetDexterity() const { return DEX; }
int GetIntelligence() const { return INT; }
int GetAgility() const { return AGI; }
int GetWisdom() const { return WIS; }
int GetLuck() const { return LCK; }
EQ_Affect& GetEffect(int nBuffSlot) { return GetCurrentBaseProfile().GetEffect(nBuffSlot); }
EQ_Affect& GetTempEffect(int nBuffSlot) { return GetCurrentBaseProfile().GetTempEffect(nBuffSlot); }
int GetEffectSlot(EQ_Affect* effect)
{
for (int nBuffSlot = 0; nBuffSlot < MAX_TOTAL_BUFFS; ++nBuffSlot)
{
if (effect == &GetEffect(nBuffSlot))
return nBuffSlot;
}
return -1;
}
// Unverified
EQLIB_OBJECT BYTE GetLanguageSkill(int) const;
};
// The starting offset is the size of PcBase
class [[offsetcomments(0x2810)]] CharacterZoneClient : virtual public CharacterBase
{
virtual void vftableph() {};
// +0x00: const PcClient::`vftable'{for `CharacterZoneClient'}
// +0x08: const PcClient::`vbtable'{for `CharacterZoneClient'}
public:
/*0x2820*/ PlayerClient* me;
/*0x2828*/ bool statDirtyFlag;
/*0x2829*/ bool zoningStatProcessing;
/*0x282c*/ int ArmorClassBonus;
/*0x2830*/ int CurrWeight;
/*0x2834*/ int LastHitPointSendPercent;
/*0x2838*/ int LastManaPointSendPercent;
/*0x283c*/ int LastEndurancePointSendPercent;
/*0x2840*/ int HPBonus;
/*0x2844*/ int ManaBonus;
/*0x2848*/ int EnduranceBonus;
/*0x284c*/ int EnduranceCostPerSecond;
/*0x2850*/ int CombatEffectsBonus;
/*0x2854*/ int ShieldingBonus;
/*0x2858*/ int SpellShieldBonus;
/*0x285c*/ int AvoidanceBonus;
/*0x2860*/ int AccuracyBonus;
/*0x2864*/ int StunResistBonus;
/*0x2868*/ int StrikeThroughBonus;
/*0x286c*/ int DoTShieldBonus;
/*0x2870*/ int DamageShieldMitigationBonus;
/*0x2874*/ int DamageShieldBonus;
/*0x2878*/ int ItemSkillMinDamageMod[NUM_ITEM_SKILL_DMG_MOD];
/*0x289c*/ int SkillMinDamageModBonus[NUM_ITEM_SKILL_DMG_MOD];
/*0x28c0*/ int HeroicSTRBonus;
/*0x28c4*/ int HeroicINTBonus;
/*0x28c8*/ int HeroicWISBonus;
/*0x28cc*/ int HeroicAGIBonus;
/*0x28d0*/ int HeroicDEXBonus;
/*0x28d4*/ int HeroicSTABonus;
/*0x28d8*/ int HeroicCHABonus;
/*0x28dc*/ int HealAmountBonus;
/*0x28e0*/ int SpellDamageBonus;
/*0x28e4*/ int ItemHealAmountDotMod;
/*0x28e8*/ int ItemSpellDamageDotMod;
/*0x28ec*/ int ClairvoyanceBonus;
/*0x28f0*/ int AttackBonus;
/*0x28f4*/ int HPRegenBonus;
/*0x28f8*/ int ManaRegenBonus;
/*0x28fc*/ int EnduranceRegenBonus;
/*0x2900*/ int AttackSpeed;
/*0x2904*/ int NoBuffItemHitpointAdjustment;
/*0x2908*/ int NoBuffItemManaAdjustment;
/*0x290c*/ int NoBuffItemEnduranceAdjustment;
/*0x2910*/ int NoBuffItemBaseChanceProc;
/*0x2914*/ int NoBuffItemMinDamageMod;
/*0x2918*/ int NoBuffItemInnateSpellRune;
/*0x291c*/ int NoBuffItemAvoidance;
/*0x2920*/ int NoBuffItemToHit;
/*0x2924*/ int NoBuffItemResistStunChance;
/*0x2928*/ int NoBuffItemDotShieldingEffect;
/*0x292c*/ int NoBuffItemStrikeThroughChance;
/*0x2930*/ int NoBuffItemAttack;
/*0x2934*/ int NoBuffItemHitPointRegen;
/*0x2938*/ int NoBuffItemManaRegen;
/*0x293c*/ int NoBuffItemEnduranceRegen;
/*0x2940*/ int NoBuffItemDamageShield;
/*0x2944*/ int NoBuffItemDamageShieldMitigation;
/*0x2948*/ int NoBuffItemHaste;
/*0x294c*/ int NoBuffItemSkillMinDamageMod[NUM_ITEM_SKILL_DMG_MOD];
/*0x2970*/ bool bOutputHpRegen;
/*0x2971*/ bool bInvulnerable;
/*0x2972*/ bool bOnAVehicle;
/*0x2978*/ SpellCache spellCache;
/*0x2a08*/ HashListSet<int, 128> DoomEffectsBySlot;
/*0x2e28*/ uint32_t LastHitEval;
/*0x2e2c*/
//EQLIB_OBJECT CharacterZoneClient();
ALT_MEMBER_GETTER(PlayerClient*, me, pSpawn);
// Verified
EQLIB_OBJECT /* virtual */ int CalculateInvisLevel(InvisibleTypes Type, bool bIncludeSoS = true);
EQLIB_OBJECT bool CanUseItem(const ItemPtr& pItem, bool bUseRequiredLvl, bool bOutput = true);
EQLIB_OBJECT unsigned char CastSpell(unsigned char gemid, int spellid, const ItemPtr& pItem, const ItemGlobalIndex& itemLoc, ItemSpellTypes slot, unsigned char spell_loc, int arg7, int arg8, int arg9, bool arg10);
EQLIB_OBJECT int Cur_HP(int Spawntype/*PC = 0 NPC=1 and so on*/, bool bCapAtMax = true);
EQLIB_OBJECT int Cur_Mana(bool bCapAtMax = true);
EQLIB_OBJECT int GetAdjustedSkill(int);
EQLIB_OBJECT int GetCurrentMod(int index); // CalculateHeroicModAmount
/* virtual */ EQLIB_OBJECT int GetBaseSkill(int);
EQLIB_OBJECT int GetEnduranceRegen(bool bIncItemsAndBuffs = true, bool bCombat = true);
EQLIB_OBJECT int GetCastingTimeModifier(const EQ_Spell* pSpell); // used to get aa modifiers