forked from RedGuides/MQ2DPSAdv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMQ2DPSAdv.h
More file actions
176 lines (161 loc) · 5.12 KB
/
MQ2DPSAdv.h
File metadata and controls
176 lines (161 loc) · 5.12 KB
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
// DPS ADV CREATED BY WARNEN 2008-2009
// MQ2DPSAdv.h
#pragma once
#include <mq/base/Color.h>
char* OtherHits[] = { " punches "," slashes "," crushes "," pierces "," hits "," kicks "," backstabs "," frenzies on "," bashes ", " strikes "," claws "," slices "," bites "," mauls "," stings ", " shoots ", " smashes ", " rends ", " gores ", " stabs ", "" };
char* YourHits[] = { " hit "," slash "," pierce "," crush "," kick "," punch "," backstab "," frenzy on "," bash ", " strike "," claw "," slice "," bite "," maul "," sting ", " shoot ", " smash ", " rend ", " gore ", ""};
enum { CLISTTARGET, CLISTMAXDMG, SINGLE };
enum { NOTOTAL, TOTALABOVE, TOTALSECOND, TOTALBOTTOM };
PSPAWNINFO CurTarget;
time_t Intervals;
int CListType;
int MaxDmgLast;
mq::MQColor MeColor;
mq::MQColor MeTopColor;
mq::MQColor NormalColor;
mq::MQColor NPCColor;
mq::MQColor TotalColor;
mq::MQColor EntHover;
mq::MQColor EntHighlight;
mq::MQColor FightNormal;
mq::MQColor FightHover;
mq::MQColor FightHighlight;
mq::MQColor FightActive;
mq::MQColor FightInActive;
mq::MQColor FightDead;
bool Saved;
bool WarnedYHO, WarnedOHO;
bool Debug;
bool MyDebug;
bool Active;
bool Zoning;
bool WrongUI;
bool ShowMeTop;
bool ShowMeMin;
int ShowMeMinNum;
bool UseRaidColors;//Use colors from set raid colors for each class display.
bool LiveUpdate;//Update Total/DPS/Time/% as it happens instead of a set pulse.
int ShowTotal;
int FightIA;//Fight Inactive.
int FightTO;//Fight Timeout.
int EntTO;//Entity Timeout.
bool UseTBMKOutputs = false;//Intended to show 1.4t, 1.5m, 343k etc outputs for total and DPS.
int HistoryLimit = 25; // Maximum number of mobs to store before deleting the closest to the beginning
//----------------------------------------------------------------------------
// new below here for current character DPS totals, this does NOT show up in the DPS Window.
char MyName[64];
uint64_t MyTotal;
uint64_t MyPetTotal;
float MyDPSValue;
float MyPetDPS;
float TotalDPSValue;
bool MyActive; // This is to turn on and off the DPS accumlator for just yourself.
time_t MyFirst;
time_t MyLast;
uint64_t MyTime;
//----------------------------------------------------------------------------
struct EntDamage {
uint64_t Total;
time_t First;
time_t Last;
int AddTime;
};
void CreateDPSWindow();
void DestroyDPSWindow();
template <unsigned int _EntSize, unsigned int _MobSize>bool SplitStringOtherHitOther(PCHAR Line, CHAR(&EntName)[_EntSize], CHAR(&MobName)[_MobSize], int* Damage);
template <unsigned int _EntSize, unsigned int _MobSize>bool SplitStringDOT(PCHAR Line, CHAR(&EntName)[_EntSize], CHAR(&MobName)[_MobSize], int* Damage);
template <unsigned int _EntSize, unsigned int _MobSize>bool SplitStringNonMelee(PCHAR Line, CHAR(&EntName)[_EntSize], CHAR(&MobName)[_MobSize], int* Damage);
void HandleYouHitOther(const char* Line);
void HandleOtherHitOther(const char* Line);
void HandleNonMelee(const char* Line);
void HandleDOT(const char* Line);
void HandleDeath(const char* Line);
void TargetSwitch();
void CheckActive();
void DPSAdvCmd(PSPAWNINFO pChar, PCHAR szLine);
void MakeItTBMK(char* szLine);
void DisplayHelp(const char* hTemp);
class DPSMob {
public:
class DPSEntry {
public:
char Name[64];
bool DoSort;
bool Pets;
bool CheckPetName;
bool UsingPetName;
int SpawnType;
int Class;
bool Mercenary;
EntDamage Damage;
DPSMob* Parent;
PSPAWNINFO Spawn;
DPSEntry* Master;
DPSEntry();
DPSEntry(char EntName[], DPSMob* pParent, bool PCOnly = false);
void Init();
void AddDamage(int Damage1);
uint64_t GetDPS();
uint64_t GetSDPS();
void Sort();
void GetSpawn(bool PCOnly = false);
bool CheckMaster();
};
char Name[64];
char Tag[8];
int SpawnType;
PSPAWNINFO Spawn;
bool Active;
bool InActive;
bool Dead;
bool PetName;
bool Mercenary;
EntDamage Damage;
DPSEntry* LastEntry;
std::vector<DPSEntry*> EntList;
DPSMob();
DPSMob(const char* MobName, size_t MobLen);
void Init();
void AddDamage(int Damage1);
void GetSpawn();
bool IsPet();
DPSEntry* GetEntry(char EntName[], bool Create = true, bool PCOnly = false);
};
std::vector<DPSMob*> MobList;
DPSMob* LastMob;
DPSMob* CurTarMob;
DPSMob* CurListMob;
DPSMob* CurMaxMob;
template <unsigned int _NameSize>DPSMob* GetMob(CHAR(&Name)[_NameSize], bool Create = true, bool Alive = false);
bool MobListMaint(DPSMob* Mob, int ListLoc);
void HandleDeath(DPSMob* DeadMob);
void ListSwitch(DPSMob* Switcher);
class CDPSAdvWnd : public CCustomWnd {
public:
CTabWnd* Tabs;
CListWnd* LTopList;
CComboWnd* CMobList;
CCheckBoxWnd* CShowMeTop;
CCheckBoxWnd* CShowMeMin;
CEditWnd* TShowMeMin;
CCheckBoxWnd* CUseRaidColors;
CCheckBoxWnd* CLiveUpdate;
CCheckBoxWnd* CUseTBMKOutput;
CEditWnd* TFightIA;
CEditWnd* TFightTO;
CEditWnd* TEntTO;
CEditWnd* THistoryLimit;
CComboWnd* CShowTotal;
CDPSAdvWnd();
~CDPSAdvWnd();
void DrawList(bool DoDead = false);
void SetTotal(int LineNum, DPSMob* Mob);
void DrawCombo();
void LoadLoc(char szChar[] = 0);
void LoadSettings();
void SaveLoc();
void SetLineColors(int LineNum, DPSMob::DPSEntry* Ent, bool Total = false, bool MeTop = false);
int WndNotification(CXWnd* pWnd, unsigned int Message, void* unknown);
void SaveSetting(PCHAR Key, PCHAR Value, ...);
};
CDPSAdvWnd* DPSWnd = nullptr;