-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.lua
More file actions
699 lines (597 loc) · 24.8 KB
/
Copy pathdisplay.lua
File metadata and controls
699 lines (597 loc) · 24.8 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
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
--[[
Display Module for Stats
Handles all display output - chat messages and on-screen overlay
]]--
local display = {}
local texts = require('texts')
-- Overlay text object
local overlay = nil
local overlay_settings = {
pos = { x = 100, y = 100 },
bg = { alpha = 180, red = 0, green = 0, blue = 0 },
text = { font = 'Consolas', size = 10, alpha = 255, red = 255, green = 255, blue = 255 },
flags = { draggable = true, bold = true },
padding = 5
}
local settings_ref = nil
-------------------------------------------
-- Initialization
-------------------------------------------
function display.init(settings)
settings_ref = settings
overlay = texts.new('', overlay_settings)
if settings.overlay_position then
overlay:pos(settings.overlay_position.x, settings.overlay_position.y)
end
if settings.overlay_enabled then
overlay:show()
else
overlay:hide()
end
end
-------------------------------------------
-- Overlay Functions
-------------------------------------------
function display.update(fight)
if not overlay then return end
if not settings_ref or not settings_ref.overlay_enabled then
overlay:hide()
return
end
if not fight then
overlay:text('Stats: No current fight')
overlay:show()
return
end
local lines = {}
-- Header with total damage
table.insert(lines, '=== ' .. fight.enemy_name .. ' ===')
table.insert(lines, string.format('Total Damage: %d', fight.total_damage or 0))
-- Melee accuracy
if fight.total_swings > 0 then
local acc = math.floor((fight.total_hits / fight.total_swings) * 100)
local crit_rate = fight.total_hits > 0 and
math.floor((fight.total_crits / fight.total_hits) * 100) or 0
table.insert(lines, string.format('Melee: %d%% (%d/%d)',
acc, fight.total_hits, fight.total_swings))
if fight.melee_min and fight.melee_max > 0 then
table.insert(lines, string.format(' Dmg: %d-%d | Crit: %d%%',
fight.melee_min or 0, fight.melee_max, crit_rate))
end
end
-- Ranged accuracy
if fight.ranged_shots > 0 then
local acc = math.floor((fight.ranged_hits / fight.ranged_shots) * 100)
table.insert(lines, string.format('Ranged: %d%% (%d/%d)',
acc, fight.ranged_hits, fight.ranged_shots))
end
-- Weapon skills (show top 3 by usage)
local ws_list = {}
for ws_name, ws_data in pairs(fight.weaponskills) do
table.insert(ws_list, { name = ws_name, data = ws_data })
end
table.sort(ws_list, function(a, b) return a.data.uses > b.data.uses end)
if #ws_list > 0 then
table.insert(lines, '--- Weapon Skills ---')
for i = 1, math.min(3, #ws_list) do
local ws = ws_list[i]
local avg = ws.data.hits > 0 and math.floor(ws.data.total_damage / ws.data.hits) or 0
table.insert(lines, string.format('%s: %d-%d (x%d)',
ws.name:sub(1, 12), ws.data.min_damage or 0, ws.data.max_damage, ws.data.uses))
end
end
-- Spells (show top 3 by usage)
local spell_list = {}
for spell_name, spell_data in pairs(fight.spells) do
table.insert(spell_list, { name = spell_name, data = spell_data })
end
table.sort(spell_list, function(a, b) return a.data.casts > b.data.casts end)
if #spell_list > 0 then
table.insert(lines, '--- Spells ---')
for i = 1, math.min(3, #spell_list) do
local spell = spell_list[i]
local acc = math.floor((spell.data.landed / spell.data.casts) * 100)
if spell.data.total_damage > 0 then
table.insert(lines, string.format('%s: %d%% %d-%d',
spell.name:sub(1, 12), acc, spell.data.min_damage or 0, spell.data.max_damage))
else
table.insert(lines, string.format('%s: %d%% (%d/%d)',
spell.name:sub(1, 12), acc, spell.data.landed, spell.data.casts))
end
end
end
-- Trusts (show top 3 by damage)
local trust_list = {}
for trust_name, trust_data in pairs(fight.trusts or {}) do
if trust_data.total_damage > 0 then
table.insert(trust_list, { name = trust_name, data = trust_data })
end
end
table.sort(trust_list, function(a, b) return a.data.total_damage > b.data.total_damage end)
if #trust_list > 0 then
table.insert(lines, '--- Trusts ---')
for i = 1, math.min(3, #trust_list) do
local trust = trust_list[i]
table.insert(lines, string.format('%s: %d dmg',
trust.name:sub(1, 12), trust.data.total_damage))
end
end
-- Pets (show all since usually only one)
local pet_list = {}
for pet_name, pet_data in pairs(fight.pets or {}) do
if pet_data.total_damage > 0 then
table.insert(pet_list, { name = pet_name, data = pet_data })
end
end
if #pet_list > 0 then
table.insert(lines, '--- Pets ---')
for _, pet in ipairs(pet_list) do
table.insert(lines, string.format('%s: %d dmg',
pet.name:sub(1, 12), pet.data.total_damage))
end
end
overlay:text(table.concat(lines, '\n'))
overlay:show()
end
function display.toggle_overlay(enabled)
if overlay then
if enabled then
overlay:show()
else
overlay:hide()
end
end
end
function display.hide()
if overlay then
overlay:hide()
end
end
-------------------------------------------
-- Chat Display Functions
-------------------------------------------
function display.show_summary(fight)
if not fight then
log('No fight data available.')
return
end
log('=== ' .. fight.enemy_name .. ' ===')
log(string.format('Total Damage: %d', fight.total_damage or 0))
-- Melee
if fight.total_swings > 0 then
local acc = math.floor((fight.total_hits / fight.total_swings) * 100)
log(string.format('Melee Accuracy: %d%% (%d/%d)',
acc, fight.total_hits, fight.total_swings))
log(string.format('Melee Damage: %d (Min: %d / Max: %d)',
fight.melee_damage, fight.melee_min or 0, fight.melee_max))
end
-- Ranged
if fight.ranged_shots > 0 then
local acc = math.floor((fight.ranged_hits / fight.ranged_shots) * 100)
log(string.format('Ranged Accuracy: %d%% (%d/%d)',
acc, fight.ranged_hits, fight.ranged_shots))
end
-- WS count
local ws_count = 0
for _ in pairs(fight.weaponskills) do ws_count = ws_count + 1 end
if ws_count > 0 then
log(string.format('Weapon Skills Used: %d types', ws_count))
end
-- Spell count
local spell_count = 0
for _ in pairs(fight.spells) do spell_count = spell_count + 1 end
if spell_count > 0 then
log(string.format('Spells Cast: %d types', spell_count))
end
end
function display.show_detailed(fight)
if not fight then
log('No fight data available.')
return
end
log('========== Detailed Report: ' .. fight.enemy_name .. ' ==========')
-- Fight duration and total damage
local duration = (fight.end_time or os.time()) - fight.start_time
log(string.format('Duration: %d:%02d', math.floor(duration / 60), duration % 60))
log(string.format('Total Damage: %d', fight.total_damage or 0))
if duration > 0 then
local dps = math.floor((fight.total_damage or 0) / duration)
log(string.format('Average DPS: %d', dps))
end
if fight.result then
log('Result: ' .. fight.result)
end
-- Melee stats
log('--- Melee ---')
if fight.total_swings > 0 then
local acc = math.floor((fight.total_hits / fight.total_swings) * 100)
local crit_rate = fight.total_hits > 0 and
math.floor((fight.total_crits / fight.total_hits) * 100) or 0
local avg = fight.total_hits > 0 and math.floor(fight.melee_damage / fight.total_hits) or 0
log(string.format(' Accuracy: %d%% (%d hits / %d swings)',
acc, fight.total_hits, fight.total_swings))
log(string.format(' Crit Rate: %d%% (%d crits)',
crit_rate, fight.total_crits))
log(string.format(' Damage: %d total (Avg: %d)',
fight.melee_damage, avg))
log(string.format(' Normal: Min %d / Max %d',
fight.melee_min or 0, fight.melee_max))
if fight.total_crits > 0 then
log(string.format(' Critical: Min %d / Max %d',
fight.melee_crit_min or 0, fight.melee_crit_max))
end
else
log(' No melee attacks')
end
-- Ranged stats
if fight.ranged_shots > 0 then
log('--- Ranged ---')
local acc = math.floor((fight.ranged_hits / fight.ranged_shots) * 100)
local crit_rate = fight.ranged_hits > 0 and
math.floor((fight.ranged_crits / fight.ranged_hits) * 100) or 0
log(string.format(' Accuracy: %d%% (%d hits / %d shots)',
acc, fight.ranged_hits, fight.ranged_shots))
log(string.format(' Crit Rate: %d%%', crit_rate))
log(string.format(' Damage: %d total (Min: %d / Max: %d)',
fight.ranged_damage, fight.ranged_min or 0, fight.ranged_max))
end
-- Weapon skill stats
local has_ws = false
for _ in pairs(fight.weaponskills) do has_ws = true break end
if has_ws then
log('--- Weapon Skills ---')
for ws_name, ws_data in pairs(fight.weaponskills) do
local acc = ws_data.uses > 0 and
math.floor((ws_data.hits / ws_data.uses) * 100) or 0
local avg = ws_data.hits > 0 and
math.floor(ws_data.total_damage / ws_data.hits) or 0
log(string.format(' %s:', ws_name))
log(string.format(' Uses: %d (Hit: %d%%) | Damage: %d',
ws_data.uses, acc, ws_data.total_damage))
log(string.format(' Min: %d / Max: %d / Avg: %d',
ws_data.min_damage or 0, ws_data.max_damage, avg))
end
end
-- Spell stats
local has_spells = false
for _ in pairs(fight.spells) do has_spells = true break end
if has_spells then
log('--- Spells ---')
for spell_name, spell_data in pairs(fight.spells) do
local acc = spell_data.casts > 0 and
math.floor((spell_data.landed / spell_data.casts) * 100) or 0
log(string.format(' %s:', spell_name))
log(string.format(' Casts: %d | Landed: %d (%d%%) | Resisted: %d',
spell_data.casts, spell_data.landed, acc, spell_data.resisted))
if spell_data.total_damage > 0 then
local avg = spell_data.landed > 0 and
math.floor(spell_data.total_damage / spell_data.landed) or 0
log(string.format(' Damage: %d (Min: %d / Max: %d / Avg: %d)',
spell_data.total_damage, spell_data.min_damage or 0,
spell_data.max_damage, avg))
end
end
end
-- Ability stats
local has_abilities = false
for _ in pairs(fight.abilities) do has_abilities = true break end
if has_abilities then
log('--- Job Abilities ---')
for ability_name, ability_data in pairs(fight.abilities) do
local avg = ability_data.uses > 0 and
math.floor(ability_data.total_damage / ability_data.uses) or 0
log(string.format(' %s: %d uses, %d total damage (Min: %d / Max: %d)',
ability_name, ability_data.uses, ability_data.total_damage,
ability_data.min_damage or 0, ability_data.max_damage))
end
end
-- Trust stats
local has_trusts = false
for _ in pairs(fight.trusts or {}) do has_trusts = true break end
if has_trusts then
log('--- Trusts ---')
local trust_list = {}
for name, data in pairs(fight.trusts) do
table.insert(trust_list, { name = name, data = data })
end
table.sort(trust_list, function(a, b) return a.data.total_damage > b.data.total_damage end)
for _, trust in ipairs(trust_list) do
local data = trust.data
log(string.format(' %s: %d total damage', trust.name, data.total_damage))
if data.melee_swings > 0 then
local acc = math.floor((data.melee_hits / data.melee_swings) * 100)
log(string.format(' Melee: %d dmg (%d%% acc, %d/%d)',
data.melee_damage, acc, data.melee_hits, data.melee_swings))
end
if data.ws_uses > 0 then
log(string.format(' WS: %d dmg (%d uses)', data.ws_damage, data.ws_uses))
end
if data.spell_casts > 0 then
log(string.format(' Spells: %d dmg (%d casts)', data.spell_damage, data.spell_casts))
end
end
end
-- Pet stats
local has_pets = false
for _ in pairs(fight.pets or {}) do has_pets = true break end
if has_pets then
log('--- Pets ---')
for pet_name, data in pairs(fight.pets) do
log(string.format(' %s: %d total damage', pet_name, data.total_damage))
if data.melee_swings > 0 then
local acc = math.floor((data.melee_hits / data.melee_swings) * 100)
log(string.format(' Melee: %d dmg (%d%% acc, %d/%d)',
data.melee_damage, acc, data.melee_hits, data.melee_swings))
end
if data.ws_uses > 0 then
log(string.format(' WS: %d dmg (%d uses)', data.ws_damage, data.ws_uses))
end
if data.spell_casts > 0 then
log(string.format(' Spells: %d dmg (%d casts)', data.spell_damage, data.spell_casts))
end
if data.ability_uses > 0 then
log(string.format(' Abilities: %d dmg (%d uses)', data.ability_damage, data.ability_uses))
end
end
end
end
function display.show_spell_stats(session, spell_name)
local found = false
log('=== Spell Stats: ' .. spell_name .. ' ===')
for name, data in pairs(session.spells) do
if name:lower():find(spell_name:lower()) then
found = true
local acc = data.casts > 0 and
math.floor((data.landed / data.casts) * 100) or 0
log(string.format('%s:', name))
log(string.format(' Casts: %d | Landed: %d (%d%%) | Resisted: %d',
data.casts, data.landed, acc, data.resisted))
if data.total_damage > 0 then
local avg = data.landed > 0 and
math.floor(data.total_damage / data.landed) or 0
log(string.format(' Damage: %d total (Min: %d / Max: %d / Avg: %d)',
data.total_damage, data.min_damage or 0, data.max_damage, avg))
end
end
end
if not found then
log('No data found for spell: ' .. spell_name)
end
end
function display.show_ws_stats(session, ws_name)
local found = false
log('=== Weapon Skill Stats: ' .. ws_name .. ' ===')
for name, data in pairs(session.weaponskills) do
if name:lower():find(ws_name:lower()) then
found = true
local acc = data.uses > 0 and
math.floor((data.hits / data.uses) * 100) or 0
local avg = data.hits > 0 and
math.floor(data.total_damage / data.hits) or 0
log(string.format('%s:', name))
log(string.format(' Uses: %d | Hits: %d (%d%%)',
data.uses, data.hits, acc))
log(string.format(' Damage: %d total', data.total_damage))
log(string.format(' Min: %d / Max: %d / Avg: %d',
data.min_damage or 0, data.max_damage, avg))
end
end
if not found then
log('No data found for weapon skill: ' .. ws_name)
end
end
function display.show_trust_stats(fight, session)
log('=== Trust Damage Stats ===')
-- Current fight trusts
local has_fight_trusts = false
for _ in pairs(fight.trusts or {}) do has_fight_trusts = true break end
if has_fight_trusts then
log('--- Current Fight ---')
local trust_list = {}
for name, data in pairs(fight.trusts) do
table.insert(trust_list, { name = name, data = data })
end
table.sort(trust_list, function(a, b) return a.data.total_damage > b.data.total_damage end)
for _, trust in ipairs(trust_list) do
local data = trust.data
log(string.format('%s: %d total damage', trust.name, data.total_damage))
if data.melee_swings > 0 then
local acc = math.floor((data.melee_hits / data.melee_swings) * 100)
log(string.format(' Melee: %d dmg (%d%% acc)', data.melee_damage, acc))
end
if data.ranged_shots > 0 then
local acc = math.floor((data.ranged_hits / data.ranged_shots) * 100)
log(string.format(' Ranged: %d dmg (%d%% acc)', data.ranged_damage, acc))
end
if data.ws_uses > 0 then
log(string.format(' WS: %d dmg (%d uses)', data.ws_damage, data.ws_uses))
end
if data.spell_casts > 0 then
log(string.format(' Spells: %d dmg (%d casts)', data.spell_damage, data.spell_casts))
end
if data.ability_uses > 0 then
log(string.format(' Abilities: %d dmg (%d uses)', data.ability_damage, data.ability_uses))
end
end
else
log('No trust damage in current fight.')
end
-- Session trusts
local has_session_trusts = false
for _ in pairs(session.trusts or {}) do has_session_trusts = true break end
if has_session_trusts then
log('--- Session Totals ---')
local trust_list = {}
for name, data in pairs(session.trusts) do
table.insert(trust_list, { name = name, data = data })
end
table.sort(trust_list, function(a, b) return a.data.total_damage > b.data.total_damage end)
for _, trust in ipairs(trust_list) do
log(string.format('%s: %d total damage', trust.name, trust.data.total_damage))
end
end
end
function display.show_pet_stats(fight, session)
log('=== Pet Damage Stats ===')
-- Current fight pets
local has_fight_pets = false
for _ in pairs(fight.pets or {}) do has_fight_pets = true break end
if has_fight_pets then
log('--- Current Fight ---')
local pet_list = {}
for name, data in pairs(fight.pets) do
table.insert(pet_list, { name = name, data = data })
end
table.sort(pet_list, function(a, b) return a.data.total_damage > b.data.total_damage end)
for _, pet in ipairs(pet_list) do
local data = pet.data
log(string.format('%s: %d total damage', pet.name, data.total_damage))
if data.melee_swings > 0 then
local acc = math.floor((data.melee_hits / data.melee_swings) * 100)
log(string.format(' Melee: %d dmg (%d%% acc)', data.melee_damage, acc))
end
if data.ranged_shots > 0 then
local acc = math.floor((data.ranged_hits / data.ranged_shots) * 100)
log(string.format(' Ranged: %d dmg (%d%% acc)', data.ranged_damage, acc))
end
if data.ws_uses > 0 then
log(string.format(' WS: %d dmg (%d uses)', data.ws_damage, data.ws_uses))
end
if data.spell_casts > 0 then
log(string.format(' Spells: %d dmg (%d casts)', data.spell_damage, data.spell_casts))
end
if data.ability_uses > 0 then
log(string.format(' Abilities: %d dmg (%d uses)', data.ability_damage, data.ability_uses))
end
end
else
log('No pet damage in current fight.')
end
-- Session pets
local has_session_pets = false
for _ in pairs(session.pets or {}) do has_session_pets = true break end
if has_session_pets then
log('--- Session Totals ---')
local pet_list = {}
for name, data in pairs(session.pets) do
table.insert(pet_list, { name = name, data = data })
end
table.sort(pet_list, function(a, b) return a.data.total_damage > b.data.total_damage end)
for _, pet in ipairs(pet_list) do
log(string.format('%s: %d total damage', pet.name, pet.data.total_damage))
end
end
end
function display.show_session(session)
-- Melee
log('--- Melee ---')
if session.melee.swings > 0 then
local acc = math.floor((session.melee.hits / session.melee.swings) * 100)
local crit_rate = session.melee.hits > 0 and
math.floor((session.melee.crits / session.melee.hits) * 100) or 0
log(string.format(' Swings: %d | Hits: %d | Accuracy: %d%%',
session.melee.swings, session.melee.hits, acc))
log(string.format(' Crits: %d (%d%%) | Total Damage: %d',
session.melee.crits, crit_rate, session.melee.total_damage))
else
log(' No melee data')
end
-- Ranged
if session.ranged.shots > 0 then
log('--- Ranged ---')
local acc = math.floor((session.ranged.hits / session.ranged.shots) * 100)
log(string.format(' Shots: %d | Hits: %d | Accuracy: %d%%',
session.ranged.shots, session.ranged.hits, acc))
log(string.format(' Total Damage: %d', session.ranged.total_damage))
end
-- Weapon skills summary
local ws_count = 0
local ws_total_uses = 0
local ws_total_damage = 0
for _, data in pairs(session.weaponskills) do
ws_count = ws_count + 1
ws_total_uses = ws_total_uses + data.uses
ws_total_damage = ws_total_damage + data.total_damage
end
if ws_count > 0 then
log('--- Weapon Skills ---')
log(string.format(' Types: %d | Total Uses: %d | Total Damage: %d',
ws_count, ws_total_uses, ws_total_damage))
-- Top 5 WS by damage
local ws_list = {}
for name, data in pairs(session.weaponskills) do
table.insert(ws_list, { name = name, data = data })
end
table.sort(ws_list, function(a, b)
return a.data.total_damage > b.data.total_damage
end)
log(' Top Weapon Skills:')
for i = 1, math.min(5, #ws_list) do
local ws = ws_list[i]
log(string.format(' %s: %d damage (%d uses)',
ws.name, ws.data.total_damage, ws.data.uses))
end
end
-- Spells summary
local spell_count = 0
local spell_total_casts = 0
for _, data in pairs(session.spells) do
spell_count = spell_count + 1
spell_total_casts = spell_total_casts + data.casts
end
if spell_count > 0 then
log('--- Spells ---')
log(string.format(' Types: %d | Total Casts: %d', spell_count, spell_total_casts))
-- Show enfeebling spells accuracy
local enfeebs = {}
for name, data in pairs(session.spells) do
if data.total_damage == 0 and data.casts >= 3 then
local acc = math.floor((data.landed / data.casts) * 100)
table.insert(enfeebs, { name = name, acc = acc, casts = data.casts })
end
end
if #enfeebs > 0 then
table.sort(enfeebs, function(a, b) return a.casts > b.casts end)
log(' Enfeebling Accuracy:')
for i = 1, math.min(5, #enfeebs) do
log(string.format(' %s: %d%% (%d casts)',
enfeebs[i].name, enfeebs[i].acc, enfeebs[i].casts))
end
end
end
-- Trust summary
local trust_count = 0
local trust_total_damage = 0
for _, data in pairs(session.trusts or {}) do
trust_count = trust_count + 1
trust_total_damage = trust_total_damage + data.total_damage
end
if trust_count > 0 then
log('--- Trusts ---')
log(string.format(' Trusts Used: %d | Total Damage: %d', trust_count, trust_total_damage))
local trust_list = {}
for name, data in pairs(session.trusts) do
table.insert(trust_list, { name = name, data = data })
end
table.sort(trust_list, function(a, b) return a.data.total_damage > b.data.total_damage end)
for i = 1, math.min(5, #trust_list) do
local trust = trust_list[i]
log(string.format(' %s: %d damage', trust.name, trust.data.total_damage))
end
end
-- Pet summary
local pet_count = 0
local pet_total_damage = 0
for _, data in pairs(session.pets or {}) do
pet_count = pet_count + 1
pet_total_damage = pet_total_damage + data.total_damage
end
if pet_count > 0 then
log('--- Pets ---')
log(string.format(' Pets Used: %d | Total Damage: %d', pet_count, pet_total_damage))
for name, data in pairs(session.pets) do
log(string.format(' %s: %d damage', name, data.total_damage))
end
end
end
return display