-
Notifications
You must be signed in to change notification settings - Fork 11
/
WorldQuests.lua
2597 lines (2348 loc) · 125 KB
/
WorldQuests.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
--[[----
--
-- Broker_WorldQuests
--
-- World of Warcraft addon to display world quests in convenient list form.
-- It doesn't do anything on its own; requires a data broker addon!
--
-- Original Author: myno
--
--]]----
local GetAchievementInfo
= GetAchievementInfo
local REPUTATION
= REPUTATION
local _, addon = ...
local CONSTANTS = addon.CONSTANTS
local WQB_DEBUG = false
local isHorde = UnitFactionGroup("player") == "Horde"
local ITEM_QUALITY_COLORS, WORLD_QUEST_QUALITY_COLORS, UnitLevel
= ITEM_QUALITY_COLORS, WORLD_QUEST_QUALITY_COLORS, UnitLevel
local GetQuestsForPlayerByMapID, GetQuestTimeLeftMinutes, GetQuestInfoByQuestID, GetQuestProgressBarInfo, QuestHasWarModeBonus
= C_TaskQuest.GetQuestsForPlayerByMapID, C_TaskQuest.GetQuestTimeLeftMinutes, C_TaskQuest.GetQuestInfoByQuestID, C_TaskQuest.GetQuestProgressBarInfo, C_QuestLog.QuestHasWarModeBonus
local GetQuestTagInfo, IsQuestFlaggedCompleted, IsQuestCriteriaForBounty, GetBountiesForMapID, GetLogIndexForQuestID, GetTitleForLogIndex, GetQuestWatchType
= C_QuestLog.GetQuestTagInfo, C_QuestLog.IsQuestFlaggedCompleted, C_QuestLog.IsQuestCriteriaForBounty, C_QuestLog.GetBountiesForMapID, C_QuestLog.GetLogIndexForQuestID, C_QuestLog.GetTitleForLogIndex, C_QuestLog.GetQuestWatchType
local GetSuperTrackedQuestID
= C_SuperTrack.GetSuperTrackedQuestID
local IsFactionParagon, GetFactionParagonInfo
= C_Reputation.IsFactionParagon, C_Reputation.GetFactionParagonInfo
local GetBestMapForUnit, GetMapInfo
= C_Map.GetBestMapForUnit, C_Map.GetMapInfo
local IsWarModeDesired
= C_PvP.IsWarModeDesired
local GetQuestObjectiveInfo, GetNumQuestLogRewards, GetQuestLogRewardInfo, GetQuestLogRewardMoney, HaveQuestData
= GetQuestObjectiveInfo, GetNumQuestLogRewards, GetQuestLogRewardInfo, GetQuestLogRewardMoney, HaveQuestData
-- When adding zones to MAP_ZONES, be sure to also add the zoneID to MAP_ZONES_SORT immediately below
-- The simplest way to get the MapID for the zone you are currently in is to enter "/dump C_Map.GetBestMapForUnit("player")"
local MAP_ZONES = {
[CONSTANTS.EXPANSIONS.THEWARWITHIN] = {
[2248] = { id = 2248, name = GetMapInfo(2248).name, quests = {}, buttons = {}, }, -- Isle of Dorn 11.0
[2214] = { id = 2214, name = GetMapInfo(2214).name, quests = {}, buttons = {}, }, -- The Ringing Deeps 11.0
[2215] = { id = 2215, name = GetMapInfo(2215).name, quests = {}, buttons = {}, }, -- Hallowfall 11.0
[2255] = { id = 2255, name = GetMapInfo(2255).name, quests = {}, buttons = {}, }, -- Azj-Kahet 11.0
},
[CONSTANTS.EXPANSIONS.DRAGONFLIGHT] = {
[2022] = { id = 2022, name = GetMapInfo(2022).name, quests = {}, buttons = {}, }, -- The Waking Shores 10.0
[2023] = { id = 2023, name = GetMapInfo(2023).name, quests = {}, buttons = {}, }, -- Ohn'ahran Plains 10.0
[2024] = { id = 2024, name = GetMapInfo(2024).name, quests = {}, buttons = {}, }, -- The Azure Span 10.0
[2025] = { id = 2025, name = GetMapInfo(2025).name, quests = {}, buttons = {}, }, -- Thaldraszus 10.0
[2085] = { id = 2085, name = GetMapInfo(2085).name, quests = {}, buttons = {}, }, -- Primalist Tomorrow 10.0
[2151] = { id = 2151, name = GetMapInfo(2151).name, quests = {}, buttons = {}, }, -- The Forbidden Reach 10.0.7
[2133] = { id = 2133, name = GetMapInfo(2133).name, quests = {}, buttons = {}, }, -- Zaralek Cavern 10.1
[2200] = { id = 2200, name = GetMapInfo(2200).name, quests = {}, buttons = {}, }, -- Emerald Dream 10.2
},
[CONSTANTS.EXPANSIONS.SHADOWLANDS] = {
[1525] = { id = 1525, name = GetMapInfo(1525).name, quests = {}, buttons = {}, }, -- Revendreth 9.0
[1533] = { id = 1533, name = GetMapInfo(1533).name, quests = {}, buttons = {}, }, -- Bastion 9.0
[1536] = { id = 1536, name = GetMapInfo(1536).name, quests = {}, buttons = {}, }, -- Maldraxxus 9.0
[1565] = { id = 1565, name = GetMapInfo(1565).name, quests = {}, buttons = {}, }, -- Ardenwald 9.0
[1543] = { id = 1543, name = GetMapInfo(1543).name, quests = {}, buttons = {}, }, -- The Maw 9.1
[1970] = { id = 1970, name = GetMapInfo(1970).name, quests = {}, buttons = {}, }, -- Zereth Mortis 9.2
},
[CONSTANTS.EXPANSIONS.BFA] = {
[863] = { id = 863, name = GetMapInfo(863).name, faction = CONSTANTS.FACTIONS.HORDE, quests = {}, buttons = {}, }, -- Nazmir
[864] = { id = 864, name = GetMapInfo(864).name, faction = CONSTANTS.FACTIONS.HORDE, quests = {}, buttons = {}, }, -- Vol'dun
[862] = { id = 862, name = GetMapInfo(862).name, faction = CONSTANTS.FACTIONS.HORDE, quests = {}, buttons = {}, }, -- Zuldazar
[895] = { id = 895, name = GetMapInfo(895).name, faction = CONSTANTS.FACTIONS.ALLIANCE, quests = {}, buttons = {}, }, -- Tiragarde
[942] = { id = 942, name = GetMapInfo(942).name, faction = CONSTANTS.FACTIONS.ALLIANCE, quests = {}, buttons = {}, }, -- Stormsong Valley
[896] = { id = 896, name = GetMapInfo(896).name, faction = CONSTANTS.FACTIONS.ALLIANCE, quests = {}, buttons = {}, }, -- Drustvar
[1161] = { id = 1161, name = GetMapInfo(1161).name, faction = CONSTANTS.FACTIONS.ALLIANCE, quests = {}, buttons = {}, }, -- Boralus
[1527] = { id = 1527, name = GetMapInfo(1527).name, quests = {}, buttons = {}, }, -- Uldum 8.3
[1530] = { id = 1530, name = GetMapInfo(1530).name, quests = {}, buttons = {}, }, -- Valley of Eternal Blossoms 8.3
[1355] = { id = 1355, name = GetMapInfo(1355).name, quests = {}, buttons = {}, }, -- Nazjatar 8.2
[1462] = { id = 1462, name = GetMapInfo(1462).name, quests = {}, buttons = {}, }, -- Mechagon 8.2
[14] = { id = 14, name = GetMapInfo(14).name, quests = {}, buttons = {}, }, -- Arathi
[62] = { id = 62, name = GetMapInfo(62).name, quests = {}, buttons = {}, }, -- Darkshore
},
[CONSTANTS.EXPANSIONS.LEGION] = {
[630] = { id = 630, name = GetMapInfo(630).name, quests = {}, buttons = {}, }, -- Aszuna
[790] = { id = 790, name = GetMapInfo(790).name, quests = {}, buttons = {}, }, -- Eye of Azshara
[641] = { id = 641, name = GetMapInfo(641).name, quests = {}, buttons = {}, }, -- Val'sharah
[650] = { id = 650, name = GetMapInfo(650).name, quests = {}, buttons = {}, }, -- Highmountain
[634] = { id = 634, name = GetMapInfo(634).name, quests = {}, buttons = {}, }, -- Stormheim
[680] = { id = 680, name = GetMapInfo(680).name, quests = {}, buttons = {}, }, -- Suramar
[627] = { id = 627, name = GetMapInfo(627).name, quests = {}, buttons = {}, }, -- Dalaran
[646] = { id = 646, name = GetMapInfo(646).name, quests = {}, buttons = {}, }, -- Broken Shore
[830] = { id = 830, name = GetMapInfo(830).name, quests = {}, buttons = {}, }, -- Krokuun
[882] = { id = 882, name = GetMapInfo(882).name, quests = {}, buttons = {}, }, -- Mac'aree
[885] = { id = 885, name = GetMapInfo(885).name, quests = {}, buttons = {}, }, -- Antoran Wastes
},
}
local MAP_ZONES_SORT = {
[CONSTANTS.EXPANSIONS.THEWARWITHIN] = {
2248, 2214, 2215, 2255
},
[CONSTANTS.EXPANSIONS.DRAGONFLIGHT] = {
2022, 2023, 2024, 2025, 2085, 2151, 2133, 2200
},
[CONSTANTS.EXPANSIONS.SHADOWLANDS] = {
1525, 1533, 1536, 1565, 1543, 1970
},
[CONSTANTS.EXPANSIONS.BFA] = {
1530, 1527, 1355, 1462, 62, 14, 863, 864, 862, 895, 942, 896, 1161
},
[CONSTANTS.EXPANSIONS.LEGION] = {
630, 790, 641, 650, 634, 680, 627, 646, 830, 882, 885
},
}
local defaultConfig = {
-- general
attachToWorldMap = false,
showOnClick = false,
usePerCharacterSettings = false,
enableClickToOpenMap = false,
enableTomTomWaypointsOnClick = true,
alwaysShowBountyQuests = true,
alwaysShowEpicQuests = true,
onlyShowRareOrAbove = false,
showTotalsInBrokerText = true,
brokerShowAP = true,
brokerShowServiceMedals = true,
brokerShowWakeningEssences = true,
brokerShowWarResources = true,
brokerShowPrismaticManapearl = true,
brokerShowCyphersOfTheFirstOnes = true,
brokerGratefulOffering = true,
brokerShowResources = true,
brokerShowLegionfallSupplies = true,
brokerShowHonor = true,
brokerShowGold = false,
brokerShowGear = false,
brokerShowMarkOfHonor = false,
brokerShowHerbalism = false,
brokerShowMining = false,
brokerShowFishing = false,
brokerShowSkinning = false,
brokerShowBloodOfSargeras = false,
brokerShowDragonIslesSupplies = true,
brokerShowElementalOverflow = true,
brokerShowFlightstones = true,
brokerShowWhelplingsDreamingCrest = true,
brokerShowDrakesDreamingCrest = true,
brokerShowWyrmsDreamingCrest = true,
brokerShowAspectsDreamingCrest = true,
brokerShowWhelplingsAwakenedCrest = true,
brokerShowDrakesAwakenedCrest = true,
brokerShowWyrmsAwakenedCrest = true,
brokerShowAspectsAwakenedCrest = true,
brokerShowMysteriousFragment = true,
brokerShowResonanceCrystals = true,
brokerShowTheAssemblyoftheDeeps = true,
brokerShowValorstones = true,
brokerShowKej = true,
brokerShowHallowfallArathi = true,
brokerShowBloodyTokens = true,
brokerShowPolishedPetCharms = false,
sortByTimeRemaining = false,
-- reward type
showDragonIslesSupplies = true,
showElementalOverflow = true,
showFlightstones = true,
showWhelplingsDreamingCrest = true,
showDrakesDreamingCrest = true,
showWyrmsDreamingCrest = true,
showAspectsDreamingCrest = true,
showWhelplingsAwakenedCrest = true,
showDrakesAwakenedCrest = true,
showWyrmsAwakenedCrest = true,
showAspectsAwakenedCrest = true,
showMysteriousFragment = true,
showResonanceCrystals = true,
showTheAssemblyoftheDeeps = true,
showHallowfallArathi = true,
showValorstones = true,
showKej = true,
showBloodyTokens = true,
showArtifactPower = true,
showPrismaticManapearl = true,
showCyphersOfTheFirstOnes = true,
showGratefulOffering = true,
showItems = true,
showGear = true,
showRelics = true,
showCraftingMaterials = true,
showConduits = true,
showMarkOfHonor = true,
showOtherItems = true,
showTWWReputation = true,
showDFReputation = true,
showSLReputation = true,
showBFAReputation = true,
showBFAServiceMedals = true,
showHonor = true,
showLowGold = true,
showHighGold = true,
showWarResources = true,
showAnima = true,
showResources = true,
showLegionfallSupplies = true,
showNethershards = true,
showArgunite = true,
showWakeningEssences = true,
-- quest type
showProfession = true,
showProfessionAlchemy = true,
showProfessionBlacksmithing = true,
showProfessionInscription = true,
showProfessionJewelcrafting = true,
showProfessionLeatherworking = true,
showProfessionTailoring = true,
showProfessionEnchanting = true,
showProfessionEngineering = true,
showProfessionHerbalism = true,
showProfessionMining = true,
showProfessionSkinning = true,
showProfessionCooking = true,
showProfessionArchaeology = true,
showProfessionFishing = true,
showDungeon = true,
showPvP = true,
hideFactionColumn = false,
hideFactionParagonBars = false,
-- Dragonflight
alwaysShowDragonscaleExpedition = false,
alwaysShowIskaaraTuskarr = false,
alwaysShowMaruukCentaur = false,
alwaysShowValdrakkenAccord = false,
alwaysShowLoammNiffen = false,
alwaysShowDreamWardens = false,
-- Shadowlands
alwaysShowAscended = false,
alwaysShowUndyingArmy = false,
alwaysShowCourtofHarvesters = false,
alwaysShowAvowed = false,
alwaysShowWildHunt = false,
alwaysShowDeathsAdvance = false,
alwaysShowEnlightened = false,
-- BFA
alwaysShow7thLegion = false,
alwaysShowStormsWake = false,
alwaysShowOrderOfEmbers = false,
alwaysShowProudmooreAdmiralty = false,
alwaysShowWavebladeAnkoan = false,
alwaysShowTheHonorbound = false,
alwaysShowZandalariEmpire = false,
alwaysShowTalanjisExpedition = false,
alwaysShowVoldunai = false,
alwaysShowTheUnshackled = false,
alwaysShowRustboltResistance = false,
alwaysShowTortollanSeekers = false,
alwaysShowChampionsOfAzeroth = false,
-- Legion
alwaysShowCourtOfFarondis = false,
alwaysShowDreamweavers = false,
alwaysShowHighmountainTribe = false,
alwaysShowNightfallen = false,
alwaysShowWardens = false,
alwaysShowValarjar = false,
alwaysShowArmiesOfLegionfall = false,
alwaysShowArmyOfTheLight = false,
alwaysShowArgussianReach = false,
showPetBattle = true,
hidePetBattleBountyQuests = false,
alwaysShowPetBattleFamilyFamiliar = true,
collapsedZones = {},
}
local C = function(k)
if BWQcfg.usePerCharacterSettings then
return BWQcfgPerCharacter[k]
else
return BWQcfg[k]
end
end
local expansion
local warmodeEnabled = false
local BWQ = CreateFrame("Frame", "Broker_WorldQuests", UIParent, "BackdropTemplate")
BWQ:EnableMouse(true)
BWQ:SetBackdrop({
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\ChatFrame\\ChatFrameBackground",
tile = false,
tileSize = 0,
edgeSize = 2,
insets = { left = 0, right = 0, top = 0, bottom = 0 },
})
BWQ:SetBackdropColor(0, 0, 0, .9)
BWQ:SetBackdropBorderColor(0, 0, 0, 1)
BWQ:SetClampedToScreen(true)
BWQ:Hide()
BWQ.buttonTheWarWithin = CreateFrame("Button", nil, BWQ, "BackdropTemplate")
BWQ.buttonTheWarWithin:SetSize(20, 15)
BWQ.buttonTheWarWithin:SetPoint("TOPRIGHT", BWQ, "TOPRIGHT", -146, -8)
BWQ.buttonTheWarWithin:SetBackdrop({bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = false, tileSize = 0, edgeSize = 2, insets = { left = 0, right = 0, top = 0, bottom = 0 }, })
BWQ.buttonTheWarWithin:SetBackdropColor(0.1, 0.1, 0.1)
BWQ.buttonTheWarWithin.texture = BWQ.buttonTheWarWithin:CreateTexture(nil, "OVERLAY")
BWQ.buttonTheWarWithin.texture:SetPoint("TOPLEFT", 1, -1)
BWQ.buttonTheWarWithin.texture:SetPoint("BOTTOMRIGHT", -1, 1)
BWQ.buttonTheWarWithin.texture:SetTexture("Interface\\Calendar\\Holidays\\Calendar_WeekendTheWarWithinStart") -- Use https://github.com/Marlamin/wow.tools.local to find textures
BWQ.buttonTheWarWithin.texture:SetTexCoord(0.15, 0.55, 0.23, 0.47)
BWQ.buttonDragonflight = CreateFrame("Button", nil, BWQ, "BackdropTemplate")
BWQ.buttonDragonflight:SetSize(20, 15)
BWQ.buttonDragonflight:SetPoint("TOPRIGHT", BWQ, "TOPRIGHT", -119, -8)
BWQ.buttonDragonflight:SetBackdrop({bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = false, tileSize = 0, edgeSize = 2, insets = { left = 0, right = 0, top = 0, bottom = 0 }, })
BWQ.buttonDragonflight:SetBackdropColor(0.1, 0.1, 0.1)
BWQ.buttonDragonflight.texture = BWQ.buttonDragonflight:CreateTexture(nil, "OVERLAY")
BWQ.buttonDragonflight.texture:SetPoint("TOPLEFT", 1, -1)
BWQ.buttonDragonflight.texture:SetPoint("BOTTOMRIGHT", -1, 1)
BWQ.buttonDragonflight.texture:SetTexture("Interface\\Calendar\\Holidays\\Calendar_dragonflightstart")
BWQ.buttonDragonflight.texture:SetTexCoord(0.15, 0.55, 0.23, 0.47)
BWQ.buttonShadowlands = CreateFrame("Button", nil, BWQ, "BackdropTemplate")
BWQ.buttonShadowlands:SetSize(20, 15)
BWQ.buttonShadowlands:SetPoint("TOPRIGHT", BWQ, "TOPRIGHT", -92, -8)
BWQ.buttonShadowlands:SetBackdrop({bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = false, tileSize = 0, edgeSize = 2, insets = { left = 0, right = 0, top = 0, bottom = 0 }, })
BWQ.buttonShadowlands:SetBackdropColor(0.1, 0.1, 0.1)
BWQ.buttonShadowlands.texture = BWQ.buttonShadowlands:CreateTexture(nil, "OVERLAY")
BWQ.buttonShadowlands.texture:SetPoint("TOPLEFT", 1, -1)
BWQ.buttonShadowlands.texture:SetPoint("BOTTOMRIGHT", -1, 1)
BWQ.buttonShadowlands.texture:SetTexture("Interface\\Calendar\\Holidays\\Calendar_WeekendShadowlandsStart")
BWQ.buttonShadowlands.texture:SetTexCoord(0.15, 0.55, 0.23, 0.47)
BWQ.buttonBFA = CreateFrame("Button", nil, BWQ, "BackdropTemplate")
BWQ.buttonBFA:SetSize(20, 15)
BWQ.buttonBFA:SetPoint("TOPRIGHT", BWQ, "TOPRIGHT", -65, -8)
BWQ.buttonBFA:SetBackdrop({bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = false, tileSize = 0, edgeSize = 2, insets = { left = 0, right = 0, top = 0, bottom = 0 }, })
BWQ.buttonBFA:SetBackdropColor(0.1, 0.1, 0.1)
BWQ.buttonBFA.texture = BWQ.buttonBFA:CreateTexture(nil, "OVERLAY")
BWQ.buttonBFA.texture:SetPoint("TOPLEFT", 1, -1)
BWQ.buttonBFA.texture:SetPoint("BOTTOMRIGHT", -1, 1)
BWQ.buttonBFA.texture:SetTexture("Interface\\Calendar\\Holidays\\Calendar_WeekendBattleforAzerothStart")
BWQ.buttonBFA.texture:SetTexCoord(0.15, 0.55, 0.23, 0.45)
BWQ.buttonLegion = CreateFrame("Button", nil, BWQ, "BackdropTemplate")
BWQ.buttonLegion:SetSize(20, 15)
BWQ.buttonLegion:SetPoint("TOPRIGHT", BWQ, "TOPRIGHT", -38, -8)
BWQ.buttonLegion:SetBackdrop({bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = false, tileSize = 0, edgeSize = 2, insets = { left = 0, right = 0, top = 0, bottom = 0 }, })
BWQ.buttonLegion:SetBackdropColor(0.1, 0.1, 0.1)
BWQ.buttonLegion.texture = BWQ.buttonLegion:CreateTexture(nil, "OVERLAY")
BWQ.buttonLegion.texture:SetPoint("TOPLEFT", 1, -1)
BWQ.buttonLegion.texture:SetPoint("BOTTOMRIGHT", -1, 1)
BWQ.buttonLegion.texture:SetTexture("Interface\\Calendar\\Holidays\\Calendar_WeekendLegionStart")
BWQ.buttonLegion.texture:SetTexCoord(0.15, 0.55, 0.23, 0.47)
BWQ.buttonTheWarWithin:SetScript("OnClick", function(self) BWQ:SwitchExpansion(CONSTANTS.EXPANSIONS.THEWARWITHIN) end)
BWQ.buttonDragonflight:SetScript("OnClick", function(self) BWQ:SwitchExpansion(CONSTANTS.EXPANSIONS.DRAGONFLIGHT) end)
BWQ.buttonShadowlands:SetScript("OnClick", function(self) BWQ:SwitchExpansion(CONSTANTS.EXPANSIONS.SHADOWLANDS) end)
BWQ.buttonBFA:SetScript("OnClick", function(self) BWQ:SwitchExpansion(CONSTANTS.EXPANSIONS.BFA) end)
BWQ.buttonLegion:SetScript("OnClick", function(self) BWQ:SwitchExpansion(CONSTANTS.EXPANSIONS.LEGION) end)
BWQ.buttonSettings = CreateFrame("BUTTON", nil, BWQ, "BackdropTemplate")
BWQ.buttonSettings:SetWidth(15)
BWQ.buttonSettings:SetHeight(15)
BWQ.buttonSettings:SetPoint("TOPRIGHT", BWQ, "TOPRIGHT", -12, -8)
BWQ.buttonSettings.texture = BWQ.buttonSettings:CreateTexture(nil, "BORDER")
BWQ.buttonSettings.texture:SetAllPoints()
BWQ.buttonSettings.texture:SetTexture("Interface\\WorldMap\\Gear_64.png")
BWQ.buttonSettings.texture:SetTexCoord(0, 0.50, 0, 0.50)
BWQ.buttonSettings.texture:SetVertexColor(1.0, 0.82, 0, 1.0)
BWQ.buttonSettings:SetScript("OnClick", function(self) BWQ:OpenConfigMenu(self) end)
local Block_OnLeave = function(self)
if not C("attachToWorldMap") or (C("attachToWorldMap") and not WorldMapFrame:IsShown()) then
if not BWQ:IsMouseOver() then
BWQ:Hide()
end
end
end
BWQ:SetScript("OnLeave", Block_OnLeave)
BWQ.slider = CreateFrame("Slider", nil, BWQ, "BackdropTemplate")
BWQ.slider:SetWidth(16)
BWQ.slider:SetThumbTexture("Interface\\Buttons\\UI-SliderBar-Button-Horizontal")
BWQ.slider:SetBackdrop( {
bgFile = "Interface\\Buttons\\UI-SliderBar-Background",
--edgeFile = "Interface\\Buttons\\UI-SliderBar-Border",
edgeSize = 8, tile = true, tileSize = 8,
insets = { left=3, right=3, top=6, bottom=6 }
} )
BWQ.slider:SetValueStep(1)
BWQ.slider:SetHeight(200)
BWQ.slider:SetMinMaxValues( 0, 100 )
BWQ.slider:SetValue(0)
BWQ.slider:Hide()
local bounties = {}
local questIds = {}
local numQuestsTotal, totalWidth, offsetTop = 0, 0, -15
local hasCollapsedQuests = false
local showDownwards = false
local blockYPos = 0
local highlightedRow = true
local CreateErrorFS = function()
BWQ.errorFS = BWQ:CreateFontString("BWQerrorFS", "OVERLAY", "SystemFont_Shadow_Med1")
BWQ.errorFS:SetJustifyH("CENTER")
BWQ.errorFS:SetTextColor(.9, .8, 0)
end
local hasUnlockedWorldQuests
function BWQ:WorldQuestsUnlocked()
if not hasUnlockedWorldQuests then
if (expansion == CONSTANTS.EXPANSIONS.THEWARWITHIN) then
hasUnlockedWorldQuests = IsQuestFlaggedCompleted(79573) -- See effect #1 under https://www.wowhead.com/spell=434027/world-quests-adventure-mode
elseif (expansion == CONSTANTS.EXPANSIONS.DRAGONFLIGHT) then
_, _, _, hasUnlockedWorldQuests = GetAchievementInfo(16326)
if not hasUnlockedWorldQuests then
hasUnlockedWorldQuests = UnitLevel("player") >= 68 and IsQuestFlaggedCompleted(66221)
end
else
hasUnlockedWorldQuests = (expansion == CONSTANTS.EXPANSIONS.SHADOWLANDS and UnitLevel("player") >= 51 and IsQuestFlaggedCompleted(57559))
or (expansion == CONSTANTS.EXPANSIONS.BFA and UnitLevel("player") >= 50 and
(IsQuestFlaggedCompleted(51916) or IsQuestFlaggedCompleted(52451) -- horde
or IsQuestFlaggedCompleted(51918) or IsQuestFlaggedCompleted(52450))) -- alliance
or (expansion == CONSTANTS.EXPANSIONS.LEGION and UnitLevel("player") >= 45 and
(IsQuestFlaggedCompleted(43341) or IsQuestFlaggedCompleted(45727))) -- broken isles
end
end
if not hasUnlockedWorldQuests then
if not BWQ.errorFS then CreateErrorFS() end
local level, quest, errorText
if expansion == CONSTANTS.EXPANSIONS.THEWARWITHIN then
errorText = "You need to unlock The War Within World Quests\non one of your characters."
elseif expansion == CONSTANTS.EXPANSIONS.DRAGONFLIGHT then
errorText = "You need to unlock Dragonflight World Quests\non one of your characters."
elseif expansion == CONSTANTS.EXPANSIONS.SHADOWLANDS then
errorText = "You need to unlock Shadowlands World Quests\non one of your characters."
elseif expansion == CONSTANTS.EXPANSIONS.BFA then
level = "50"
quest = isHorde and "|cffffff00|Hquest:57559:-1|h[Uniting Zandalar]|h|r" or "|cffffff00|Hquest:51918:-1|h[Uniting Kul Tiras]|h|r"
errorText = ("You need to reach Level %s and complete the\nquest %s to unlock World Quests."):format(level, quest)
else -- legion
level = "45"
quest = "|cffffff00|Hquest:43341:-1|h[Uniting the Isles]|h|r"
errorText = ("You need to reach Level %s and complete the\nquest %s to unlock World Quests."):format(level, quest)
end
BWQ:SetErrorFSPosition(offsetTop)
BWQ.errorFS:SetText(errorText)
BWQ:SetSize(BWQ.errorFS:GetStringWidth() + 20, BWQ.errorFS:GetStringHeight() + 45)
BWQ.errorFS:Show()
return false
else
if BWQ.errorFS then
BWQ.errorFS:Hide()
end
return true
end
end
function BWQ:ShowNoWorldQuestsInfo()
if not BWQ.errorFS then CreateErrorFS() end
BWQ.errorFS:ClearAllPoints()
BWQ:SetErrorFSPosition(offsetTop - 10)
BWQ.errorFS:SetPoint("TOP", BWQ, "TOP", 0, offsetTop - 10)
BWQ.errorFS:SetText("There are no world quests available that match your filter settings.")
BWQ.errorFS:Show()
end
function BWQ:SetErrorFSPosition(offsetTop)
if (expansion == CONSTANTS.EXPANSIONS.SHADOWLANDS or expansion == CONSTANTS.EXPANSIONS.DRAGONFLIGHT or expansion == CONSTANTS.EXPANSIONS.THEWARWITHIN) then -- TODO: We are not supporting bounty quests for these expansions atm, so the ErrorFS position should be at the top of BWQ
BWQ.errorFS:SetPoint("TOP", BWQ, "TOP", 0, offsetTop)
else
if BWQ.factionDisplay:IsShown() then
BWQ.errorFS:SetPoint("TOP", BWQ.factionDisplay, "BOTTOM", 0, -10)
else
BWQ.errorFS:SetPoint("TOP", BWQ, "TOP", 0, offsetTop)
end
end
end
local locale = GetLocale()
local millionSearchLocalized = { enUS = "million", enGB = "million", zhCN = "万", frFR = "million", deDE = "Million", esES = "mill", itIT = "milion", koKR = "만", esMX = "mill", ptBR = "milh", ruRU = "млн", zhTW = "萬", }
local billionSearchLocalized = { enUS = "billion", enGB = "billion", zhCN = "亿", frFR = "milliard", deDE = "Milliarde", esES = "mil millones", itIT = "miliard", koKR = "억", esMX = "mil millones", ptBR = "bilh", ruRU = "млрд", zhTW = "億", }
local BWQScanTooltip = CreateFrame("GameTooltip", "BWQScanTooltip", nil, "GameTooltipTemplate,BackdropTemplate")
BWQScanTooltip:Hide()
function BWQ:GetArtifactPowerValue(itemId)
local _, itemLink = GetItemInfo(itemId)
BWQScanTooltip:SetOwner(BWQ, "ANCHOR_NONE")
BWQScanTooltip:SetHyperlink(itemLink)
local numLines = BWQScanTooltip:NumLines()
local isArtifactPower = false
for i = 2, numLines do
local text = _G["BWQScanTooltipTextLeft" .. i]:GetText()
if text then
if text:find(ARTIFACT_POWER) then
isArtifactPower = true
end
if isArtifactPower and text:find(ITEM_SPELL_TRIGGER_ONUSE) then
-- gsub french special-space character (wtf..)
local power = text:gsub(" ", ""):match("%d+%p?%d*") or "0"
if (text:find(millionSearchLocalized[locale])) then
-- en locale only use ',' for thousands, shouldn't occur in these million digit numbers
-- replace ',' for german etc comma numbers so we can do math with them.
power = power:gsub(",", ".")
power = power * 1000000
elseif (text:find(billionSearchLocalized[locale])) then
power = power:gsub(",", ".")
power = power * 1000000000
else
-- get rid of thousands comma for non-million numbers
power = power:gsub("%p", "")
end
return power
end
end
end
return "0"
end
function BWQ:GetItemLevelValueForQuestId(questId)
BWQScanTooltip:SetOwner(BWQ, "ANCHOR_NONE")
BWQScanTooltip:SetQuestLogItem("reward", 1, questId)
local numLines = BWQScanTooltip:NumLines()
for i = 2, numLines do
local text = _G["BWQScanTooltipTextLeft" .. i]:GetText()
local e = ITEM_LEVEL_PLUS:find("%%d")
if text and text:find(ITEM_LEVEL_PLUS:sub(1, e - 1)) then
return text:match("%d+%+?") or ""
end
end
return ""
end
function BWQ:ValueWithWarModeBonus(questId, value)
local multiplier = warmodeEnabled and 1.1 or 1
return floor(value * multiplier + 0.5)
end
function BWQ:IsQuestAchievementCriteriaMissing(achievementId, questId)
local criteriaId = CONSTANTS.ACHIEVEMENT_CRITERIAS[questId]
if criteriaId then
local _, _, completed = GetAchievementCriteriaInfo(achievementId, criteriaId)
return not completed
else
return false
end
end
local AbbreviateNumber = function(number)
number = tonumber(number)
if number >= 1000000 then
number = number / 1000000
return string.format((number % 1 == 0) and "%.0f%s" or "%.1f%s", number, "M")
elseif number >= 10000 then
return string.format("%.0f%s", number / 1000, "K")
end
return number
end
local FormatTimeLeftString = function(timeLeft)
if timeLeft <= 0 then return "" end
local timeLeftStr = ""
-- if timeLeft >= 60 * 24 then -- at least 1 day
-- timeLeftStr = string.format("%.0fd", timeLeft / 60 / 24)
-- end
if timeLeft >= 60 then -- hours
timeLeftStr = string.format("%.0fh", math.floor(timeLeft / 60))
end
timeLeftStr = string.format("%s%s%sm", timeLeftStr, timeLeftStr ~= "" and " " or "", timeLeft % 60) -- always show minutes
if timeLeft <= 120 then timeLeftStr = string.format("|cffD96932%s|r", timeLeftStr)
elseif timeLeft <= 240 then timeLeftStr = string.format("|cffDBA43B%s|r", timeLeftStr)
elseif timeLeft <= 480 then timeLeftStr = string.format("|cffE6D253%s|r", timeLeftStr)
elseif timeLeft <= 960 then timeLeftStr = string.format("|cffE6DA8E%s|r", timeLeftStr)
end
return timeLeftStr
end
local tip = GameTooltip
local ShowQuestObjectiveTooltip = function(row)
tip:SetOwner(row, "ANCHOR_CURSOR")
local color = WORLD_QUEST_QUALITY_COLORS[row.quest.quality]
tip:AddLine(row.quest.title, color.r, color.g, color.b, true)
for objectiveIndex = 1, row.quest.numObjectives do
local objectiveText, objectiveType, finished = GetQuestObjectiveInfo(row.quest.questId, objectiveIndex, false);
if objectiveText and #objectiveText > 0 then
color = finished and GRAY_FONT_COLOR or HIGHLIGHT_FONT_COLOR;
tip:AddLine(QUEST_DASH .. objectiveText, color.r, color.g, color.b, true);
end
end
local percent = GetQuestProgressBarInfo(row.quest.questId)
if percent then
GameTooltip_ShowProgressBar(tip, 0, 100, percent, PERCENTAGE_STRING:format(percent))
end
tip:Show()
end
local ShowQuestLogItemTooltip = function(button)
local name, texture = GetQuestLogRewardInfo(1, button.quest.questId)
if name and texture then
tip:SetOwner(button.reward, "ANCHOR_CURSOR")
BWQScanTooltip:SetQuestLogItem("reward", 1, button.quest.questId)
local _, itemLink = BWQScanTooltip:GetItem()
tip:SetHyperlink(itemLink)
tip:Show()
end
end
-- super track map ping
local mapTextures = CreateFrame("Frame", "BWQ_MapTextures", WorldMapFrame:GetCanvas())
mapTextures:SetSize(400,400)
mapTextures:SetFrameStrata("DIALOG")
mapTextures:SetFrameLevel(2001)
local highlightArrow = mapTextures:CreateTexture("highlightArrow")
highlightArrow:SetTexture("Interface\\minimap\\MiniMap-DeadArrow")
highlightArrow:SetSize(56, 56)
highlightArrow:SetRotation(3.14)
highlightArrow:SetPoint("CENTER", mapTextures)
highlightArrow:SetDrawLayer("ARTWORK", 1)
mapTextures.highlightArrow = highlightArrow
local animationGroup = mapTextures:CreateAnimationGroup()
animationGroup:SetLooping("REPEAT")
animationGroup:SetScript("OnPlay", function(self)
mapTextures.highlightArrow:Show()
end)
animationGroup:SetScript("OnStop", function(self)
mapTextures.highlightArrow:Hide()
end)
local downAnimation = animationGroup:CreateAnimation("Translation")
downAnimation:SetChildKey("highlightArrow")
downAnimation:SetOffset(0, -10)
downAnimation:SetDuration(0.4)
downAnimation:SetOrder(1)
local upAnimation = animationGroup:CreateAnimation("Translation")
upAnimation:SetChildKey("highlightArrow")
upAnimation:SetOffset(0, 10)
upAnimation:SetDuration(0.4)
upAnimation:SetOrder(2)
mapTextures.animationGroup = animationGroup
BWQ.mapTextures = mapTextures
function BWQ:QueryZoneQuestCoordinates(mapId)
local quests = GetQuestsForPlayerByMapID(mapId)
if quests then
for _, v in next, quests do
local quest = MAP_ZONES[expansion][mapId].quests[v.questId]
if quest then
quest.x = v.x
quest.y = v.y
end
end
end
end
function BWQ:CalculateMapPosition(x, y)
return x * WorldMapFrame:GetCanvas():GetWidth() , -1 * y * WorldMapFrame:GetCanvas():GetHeight()
end
local currentTomTomWaypoint
local Row_OnClick = function(row)
if IsShiftKeyDown() then
if (GetQuestWatchType(row.quest.questId) == Enum.QuestWatchType.Manual or GetSuperTrackedQuestID() == row.quest.questId) then
BonusObjectiveTracker_UntrackWorldQuest(row.quest.questId)
else
BonusObjectiveTracker_TrackWorldQuest(row.quest.questId, Enum.QuestWatchType.Manual)
end
else
if not WorldMapFrame:IsShown() then ShowUIPanel(WorldMapFrame) end
if WorldMapFrame:IsShown() then
WorldMapFrame:SetMapID(row.mapId)
if not row.quest.x or not row.quest.y then BWQ:QueryZoneQuestCoordinates(row.mapId) end
if row.quest.x and row.quest.y then
local x, y = BWQ:CalculateMapPosition(row.quest.x, row.quest.y)
local scale = WorldMapFrame:GetCanvasScale()
local size = 30 / scale * 1.35
BWQ.mapTextures:ClearAllPoints()
BWQ.mapTextures.highlightArrow:SetSize(size, size)
BWQ.mapTextures:SetPoint("CENTER", WorldMapFrame:GetCanvas(), "TOPLEFT", x, y + 25 + (scale < 0.5 and 50 or 0))
BWQ.mapTextures.animationGroup:Play()
end
end
if TomTom and C("enableTomTomWaypointsOnClick") then
if not row.quest.x or not row.quest.y then BWQ:QueryZoneQuestCoordinates(row.mapId) end
if row.quest.x and row.quest.y then
if currentTomTomWaypoint then TomTom:RemoveWaypoint(currentTomTomWaypoint) end
currentTomTomWaypoint = TomTom:AddWaypoint(row.mapId, row.quest.x, row.quest.y, { title = row.quest.title, silent = true })
end
end
end
end
local lastUpdate, updateTries = 0, 0
local needsRefresh = false
local RetrieveWorldQuests = function(mapId)
local numQuests = 0
local currentTime = GetTime()
local questList = GetQuestsForPlayerByMapID(mapId)
warmodeEnabled = IsWarModeDesired()
-- quest object fields are: x, y, floor, numObjectives, questId, inProgress
if questList then
numQuests = 0
MAP_ZONES[expansion][mapId].questsSort = {}
local timeLeft, questTagInfo, title, factionId
for i, q in ipairs(questList) do
if HaveQuestData(q.questId) and q.mapID == mapId then
--[[
questTagInfo = {
tagId = 116
tagName = Blacksmithing World Quest
worldQuestType =
1 -> profession,
2 -> pve?
3 -> pvp
4 -> battle pet
5 -> ??
6 -> dungeon
7 -> invasion
8 -> raid
quality =
1 -> normal
2 -> rare
3 -> epic
isElite = true/false
tradeskillLineIndex = some number, no idea of meaning atm
}
]]
timeLeft = GetQuestTimeLeftMinutes(q.questId) or 0
questTagInfo = GetQuestTagInfo(q.questId)
if questTagInfo and questTagInfo.worldQuestType then
local questId = q.questId
table.insert(MAP_ZONES[expansion][mapId].questsSort, questId)
local quest = MAP_ZONES[expansion][mapId].quests[questId] or {}
if not quest.timeAdded then
quest.wasSaved = questIds[questId] ~= nil
end
quest.timeAdded = quest.timeAdded or currentTime
if quest.wasSaved or currentTime - quest.timeAdded > 900 then
quest.isNew = false
else
quest.isNew = true
end
quest.hide = true
quest.sort = 0
-- GetQuestsForPlayerByMapID fields
quest.questId = questId
quest.numObjectives = q.numObjectives
quest.xFlight = q.x
quest.yFlight = q.y
-- GetQuestTagInfo fields
quest.tagId = questTagInfo.tagID
quest.tagName = questTagInfo.tagName
quest.worldQuestType = questTagInfo.worldQuestType
quest.quality = questTagInfo.quality
quest.isElite = questTagInfo.isElite
title, factionId = GetQuestInfoByQuestID(quest.questId)
quest.title = title
quest.factionId = factionId
if factionId then
quest.faction = C_Reputation.GetFactionDataByID(factionId).name
end
quest.timeLeft = timeLeft
quest.bounties = {}
quest.reward = {}
local rewardType = {}
local hasReward = false
-- item reward
if GetNumQuestLogRewards(quest.questId) > 0 then
local itemName, itemTexture, quantity, quality, isUsable, itemId = GetQuestLogRewardInfo(1, quest.questId)
if itemName then
hasReward = true
quest.reward.itemTexture = itemTexture
quest.reward.itemId = itemId
quest.reward.itemQuality = quality
quest.reward.itemQuantity = quantity
quest.reward.itemName = itemName
--print(string.format("[BWQ] Quest %s - %s - %s - %s - %s", quest.questId, quest.title, itemName, itemId, quantity)) -- for debugging
local _, _, _, _, _, _, _, _, equipSlot, _, _, classId, subClassId = GetItemInfo(quest.reward.itemId)
if classId == 7 then
quest.sort = quest.sort > CONSTANTS.SORT_ORDER.PROFESSION and quest.sort or CONSTANTS.SORT_ORDER.PROFESSION
if quest.reward.itemId == 124124 then
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.BLOODOFSARGERAS
end
if C("showItems") and C("showCraftingMaterials") then quest.hide = false end
elseif equipSlot ~= "" or itemId == 163857 --[[ Azerite Armor Cache ]] then
quest.sort = quest.sort > CONSTANTS.SORT_ORDER.EQUIP and quest.sort or CONSTANTS.SORT_ORDER.EQUIP
quest.reward.realItemLevel = BWQ:GetItemLevelValueForQuestId(quest.questId)
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.GEAR
if C("showItems") and C("showGear") then quest.hide = false end
elseif C_Soulbinds.IsItemConduitByItemInfo(itemId) == true then
if C("showConduits") then quest.hide = false end
elseif C_Item.IsAnimaItemByID(itemId) == true then
if C("showAnima") then quest.hide = false end
elseif itemId == 137642 then -- mark of honor
quest.sort = quest.sort > CONSTANTS.SORT_ORDER.ITEM and quest.sort or CONSTANTS.SORT_ORDER.ITEM
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.MARK_OF_HONOR
if C("showItems") and C("showMarkOfHonor") then quest.hide = false end
elseif itemId == 163036 then -- polished pet charm
quest.reward.polishedPetCharmsAmount = quest.reward.itemQuantity
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.POLISHED_PET_CHARM
else
quest.sort = quest.sort > CONSTANTS.SORT_ORDER.ITEM and quest.sort or CONSTANTS.SORT_ORDER.ITEM
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.IRRELEVANT
if C("showItems") and C("showOtherItems") then quest.hide = false end
end
end
end
-- gold reward
local money = GetQuestLogRewardMoney(quest.questId);
if money > 20000 then -- >2g, hides these silly low gold extra rewards
hasReward = true
quest.reward.money = floor(BWQ:ValueWithWarModeBonus(quest.questId, money) / 10000) * 10000
quest.sort = quest.sort > CONSTANTS.SORT_ORDER.MONEY and quest.sort or CONSTANTS.SORT_ORDER.MONEY
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.MONEY
if money < 1000000 then
if C("showLowGold") then quest.hide = false end
else
if C("showHighGold") then quest.hide = false end
end
end
local honor = GetQuestLogRewardHonor(quest.questId)
if honor > 0 then
hasReward = true
quest.reward.honor = honor
quest.sort = quest.sort > CONSTANTS.SORT_ORDER.HONOR and quest.sort or CONSTANTS.SORT_ORDER.HONOR
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.HONOR
if C("showHonor") then quest.hide = false end
end
-- currency reward
local rewardCurrencies = C_QuestInfoSystem.GetQuestRewardCurrencies(quest.questId)
if rewardCurrencies then
quest.reward.currencies = {}
for i, currencyInfo in ipairs(rewardCurrencies) do
local name = currencyInfo.name
local texture = currencyInfo.texture
local numItems = currencyInfo.totalRewardAmount
local currencyId = currencyInfo.currencyID
--print(string.format("[BWQ] currencyInfo: %d - %s - %d - %d - %d", i, name, texture, numItems, currencyId)) -- Debugging
if name then
hasReward = true
local currency = {}
if CONSTANTS.CURRENCIES_AFFECTED_BY_WARMODE[currencyId] then
currency.amount = BWQ:ValueWithWarModeBonus(quest.questId, numItems)
else
currency.amount = numItems
end
currency.name = string.format("%d %s", currency.amount, name)
currency.texture = texture
--print(string.format("[BWQ] Quest %s - %s - %s - %s - %s - %s - %s", quest.questId, quest.title, name, currencyId, currency.name, currency.texture, currency.amount)) -- for debugging
if currencyId == 1553 then -- azerite
currency.name = string.format("|cffe5cc80[%d %s]|r", currency.amount, name)
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.ARTIFACTPOWER
quest.reward.azeriteAmount = currency.amount -- todo: improve broker text values?
if C("showArtifactPower") then quest.hide = false end
elseif CONSTANTS.THEWARWITHIN_REPUTATION_CURRENCY_IDS[currencyId] then
currency.name = string.format("%s: %d %s", name, currency.amount, REPUTATION)
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.IRRELEVANT
if C("showTWWReputation") then quest.hide = false end
elseif CONSTANTS.DRAGONFLIGHT_REPUTATION_CURRENCY_IDS[currencyId] then
currency.name = string.format("%s: %d %s", name, currency.amount, REPUTATION)
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.IRRELEVANT
if C("showDFReputation") then quest.hide = false end
elseif CONSTANTS.SHADOWLANDS_REPUTATION_CURRENCY_IDS[currencyId] then
currency.name = string.format("%s: %d %s", name, currency.amount, REPUTATION)
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.IRRELEVANT
if C("showSLReputation") then quest.hide = false end
elseif CONSTANTS.BFA_REPUTATION_CURRENCY_IDS[currencyId] then
currency.name = string.format("%s: %d %s", name, currency.amount, REPUTATION)
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.IRRELEVANT
if C("showBFAReputation") then quest.hide = false end
elseif currencyId == 1560 then -- war resources
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.WAR_RESOURCES
quest.reward.warResourceAmount = currency.amount
if C("showWarResources") then quest.hide = false end
elseif currencyId == 1716 or currencyId == 1717 then -- service medals
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.SERVICE_MEDAL
quest.reward.serviceMedalAmount = currency.amount
if C("showBFAServiceMedals") then quest.hide = false end
elseif currencyId == 1220 then -- order hall resources
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.RESOURCES
quest.reward.resourceAmount = currency.amount
if C("showResources") then quest.hide = false end
elseif currencyId == 1342 then -- legionfall supplies
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.LEGIONFALL_SUPPLIES
quest.reward.legionfallSuppliesAmount = currency.amount
if C("showLegionfallSupplies") then quest.hide = false end
elseif currencyId == 1226 then -- nethershard
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.NETHERSHARD
if C("showNethershards") then quest.hide = false end
elseif currencyId == 1508 then -- argunite
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.ARGUNITE
if C("showArgunite") then quest.hide = false end
elseif currencyId == 1533 then
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.WAKENING_ESSENCE
quest.reward.wakeningEssencesAmount = currency.amount
if C("showWakeningEssences") then quest.hide = false end
elseif currencyId == 1721 then -- prismatic manapearl
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.PRISMATIC_MANAPEARL
quest.reward.prismaticManapearlAmount = currency.amount
if C("showPrismaticManapearl") then quest.hide = false end
elseif currencyId == 1979 then -- cyphers of the first ones (Zereth Mortis - 9.2)
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.CYPHERS_OF_THE_FIRST_ONES
quest.reward.cyphersOfTheFirstOnesAmount = currency.amount
if C("showCyphersOfTheFirstOnes") then quest.hide = false end
elseif currencyId == 1885 then -- grateful offering
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.GRATEFUL_OFFERING
quest.reward.gratefulOfferingAmount = currency.amount
if C("showGratefulOffering") then quest.hide = false end
elseif currencyId == 2123 then -- bloody tokens
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.BLOODY_TOKENS
quest.reward.bloodyTokensAmount = currency.amount
if C("showBloodyTokens") then quest.hide = false end
elseif currencyId == 2003 then -- dragon isles supplies
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.DRAGON_ISLES_SUPPLIES
quest.reward.dragonIslesSuppliesAmount = currency.amount
if C("showDragonIslesSupplies") then quest.hide = false end
elseif currencyId == 2118 then -- elemental overflow
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.ELEMENTAL_OVERFLOW
quest.reward.elementalOverflowAmount = currency.amount
if C("showElementalOverflow") then quest.hide = false end
elseif currencyId == 2245 then -- flightstones
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.FLIGHTSTONES
quest.reward.flightstonesAmount = currency.amount
if C("showFlightstones") then quest.hide = false end
elseif currencyId == 2706 then -- Whelplings Dreaming Crest
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.WHELPLINGS_DREAMING_CREST
quest.reward.WhelplingsDreamingCrestAmount = currency.amount
if C("showWhelplingsDreamingCrest") then quest.hide = false end
elseif currencyId == 2707 then -- Drakes Dreaming Crest
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.DRAKES_DREAMING_CREST
quest.reward.DrakesDreamingCrestAmount = currency.amount
if C("showDrakesDreamingCrest") then quest.hide = false end
elseif currencyId == 2708 then -- Wyrms Dreaming Crest
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.WYRMS_DREAMING_CREST
quest.reward.WyrmsDreamingCrestAmount = currency.amount
if C("showWyrmsDreamingCrest") then quest.hide = false end
elseif currencyId == 2709 then -- Aspects Dreaming Crest
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.ASPECTS_DREAMING_CREST
quest.reward.AspectsDreamingCrestAmount = currency.amount
if C("showAspectsDreamingCrest") then quest.hide = false end
elseif currencyId == 2806 then -- Whelplings Awakened Crest
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.WHELPLINGS_Awakened_CREST
quest.reward.WhelplingsAwakenedCrestAmount = currency.amount
if C("showWhelplingsAwakenedCrest") then quest.hide = false end
elseif currencyId == 2807 then -- Drakes Awakened Crest
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.DRAKES_Awakened_CREST
quest.reward.DrakesAwakenedCrestAmount = currency.amount
if C("showDrakesAwakenedCrest") then quest.hide = false end
elseif currencyId == 2809 then -- Wyrms Awakened Crest
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.WYRMS_Awakened_CREST
quest.reward.WyrmsAwakenedCrestAmount = currency.amount
if C("showWyrmsAwakenedCrest") then quest.hide = false end
elseif currencyId == 2812 then -- Aspects Awakened Crest
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.ASPECTS_Awakened_CREST
quest.reward.AspectsAwakenedCrestAmount = currency.amount
if C("showAspectsAwakenedCrest") then quest.hide = false end
elseif currencyId == 2657 then -- Mysterious Fragment
rewardType[#rewardType+1] = CONSTANTS.REWARD_TYPES.MYSTERIOUS_FRAGMENT