Raidcore Nexus
 
Loading...
Searching...
No Matches
ArcDPS.h
1#ifndef ARCDPS_H
2#define ARCDPS_H
3
4#include <stdint.h>
5#include <windows.h>
6
7#ifdef __cplusplus
8namespace ArcDPS
9{
10#endif
11 /* arcdps export table */
12 typedef struct Exports
13 {
14 uintptr_t Size; /* sizeof(arcdps_exports) */
15 uint32_t Signature; /* pick a number between 0 and uint32 max that is not used by any other some_module */
16 uint32_t ImGuiVersion; /* IMGUI_VERSION_NUM */
17 const char* Name; /* "your module name", name string shown in options */
18 const char* Build; /* "1.2.40", version string */
19
20 void* WndProc; // UINT fn(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
21 // return value is assigned to real uMsg.
22 // unfiltered window event messages.
23
24 void* CombatSquadCallback; // void fn(cbtevent* ev, ag* src, ag* dst, const char* skillname, uint64_t id, uint64_t revision)
25 // called asynchronously.
26 // ev parameter is cbtevent as in evtc documentation.
27 // ev may be null. if so, if src->elite == 1, then src->id is the id of the new targeted agent.
28 // else, if src->prof, src->id was added
29 // src->name = char name
30 // dst->name = acc names
31 // src->id = id
32 // dst->id = instance id on map
33 // dst->prof = prof
34 // dst->elite = elite spec
35 // dst->self = is self
36 // src->team = team id
37 // dst->team = subgroup
38 // else, src->id was removed
39 // use id parameter to re-establish order of events (if id == 0, consider the event unordered).
40 // due to unforseen circumstances after a change in assigning id, the first event will always have id == 2.
41 // refer to ag typedef for src and dst parameters.
42 // revision is cbtevent type revision, will most likely be 1.
43
44 void* ImGuiRenderCallback; // void fn(uint32_t not_charsel_or_loading, uint32_t hide_if_combat_or_ooc)
45 // called before ImGui::Render.
46 // not_charsel_or_loading and hide_if_combat_or_ooc may be used to match arcdps window visibility.
47
48 void* ImGuiOptions; // void fn()
49 // called when drawing module's options tab.
50
51 void* CombatLocalCallback; // void fn(cbtevent* ev, ag* src, ag* dst, char* skillname, uint64_t id, uint64_t revision)
52 // same as combat, but for chatbox events.
53
54 void* WndProcFiltered; // UINT fn(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
55 // return value is assigned to real uMsg.
56 // modifiers-filtered window event messages.
57
58 void* ImGuiWindows; // void fn(char* windowname)
59 // called during options window list, before the checkbox of 'window' is drawn.
60 } PluginInfo;
61
62 /* combat event - see evtc docs for details, revision param in combat cb is equivalent of revision byte header */
64 {
65 uint64_t Time;
66 uint64_t SourceAgent;
67 uint64_t DestinationAgent;
68 int32_t Value;
69 int32_t BuffDamage;
70 uint32_t OverstackValue;
71 uint32_t SkillID;
72 uint16_t SourceInstanceID;
73 uint16_t DestinationInstanceID;
74 uint16_t SrcMasterInstanceID;
75 uint16_t DestinationMasterInstanceID;
76 uint8_t IFF;
77 uint8_t Buff;
78 uint8_t Result;
79 uint8_t IsActivation;
80 uint8_t IsBuffRemove;
81 uint8_t IsNinety;
82 uint8_t IsFifty;
83 uint8_t IsMoving;
84 uint8_t IsStatechange;
85 uint8_t IsFlanking;
86 uint8_t IsShields;
87 uint8_t IsOffcycle;
88 uint8_t PAD61;
89 uint8_t PAD62;
90 uint8_t PAD63;
91 uint8_t PAD64;
92 };
93
94 /* agent short */
96 {
97 char* Name; /* agent name. may be null. valid only at time of event. utf8 */
98 uintptr_t ID; /* agent unique identifier */
99 uint32_t Profession; /* profession at time of event. refer to evtc notes for identification */
100 uint32_t Specialization; /* elite spec at time of event. refer to evtc notes for identification */
101 uint32_t IsSelf; /* 1 if self, 0 if not */
102 uint16_t Team; /* sep21+ */
103 };
104
105 enum ECombatStateChange
106 {
107 CBTS_NONE, // not used - not this kind of event
108 // not used - not this kind of event
109
110 CBTS_ENTERCOMBAT, // agent entered combat
111 // src_agent: relates to agent
112 // dst_agent: subgroup
113 // value: prof id
114 // buff_dmg: elite spec id
115 // evtc: limited to squad outside instances
116 // realtime: limited to squad
117
118 CBTS_EXITCOMBAT, // agent left combat
119 // src_agent: relates to agent
120 // evtc: limited to squad outside instances
121 // realtime: limited to squad
122
123 CBTS_CHANGEUP, // agent is alive at time of event
124 // src_agent: relates to agent
125 // evtc: limited to agent table outside instances
126 // realtime: limited to squad
127
128 CBTS_CHANGEDEAD, // agent is dead at time of event
129 // src_agent: relates to agent
130 // evtc: limited to agent table outside instances
131 // realtime: limited to squad
132
133 CBTS_CHANGEDOWN, // agent is down at time of event
134 // src_agent: relates to agent
135 // evtc: limited to agent table outside instances
136 // realtime: limited to squad
137
138 CBTS_SPAWN, // agent entered tracking
139 // src_agent: relates to agent
140 // evtc: limited to agent table outside instances
141 // realtime: no
142
143 CBTS_DESPAWN, // agent left tracking
144 // src_agent: relates to agent
145 // evtc: limited to agent table outside instances
146 // realtime: no
147
148 CBTS_HEALTHPCTUPDATE, // agent health percentage changed
149 // src_agent: relates to agent
150 // dst_agent: percent * 10000 eg. 99.5% will be 9950
151 // evtc: limited to agent table outside instances
152 // realtime: no
153
154 CBTS_SQCOMBATSTART, // squad combat start, first player enter combat. previously named log start
155 // value: as uint32_t, server unix timestamp
156 // buff_dmg: local unix timestamp
157 // evtc: yes
158 // realtime: yes
159
160 CBTS_LOGEND, // squad combat stop, last player left combat. previously named log end
161 // value: as uint32_t, server unix timestamp
162 // buff_dmg: local unix timestamp
163 // evtc: yes
164 // realtime: yes
165
166 CBTS_WEAPSWAP, // agent weapon set changed
167 // src_agent: relates to agent
168 // dst_agent: new weapon set id
169 // value: old weapon seet id
170 // evtc: yes
171 // realtime: yes
172
173 CBTS_MAXHEALTHUPDATE, // agent maximum health changed
174 // src_agent: relates to agent
175 // dst_agent: new max health
176 // evtc: limited to non-players
177 // realtime: no
178
179 CBTS_POINTOFVIEW, // "recording" player
180 // src_agent: relates to agent
181 // evtc: yes
182 // realtime: no
183
184 CBTS_LANGUAGE, // text language id
185 // src_agent: text language id
186 // evtc: yes
187 // realtime: no
188
189 CBTS_GWBUILD, // game build
190 // src_agent: game build number
191 // evtc: yes
192 // realtime: no
193
194 CBTS_SHARDID, // server shard id
195 // src_agent: shard id
196 // evtc: yes
197 // realtime: no
198
199 CBTS_REWARD, // wiggly box reward
200 // dst_agent: reward id
201 // value: reward type
202 // evtc: yes
203 // realtime: yes
204
205 CBTS_BUFFINITIAL, // buff application for buffs already existing at time of event
206 // refer to cbtevent struct, identical to buff application. statechange is set to this
207 // evtc: limited to squad outside instances
208 // realtime: limited to squad
209
210 CBTS_POSITION, // agent position changed
211 // src_agent: relates to agent
212 // dst_agent: (float*)&dst_agent is float[3], x/y/z
213 // evtc: limited to agent table outside instances
214 // realtime: no
215
216 CBTS_VELOCITY, // agent velocity changed
217 // src_agent: relates to agent
218 // dst_agent: (float*)&dst_agent is float[3], x/y/z
219 // evtc: limited to agent table outside instances
220 // realtime: no
221
222 CBTS_FACING, // agent facing direction changed
223 // src_agent: relates to agent
224 // dst_agent: (float*)&dst_agent is float[2], x/y
225 // evtc: limited to agent table outside instances
226 // realtime: no
227
228 CBTS_TEAMCHANGE, // agent team id changed
229 // src_agent: relates to agent
230 // dst_agent: new team id
231 // value: old team id
232 // evtc: limited to agent table outside instances
233 // realtime: limited to squad
234
235 CBTS_ATTACKTARGET, // attacktarget to gadget association
236 // src_agent: relates to agent, the attacktarget
237 // dst_agent: the gadget
238 // evtc: limited to agent table outside instances
239 // realtime: no
240
241 CBTS_TARGETABLE, // agent targetable state
242 // src_agent: relates to agent
243 // dst_agent: new targetable state
244 // evtc: limited to agent table outside instances
245 // realtime: no
246
247 CBTS_MAPID, // map id
248 // src_agent: map id
249 // evtc: yes
250 // realtime: no
251
252 CBTS_REPLINFO, // internal use
253 // internal use
254
255 CBTS_STACKACTIVE, // buff instance is now active
256 // src_agent: relates to agent
257 // dst_agent: buff instance id
258 // value: current buff duration
259 // evtc: limited to squad outside instances
260 // realtime: limited to squad
261
262 CBTS_STACKRESET, // buff instance duration changed, value is the duration to reset to (also marks inactive), pad61-pad64 buff instance id
263 // src_agent: relates to agent
264 // value: new duration
265 // evtc: limited to squad outside instances
266 // realtime: limited to squad
267
268 CBTS_GUILD, // agent is a member of guild
269 // src_agent: relates to agent
270 // dst_agent: (uint8_t*)&dst_agent is uint8_t[16], guid of guild
271 // value: new duration
272 // evtc: limited to squad outside instances
273 // realtime: no
274
275 CBTS_BUFFINFO, // buff information
276 // skillid: skilldef id of buff
277 // overstack_value: max combined duration
278 // src_master_instid:
279 // is_src_flanking: likely an invuln
280 // is_shields: likely an invert
281 // is_offcycle: category
282 // pad61: buff stacking type
283 // pad62: likely a resistance
284 // evtc: yes
285 // realtime: no
286
287 CBTS_BUFFFORMULA, // buff formula, one per event of this type
288 // skillid: skilldef id of buff
289 // time: (float*)&time is float[9], type attribute1 attribute2 parameter1 parameter2 parameter3 trait_condition_source trait_condition_self content_reference
290 // src_instid: (float*)&src_instid is float[2], buff_condition_source buff_condition_self
291 // evtc: yes
292 // realtime: no
293
294 CBTS_SKILLINFO, // skill information
295 // skillid: skilldef id of skill
296 // time: (float*)&time is float[4], cost range0 range1 tooltiptime
297 // evtc: yes
298 // realtime: no
299
300 CBTS_SKILLTIMING, // skill timing, one per event of this type
301 // skillid: skilldef id of skill
302 // src_agent: timing type
303 // dst_agent: at time since activation in milliseconds
304 // evtc: yes
305 // realtime: no
306
307 CBTS_BREAKBARSTATE, // agent breakbar state changed
308 // src_agent: relates to agent
309 // dst_agent: new breakbar state
310 // evtc: limited to agent table outside instances
311 // realtime: no
312
313 CBTS_BREAKBARPERCENT, // agent breakbar percentage changed
314 // src_agent: relates to agent
315 // value: (float*)&value is float[1], new percentage
316 // evtc: limited to agent table outside instances
317 // realtime: no
318
319 CBTS_INTEGRITY, // one event per message. previously named error
320 // time: (char*)&time is char[32], a short null-terminated message with reason
321 // evtc: yes
322 // realtime: no
323
324 CBTS_MARKER, // one event per marker on an agent
325 // src_agent: relates to agent
326 // value: markerdef id. if value is 0, remove all markers presently on agent
327 // buff: marker is a commander tag
328 // evtc: limited to agent table outside instances
329 // realtime: no
330
331 CBTS_BARRIERPCTUPDATE, // agent barrier percentage changed
332 // src_agent: relates to agent
333 // dst_agent: percent * 10000 eg. 99.5% will be 9950
334 // evtc: limited to agent table outside instances
335 // realtime: no
336
337 CBTS_STATRESET, // arcdps stats reset
338 // src_agent: species id of agent that triggered the reset, eg boss species id
339 // evtc: yes
340 // realtime: yes
341
342 CBTS_EXTENSION, // for extension use. not managed by arcdps
343 // evtc: yes
344 // realtime: yes
345
346 CBTS_APIDELAYED, // one per cbtevent that got deemed unsafe for realtime but safe for posting after squadcombat
347 // evtc: no
348 // realtime: yes
349
350 CBTS_INSTANCESTART, // map instance start
351 // src_agent: milliseconds ago instance was started
352 // evtc: yes
353 // realtime: yes
354
355 CBTS_RATEHEALTH, // tick health. previously named tickrate
356 // src_agent: 25 - tickrate, when tickrate <= 20
357 // evtc: yes
358 // realtime: no
359
360 CBTS_LAST90BEFOREDOWN, // retired, not used since 240529+
361 // retired
362
363 CBTS_EFFECT, // retired, not used since 230716+
364 // retired
365
366 CBTS_IDTOGUID, // content id to guid association for volatile types
367 // src_agent: (uint8_t*)&src_agent is uint8_t[16] guid of content
368 // overstack_value: is of enum contentlocal
369 // evtc: yes
370 // realtime: no
371
372 CBTS_LOGNPCUPDATE, // log boss agent changed
373 // src_agent: species id of agent
374 // dst_agent: related to agent
375 // value: as uint32_t, server unix timestamp
376 // evtc: yes
377 // realtime: yes
378
379 CBTS_IDLEEVENT, // internal use
380 // internal use
381
382 CBTS_EXTENSIONCOMBAT, // for extension use. not managed by arcdps
383 // assumed to be cbtevent struct, skillid will be processed as such for purpose of buffinfo/skillinfo
384 // evtc: yes
385 // realtime: yes
386
387 CBTS_FRACTALSCALE, // fractal scale for fractals
388 // src_agent: scale
389 // evtc: yes
390 // realtime: no
391
392 CBTS_EFFECT2, // play graphical effect
393 // src_agent: related to agent
394 // dst_agent: effect at location of agent (if applicable)
395 // value: (float*)&value is float[3], location x/y/z (if not at agent location)
396 // iff: (uint32_t*)&iff is uint32_t[1], effect duration
397 // buffremove: (uint32_t*)&buffremove is uint32_t[1], trackable id of effect. id dst_agent and location is 0/0/0, effect was stopped
398 // is_shields: (int16_t*)&is_shields is int16_t[3], orientation x/y/z, values are original*1000
399 // is_flanking: effect is on a non-static platform
400 // evtc: limited to agent table outside instances
401 // realtime: no
402
403 CBTS_RULESET, // ruleset for self
404 // src_agent: bit0: pve, bit1: wvw, bit2: pvp
405 // evtc: yes
406 // realtime: no
407
408 CBTS_SQUADMARKER, // squad ground markers
409 // src_agent: (float*)&src_agent is float[3], x/y/z of marker location. if values are all zero or infinity, this marker is removed
410 // skillid: index of marker eg. 0 is arrow
411 // evtc: yes
412 // realtime: no
413
414 CBTS_ARCBUILD, // arc build info
415 // src_agent: (char*)&src_agent is a null-terminated string matching the full build string in arcdps.log
416 // evtc: yes
417 // realtime: no
418
419 CBTS_GLIDER, // glider status change
420 // src_agent: related to agent
421 // value: 1 deployed, 0 stowed
422 // evtc: limited to agent table outside instances
423 // realtime: no
424
425 CBTS_STUNBREAK, // disable stopped early
426 // src_agent: related to agent
427 // value: duration remaining
428 // evtc: limited to agent table outside instances
429 // realtime: no
430
431 CBTS_UNKNOWN // unknown/unsupported type newer than this list maybe
432 };
433
434 /* is friend/foe */
435 enum EIsFriendFoe
436 {
437 IFF_FRIEND,
438 IFF_FOE,
439 IFF_UNKNOWN
440 };
441
442 /* combat result (direct) */
443 enum ECombatResult
444 {
445 CBTR_NORMAL, // strike was neither crit or glance
446 CBTR_CRIT, // strike was crit
447 CBTR_GLANCE, // strike was glance
448 CBTR_BLOCK, // strike was blocked eg. mesmer shield 4
449 CBTR_EVADE, // strike was evaded, eg. dodge or mesmer sword 2
450 CBTR_INTERRUPT, // strike interrupted something
451 CBTR_ABSORB, // strike was "invulned" or absorbed eg. guardian elite
452 CBTR_BLIND, // strike missed
453 CBTR_KILLINGBLOW, // not a damage strike, target was killed by skill
454 CBTR_DOWNED, // not a damage strike, target was downed by skill
455 CBTR_BREAKBAR, // not a damage strike, target had value of breakbar damage dealt
456 CBTR_ACTIVATION, // not a damage strike, skill activation event
457 CBTR_CROWDCONTROL, // not a damage strike, target was crowdcontrolled
458 CBTR_UNKNOWN
459 };
460
461 /* combat activation */
462 enum ECombatActivation {
463 ACTV_NONE, // not used - not this kind of event
464 ACTV_START, // started skill/animation activation
465 ACTV_QUICKNESS_UNUSED, // unused as of nov 5 2019
466 ACTV_CANCEL_FIRE, // stopped skill activation with reaching tooltip time
467 ACTV_CANCEL_CANCEL, // stopped skill activation without reaching tooltip time
468 ACTV_RESET, // animation completed fully
469 ACTV_UNKNOWN
470 };
471
472 /* combat buff remove type */
473 enum ECombatBuffRemove {
474 CBTB_NONE, // not used - not this kind of event
475 CBTB_ALL, // last/all stacks removed (sent by server)
476 CBTB_SINGLE, // single stack removed (sent by server). will happen for each stack on cleanse
477 CBTB_MANUAL, // single stack removed (auto by arc on ooc or all stack, ignore for strip/cleanse calc, use for in/out volume)
478 CBTB_UNKNOWN
479 };
480
481 /* combat buff cycle type */
482 enum ECombatBuffCycle {
483 CBTC_CYCLE, // damage happened on tick timer
484 CBTC_NOTCYCLE, // damage happened outside tick timer (resistable)
485 CBTC_NOTCYCLENORESIST, // BEFORE MAY 2021: the others were lumped here, now retired
486 CBTC_NOTCYCLEDMGTOTARGETONHIT, // damage happened to target on hitting target
487 CBTC_NOTCYCLEDMGTOSOURCEONHIT, // damage happened to source on htiting target
488 CBTC_NOTCYCLEDMGTOTARGETONSTACKREMOVE, // damage happened to target on source losing a stack
489 CBTC_UNKNOWN
490 };
491
492 /* language */
493 enum EGWLanguage {
494 GWL_ENG = 0,
495 GWL_FRE = 2,
496 GWL_GEM = 3,
497 GWL_SPA = 4,
498 GWL_CN = 5,
499 };
500
501 /* content local enum */
502 enum EContentLocal {
503 CONTENTLOCAL_EFFECT,
504 CONTENTLOCAL_MARKER
505 };
506
508 {
509 uint64_t IsHidden : 1;
510 uint64_t IsAlwaysDrawn : 1;
511 uint64_t IsModMoveLocked : 1;
512 uint64_t IsModClickLocked : 1;
513 uint64_t IsClosingWithEscape : 1;
514 };
515
517 {
518 WORD Mod1;
519 WORD Mod2;
520 WORD ModMulti;
521 };
522
523 /* exports */
524 typedef uint64_t(*Export_GetU64)();
525
526 static void* LogFile;
527 static void* LogArc;
528
529 static void LogToFile(char* str) /* log to arcdps.log, thread/async safe */
530 {
531 size_t(*log)(char*) = (size_t(*)(char*))LogFile;
532 if (log) (*log)(str);
533 return;
534 }
535 static void LogToArc(char* str) /* log to extensions tab in arcdps log window, thread/async safe */
536 {
537 size_t(*log)(char*) = (size_t(*)(char*))LogArc;
538 if (log) (*log)(str);
539 return;
540 }
541 static void Log(char* str) /* log to arcdps.log and log window*/
542 {
543 LogToFile(str);
544 LogToArc(str);
545 return;
546 }
547#ifdef __cplusplus
548}
549#endif
550
551#endif
Definition ArcDPS.h:96
Definition ArcDPS.h:64
Definition ArcDPS.h:13
Definition ArcDPS.h:517
Definition ArcDPS.h:508