Skip to content

Commit 1b581eb

Browse files
author
LocalIdentity
committed
Fix Trade generator subtype exports
Trade query was running in a random order due to pairs JIT stuff Fixed it to use the correct order and also updated it to no longer inherits the subtype for all bases in the same section Fixes the flask generation mod with a `overrideModLineSingular` entry Uses the new rune dagger wording too
1 parent 0c43eb2 commit 1b581eb

File tree

2 files changed

+55
-39
lines changed

2 files changed

+55
-39
lines changed

src/Classes/TradeQueryGenerator.lua

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ function TradeQueryGeneratorClass:ProcessMod(modId, mod, tradeQueryStatsParsed,
229229
elseif modLine == "Has 1 Abyssal Socket" then
230230
specialCaseData.overrideModLineSingular = "Has 1 Abyssal Socket"
231231
modLine = "Has 1 Abyssal Sockets"
232+
elseif modLine == "Flasks gain a Charge every 3 seconds" then
233+
specialCaseData.overrideModLineSingular = "Flasks gain a Charge every 3 seconds"
234+
modLine = "Flasks gain 1 Charges every 3 seconds"
232235
end
233236

234237
-- If this is the first tier for this mod, find matching trade mod and init the entry
@@ -379,7 +382,7 @@ function TradeQueryGeneratorClass:ProcessMod(modId, mod, tradeQueryStatsParsed,
379382
end
380383

381384
function TradeQueryGeneratorClass:GenerateModData(mods, tradeQueryStatsParsed, itemCategoriesMask, itemCategoriesOverride)
382-
for modId, mod in pairs(mods) do
385+
for modId, mod in pairsSortByKey(mods) do
383386
self:ProcessMod(modId, mod, tradeQueryStatsParsed, itemCategoriesMask, itemCategoriesOverride)
384387
end
385388
end
@@ -461,8 +464,26 @@ function TradeQueryGeneratorClass:InitMods()
461464
end
462465
self:GenerateModData(clusterNotableMods, tradeQueryStatsParsed)
463466

464-
-- Base item implicit mods. A lot of this code is duplicated from generateModData(), but with important small logical flow changes to handle the format differences
465-
for baseName, entry in pairs(data.itemBases) do
467+
-- Base item implicit mods. A lot of this code is duplicated from generateModData(), but with important small logical flow changes to handle the format differences
468+
local subTypeState = { }
469+
local function updateRangeSubType(range, entry)
470+
if subTypeState[range] == "mixed" then
471+
return
472+
end
473+
if not entry.subType then
474+
subTypeState[range] = "mixed"
475+
range.subType = nil
476+
return
477+
end
478+
if not range.subType then
479+
range.subType = entry.subType
480+
elseif range.subType ~= entry.subType then
481+
subTypeState[range] = "mixed"
482+
range.subType = nil
483+
end
484+
end
485+
486+
for baseName, entry in pairsSortByKey(data.itemBases) do
466487
if entry.implicit ~= nil then
467488
local stats = { }
468489
for modLine in string.gmatch(entry.implicit, "([^".."\n".."]+)") do
@@ -534,10 +555,11 @@ function TradeQueryGeneratorClass:InitMods()
534555

535556
if tagMatch then
536557
if self.modData[modType][uniqueIndex][category] == nil then
537-
self.modData[modType][uniqueIndex][category] = { min = 999999, max = -999999, subType = entry.subType }
558+
self.modData[modType][uniqueIndex][category] = { min = 999999, max = -999999 }
538559
end
539560

540561
local modRange = self.modData[modType][uniqueIndex][category]
562+
updateRangeSubType(modRange, entry)
541563
if #tokens == 0 then
542564
modRange.min = 1
543565
modRange.max = 1

src/Data/QueryMods.lua

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12571,11 +12571,12 @@ return {
1257112571
},
1257212572
["3386_FlaskGainPerSecond"] = {
1257312573
["Chest"] = {
12574-
["max"] = 3,
12575-
["min"] = 2,
12574+
["max"] = 2,
12575+
["min"] = 1,
1257612576
},
1257712577
["sign"] = "",
1257812578
["specialCaseData"] = {
12579+
["overrideModLineSingular"] = "Flasks gain a Charge every 3 seconds",
1257912580
},
1258012581
["tradeMod"] = {
1258112582
["id"] = "implicit.stat_1193283913",
@@ -58879,7 +58880,6 @@ return {
5887958880
["Boots"] = {
5888058881
["max"] = 20,
5888158882
["min"] = 5,
58882-
["subType"] = "Energy Shield",
5888358883
},
5888458884
["Bow"] = {
5888558885
["max"] = 30,
@@ -58888,7 +58888,6 @@ return {
5888858888
["Chest"] = {
5888958889
["max"] = 20,
5889058890
["min"] = 5,
58891-
["subType"] = "Energy Shield",
5889258891
},
5889358892
["Claw"] = {
5889458893
["max"] = 30,
@@ -58901,12 +58900,10 @@ return {
5890158900
["Gloves"] = {
5890258901
["max"] = 20,
5890358902
["min"] = 5,
58904-
["subType"] = "Energy Shield",
5890558903
},
5890658904
["Helmet"] = {
5890758905
["max"] = 20,
5890858906
["min"] = 5,
58909-
["subType"] = "Energy Shield",
5891058907
},
5891158908
["Shield"] = {
5891258909
["max"] = 10,
@@ -58944,67 +58941,67 @@ return {
5894458941
["1HAxe"] = {
5894558942
["max"] = 30,
5894658943
["min"] = 10,
58947-
["subType"] = "Rune",
58944+
["subType"] = "Rune Dagger",
5894858945
},
5894958946
["1HMace"] = {
5895058947
["max"] = 30,
5895158948
["min"] = 10,
58952-
["subType"] = "Rune",
58949+
["subType"] = "Rune Dagger",
5895358950
},
5895458951
["1HSword"] = {
5895558952
["max"] = 30,
5895658953
["min"] = 10,
58957-
["subType"] = "Rune",
58954+
["subType"] = "Rune Dagger",
5895858955
},
5895958956
["1HWeapon"] = {
5896058957
["max"] = 30,
5896158958
["min"] = 10,
58962-
["subType"] = "Rune",
58959+
["subType"] = "Rune Dagger",
5896358960
},
5896458961
["2HAxe"] = {
5896558962
["max"] = 30,
5896658963
["min"] = 10,
58967-
["subType"] = "Rune",
58964+
["subType"] = "Rune Dagger",
5896858965
},
5896958966
["2HMace"] = {
5897058967
["max"] = 30,
5897158968
["min"] = 10,
58972-
["subType"] = "Rune",
58969+
["subType"] = "Rune Dagger",
5897358970
},
5897458971
["2HSword"] = {
5897558972
["max"] = 30,
5897658973
["min"] = 10,
58977-
["subType"] = "Rune",
58974+
["subType"] = "Rune Dagger",
5897858975
},
5897958976
["2HWeapon"] = {
5898058977
["max"] = 30,
5898158978
["min"] = 10,
58982-
["subType"] = "Rune",
58979+
["subType"] = "Rune Dagger",
5898358980
},
5898458981
["Bow"] = {
5898558982
["max"] = 30,
5898658983
["min"] = 10,
58987-
["subType"] = "Rune",
58984+
["subType"] = "Rune Dagger",
5898858985
},
5898958986
["Claw"] = {
5899058987
["max"] = 30,
5899158988
["min"] = 10,
58992-
["subType"] = "Rune",
58989+
["subType"] = "Rune Dagger",
5899358990
},
5899458991
["Dagger"] = {
5899558992
["max"] = 30,
5899658993
["min"] = 10,
58997-
["subType"] = "Rune",
58994+
["subType"] = "Rune Dagger",
5899858995
},
5899958996
["Staff"] = {
5900058997
["max"] = 30,
5900158998
["min"] = 10,
59002-
["subType"] = "Rune",
58999+
["subType"] = "Rune Dagger",
5900359000
},
5900459001
["Wand"] = {
5900559002
["max"] = 30,
5900659003
["min"] = 10,
59007-
["subType"] = "Rune",
59004+
["subType"] = "Rune Dagger",
5900859005
},
5900959006
["sign"] = "",
5901059007
["specialCaseData"] = {
@@ -59784,67 +59781,67 @@ return {
5978459781
["1HAxe"] = {
5978559782
["max"] = 40,
5978659783
["min"] = 20,
59787-
["subType"] = "Rune",
59784+
["subType"] = "Rune Dagger",
5978859785
},
5978959786
["1HMace"] = {
5979059787
["max"] = 40,
5979159788
["min"] = 20,
59792-
["subType"] = "Rune",
59789+
["subType"] = "Rune Dagger",
5979359790
},
5979459791
["1HSword"] = {
5979559792
["max"] = 40,
5979659793
["min"] = 20,
59797-
["subType"] = "Rune",
59794+
["subType"] = "Rune Dagger",
5979859795
},
5979959796
["1HWeapon"] = {
5980059797
["max"] = 40,
5980159798
["min"] = 20,
59802-
["subType"] = "Rune",
59799+
["subType"] = "Rune Dagger",
5980359800
},
5980459801
["2HAxe"] = {
5980559802
["max"] = 40,
5980659803
["min"] = 20,
59807-
["subType"] = "Rune",
59804+
["subType"] = "Rune Dagger",
5980859805
},
5980959806
["2HMace"] = {
5981059807
["max"] = 40,
5981159808
["min"] = 20,
59812-
["subType"] = "Rune",
59809+
["subType"] = "Rune Dagger",
5981359810
},
5981459811
["2HSword"] = {
5981559812
["max"] = 40,
5981659813
["min"] = 20,
59817-
["subType"] = "Rune",
59814+
["subType"] = "Rune Dagger",
5981859815
},
5981959816
["2HWeapon"] = {
5982059817
["max"] = 40,
5982159818
["min"] = 20,
59822-
["subType"] = "Rune",
59819+
["subType"] = "Rune Dagger",
5982359820
},
5982459821
["Bow"] = {
5982559822
["max"] = 40,
5982659823
["min"] = 20,
59827-
["subType"] = "Rune",
59824+
["subType"] = "Rune Dagger",
5982859825
},
5982959826
["Claw"] = {
5983059827
["max"] = 40,
5983159828
["min"] = 20,
59832-
["subType"] = "Rune",
59829+
["subType"] = "Rune Dagger",
5983359830
},
5983459831
["Dagger"] = {
5983559832
["max"] = 40,
5983659833
["min"] = 20,
59837-
["subType"] = "Rune",
59834+
["subType"] = "Rune Dagger",
5983859835
},
5983959836
["Staff"] = {
5984059837
["max"] = 40,
5984159838
["min"] = 20,
59842-
["subType"] = "Rune",
59839+
["subType"] = "Rune Dagger",
5984359840
},
5984459841
["Wand"] = {
5984559842
["max"] = 40,
5984659843
["min"] = 20,
59847-
["subType"] = "Rune",
59844+
["subType"] = "Rune Dagger",
5984859845
},
5984959846
["sign"] = "",
5985059847
["specialCaseData"] = {
@@ -60850,17 +60847,14 @@ return {
6085060847
["Chest"] = {
6085160848
["max"] = 25,
6085260849
["min"] = 4,
60853-
["subType"] = "Armour/Energy Shield",
6085460850
},
6085560851
["Gloves"] = {
6085660852
["max"] = 25,
6085760853
["min"] = 4,
60858-
["subType"] = "Armour/Energy Shield",
6085960854
},
6086060855
["Helmet"] = {
6086160856
["max"] = 25,
6086260857
["min"] = 4,
60863-
["subType"] = "Armour/Energy Shield",
6086460858
},
6086560859
["Ring"] = {
6086660860
["max"] = 10,

0 commit comments

Comments
 (0)