-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDatabase.lua
1331 lines (1229 loc) · 55.9 KB
/
Database.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
---@type string
local addonName = select(1, ...)
---@class AE_Addon
local addon = select(2, ...)
---@class AE_Data
local Data = {}
addon.Data = Data
Data.dbVersion = 19
Data.defaultDB = {
---@type AE_Global
global = {
weeklyReset = 0,
characters = {},
minimap = {
minimapPos = 195,
hide = false,
lock = false,
},
sorting = "lastUpdate",
showTiers = true,
showScores = true,
showAffixColors = true,
showAffixHeader = true,
showZeroRatedCharacters = true,
showRealms = true,
announceKeystones = {
autoParty = true,
autoGuild = false,
multiline = false,
multilineNames = false,
},
announceResets = true,
world = {
enabled = true,
},
raids = {
enabled = true,
colors = true,
currentTierOnly = true,
hiddenDifficulties = {},
boxes = false,
modifiedInstanceOnly = true,
},
interface = {
-- fontSize = 12,
windowScale = 100,
windowColor = {r = 0.11372549019, g = 0.14117647058, b = 0.16470588235, a = 1},
},
useRIOScoreColor = false,
},
}
---@type AE_Character
Data.defaultCharacter = {
GUID = "",
lastUpdate = 0,
currentSeason = 0,
enabled = true,
info = {
name = "",
realm = "",
level = 0,
race = {
name = "",
file = "",
id = 0,
},
class = {
name = "",
file = "",
id = 0,
},
factionGroup = {
english = "",
localized = "",
},
ilvl = {
level = 0,
equipped = 0,
pvp = 0,
color = "ffffffff",
},
},
equipment = {},
currencies = {
-- [1] = {
-- name = string
-- description = string
-- isHeader = boolean
-- isHeaderExpanded = boolean
-- isTypeUnused = boolean
-- isShowInBackpack = boolean
-- quantity = number
-- trackedQuantity = number
-- iconFileID = number
-- maxQuantity = number
-- canEarnPerWeek = boolean
-- quantityEarnedThisWeek = number
-- isTradeable = boolean
-- quality = Enum
-- maxWeeklyQuantity = number
-- totalEarned = number
-- discovered = boolean
-- useTotalEarnedForMaxQty = boolean
-- }
},
raids = {
savedInstances = {
-- [1] = {
-- ["id"] = 0,
-- ["name"] = "",
-- ["lockoutId"] = 0,
-- ["reset"] = 0,
-- ["difficultyID"] = 0,
-- ["locked"] = false,
-- ["extended"] = false,
-- ["instanceIDMostSig"] = 0,
-- ["isRaid"] = true,
-- ["maxPlayers"] = 0,
-- ["difficultyName"] = "",
-- ["numEncounters"] = 0,
-- ["encounterProgress"] = 0,
-- ["extendDisabled"] = false,
-- ["instanceID"] = 0,
-- ["link"] = "",
-- ["expires"] = 0,
-- ["encounters"] = {
-- [1] = {
-- ["instanceEncounterID"] = 0,
-- ["bossName"] = "",
-- ["fileDataID"] = 0,
-- ["killed"] = false
-- }
-- }
-- }
},
},
mythicplus = { -- Mythic Plus
numCompletedDungeonRuns = {
-- heroic = 0,
-- mythic = 0,
-- mythicPlus = 0
},
rating = 0,
keystone = {
challengeModeID = 0,
mapId = 0,
level = 0,
color = "",
itemId = 0,
itemLink = "",
},
weeklyRewardAvailable = false,
bestSeasonScore = 0,
bestSeasonNumber = 0,
runHistory = {},
dungeons = {
-- [1] = {
-- rating = 0,
-- level = 0,
-- finishedSuccess = false,
-- bestTimedRun = {
-- ["durationSec"] = 0,
-- ["completionDate"] = {
-- ["year"] = 0,
-- ["month"] = 0,
-- ["minute"] = 0,
-- ["hour"] = 0,
-- ["day"] = 0,
-- },
-- ["affixIDs"] = {
-- 0, 0, 0
-- },
-- ["level"] = 0,
-- ["members"] = {
-- {
-- ["specID"] = 0,
-- ["name"] = "",
-- ["classID"] = 0,
-- }
-- }
-- },
-- bestNotTimedRun = {},
-- affixScores = {
-- [1] = {
-- ["name"] = "Tyrannical",
-- ["overTime"] = false,
-- ["level"] = 0,
-- ["durationSec"] = 0,
-- ["score"] = 0,
-- },
-- [2] = {
-- ["name"] = "Fortified",
-- ["overTime"] = false,
-- ["level"] = 0,
-- ["durationSec"] = 0,
-- ["score"] = 0,
-- },
-- }
-- }
},
},
-- pvp = {},
vault = {
hasAvailableRewards = false,
slots = {
-- [1] = {
-- ["threshold"] = 0,
-- ["type"] = 0,
-- ["index"] = 0,
-- ["rewards"] = {},
-- ["progress"] = 0,
-- ["level"] = 0,
-- ["raidString"] = "",
-- ["id"] = 0,
-- ["exampleRewardLink"] = ""
-- ["exampleRewardUpgradeLink"] = ""
-- },
},
},
}
---@type AE_Inventory[]
Data.inventory = {
{id = INVSLOT_HEAD, name = "HEADSLOT"},
{id = INVSLOT_NECK, name = "NECKSLOT"},
{id = INVSLOT_SHOULDER, name = "SHOULDERSLOT"},
{id = INVSLOT_BACK, name = "BACKSLOT"},
{id = INVSLOT_CHEST, name = "CHESTSLOT"},
{id = INVSLOT_WRIST, name = "WRISTSLOT"},
{id = INVSLOT_HAND, name = "HANDSSLOT"},
{id = INVSLOT_WAIST, name = "WAISTSLOT"},
{id = INVSLOT_LEGS, name = "LEGSSLOT"},
{id = INVSLOT_FEET, name = "FEETSLOT"},
{id = INVSLOT_FINGER1, name = "FINGER0SLOT"},
{id = INVSLOT_FINGER2, name = "FINGER1SLOT"},
{id = INVSLOT_TRINKET1, name = "TRINKET0SLOT"},
{id = INVSLOT_TRINKET2, name = "TRINKET1SLOT"},
{id = INVSLOT_MAINHAND, name = "MAINHANDSLOT"},
{id = INVSLOT_OFFHAND, name = "SECONDARYHANDSLOT"},
}
local AFFIX_VOLCANIC = 3
local AFFIX_RAGING = 6
local AFFIX_BOLSTERING = 7
local AFFIX_SANGUINE = 8
local AFFIX_TYRANNICAL = 9
local AFFIX_FORTIFIED = 10
local AFFIX_BURSTING = 11
local AFFIX_SPITEFUL = 123
local AFFIX_STORMING = 124
local AFFIX_ENTANGLING = 134
local AFFIX_AFFLICTED = 135
local AFFIX_INCORPOREAL = 136
local AFFIX_XALATAHS_GUILE = 147
local AFFIX_XALATAHS_BARGAIN_ASCENDANT = 148
local AFFIX_CHALLENGERS_PERIL = 152
local AFFIX_XALATAHS_BARGAIN_VOIDBOUND = 158
local AFFIX_XALATAHS_BARGAIN_OBLIVION = 159
local AFFIX_XALATAHS_BARGAIN_DEVOUR = 160
---@type AE_Affix[]
Data.affixes = {
{id = AFFIX_VOLCANIC, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_RAGING, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_BOLSTERING, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_SANGUINE, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_FORTIFIED, base = 1, name = "", description = "", fileDataID = nil},
{id = AFFIX_TYRANNICAL, base = 1, name = "", description = "", fileDataID = nil},
{id = AFFIX_BURSTING, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_SPITEFUL, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_STORMING, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_ENTANGLING, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_AFFLICTED, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_INCORPOREAL, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_XALATAHS_GUILE, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_XALATAHS_BARGAIN_ASCENDANT, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_CHALLENGERS_PERIL, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_XALATAHS_BARGAIN_VOIDBOUND, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_XALATAHS_BARGAIN_OBLIVION, base = 0, name = "", description = "", fileDataID = nil},
{id = AFFIX_XALATAHS_BARGAIN_DEVOUR, base = 0, name = "", description = "", fileDataID = nil},
}
-- Rotation: https://mythicpl.us
---@type AE_AffixRotation[]
Data.affixRotations = {
{
seasonID = 11,
seasonDisplayID = 3,
activation = {2, 7, 14},
affixes = {
{AFFIX_TYRANNICAL, AFFIX_STORMING, AFFIX_RAGING},
{AFFIX_FORTIFIED, AFFIX_ENTANGLING, AFFIX_BOLSTERING},
{AFFIX_TYRANNICAL, AFFIX_INCORPOREAL, AFFIX_SPITEFUL},
{AFFIX_FORTIFIED, AFFIX_AFFLICTED, AFFIX_RAGING},
{AFFIX_TYRANNICAL, AFFIX_VOLCANIC, AFFIX_SANGUINE},
{AFFIX_FORTIFIED, AFFIX_STORMING, AFFIX_BURSTING},
{AFFIX_TYRANNICAL, AFFIX_AFFLICTED, AFFIX_BOLSTERING},
{AFFIX_FORTIFIED, AFFIX_INCORPOREAL, AFFIX_SANGUINE},
{AFFIX_TYRANNICAL, AFFIX_ENTANGLING, AFFIX_BURSTING},
{AFFIX_FORTIFIED, AFFIX_VOLCANIC, AFFIX_SPITEFUL},
},
},
{
seasonID = 12,
seasonDisplayID = 4,
activation = {2, 5, 10},
affixes = {
{AFFIX_TYRANNICAL, AFFIX_STORMING, AFFIX_RAGING},
{AFFIX_FORTIFIED, AFFIX_ENTANGLING, AFFIX_BOLSTERING},
{AFFIX_TYRANNICAL, AFFIX_INCORPOREAL, AFFIX_SPITEFUL},
{AFFIX_FORTIFIED, AFFIX_AFFLICTED, AFFIX_RAGING},
{AFFIX_TYRANNICAL, AFFIX_VOLCANIC, AFFIX_SANGUINE},
{AFFIX_FORTIFIED, AFFIX_STORMING, AFFIX_BURSTING},
{AFFIX_TYRANNICAL, AFFIX_AFFLICTED, AFFIX_BOLSTERING},
{AFFIX_FORTIFIED, AFFIX_INCORPOREAL, AFFIX_SANGUINE},
{AFFIX_TYRANNICAL, AFFIX_ENTANGLING, AFFIX_BURSTING},
{AFFIX_FORTIFIED, AFFIX_VOLCANIC, AFFIX_SPITEFUL},
},
},
{
seasonID = 13,
seasonDisplayID = 1,
activation = {2, 4, 7, 10, 12},
affixes = {
{AFFIX_XALATAHS_BARGAIN_ASCENDANT, AFFIX_TYRANNICAL, AFFIX_CHALLENGERS_PERIL, AFFIX_FORTIFIED, AFFIX_XALATAHS_GUILE},
{AFFIX_XALATAHS_BARGAIN_OBLIVION, AFFIX_FORTIFIED, AFFIX_CHALLENGERS_PERIL, AFFIX_TYRANNICAL, AFFIX_XALATAHS_GUILE},
{AFFIX_XALATAHS_BARGAIN_VOIDBOUND, AFFIX_TYRANNICAL, AFFIX_CHALLENGERS_PERIL, AFFIX_FORTIFIED, AFFIX_XALATAHS_GUILE},
{AFFIX_XALATAHS_BARGAIN_DEVOUR, AFFIX_FORTIFIED, AFFIX_CHALLENGERS_PERIL, AFFIX_TYRANNICAL, AFFIX_XALATAHS_GUILE},
{AFFIX_XALATAHS_BARGAIN_OBLIVION, AFFIX_TYRANNICAL, AFFIX_CHALLENGERS_PERIL, AFFIX_FORTIFIED, AFFIX_XALATAHS_GUILE},
{AFFIX_XALATAHS_BARGAIN_ASCENDANT, AFFIX_FORTIFIED, AFFIX_CHALLENGERS_PERIL, AFFIX_TYRANNICAL, AFFIX_XALATAHS_GUILE},
{AFFIX_XALATAHS_BARGAIN_DEVOUR, AFFIX_TYRANNICAL, AFFIX_CHALLENGERS_PERIL, AFFIX_FORTIFIED, AFFIX_XALATAHS_GUILE},
{AFFIX_XALATAHS_BARGAIN_VOIDBOUND, AFFIX_FORTIFIED, AFFIX_CHALLENGERS_PERIL, AFFIX_TYRANNICAL, AFFIX_XALATAHS_GUILE},
},
},
}
---@type AE_Keystone[]
Data.keystones = {
{seasonID = 11, seasonDisplayID = 3, itemID = 151086},
{seasonID = 12, seasonDisplayID = 4, itemID = 180653},
{seasonID = 13, seasonDisplayID = 1, itemID = 180653},
}
---@type AE_Dungeon[]
Data.dungeons = {
{seasonID = 10, seasonDisplayID = 2, journalInstanceID = 767, challengeModeID = 206, mapId = 1458, encounters = {}, loot = {}, spellID = 410078, time = 0, abbr = "NL", name = "Neltharion's Lair"},
{seasonID = 10, seasonDisplayID = 2, journalInstanceID = 1001, challengeModeID = 245, mapId = 1754, encounters = {}, loot = {}, spellID = 410071, time = 0, abbr = "FH", name = "Freehold"},
{seasonID = 10, seasonDisplayID = 2, journalInstanceID = 1022, challengeModeID = 251, mapId = 1841, encounters = {}, loot = {}, spellID = 410074, time = 0, abbr = "UNDR", name = "The Underrot"},
{seasonID = 10, seasonDisplayID = 2, journalInstanceID = 1197, challengeModeID = 403, mapId = 2451, encounters = {}, loot = {}, spellID = 393222, time = 0, abbr = "ULD", name = "Uldaman: Legacy of Tyr"},
{seasonID = 10, seasonDisplayID = 2, journalInstanceID = 1199, challengeModeID = 404, mapId = 2519, encounters = {}, loot = {}, spellID = 393276, time = 0, abbr = "NELT", name = "Neltharus"},
{seasonID = 10, seasonDisplayID = 2, journalInstanceID = 1196, challengeModeID = 405, mapId = 2520, encounters = {}, loot = {}, spellID = 393267, time = 0, abbr = "BH", name = "Brackenhide Hollow"},
{seasonID = 10, seasonDisplayID = 2, journalInstanceID = 1204, challengeModeID = 406, mapId = 2527, encounters = {}, loot = {}, spellID = 393283, time = 0, abbr = "HOI", name = "Halls of Infusion"},
{seasonID = 10, seasonDisplayID = 2, journalInstanceID = 68, challengeModeID = 438, mapId = 657, encounters = {}, loot = {}, spellID = 410080, time = 0, abbr = "VP", name = "The Vortex Pinnacle"},
{seasonID = 11, seasonDisplayID = 3, journalInstanceID = 556, challengeModeID = 168, mapId = 1279, encounters = {}, loot = {}, spellID = 159901, time = 0, abbr = "EB", name = "The Everbloom"},
{seasonID = 11, seasonDisplayID = 3, journalInstanceID = 762, challengeModeID = 198, mapId = 1466, encounters = {}, loot = {}, spellID = 424163, time = 0, abbr = "DHT", name = "Darkheart Thicket"},
{seasonID = 11, seasonDisplayID = 3, journalInstanceID = 740, challengeModeID = 199, mapId = 1501, encounters = {}, loot = {}, spellID = 424153, time = 0, abbr = "BRH", name = "Black Rook Hold"},
{seasonID = 11, seasonDisplayID = 3, journalInstanceID = 968, challengeModeID = 244, mapId = 1763, encounters = {}, loot = {}, spellID = 424187, time = 0, abbr = "AD", name = "Atal'Dazar"},
{seasonID = 11, seasonDisplayID = 3, journalInstanceID = 1021, challengeModeID = 248, mapId = 1862, encounters = {}, loot = {}, spellID = 424167, time = 0, abbr = "WM", name = "Waycrest Manor"},
{seasonID = 11, seasonDisplayID = 3, journalInstanceID = 65, challengeModeID = 456, mapId = 643, encounters = {}, loot = {}, spellID = 424142, time = 0, abbr = "TOTT", name = "Throne of the Tides"},
{seasonID = 11, seasonDisplayID = 3, journalInstanceID = 1209, challengeModeID = 463, mapId = 2579, encounters = {}, loot = {}, spellID = 424197, time = 0, abbr = "FALL", name = "Dawn of the Infinite: Galakrond's Fall", short = "DOTI: Galakrond's Fall"},
{seasonID = 11, seasonDisplayID = 3, journalInstanceID = 1209, challengeModeID = 464, mapId = 2579, encounters = {}, loot = {}, spellID = 424197, time = 0, abbr = "RISE", name = "Dawn of the Infinite: Murozond's Rise", short = "DOTI: Murozond's Rise"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1202, challengeModeID = 399, mapId = 2521, encounters = {}, loot = {}, spellID = 393256, time = 0, abbr = "RLP", name = "Ruby Life Pools"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1198, challengeModeID = 400, mapId = 2516, encounters = {}, loot = {}, spellID = 393262, time = 0, abbr = "NO", name = "The Nokhud Offensive"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1203, challengeModeID = 401, mapId = 2515, encounters = {}, loot = {}, spellID = 393279, time = 0, abbr = "AV", name = "The Azure Vault"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1201, challengeModeID = 402, mapId = 2526, encounters = {}, loot = {}, spellID = 393273, time = 0, abbr = "AA", name = "Algeth'ar Academy"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1197, challengeModeID = 403, mapId = 2451, encounters = {}, loot = {}, spellID = 393222, time = 0, abbr = "ULD", name = "Uldaman: Legacy of Tyr"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1199, challengeModeID = 404, mapId = 2519, encounters = {}, loot = {}, spellID = 393276, time = 0, abbr = "NELT", name = "Neltharus"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1196, challengeModeID = 405, mapId = 2520, encounters = {}, loot = {}, spellID = 393267, time = 0, abbr = "BH", name = "Brackenhide Hollow"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1204, challengeModeID = 406, mapId = 2527, encounters = {}, loot = {}, spellID = 393283, time = 0, abbr = "HOI", name = "Halls of Infusion"},
{seasonID = 13, seasonDisplayID = 1, journalInstanceID = 1271, challengeModeID = 503, mapId = 2660, encounters = {}, loot = {}, spellID = 445417, time = 0, abbr = "ARAK", name = "Ara-Kara, City of Echoes"},
{seasonID = 13, seasonDisplayID = 1, journalInstanceID = 1274, challengeModeID = 502, mapId = 2669, encounters = {}, loot = {}, spellID = 445416, time = 0, abbr = "COT", name = "City of Threads"},
{seasonID = 13, seasonDisplayID = 1, journalInstanceID = 71, challengeModeID = 507, mapId = 670, encounters = {}, loot = {}, spellID = 445424, time = 0, abbr = "GB", name = "Grim Batol"},
{seasonID = 13, seasonDisplayID = 1, journalInstanceID = 1184, challengeModeID = 375, mapId = 2290, encounters = {}, loot = {}, spellID = 354464, time = 0, abbr = "MISTS", name = "Mists of Tirna Scithe"},
{seasonID = 13, seasonDisplayID = 1, journalInstanceID = 1023, challengeModeID = 353, mapId = 1822, encounters = {}, loot = {}, spellID = UnitFactionGroup("player") == "Alliance" and 445418 or 464256, time = 0, abbr = "SIEGE", name = "Siege of Boralus"},
{seasonID = 13, seasonDisplayID = 1, journalInstanceID = 1270, challengeModeID = 505, mapId = 2662, encounters = {}, loot = {}, spellID = 445414, time = 0, abbr = "DAWN", name = "The Dawnbreaker"},
{seasonID = 13, seasonDisplayID = 1, journalInstanceID = 1182, challengeModeID = 376, mapId = 2286, encounters = {}, loot = {}, spellID = 354462, time = 0, abbr = "NW", name = "The Necrotic Wake"},
{seasonID = 13, seasonDisplayID = 1, journalInstanceID = 1269, challengeModeID = 501, mapId = 2652, encounters = {}, loot = {}, spellID = 445269, time = 0, abbr = "SV", name = "The Stonevault"},
}
---@type AE_Raid[]
Data.raids = {
{seasonID = 9, seasonDisplayID = 1, journalInstanceID = 1200, instanceID = 2522, order = 1, numEncounters = 8, encounters = {}, loot = {}, modifiedInstanceInfo = nil, abbr = "VOTI", name = "Vault of the Incarnates"},
{seasonID = 10, seasonDisplayID = 2, journalInstanceID = 1208, instanceID = 2569, order = 2, numEncounters = 9, encounters = {}, loot = {}, modifiedInstanceInfo = nil, abbr = "ATSC", name = "Aberrus, the Shadowed Crucible"},
{seasonID = 11, seasonDisplayID = 3, journalInstanceID = 1207, instanceID = 2549, order = 3, numEncounters = 9, encounters = {}, loot = {}, modifiedInstanceInfo = nil, abbr = "ATDH", name = "Amirdrassil, the Dream's Hope"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1200, instanceID = 2522, order = 1, numEncounters = 8, encounters = {}, loot = {}, modifiedInstanceInfo = nil, abbr = "VOTI", name = "Vault of the Incarnates"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1208, instanceID = 2569, order = 2, numEncounters = 9, encounters = {}, loot = {}, modifiedInstanceInfo = nil, abbr = "ATSC", name = "Aberrus, the Shadowed Crucible"},
{seasonID = 12, seasonDisplayID = 4, journalInstanceID = 1207, instanceID = 2549, order = 3, numEncounters = 9, encounters = {}, loot = {}, modifiedInstanceInfo = nil, abbr = "ATDH", name = "Amirdrassil, the Dream's Hope"},
{seasonID = 13, seasonDisplayID = 1, journalInstanceID = 1273, instanceID = 2657, order = 1, numEncounters = 8, encounters = {}, loot = {}, modifiedInstanceInfo = nil, abbr = "NAP", name = "Nerub-ar Palace"},
}
---@type AE_RaidDifficulty[]
Data.raidDifficulties = {
{id = 14, color = RARE_BLUE_COLOR, order = 2, abbr = "N", name = "Normal"},
{id = 15, color = EPIC_PURPLE_COLOR, order = 3, abbr = "H", name = "Heroic"},
{id = 16, color = LEGENDARY_ORANGE_COLOR, order = 4, abbr = "M", name = "Mythic"},
{id = 17, color = UNCOMMON_GREEN_COLOR, order = 1, abbr = "L", name = "Looking For Raid", short = "LFR"},
}
---@type AE_Currency[]
Data.currencies = {
{seasonID = 11, seasonDisplayID = 3, id = 2709, currencyType = "crest"}, -- Aspect
{seasonID = 11, seasonDisplayID = 3, id = 2708, currencyType = "crest"}, -- Wyrm
{seasonID = 11, seasonDisplayID = 3, id = 2707, currencyType = "crest"}, -- Drake
{seasonID = 11, seasonDisplayID = 3, id = 2706, currencyType = "crest"}, -- Whelpling
{seasonID = 11, seasonDisplayID = 3, id = 2245, currencyType = "upgrade"}, -- Flightstones
{seasonID = 11, seasonDisplayID = 3, id = 2796, currencyType = "catalyst"}, -- Catalyst
{seasonID = 12, seasonDisplayID = 4, id = 2812, currencyType = "crest"}, -- Aspect
{seasonID = 12, seasonDisplayID = 4, id = 2809, currencyType = "crest"}, -- Wyrm
{seasonID = 12, seasonDisplayID = 4, id = 2807, currencyType = "crest"}, -- Drake
{seasonID = 12, seasonDisplayID = 4, id = 2806, currencyType = "crest"}, -- Whelpling
{seasonID = 12, seasonDisplayID = 4, id = 2245, currencyType = "upgrade"}, -- Flightstones
{seasonID = 12, seasonDisplayID = 4, id = 2912, currencyType = "catalyst"}, -- Catalyst
{seasonID = 12, seasonDisplayID = 4, id = 3010, currencyType = "dinar", itemID = 213089}, -- Dinar
{seasonID = 13, seasonDisplayID = 1, id = 2914, currencyType = "crest"}, -- Weathered
{seasonID = 13, seasonDisplayID = 1, id = 2915, currencyType = "crest"}, -- Carved
{seasonID = 13, seasonDisplayID = 1, id = 2916, currencyType = "crest"}, -- Runed
{seasonID = 13, seasonDisplayID = 1, id = 2917, currencyType = "crest"}, -- Gilded
{seasonID = 13, seasonDisplayID = 1, id = 3008, currencyType = "upgrade"}, -- Valorstones
{seasonID = 13, seasonDisplayID = 1, id = 2813, currencyType = "catalyst"}, -- Catalyst
{seasonID = 13, seasonDisplayID = 1, id = 3028, currencyType = "delve"}, -- Restored Coffer key
}
Data.cache = {
seasonID = nil,
seasonDisplayID = nil,
---@type MythicPlusKeystoneAffix[]
currentAffixes = {},
classes = {},
specs = {},
}
---Initiate AceDB
function Data:Initialize()
---@class AceDBObject-3.0
---@field global AE_Global
self.db = LibStub("AceDB-3.0"):New(
"AlterEgoDB",
self.defaultDB,
true
)
end
---Get the current Season IDs
---@return number, number
function Data:GetCurrentSeason()
if not self.cache.seasonID or self.cache.seasonID == -1 then
self.cache.seasonID = C_MythicPlus.GetCurrentSeason()
end
if not self.cache.seasonDisplayID or self.cache.seasonDisplayID == -1 then
self.cache.seasonDisplayID = C_MythicPlus.GetCurrentUIDisplaySeason()
end
return self.cache.seasonID or -1, self.cache.seasonDisplayID or -1
end
---Get the currencies of the current season
---@return AE_Currency[]
function Data:GetCurrencies()
local seasonID = self:GetCurrentSeason()
return addon.Utils:TableFilter(self.currencies, function(dataCurrency)
return dataCurrency.seasonID == seasonID
end)
end
---Get stored character by GUID
---@param playerGUID WOWGUID?
---@return AE_Character|nil
function Data:GetCharacter(playerGUID)
if playerGUID == nil then
playerGUID = UnitGUID("player")
end
if playerGUID == nil then
return nil
end
if self.db.global.characters[playerGUID] == nil then
self.db.global.characters[playerGUID] = addon.Utils:TableCopy(Data.defaultCharacter)
end
self.db.global.characters[playerGUID].GUID = playerGUID
return self.db.global.characters[playerGUID]
end
---Get all of the raids in the current season
---@param unfiltered boolean?
---@return AE_RaidDifficulty[]
function Data:GetRaidDifficulties(unfiltered)
local result = {}
for _, difficulty in pairs(self.raidDifficulties) do
table.insert(result, difficulty)
end
table.sort(result, function(a, b)
return a.order < b.order
end)
if unfiltered then
return result
end
local filtered = {}
for _, difficulty in ipairs(result) do
if self.db.global.raids.hiddenDifficulties and not self.db.global.raids.hiddenDifficulties[difficulty.id] then
table.insert(filtered, difficulty)
end
end
return filtered
end
---Get the current affixes of the week
---@return MythicPlusKeystoneAffix[]
function Data:GetCurrentAffixes()
if addon.Utils:TableCount(self.cache.currentAffixes) == 0 then
local currentAffixes = C_MythicPlus.GetCurrentAffixes()
if currentAffixes then
self.cache.currentAffixes = currentAffixes
end
end
return self.cache.currentAffixes
end
---Get either all affixes or just the base seasonal affixes
---@param baseOnly boolean?
---@return AE_Affix[]
function Data:GetAffixes(baseOnly)
return addon.Utils:TableFilter(self.affixes, function(dataAffix)
return not baseOnly or dataAffix.base == 1
end)
end
---Get affix rotation of the season
---@return AE_AffixRotation|nil
function Data:GetAffixRotation()
local seasonID = self:GetCurrentSeason()
return addon.Utils:TableGet(self.affixRotations, "seasonID", seasonID)
end
---Get the index of the active affix week
---TODO: This is hardcoded for 3 affixes only but somehow still works
---@param currentAffixes MythicPlusKeystoneAffix|nil
---@return number
function Data:GetActiveAffixRotation(currentAffixes)
local affixRotation = self:GetAffixRotation()
local index = 0
if currentAffixes and affixRotation then
addon.Utils:TableForEach(affixRotation.affixes, function(affix, i)
if affix[1] == currentAffixes[1].id and affix[2] == currentAffixes[2].id and affix[3] == currentAffixes[3].id then
index = i
end
end)
end
return index
end
---Get the Keystone ItemID of the current season
---@return number|nil
function Data:GetKeystoneItemID()
local seasonID = self:GetCurrentSeason()
local keystone = addon.Utils:TableGet(self.keystones, "seasonID", seasonID)
if keystone ~= nil then
return keystone.itemID
end
return nil
end
---Get all of the M+ dungeons in the current season
---@return AE_Dungeon[]
function Data:GetDungeons()
local seasonID = self:GetCurrentSeason()
local dungeons = addon.Utils:TableFilter(self.dungeons, function(dataDungeon)
return dataDungeon.seasonID == seasonID
end)
table.sort(dungeons, function(a, b)
return strcmputf8i(a.name, b.name) < 0
end)
return dungeons
end
---Get all of the raids in the current season
---@param unfiltered boolean?
---@return AE_Raid[]
function Data:GetRaids(unfiltered)
local seasonID = self:GetCurrentSeason()
local raids = addon.Utils:TableFilter(self.raids, function(dataRaid)
return dataRaid.seasonID == seasonID
end)
table.sort(raids, function(a, b)
return a.order < b.order
end)
if unfiltered then
return raids
end
if self.db.global.raids.modifiedInstanceOnly and seasonID == 12 then
raids = addon.Utils:TableFilter(raids, function(raid)
return raid.modifiedInstanceInfo ~= nil
end)
end
return raids
end
---Get user characters
---@param unfiltered boolean?
---@return AE_Character[]
function Data:GetCharacters(unfiltered)
local characters = {}
for _, character in pairs(self.db.global.characters) do
if character.info.level ~= nil and character.info.level >= 80 then -- Todo later: GetMaxLevelForPlayerExpansion()
table.insert(characters, character)
end
end
-- Sorting
table.sort(characters, function(a, b)
if self.db.global.sorting == "name.asc" then
return strcmputf8i(a.info.name, b.info.name) < 0
elseif self.db.global.sorting == "name.desc" then
return strcmputf8i(a.info.name, b.info.name) > 0
elseif self.db.global.sorting == "realm.asc" then
return strcmputf8i(a.info.realm, b.info.realm) < 0
elseif self.db.global.sorting == "realm.desc" then
return strcmputf8i(a.info.realm, b.info.realm) > 0
elseif self.db.global.sorting == "rating.asc" then
return a.mythicplus.rating < b.mythicplus.rating
elseif self.db.global.sorting == "rating.desc" then
return a.mythicplus.rating > b.mythicplus.rating
elseif self.db.global.sorting == "ilvl.asc" then
return a.info.ilvl.level < b.info.ilvl.level
elseif self.db.global.sorting == "ilvl.desc" then
return a.info.ilvl.level > b.info.ilvl.level
elseif self.db.global.sorting == "class.asc" then
return strcmputf8i(a.info.class.name, b.info.class.name) < 0
elseif self.db.global.sorting == "class.desc" then
return strcmputf8i(a.info.class.name, b.info.class.name) > 0
end
return a.lastUpdate > b.lastUpdate
end)
-- Filters
if unfiltered then
return characters
end
local charactersFiltered = {}
for _, character in ipairs(characters) do
local keep = true
if not character.enabled then
keep = false
end
if self.db.global.showZeroRatedCharacters == false and (character.mythicplus.rating and character.mythicplus.rating <= 0) then
keep = false
end
if keep then
table.insert(charactersFiltered, character)
end
end
return charactersFiltered
end
function Data:UpdateDB()
self:UpdateCharacterInfo()
self:UpdateEquipment()
self:UpdateCurrencies()
self:UpdateKeystoneItem()
self:UpdateRaidInstances()
self:UpdateVault()
self:UpdateMythicPlus()
end
function Data:MigrateDB()
if type(self.db.global.dbVersion) ~= "number" then
self.db.global.dbVersion = self.dbVersion
end
if self.db.global.dbVersion < self.dbVersion then
if self.db.global.dbVersion == 1 then
for characterIndex in pairs(self.db.global.characters) do
self.db.global.characters[characterIndex].raids.killed = nil
if self.db.global.characters[characterIndex].raids.savedInstances then
for savedInstanceIndex, savedInstance in ipairs(self.db.global.characters[characterIndex].raids.savedInstances) do
if savedInstance.instanceID == 2549 and savedInstance.encounters then
self.db.global.characters[characterIndex].raids.savedInstances[savedInstanceIndex].encounters[4].instanceEncounterID = 2731
self.db.global.characters[characterIndex].raids.savedInstances[savedInstanceIndex].encounters[5].instanceEncounterID = 2728
end
end
end
end
end
-- Add missing affix IDs
if self.db.global.dbVersion == 10 then
local affixes = self:GetAffixes()
for characterIndex in pairs(self.db.global.characters) do
local character = self.db.global.characters[characterIndex]
if character.mythicplus.dungeons ~= nil then
addon.Utils:TableForEach(character.mythicplus.dungeons, function(dungeon)
addon.Utils:TableForEach(dungeon.affixScores, function(affixScore)
local affix = addon.Utils:TableGet(affixes, "name", affixScore.name)
if affixScore.id == nil then
affixScore.id = affix and affix.id or 0
end
end)
end)
end
end
end
-- Convert season ID from display ID to season major version ID
if self.db.global.dbVersion == 15 then
for _, character in pairs(self.db.global.characters) do
if character.currentSeason ~= nil and character.currentSeason == 3 then
character.currentSeason = 11
end
end
end
-- Fix SavedInstance/EncounterJournal name mismatch for "Sennarth, t|The Cold Breath"
if self.db.global.dbVersion == 16 then
for _, character in pairs(self.db.global.characters) do
if character.raids and character.raids.savedInstances then
for _, savedInstance in pairs(character.raids.savedInstances) do
if savedInstance.instanceID == 2522 and savedInstance.encounters then
for _, encounter in pairs(savedInstance.encounters) do
if encounter.index and encounter.index == 5 and encounter.instanceEncounterID == 0 then
encounter.instanceEncounterID = 2592
end
end
end
end
end
end
end
self.db.global.dbVersion = self.db.global.dbVersion + 1
self:MigrateDB()
end
end
function Data:TaskWeeklyReset()
if type(self.db.global.weeklyReset) == "number" and self.db.global.weeklyReset <= time() then
addon.Utils:TableForEach(self.db.global.characters, function(character)
if character.currencies ~= nil then
addon.Utils:TableForEach(character.currencies, function(currency)
if currency.currencyType == "crest" and currency.maxQuantity > 0 then
currency.maxQuantity = currency.maxQuantity + 90
end
-- if currency.currencyType == "catalyst" then
-- currency.quantity = math.min(currency.quantity + 1, currency.maxQuantity)
-- end
end)
end
addon.Utils:TableForEach(character.vault.slots, function(slot)
if slot.progress >= slot.threshold then
character.vault.hasAvailableRewards = true
end
end)
addon.Utils:TableForEach(character.mythicplus.runHistory, function(run)
run.thisWeek = false
end)
wipe(character.vault.slots or {})
wipe(character.mythicplus.keystone or {})
wipe(character.mythicplus.numCompletedDungeonRuns or {})
end)
end
self.db.global.weeklyReset = time() + C_DateAndTime.GetSecondsUntilWeeklyReset()
end
function Data:TaskSeasonReset()
local seasonID = self:GetCurrentSeason()
if seasonID then
addon.Utils:TableForEach(self.db.global.characters, function(character)
if character.currentSeason == nil or character.currentSeason < seasonID then
wipe(character.mythicplus.runHistory or {})
wipe(character.mythicplus.dungeons or {})
wipe(character.currencies or {})
character.mythicplus.rating = 0
character.currentSeason = seasonID
end
end)
end
end
function Data:loadGameData()
local seasonID = self:GetCurrentSeason()
for _, raid in pairs(self.raids) do
-- if raid.seasonID == seasonID then
-- EJ_ClearSearch()
-- EJ_ResetLootFilter()
-- EJ_SelectInstance(raid.journalInstanceID)
-- for classID = 1, GetNumClasses() do
-- for specIndex = 1, GetNumSpecializationsForClassID(classID) do
-- local specID = GetSpecializationInfoForClassID(classID, specIndex)
-- if specID then
-- EJ_SetLootFilter(classID, specID)
-- for i = 1, EJ_GetNumLoot() do
-- local lootInfo = C_EncounterJournal.GetLootInfoByIndex(i)
-- if lootInfo.name ~= nil and lootInfo.slot ~= nil and lootInfo.slot ~= "" then
-- local item = raid.loot[lootInfo.itemID]
-- if not item then
-- item = lootInfo
-- item.stats = C_Item.GetItemStats(lootInfo.link)
-- item.classes = {}
-- item.specs = {}
-- raid.loot[lootInfo.itemID] = item
-- end
-- item.classes[classID] = true
-- item.specs[specID] = true
-- -- table.insert(item.classes, classID)
-- -- table.insert(item.specs, specID)
-- -- TODO: Make above arrays unique
-- end
-- end
-- end
-- end
-- end
-- EJ_ResetLootFilter()
-- end
if raid.seasonID == seasonID then
local encounterIndex = 1
EJ_SelectInstance(raid.journalInstanceID)
local _, _, bossID = EJ_GetEncounterInfoByIndex(encounterIndex, raid.journalInstanceID)
while bossID do
local name, description, journalEncounterID, journalEncounterSectionID, journalLink, journalInstanceID, instanceEncounterID, instanceID = EJ_GetEncounterInfoByIndex(encounterIndex, raid.journalInstanceID)
---@type AE_Encounter
local encounter = {
index = encounterIndex,
name = name,
description = description,
journalInstanceID = journalInstanceID,
journalEncounterID = journalEncounterID,
journalEncounterSectionID = journalEncounterSectionID,
journalLink = journalLink,
instanceID = instanceID,
instanceEncounterID = instanceEncounterID,
}
raid.encounters[encounterIndex] = encounter
encounterIndex = encounterIndex + 1
_, _, bossID = EJ_GetEncounterInfoByIndex(encounterIndex, raid.journalInstanceID)
end
raid.modifiedInstanceInfo = C_ModifiedInstance.GetModifiedInstanceInfoFromMapID(raid.instanceID)
end
end
for _, dungeon in pairs(self.dungeons) do
-- if dungeon.seasonID == seasonID then
-- EJ_ClearSearch()
-- EJ_ResetLootFilter()
-- EJ_SelectInstance(dungeon.journalInstanceID)
-- local count = 0
-- for classID = 1, GetNumClasses() do
-- for specIndex = 1, GetNumSpecializationsForClassID(classID) do
-- local specID = GetSpecializationInfoForClassID(classID, specIndex)
-- if specID then
-- EJ_SetLootFilter(classID, specID)
-- for i = 1, EJ_GetNumLoot() do
-- local lootInfo = C_EncounterJournal.GetLootInfoByIndex(i)
-- if lootInfo.name ~= nil and lootInfo.slot ~= nil and lootInfo.slot ~= "" then
-- local item = dungeon.loot[lootInfo.itemID]
-- if not item then
-- item = lootInfo
-- item.stats = C_Item.GetItemStats(lootInfo.link)
-- item.classes = {}
-- item.specs = {}
-- dungeon.loot[lootInfo.itemID] = item
-- count = count + 1
-- end
-- item.classes[classID] = true
-- item.specs[specID] = true
-- -- table.insert(item.classes, classID)
-- -- table.insert(item.specs, specID)
-- -- TODO: Make above arrays unique
-- end
-- end
-- end
-- end
-- end
-- EJ_ResetLootFilter()
-- end
if dungeon.seasonID == seasonID then
-- TODO: Get and store more dungeon data for m+
local dungeonName, _, dungeonTimeLimit, dungeonTexture = C_ChallengeMode.GetMapUIInfo(dungeon.challengeModeID)
dungeon.name = dungeonName
dungeon.time = dungeonTimeLimit
dungeon.texture = dungeon.texture ~= 0 and dungeonTexture or "Interface/Icons/achievement_bg_wineos_underxminutes"
local encounterIndex = 1
EJ_SelectInstance(dungeon.journalInstanceID)
local _, _, bossID = EJ_GetEncounterInfoByIndex(encounterIndex, dungeon.journalInstanceID)
while bossID do
local name, description, journalEncounterID, journalEncounterSectionID, journalLink, journalInstanceID, instanceEncounterID, instanceID = EJ_GetEncounterInfoByIndex(encounterIndex, dungeon.journalInstanceID)
---@type AE_Encounter
local encounter = {
index = encounterIndex,
name = name,
description = description,
journalEncounterID = journalEncounterID,
journalEncounterSectionID = journalEncounterSectionID,
journalLink = journalLink,
journalInstanceID = journalInstanceID,
instanceEncounterID = instanceEncounterID,
instanceID = instanceID,
}
dungeon.encounters[encounterIndex] = encounter
encounterIndex = encounterIndex + 1
_, _, bossID = EJ_GetEncounterInfoByIndex(encounterIndex, dungeon.journalInstanceID)
end
end
end
for _, affix in pairs(self.affixes) do
local name, description, fileDataID = C_ChallengeMode.GetAffixInfo(affix.id)
affix.name = name
affix.description = description
affix.fileDataID = fileDataID
end
end
function Data:UpdateRaidInstances()
local character = self:GetCharacter()
if not character then return end
local raids = self:GetRaids()
local numSavedInstances = GetNumSavedInstances()
wipe(character.raids.savedInstances or {})
if numSavedInstances == 0 then return end
for savedInstanceIndex = 1, numSavedInstances do
local name, lockoutId, reset, difficultyID, locked, extended, instanceIDMostSig, isRaid, maxPlayers, difficultyName, numEncounters, encounterProgress, extendDisabled, instanceID = GetSavedInstanceInfo(savedInstanceIndex)
local raid = addon.Utils:TableGet(raids, "instanceID", instanceID)
---@type AE_SavedInstance
local savedInstance = {
index = savedInstanceIndex,
id = lockoutId,
name = name,
lockoutId = lockoutId,
reset = reset,
difficultyID = difficultyID,
locked = locked,
extended = extended,
instanceIDMostSig = instanceIDMostSig,
isRaid = isRaid,
maxPlayers = maxPlayers,
difficultyName = difficultyName,
numEncounters = numEncounters,
encounterProgress = encounterProgress,
extendDisabled = extendDisabled,
instanceID = instanceID,
link = GetSavedInstanceChatLink(savedInstanceIndex),
expires = 0,
encounters = {},
}
if reset and reset > 0 then
savedInstance.expires = reset + time()
end
for encounterIndex = 1, numEncounters do
local bossName, fileDataID, isKilled = GetSavedInstanceEncounterInfo(savedInstanceIndex, encounterIndex)
local instanceEncounterID = 0
if raid then
addon.Utils:TableForEach(raid.encounters, function(encounter)
if string.lower(encounter.name) == string.lower(bossName) then
instanceEncounterID = encounter.instanceEncounterID
end
end)
end
---@type AE_SavedInstanceEncounter
local savedInstanceEncounter = {
index = encounterIndex,
instanceEncounterID = instanceEncounterID,
bossName = bossName,
fileDataID = fileDataID or 0,
isKilled = isKilled,
}
savedInstance.encounters[encounterIndex] = savedInstanceEncounter
end
character.raids.savedInstances[savedInstanceIndex] = savedInstance
end
addon.UI:Render()
end
function Data:UpdateCharacterInfo()
local character = self:GetCharacter()
if not character then return end
local playerName = UnitName("player")
local playerRealm = GetRealmName()