-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTracker.lua
2591 lines (2269 loc) · 93.7 KB
/
Tracker.lua
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
local Recount = _G.Recount
local AceLocale = LibStub("AceLocale-3.0")
local L = AceLocale:GetLocale("Recount")
local BossIDs = LibStub("LibBossIDs-1.0")
local revision = tonumber(string.sub("$Revision: 1552 $", 12, -3))
if Recount.Version < revision then
Recount.Version = revision
end
local bit_band = bit.band
local bit_bor = bit.bor
local math = math
local math_abs = math.abs
local math_floor = math.floor
local math_fmod = math.fmod
local pairs = pairs
local strfind = strfind
local string_lower = string.lower
local string_match = string.match
local string_sub = string.sub
local string_upper = string.upper
local tinsert = table.insert
local tonumber = tonumber
local type = type
local unpack = unpack
local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo
local CreateFrame = CreateFrame
local DeclineName = DeclineName
local GetFramerate = GetFramerate
local GetLocale = GetLocale
local GetNetStats = GetNetStats
local GetNumDeclensionSets = GetNumDeclensionSets
local GetNumGroupMembers = GetNumGroupMembers
local GetSpellInfo = GetSpellInfo
local GetTime = GetTime
local IsInRaid = IsInRaid
local UnitExists = UnitExists
local UnitHealth = UnitHealth
local UnitHealthMax = UnitHealthMax
local UnitIsFeignDeath = UnitIsFeignDeath
local UnitName = UnitName
local ChatThrottleLib = ChatThrottleLib
local dbCombatants
local Epsilon = 0.000000000000000001
-- Pre-4.1 CLEU compat start
--[[local TOC
local dummyTable = { }
local loopprevent
do
-- Because GetBuildInfo() still returns 40000 on the PTR
local major, minor, rev = strsplit(".", (GetBuildInfo()))
TOC = major * 10000 + minor * 100
end]]
-- Pre-4.1 CLEU compat end
-- Data for Recount is tracked within this file
local Tracking = { }
-- Elsia: This is straight from GUIDRegistryLib-0.1 by ArrowMaster.
local COMBATLOG_OBJECT_AFFILIATION_MINE = COMBATLOG_OBJECT_AFFILIATION_MINE or 0x00000001
local COMBATLOG_OBJECT_AFFILIATION_PARTY = COMBATLOG_OBJECT_AFFILIATION_PARTY or 0x00000002
local COMBATLOG_OBJECT_AFFILIATION_RAID = COMBATLOG_OBJECT_AFFILIATION_RAID or 0x00000004
local COMBATLOG_OBJECT_AFFILIATION_OUTSIDER = COMBATLOG_OBJECT_AFFILIATION_OUTSIDER or 0x00000008
local COMBATLOG_OBJECT_AFFILIATION_MASK = COMBATLOG_OBJECT_AFFILIATION_MASK or 0x0000000F
-- Reaction
local COMBATLOG_OBJECT_REACTION_FRIENDLY = COMBATLOG_OBJECT_REACTION_FRIENDLY or 0x00000010
local COMBATLOG_OBJECT_REACTION_NEUTRAL = COMBATLOG_OBJECT_REACTION_NEUTRAL or 0x00000020
local COMBATLOG_OBJECT_REACTION_HOSTILE = COMBATLOG_OBJECT_REACTION_HOSTILE or 0x00000040
local COMBATLOG_OBJECT_REACTION_MASK = COMBATLOG_OBJECT_REACTION_MASK or 0x000000F0
-- Ownership
local COMBATLOG_OBJECT_CONTROL_PLAYER = COMBATLOG_OBJECT_CONTROL_PLAYER or 0x00000100
local COMBATLOG_OBJECT_CONTROL_NPC = COMBATLOG_OBJECT_CONTROL_NPC or 0x00000200
local COMBATLOG_OBJECT_CONTROL_MASK = COMBATLOG_OBJECT_CONTROL_MASK or 0x00000300
-- Unit type
local COMBATLOG_OBJECT_TYPE_PLAYER = COMBATLOG_OBJECT_TYPE_PLAYER or 0x00000400
local COMBATLOG_OBJECT_TYPE_NPC = COMBATLOG_OBJECT_TYPE_NPC or 0x00000800
local COMBATLOG_OBJECT_TYPE_PET = COMBATLOG_OBJECT_TYPE_PET or 0x00001000
local COMBATLOG_OBJECT_TYPE_GUARDIAN = COMBATLOG_OBJECT_TYPE_GUARDIAN or 0x00002000
local COMBATLOG_OBJECT_TYPE_OBJECT = COMBATLOG_OBJECT_TYPE_OBJECT or 0x00004000
local COMBATLOG_OBJECT_TYPE_MASK = COMBATLOG_OBJECT_TYPE_MASK or 0x0000FC00
-- Special cases (non-exclusive)
local COMBATLOG_OBJECT_TARGET = COMBATLOG_OBJECT_TARGET or 0x00010000
local COMBATLOG_OBJECT_FOCUS = COMBATLOG_OBJECT_FOCUS or 0x00020000
local COMBATLOG_OBJECT_MAINTANK = COMBATLOG_OBJECT_MAINTANK or 0x00040000
local COMBATLOG_OBJECT_MAINASSIST = COMBATLOG_OBJECT_MAINASSIST or 0x00080000
local COMBATLOG_OBJECT_RAIDTARGET1 = COMBATLOG_OBJECT_RAIDTARGET1 or 0x00100000
local COMBATLOG_OBJECT_RAIDTARGET2 = COMBATLOG_OBJECT_RAIDTARGET2 or 0x00200000
local COMBATLOG_OBJECT_RAIDTARGET3 = COMBATLOG_OBJECT_RAIDTARGET3 or 0x00400000
local COMBATLOG_OBJECT_RAIDTARGET4 = COMBATLOG_OBJECT_RAIDTARGET4 or 0x00800000
local COMBATLOG_OBJECT_RAIDTARGET5 = COMBATLOG_OBJECT_RAIDTARGET5 or 0x01000000
local COMBATLOG_OBJECT_RAIDTARGET6 = COMBATLOG_OBJECT_RAIDTARGET6 or 0x02000000
local COMBATLOG_OBJECT_RAIDTARGET7 = COMBATLOG_OBJECT_RAIDTARGET7 or 0x04000000
local COMBATLOG_OBJECT_RAIDTARGET8 = COMBATLOG_OBJECT_RAIDTARGET8 or 0x08000000
local COMBATLOG_OBJECT_NONE = COMBATLOG_OBJECT_NONE or 0x80000000
local COMBATLOG_OBJECT_SPECIAL_MASK = COMBATLOG_OBJECT_SPECIAL_MASK or 0xFFFF0000
local LIB_FILTER_RAIDTARGET = bit_bor(
COMBATLOG_OBJECT_RAIDTARGET1, COMBATLOG_OBJECT_RAIDTARGET2, COMBATLOG_OBJECT_RAIDTARGET3, COMBATLOG_OBJECT_RAIDTARGET4,
COMBATLOG_OBJECT_RAIDTARGET5, COMBATLOG_OBJECT_RAIDTARGET6, COMBATLOG_OBJECT_RAIDTARGET7, COMBATLOG_OBJECT_RAIDTARGET8
)
local LIB_FILTER_ME = bit_bor(
COMBATLOG_OBJECT_AFFILIATION_MINE, COMBATLOG_OBJECT_CONTROL_PLAYER, COMBATLOG_OBJECT_TYPE_PLAYER
)
--[[local LIB_FILTER_MY_PET = bit_bor(
COMBATLOG_OBJECT_AFFILIATION_MINE,
COMBATLOG_OBJECT_CONTROL_PLAYER,
COMBATLOG_OBJECT_TYPE_PET
)--]]
local LIB_FILTER_PARTY = bit_bor(COMBATLOG_OBJECT_TYPE_PLAYER, COMBATLOG_OBJECT_AFFILIATION_PARTY)
local LIB_FILTER_RAID = bit_bor(COMBATLOG_OBJECT_TYPE_PLAYER, COMBATLOG_OBJECT_AFFILIATION_RAID)
local LIB_FILTER_GROUP = bit_bor(LIB_FILTER_PARTY, LIB_FILTER_RAID)
local IgnoreAuras = { }
local HotTickTimeId = {
[746] = 1, -- First Aid (rank 1)
[1159] = 1,
[3267] = 1,
[3268] = 1,
[7926] = 1,
[7927] = 1,
[23569] = 1,
[24412] = 1,
[10838] = 1,
[10839] = 1,
[23568] = 1,
[24413] = 1,
[18608] = 1,
[18610] = 1,
[23567] = 1,
[23696] = 1,
[24414] = 1,
[27030] = 1,
[27031] = 1, -- First Aid (rank 12)
[33763] = 1, -- Lifebloom (rank 1) no other ranks
}
local DotTickTimeId = {
-- Mage Ticks
[133] = 2, -- Fireball (rank 1)
[143] = 2,
[145] = 2,
[3140] = 2,
[8400] = 2,
[8401] = 2,
[8402] = 2,
[10148] = 2,
[10149] = 2,
[10150] = 2,
[10151] = 2,
[25306] = 2,
[27070] = 2,
[38692] = 2, -- Fireball (rank 14)
[11119] = 2, -- Ignite (rank 1)
[11120] = 2,
[12846] = 2,
[12847] = 2,
[12848] = 2, -- Ignite (rank 5)
[15407] = 1, -- Mind Flay (rank 1)
[17311] = 1,
[17312] = 1,
[17313] = 1,
[17314] = 1,
[18807] = 1,
[25387] = 1, -- Mind Flay (rank 7)
[980] = 2, -- Curse of Agony (rank 1)
[1014] = 2,
[6217] = 2,
[11711] = 2,
[11712] = 2,
[11713] = 2,
[27218] = 2, -- Curse of Agony (rank 7)
[603] = 60, -- Curse of Doom (rank 1)
[30910] = 60, -- Curse of Doom (rank 2)
[689] = 1, -- Drain Life (rank 1) Elsia: According to wowhead it's 1. Which makes sense compared to Mind Flay...
[699] = 1,
[709] = 1,
[7651] = 1,
[11699] = 1,
[11700] = 1,
[27219] = 1,
[27220] = 1, -- Drain Life (rank 8)
[755] = 1, -- Health Funnel (rank 1)
[3698] = 1,
[3699] = 1,
[3700] = 1,
[11693] = 1,
[11694] = 1,
[11695] = 1,
[27259] = 1, -- Health Funnel (rank 8)
[1949] = 1, -- Hellfire (rank 1)
[11683] = 1,
[11684] = 1,
[27213] = 1, -- Hellfire (rank 4)
}
-- Identified Absorb abilities by spell ID and contains their respective expected durations.
-- These do not give the needed SPELL_AURA_* information to track accurately and hence need to be guessed
--[[local GuessAbsorbSpells = {
-- Death Knight
--[77535] = 10, -- Blood Shield
-- Druid
[62606] = 10, -- Savage Defense proc. (Druid) Tooltip of the original spell doesn't clearly state that this is an absorb, but the buff does.
-- Priest
[62618] = 25, -- Power Word: Barrier
[81781] = 25,
}]]
-- Identified Absorb abilities by spell ID and contains their respective expected durations.
local AbsorbSpellDuration = {
-- Death Knight
[48707] = 5, -- Anti-Magic Shell (DK) Rank 1 -- Does not currently seem to show tracable combat log evnets. It shows energizes which do not reveal the amount of damage absorbed
[51052] = 10, -- Anti-Magic Zone (DK)( Rank 1 (Correct spellID?)
-- Does DK Spell Deflection show absorbs in the CL?
[51271] = 20, -- Unbreakable Armor (DK)
[77535] = 10, -- Blood Shield (DK)
-- Druid
[62606] = 10, -- Savage Defense proc. (Druid) Tooltip of the original spell doesn't clearly state that this is an absorb, but the buff does.
[110570] = 5, -- Anti-Magic Shell (DK swap ability) (may have unverified aura trigger), MOP
-- Mage
[11426] = 60, -- Ice Barrier (Mage) Rank 1
[13031] = 60,
[13032] = 60,
[13033] = 60,
[27134] = 60,
[33405] = 60,
[43038] = 60,
[43039] = 60, -- Rank 8
[6143] = 30, -- Frost Ward (Mage) Rank 1
[8461] = 30,
[8462] = 30,
[10177] = 30,
[28609] = 30,
[32796] = 30,
[43012] = 30, -- Rank 7
[1463] = 60, -- Mana shield (Mage) Rank 1
[8494] = 60,
[8495] = 60,
[10191] = 60,
[10192] = 60,
[10193] = 60,
[27131] = 60,
[43019] = 60,
[43020] = 60, -- Rank 9
[543] = 30 , -- Fire Ward (Mage) Rank 1
[8457] = 30,
[8458] = 30,
[10223] = 30,
[10225] = 30,
[27128] = 30,
[43010] = 30, -- Rank 7
[1463] = 8, -- Incanter's Ward (Mage) (may have unverified aura trigger), MOP
-- Monk
[116849] = 12, -- Life Cocoon (may have unverified aura trigger), MOP
--[123402] = 30, -- Guard (Ox Stance, Brewmaster) (may have unverified aura trigger), MOP
[115295] = 30, -- Guard (Ox Stance, Brewmaster) (may have unverified aura trigger), MOP
[145441] = 15, -- Yu'lons Barrier (Mistweaver 2pc T16), MOP
-- Paladin
[58597] = 6, -- Sacred Shield (Paladin) proc (Fixed, thanks to Julith)
[86273] = 6, -- Illuminated Healing
[88063] = 6, -- Guarded by the Light
[65148] = 5.67, -- Sacred Shield (Paladin) proc, MOP
-- Priest
[17] = 30, -- Power Word: Shield (Priest) Rank 1
[592] = 30,
[600] = 30,
[3747] = 30,
[6065] = 30,
[6066] = 30,
[10898] = 30,
[10899] = 30,
[10900] = 30,
[10901] = 30,
[25217] = 30,
[25218] = 30,
[48065] = 30,
[48066] = 30, -- Rank 14
[47509] = 12, -- Divine Aegis (Priest) Rank 1
[47511] = 12,
[47515] = 12, -- Divine Aegis (Priest) Rank 3 (Some of these are not actual buff spellIDs)
[47753] = 12, -- Divine Aegis (Priest) Rank 1
[54704] = 12, -- Divine Aegis (Priest) Rank 1
[47788] = 10, -- Guardian Spirit (Priest) (50 nominal absorb, this may not show in the CL)
[62618] = 25, -- Power Word: Barrier (Priest)
[81781] = 25,
[109964] = 15, -- Spirit Shell (Priest) base. MOP
[114908] = 15, -- Spirit Shell (Priest) proc, MOP
[114214] = 20, -- Angelic Bulwark (Priest) proc, MOP
[152118] = 20, -- Clarity of Will (Priest) talent, WOD
-- Shaman
--[108270] = 30, -- Stone Bulwark Totem (confirmed to be base spell, not aura), MOP
[114893] = 30, -- Stone Bulwark Totem Aura (confirmed), MOP
[145379] = 15, -- Nature's Barrier, Shaman T16 Restoration 2P Bonus, 5.4
-- Warlock
[7812] = 30, -- Sacrifice (warlock) Rank 1
[19438] = 30,
[19440] = 30,
[19441] = 30,
[19442] = 30,
[19443] = 30,
[27273] = 30,
[47985] = 30,
[47986] = 30, -- rank 9
[6229] = 30, -- Shadow Ward (warlock) Rank 1
[11739] = 30,
[11740] = 30,
[28610] = 30,
[47890] = 30,
[47891] = 30, -- Rank 6
[6229] = 30, -- Twilight Ward (partially confirmed), MOP
[110913] = 10, -- Dark Bargain (partially confirmed, may not be an absorb), MOP
[91711] = 30, -- Nether Ward (may have unverified aura trigger), MOP
[108366] = 20, -- Soul Leech
[108416] = 20, -- Sacrificial Pact
[131623] = 30, -- Twilight Ward
-- Warrior
[112048] = 6, -- Shield Barrier (confirmed), MOP
-- Enchants
[116631] = 10, -- Enchant Weapon - Colossus (Aura proc, unconfirmed), MOP
-- Consumables
[29674] = 86400, -- Lesser Ward of Shielding
[29719] = 86400, -- Greater Ward of Shielding (these have infinite duration, set for a day here :P)
[29701] = 86400,
[28538] = 120, -- Major Holy Protection Potion
[28537] = 120, -- Major Shadow
[28536] = 120, -- Major Arcane
[28513] = 120, -- Major Nature
[28512] = 120, -- Major Frost
[28511] = 120, -- Major Fire
[7233] = 120, -- Fire
[7239] = 120, -- Frost
[7242] = 120, -- Shadow Protection Potion
[7245] = 120, -- Holy
[6052] = 120, -- Nature Protection Potion
[53915] = 120, -- Mighty Shadow Protection Potion
[53914] = 120, -- Mighty Nature Protection Potion
[53913] = 120, -- Mighty Frost Protection Potion
[53911] = 120, -- Mighty Fire
[53910] = 120, -- Mighty Arcane
[17548] = 120, -- Greater Shadow
[17546] = 120, -- Greater Nature
[17545] = 120, -- Greater Holy
[17544] = 120, -- Greater Frost
[17543] = 120, -- Greater Fire
[17549] = 120, -- Greater Arcane
[28527] = 15, -- Fel Blossom
[29432] = 3600, -- Frozen Rune usage (Naxx classic)
-- Item usage
[36481] = 4, -- Arcane Barrier (TK Kael'Thas) Shield
[57350] = 6, -- Darkmoon Card: Illusion
[17252] = 30, -- Mark of the Dragon Lord (LBRS epic ring) usage
[25750] = 15, -- Defiler's Talisman/Talisman of Arathor Rank 1
[25747] = 15,
[25746] = 15,
[23991] = 15,
[31000] = 300, -- Pendant of Shadow's End Usage
[30997] = 300, -- Pendant of Frozen Flame Usage
[31002] = 300, -- Pendant of the Null Rune
[30999] = 300, -- Pendant of Withering
[30994] = 300, -- Pendant of Thawing
[31000] = 300, --
[23506] = 20, -- Arena Grand Master Usage (Aura of Protection)
[12561] = 60, -- Goblin Construction Helmet usage
[31771] = 20, -- Runed Fungalcap usage
[21956] = 10, -- Mark of Resolution usage
[29506] = 20, -- The Burrower's Shell
[4057] = 60, -- Flame Deflector
[4077] = 60, -- Ice Deflector
[39228] = 20, -- Argussian Compass (may not be an actual absorb)
-- Item procs
[27779] = 30, -- Divine Protection - Priest dungeon set 1/2 Proc
[11657] = 20, -- Jang'thraze (Zul Farrak) proc
[10368] = 15, -- Uther's Strength proc
[37515] = 15, -- Warbringer Armor Proc
[42137] = 86400, -- Greater Rune of Warding Proc
[26467] = 30, -- Scarab Brooch proc
[27539] = 6, -- Thick Obsidian Breatplate proc
[28810] = 30, -- Faith Set Proc Armor of Faith
[54808] = 12, -- Noise Machine proc Sonic Shield
[55019] = 12, -- Sonic Shield (one of these too ought to be wrong)
[64411] = 15, -- Blessing of the Ancient (Val'anyr Hammer of Ancient Kings equip effect)
[64413] = 8, -- Val'anyr, Hammer of Ancient Kings proc Protection of Ancient Kings
[105909] = 6, -- Shield of Fury (Warrior T13 Protection 2P Bonus)
[105801] = 6, -- Delayed Judgement (Paladin T13 Protection 2P Bonus)
[140380] = 15, -- Shield of Hydra Sputum
-- Misc
[40322] = 30, -- Teron's Vengeful Spirit Ghost - Spirit Shield
-- Boss abilities
[65874] = 15, -- Twin Val'kyr's Shield of Darkness 175000
[67257] = 15, -- 300000
[67256] = 15, -- 700000
[67258] = 15, -- 1200000
[65858] = 15, -- Twin Val'kyr's Shield of Lights 175000
[67260] = 15, -- 300000
[67259] = 15, -- 700000
[67261] = 15, -- 1200000
}
local bossIDs = BossIDs.BossIDs
function Recount.IsBoss(GUID)
return GUID and bossIDs[Recount:NPCID(GUID)]
end
-- Base Events: SWING‚ These events relate to melee swings, commonly called‚ White Damage. RANGE‚ These events relate to hunters shooting their bow or a warlock shooting their wand. SPELL‚ These events relate to spells and abilities. SPELL_CAST‚ These events relate to spells starting and failing. SPELL_AURA‚ These events relate to buffs and debuffs. SPELL_PERIODIC‚ These events relate to HoT, DoTs and similar effects. DAMAGE_SHIELD‚ These events relate to damage shields, such as Thorns ENCHANT‚ These events relate to temporary and permanent item buffs. ENVIRONMENTAL‚ This is any damage done by the world. Fires, Lava, Falling, etc.
-- Suffixes: _DAMAGE‚ If the event resulted in damage, here it is. _MISSED - If the event resulted in failure, such as missing, resisting or being blocked. _HEAL‚ If the event resulted in a heal. _ENERGIZE‚ If the event resulted in a power restoration. _LEECH‚ If the event transferred health or power. _DRAIN‚ If the event reduces power, but did not transfer it.
-- Special Events: PARTY_KILL‚ Fired when you or a party member kills something. UNIT_DIED‚ Fired when any nearby unit dies.
local SPELLSCHOOL_PHYSICAL = 1
local SPELLSCHOOL_HOLY = 2
local SPELLSCHOOL_FIRE = 4
local SPELLSCHOOL_NATURE = 8
local SPELLSCHOOL_NATUREFIRE = SPELLSCHOOL_FIRE + SPELLSCHOOL_NATURE
local SPELLSCHOOL_FROST = 16
local SPELLSCHOOL_FROSTFIRE = SPELLSCHOOL_FIRE + SPELLSCHOOL_FROST
local SPELLSCHOOL_SHADOW = 32
local SPELLSCHOOL_ARCANE = 64
Recount.SpellSchoolName = {
[SPELLSCHOOL_PHYSICAL] = "Physical", -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
[SPELLSCHOOL_HOLY] = "Holy", -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
[SPELLSCHOOL_FIRE] = "Fire", -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
[SPELLSCHOOL_NATURE] = "Nature", -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
[SPELLSCHOOL_NATUREFIRE] = "Naturefire", -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
[SPELLSCHOOL_FROST] = "Frost", -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
[SPELLSCHOOL_FROSTFIRE] = "Frostfire", -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
[SPELLSCHOOL_SHADOW] = "Shadow", -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
[SPELLSCHOOL_ARCANE] = "Arcane", -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
}
function Recount:MatchGUID(nName, nGUID, nFlags)
if not Recount.PlayerName or not Recount.PlayerGUID then
if nFlags and bit_band(nFlags, LIB_FILTER_ME) == LIB_FILTER_ME then
Recount.PlayerName = nName
Recount.PlayerGUID = nGUID
return
end
end
--[[if bit_band(nFlags, LIB_FILTER_MY_PET) == LIB_FILTER_MY_PET then
if not Recount.PlayerPet or not Recount.PlayerPetGUID or nGUID ~= Recount.PlayerPetGUID then
--Recount:Print("NewPet detected: "..nName.." "..nGUID.."("..(Recount.PlayerPetGUID or "nil")..")")
Recount.PlayerPetGUID = nGUID
if Recount.PlayerPet ~= nName then
Recount.PlayerPet = nName
end
return
end
end]]
end
-- Biffur: Keep track of active shields on each target
--local AllShields = {}
--local last_timestamp
-- This is needed only for abilities that do not offer absorb values through SPELL_AURA_*
-- It involves a guessing heuristic
--[=[function Recount:AddGuessedAbsorbData(source, victim, ability, element, hittype, damage, resist, srcGUID, srcFlags, dstGUID, dstFlags, spellId, blocked, absorbed, timestamp)
local shieldref = AllShields[victim]
local currenttime = timestamp
local mintime = 900000
local minspell
local minsrc
if not shieldref then
return
end
for k, v in pairs(shieldref) do
if GuessAbsorbSpells[k] then
for k2, v2 in pairs(v) do
if v2 - currenttime < mintime then
if v2 - currenttime < -1.0 then
shieldref[k][k2] = nil
--Recount:DPrint("Removing old "..k.." "..k2.." on "..victim)
else
mintime = v2 - currenttime
minsrc = k2
minspell = k
end
end
--Recount:DPrint(k2.." "..v2.." "..currenttime.." "..v2-currenttime)
end
end
end
if not minsrc then
--Recount:DPrint("Failed to find a minsource for absorb on "..victim.." "..absorbed)
else
local damagesrc = source
local spellName = GetSpellInfo(minspell)
local source = minsrc
--Recount:DPrint("Guessing that the absorb goes to "..minsrc.." having used spell "..minspell ..":"..absorbed)
if not Recount.db2.combatants[source] then
--Recount:DPrint("No source combatant!")
else
local sourceData = Recount.db2.combatants[source]
Recount:AddAmount(sourceData, "Absorbs", absorbed)
Recount:AddTableDataStats(sourceData, "Absorbed", spellName, victim, absorbed)
--Recount:AddTableDataStats(sourceData, "ShieldDamagedBy", damagesrc, spellName, absorbed)
if Recount.db.profile.MergeAbsorbs then -- Elsia: This cannot be unsplit, but it saves memory.
Recount:AddTableDataStats(sourceData, "Heals", spellName, "Absorb", absorbed)
Recount:AddTableDataSum(sourceData, "HealedWho", victim, spellName, absorbed)
end
end
end
end]=]
function Recount:SwingDamage(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing, isOffHand)
Recount:SpellDamage(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, 0, L["Melee"], SPELLSCHOOL_PHYSICAL, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing, isOffHand)
end
function Recount:SpellBuildingDamage(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing, isOffHand)
Recount:SpellDamage(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing, isOffHand)
end
function Recount:SpellBuildingHeal(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, amount, overheal, critical)
-- Ignoring these for now
end
function Recount:SpellDamage(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing, isOffHand)
-- Prismatic Crystal
if string_match(dstGUID, "^Creature%-0%-%d+%-%d+%-%d+%-76933%-%w+$") then
return
end
-- Soul Effigy
if string_match(dstGUID, "^Creature%-0%-%d+%-%d+%-%d+%-103679%-%w+$") then
return
end
--amount = amount - overkill -- Taking out overdamage on killing blows
local HitType = "Hit" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
local isDot
if eventtype == "SPELL_PERIODIC_DAMAGE" then
HitType = "Tick" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
spellName = spellName .." ("..L["DoT"]..")"
isDot = true
end
if critical then
HitType = "Crit" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
end
if eventtype == "DAMAGE_SPLIT" then
HitType = "Split" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
end
if crushing then
HitType = "Crushing" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
end
if glancing then
HitType = "Glancing" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
end
--[[if multistrike and critical then
HitType = "Multistrike (Crit)"
elseif multistrike and not critical then
HitType = "Multistrike"
end]]
--[[if blocked then
HitType = "Block"
end
if absorbed then
HitType = "Absorbed"
end]]
if eventtype == "RANGE_DAMAGE" then
spellSchool = school
end
if absorbed then
if Recount.db.profile.MergeDamageAbsorbs then
if spellId == 0 then
Recount:AddDamageData(srcName, dstName, L["Melee"], SPELLSCHOOL_PHYSICAL, "Absorb", absorbed, nil, srcGUID, srcFlags, dstGUID, dstFlags, spellId, nil, nil)
else
Recount:AddDamageData(srcName, dstName, spellName, Recount.SpellSchoolName[spellSchool], "Absorb", absorbed, nil, srcGUID, srcFlags, dstGUID, dstFlags, spellId, nil, nil)
end
end
end
Recount:AddDamageData(srcName, dstName, spellName, Recount.SpellSchoolName[spellSchool], HitType, amount, resisted, srcGUID, srcFlags, dstGUID, dstFlags, spellId, blocked, absorbed, isDot)
end
function Recount:EnvironmentalDamage(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, enviromentalType, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing)
local HitType = "Hit" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
if critical then
HitType = "Crit" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
end
if crushing then
HitType = "Crushing" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
end
if glancing then
HitType = "Glancing" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
end
--[[if blocked then
HitType = "Block"
end
if absorbed then
HitType = "Absorbed"
end]]
if absorbed then
if Recount.db.profile.MergeDamageAbsorbs then
Recount:AddDamageData("Environment", dstName, Recount:FixCaps(enviromentalType), Recount.SpellSchoolName[school], "Absorb", absorbed, resisted, srcGUID, 0, dstGUID, dstFlags, nil, nil, nil)
end
end
Recount:AddDamageData("Environment", dstName, Recount:FixCaps(enviromentalType), Recount.SpellSchoolName[school], HitType, amount, resisted, srcGUID, 0, dstGUID, dstFlags, nil, blocked, absorbed)
end
function Recount:FixCaps(capsstr)
if type(capsstr) == "string" then
return string_upper(string_sub(capsstr, 1, 1))..string_lower(string_sub(capsstr, 2))
else
return nil
end
end
function Recount:SwingMissed(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, missType, isOffHand, amountMissed)
local blocked
local absorbed
local spellId = L["Melee"]
if missType == "ABSORB" then
absorbed = amountMissed
elseif missType == "BLOCK" then
blocked = amountMissed
end
if Recount.db.profile.MergeDamageAbsorbs then
if IgnoreAuras[srcGUID] then
absorbed = nil
end
Recount:AddDamageData(srcName, dstName, L["Melee"], SPELLSCHOOL_PHYSICAL, Recount:FixCaps(missType), absorbed, nil, srcGUID, srcFlags, dstGUID, dstFlags, spellId, blocked, absorbed)
else
Recount:AddDamageData(srcName, dstName, L["Melee"], SPELLSCHOOL_PHYSICAL, Recount:FixCaps(missType), nil, nil, srcGUID, srcFlags, dstGUID, dstFlags, spellId, blocked, absorbed)
end
end
function Recount:SpellMissed(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, missType, isOffHand, amountMissed)
local blocked
local absorbed
if missType == "ABSORB" then
absorbed = amountMissed
elseif missType == "BLOCK" then
blocked = amountMissed
end
local isDot
if eventtype == "SPELL_PERIODIC_MISSED" then
spellName = spellName .." ("..L["DoT"]..")"
isDot = true
end
if Recount.db.profile.MergeDamageAbsorbs then
if IgnoreAuras[srcGUID] then
absorbed = nil
end
Recount:AddDamageData(srcName, dstName, spellName, Recount.SpellSchoolName[spellSchool], Recount:FixCaps(missType), absorbed, nil, srcGUID, srcFlags, dstGUID, dstFlags, spellId, blocked, absorbed, isDot)
else
Recount:AddDamageData(srcName, dstName, spellName, Recount.SpellSchoolName[spellSchool], Recount:FixCaps(missType), nil, nil, srcGUID, srcFlags, dstGUID, dstFlags, spellId, blocked, absorbed, isDot)
end
end
function Recount:SpellHeal(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, amount, overheal, absorbed, critical)
local healtype = "Hit" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
local isHot
if eventtype == "SPELL_PERIODIC_HEAL" then
healtype = "Tick" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
isHot = true
-- Not activated yet: spellName = spellName.." ("..L["HoT"]..")"
end
if absorbed == 1 and not critical then -- 3.1 to 3.2 combatibility
critical = absorbed
absorbed = nil
end
if critical then
healtype = "Crit" -- Elsia: Do NOT localize this, it breaks functionality!!! If you need this localized contact me on WowAce or Curse.
end
--[[if multistrike and critical then
healtype = "Multistrike (Crit)"
elseif multistrike and not critical then
healtype = "Multistrike"
end]]
Recount:AddHealData(srcName, dstName, spellName, healtype, amount, overheal, srcGUID, srcFlags, dstGUID, dstFlags, spellId, isHot, absorbed) -- Elsia: Overheal missing!!!
end
local extraattacks
function Recount:SpellExtraAttacks(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, amount)
--[[source = Recount.curr_srcName
victim = Recount.curr_dstName
local healtype="Hit"
Recount:Print(Recount.curr_type.." "..spellName.." "..amount)
Recount:AddDamageData(source, victim, spellName, Recount.SpellSchoolName[spellSchool], HitType, amount)]]
-- Elsia: Don't have use for extra attacks currently, amount is number of extra attacks it seems from combat log traces.
extraattacks = extraattacks or {}
if extraattacks[srcName] then
--Recount:DPrint("Double proc: "..spellName.." "..extraattacks[srcName].spellName)
else
extraattacks[srcName] = {}
extraattacks[srcName].spellName = spellName
extraattacks[srcName].amount = amount
extraattacks[srcName].proctime = GetTime()
--Recount:DPrint("Proc: "..spellName.." "..extraattacks[srcName].spellName)
end
end
function Recount:SpellDrain(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, amount, powerType, extraAmount)
-- Currently unused.
end
function Recount:AddAbsorbCredit(source, victim, spellName, spellId, absorbed)
if not source or not Recount.db2.combatants[source] then
--Recount:DPrint("No source combatant with absorb! "..spellName.." "..spellId)
else
--Recount:DPrint("Absorb goes to "..source.." having used spell "..spellName.."("..spellId..")" ..":"..absorbed)
local sourceData = Recount.db2.combatants[source]
Recount:AddAmount(sourceData, "Absorbs", absorbed)
Recount:AddTableDataStats(sourceData, "Absorbed", spellName, victim, absorbed)
if Recount.db.profile.MergeAbsorbs then -- Elsia: This cannot be unsplit, but it saves memory.
Recount:AddTableDataStats(sourceData, "Heals", spellName, "Absorb", absorbed)
Recount:AddTableDataSum(sourceData, "HealedWho", victim, spellName, absorbed)
local victimData = Recount.db2.combatants[victim]
if Recount.db.profile.Modules.HealingTaken then
Recount:AddAmount(victimData, "HealingTaken", absorbed)
--Recount:AddTableDataStats(victimData, "HealingTaken", spellName, "Absorb", absorbed)
end
Recount:AddTableDataSum(victimData, "WhoHealed", source, spellName, absorbed)
end
end
end
local frame = CreateFrame("Frame")
local function IgnoreAurasUpdate(self, elapsed)
self.time = (self.time or 0) + elapsed
if self.time > 0.2 then
local num = 0
for k, v in pairs(IgnoreAuras) do
if v + 10 < GetTime() then
v = nil
else
num = num + 1
end
end
if num == 0 then
frame:SetScript("OnUpdate", nil)
end
self.time = 0
end
end
function Recount:SpellAuraApplied(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, auraType, amount)
-- Spirit Shift
if spellId == 184293 then
IgnoreAuras[srcGUID] = GetTime()
local script = frame:GetScript("OnUpdate")
if not script then
frame:SetScript("OnUpdate", IgnoreAurasUpdate)
end
end
if AbsorbSpellDuration[spellId] then
if Recount.db2.combatants[srcName] then
local sourceData = Recount.db2.combatants[srcName]
Recount:AddTableDataSum(sourceData, "ShieldedWho", dstName, spellName, 1)
end
end
-- Is this an absorb effect?
--[=[if AbsorbSpellDuration[spellId] then
--Recount:DPrint("Absorb Aura: "..spellName.." "..spellId)
-- Yes? Add shield
AllShields[dstName] = AllShields[dstName] or {}
--Recount:DPrint("Assigning active " .. spellName .." on " .. dstName .." cast by " ..srcName)
AllShields[dstName][spellId] = AllShields[dstName][spellId] or {}
--[[if AllShields[dstName][spellId][srcName] then
Recount:DPrint("Valid shield is being rewritten without having been removed first: "..srcName.." "..dstName.." "..spellName)
end]]
AllShields[dstName][spellId][srcName] = {}
if amount then -- Not guessed!!
AllShields[dstName][spellId][srcName] = amount -- Store actual shield amount
else
--[[if not GuessAbsorbSpells[spellId] then -- Find unknown spellIds
Recount:DPrint("Unknown absorb spell without trackability *PLEASE REPORT*: ".. spellName.. " "..spellId)
end]]
AllShields[dstName][spellId][srcName] = timestamp + AbsorbSpellDuration[spellId] -- Store duration for guessing
end
if not Recount.db2.combatants[srcName] then
--Recount:DPrint("No source combatant!")
else
local sourceData = Recount.db2.combatants[srcName]
Recount:AddTableDataSum(sourceData, "ShieldedWho", dstName, spellName, 1)
end
--[[else
Recount:DPrint("Aura Applied: "..spellName.." "..spellId)]]
end]=]
end
function Recount:SpellAuraRefresh(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, auraType, amount)
if AbsorbSpellDuration[spellId] then
if Recount.db2.combatants[srcName] then
local sourceData = Recount.db2.combatants[srcName]
Recount:AddTableDataSum(sourceData, "ShieldedWho", dstName, spellName, 1)
end
end
--[=[if AbsorbSpellDuration[spellId] and amount then
-- Yes? Update shield if it is tracked
if AllShields[dstName] and AllShields[dstName][spellId] and AllShields[dstName][spellId][srcName] then
--Recount:DPrint("Updating " .. spellName .." from " .. dstName .. " at time ".. timestamp .. " old stamp was "..AllShields[dstName][spellId][srcName].." "..amount)
--[[if AllShields[dstName][spellId][srcName].expiration < timestamp then
Recount:DPrint("EXPIRED REFRESH FOUND!")
end]]
local absorb = AllShields[dstName][spellId][srcName] - amount
AllShields[dstName][spellId][srcName] = amount
if absorb > 0 then
absorb = math.floor(absorb + 0.5) -- Bandaid for weird rounding issues
--Recount:AddAbsorbCredit(srcName, dstName, spellName, spellId, absorb)
end
else
--Recount:DPrint("ORPHAN REFRESH FOUND! Rescuing")
Recount:SpellAuraApplied(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, auraType, amount)
end
elseif GuessAbsorbSpells[spellId] then
--Recount:DPrint("Refreshing shield: "..spellName.." on "..dstName)
-- Yes? Add shield
AllShields[dstName] = AllShields[dstName] or {}
AllShields[dstName][spellId] = AllShields[dstName][spellId] or {}
AllShields[dstName][spellId][srcName] = {}
AllShields[dstName][spellId][srcName] = timestamp + AbsorbSpellDuration[spellId] -- Store duration for guessing
if not Recount.db2.combatants[srcName] then
--Recount:DPrint("No source combatant!")
else
local sourceData = Recount.db2.combatants[srcName]
Recount:AddTableDataSum(sourceData, "ShieldedWho", dstName, spellName, 1)
end
end]=]
end
--[=[function Recount:RemoveShield(args)
local dstName, spellId, srcName = unpack(args)
--Recount:DPrint("Removing "..dstName.." "..spellId.." "..srcName)
AllShields[dstName][spellId][srcName] = nil
end]=]
function Recount:SpellAuraRemoved(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, auraType, amount)
if spellId == 184293 then
IgnoreAuras[srcGUID] = nil
end
-- Spirit of Redemption and Shadow of Death handling
--[[if spellId == 54223 or spellId == 27827 then
Recount:HandleDoubleDeath(srcName, dstName, spellName, srcGUID, srcFlags, dstGUID, dstFlags, spellId)
-- Is this an absorb effect?
else]]
--[=[if AbsorbSpellDuration[spellId] then
-- Yes? Lets remove it if it was tracked
if AllShields[dstName] and AllShields[dstName][spellId] and AllShields[dstName][spellId][srcName] then
if amount then
--Recount:DPrint("B1: "..spellName.." "..amount)
local absorb = AllShields[dstName][spellId][srcName] - amount
if absorb > 0 then
absorb = math.floor(absorb + 0.5) -- Bandaid for weird rounding issues
--Recount:AddAbsorbCredit(srcName, dstName, spellName, spellId, absorb)
end
AllShields[dstName][spellId][srcName] = 0
else
--Recount:DPrint("B2")
-- Unfortunately last absorbs of a shield can show after the aura is removed in the combat log which is why we have to do the below, unfortunately
-- Luckily we only need to do this for guessed absorbs
local packagedargs = {dstName, spellId, srcName}
Recount:ScheduleTimer("RemoveShield", 0.2, packagedargs)
end
--[[else
Recount:DPrint("Shield "..spellName.." was removed on target "..dstName.." but wasn't detected as applied")]]
end
end]=]
end
function Recount:SpellAuraAppliedRemovedDose(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, auraType, amount)
-- Not sure yet how to handle this
end
function Recount:SpellCastStartSuccess(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool)
if eventtype == "SPELL_INSTAKILL" then
--Recount:Print(Recount.curr_type .." "..source.." "..victim)
Recount:AddDeathData(srcName, dstName, nil, srcGUID, srcFlags, dstGUID, dstFlags, spellId)
end
end
-- Note: GetSpellLink(id) gets spell name from ID.
-- GetSpellInfo(id)
function Recount:SpellCastFailed(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, failedType)
-- Not sure yet how to handle this, are these interrupts?
end
function Recount:EnchantAppliedRemoved(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellName, itemId, itemName)
-- Not sure yet how to handle this,
end
function Recount:PartyKill(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags)
--Recount:AddDeathData(srcName , dstName, nil, srcGUID, srcFlags, dstGUID, dstFlags, nil)
-- Could be killing blow tracker
end
function Recount:UnitDied(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags)
Recount:AddDeathData(nil , dstName, nil, srcGUID, srcFlags, dstGUID, dstFlags, nil)
end
function Recount:SpellSummon(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags)
Recount:AddPetCombatant(dstGUID, dstName, dstFlags, srcGUID, srcName, srcFlags)
end
function Recount:SpellCreate(timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool)
-- Elsia: We do nothing for these yet.
end
function Recount:SpellAbsorbed(...)
local _, _, _, _, _, _, _, _, srcSpellId = ...
if type(srcSpellId) == "number" then
local timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, srcSpellId, srcSpellName, srcSpellSchool, casterGUID, casterName, casterFlags, casterRaidFlags, spellId, spellName, spellSchool, absorbed = ...
-- Spirit of Redemption, Stance of the Sturdy Ox, Purgatory, Spirit Shift
if spellId == 20711 or spellId == 115069 or spellId == 114556 or spellId == 184553 then
return
end
local caster, casterowner, casterownerID = Recount:DetectPet(casterName, casterGUID, casterFlags)
if casterowner then
casterName = casterowner
end
local sourceData = dbCombatants[casterName]
Recount:AddTimeEvent(sourceData, dstName, spellName, true)
Recount:AddAbsorbCredit(casterName, dstName, spellName, spellId, absorbed)
else
local timestamp, eventtype, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, casterGUID, casterName, casterFlags, casterRaidFlags, spellId, spellName, spellSchool, absorbed = ...
-- Spirit of Redemption, Stance of the Sturdy Ox, Purgatory, Spirit Shift
if spellId == 20711 or spellId == 115069 or spellId == 114556 or spellId == 184553 then
return
end
local caster, casterowner, casterownerID = Recount:DetectPet(casterName, casterGUID, casterFlags)
if casterowner then
casterName = casterowner
end
local sourceData = dbCombatants[casterName]
Recount:AddTimeEvent(sourceData, dstName, spellName, true)
Recount:AddAbsorbCredit(casterName, dstName, spellName, spellId, absorbed)
end
end
local EventParse = {
["SWING_DAMAGE"] = Recount.SwingDamage, -- Elsia: Melee swing damage
["RANGE_DAMAGE"] = Recount.SpellDamage, -- Elsia: Ranged and spell damage types
["SPELL_DAMAGE"] = Recount.SpellDamage,
["SPELL_PERIODIC_DAMAGE"] = Recount.SpellDamage,
["DAMAGE_SHIELD"] = Recount.SpellDamage,
["DAMAGE_SPLIT"] = Recount.SpellDamage,
["ENVIRONMENTAL_DAMAGE"] = Recount.EnvironmentalDamage, -- Elsia: Environmental damage
["SWING_MISSED"] = Recount.SwingMissed, -- Elsia: Misses
["RANGE_MISSED"] = Recount.SpellMissed,
["SPELL_MISSED"] = Recount.SpellMissed,
["SPELL_PERIODIC_MISSED"] = Recount.SpellMissed,
["DAMAGE_SHIELD_MISSED"] = Recount.SpellMissed,
["SPELL_HEAL"] = Recount.SpellHeal, -- Elsia: heals
["SPELL_PERIODIC_HEAL"] = Recount.SpellHeal,
["SPELL_ENERGIZE"] = Recount.SpellEnergize, -- Elsia: Energize
["SPELL_PERIODIC_ENERGIZE"] = Recount.SpellEnergize,
["SPELL_EXTRA_ATTACKS"] = Recount.SpellExtraAttacks, -- Elsia: Extra attacks
["SPELL_INTERRUPT"] = Recount.SpellInterrupt, -- Elsia: Interrupts
["SPELL_DRAIN"] = Recount.SpellDrain, -- Elsia: Drains and leeches.
["SPELL_LEECH"] = Recount.SpellLeech,
["SPELL_PERIODIC_DRAIN"] = Recount.SpellDrain,
["SPELL_PERIODIC_LEECH"] = Recount.SpellLeech,
["SPELL_DISPEL_FAILED"] = Recount.SpellAuraDispelFailed, -- Elsia: Failed dispell
["SPELL_AURA_APPLIED"] = Recount.SpellAuraApplied, -- Elsia: Auras
["SPELL_AURA_REMOVED"] = Recount.SpellAuraRemoved,
["SPELL_AURA_APPLIED_DOSE"] = Recount.SpellAuraAppliedRemovedDose, -- Elsia: Aura doses
["SPELL_AURA_REMOVED_DOSE"] = Recount.SpellAuraAppliedRemovedDose,
["SPELL_CAST_START"] = Recount.SpellCastStartSuccess, -- Elsia: Spell casts
["SPELL_CAST_SUCCESS"] = Recount.SpellCastStartSuccess,
["SPELL_INSTAKILL"] = Recount.SpellCastStartSuccess,