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
This commit is contained in:
LocalIdentity
2025-11-07 17:59:40 +11:00
parent 0c43eb230b
commit 1b581eb98c
2 changed files with 55 additions and 39 deletions

View File

@@ -229,6 +229,9 @@ function TradeQueryGeneratorClass:ProcessMod(modId, mod, tradeQueryStatsParsed,
elseif modLine == "Has 1 Abyssal Socket" then
specialCaseData.overrideModLineSingular = "Has 1 Abyssal Socket"
modLine = "Has 1 Abyssal Sockets"
elseif modLine == "Flasks gain a Charge every 3 seconds" then
specialCaseData.overrideModLineSingular = "Flasks gain a Charge every 3 seconds"
modLine = "Flasks gain 1 Charges every 3 seconds"
end
-- 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,
end
function TradeQueryGeneratorClass:GenerateModData(mods, tradeQueryStatsParsed, itemCategoriesMask, itemCategoriesOverride)
for modId, mod in pairs(mods) do
for modId, mod in pairsSortByKey(mods) do
self:ProcessMod(modId, mod, tradeQueryStatsParsed, itemCategoriesMask, itemCategoriesOverride)
end
end
@@ -461,8 +464,26 @@ function TradeQueryGeneratorClass:InitMods()
end
self:GenerateModData(clusterNotableMods, tradeQueryStatsParsed)
-- 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
for baseName, entry in pairs(data.itemBases) do
-- 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
local subTypeState = { }
local function updateRangeSubType(range, entry)
if subTypeState[range] == "mixed" then
return
end
if not entry.subType then
subTypeState[range] = "mixed"
range.subType = nil
return
end
if not range.subType then
range.subType = entry.subType
elseif range.subType ~= entry.subType then
subTypeState[range] = "mixed"
range.subType = nil
end
end
for baseName, entry in pairsSortByKey(data.itemBases) do
if entry.implicit ~= nil then
local stats = { }
for modLine in string.gmatch(entry.implicit, "([^".."\n".."]+)") do
@@ -534,10 +555,11 @@ function TradeQueryGeneratorClass:InitMods()
if tagMatch then
if self.modData[modType][uniqueIndex][category] == nil then
self.modData[modType][uniqueIndex][category] = { min = 999999, max = -999999, subType = entry.subType }
self.modData[modType][uniqueIndex][category] = { min = 999999, max = -999999 }
end
local modRange = self.modData[modType][uniqueIndex][category]
updateRangeSubType(modRange, entry)
if #tokens == 0 then
modRange.min = 1
modRange.max = 1

View File

@@ -12571,11 +12571,12 @@ return {
},
["3386_FlaskGainPerSecond"] = {
["Chest"] = {
["max"] = 3,
["min"] = 2,
["max"] = 2,
["min"] = 1,
},
["sign"] = "",
["specialCaseData"] = {
["overrideModLineSingular"] = "Flasks gain a Charge every 3 seconds",
},
["tradeMod"] = {
["id"] = "implicit.stat_1193283913",
@@ -58879,7 +58880,6 @@ return {
["Boots"] = {
["max"] = 20,
["min"] = 5,
["subType"] = "Energy Shield",
},
["Bow"] = {
["max"] = 30,
@@ -58888,7 +58888,6 @@ return {
["Chest"] = {
["max"] = 20,
["min"] = 5,
["subType"] = "Energy Shield",
},
["Claw"] = {
["max"] = 30,
@@ -58901,12 +58900,10 @@ return {
["Gloves"] = {
["max"] = 20,
["min"] = 5,
["subType"] = "Energy Shield",
},
["Helmet"] = {
["max"] = 20,
["min"] = 5,
["subType"] = "Energy Shield",
},
["Shield"] = {
["max"] = 10,
@@ -58944,67 +58941,67 @@ return {
["1HAxe"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["1HMace"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["1HSword"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["1HWeapon"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["2HAxe"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["2HMace"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["2HSword"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["2HWeapon"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["Bow"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["Claw"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["Dagger"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["Staff"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["Wand"] = {
["max"] = 30,
["min"] = 10,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["sign"] = "",
["specialCaseData"] = {
@@ -59784,67 +59781,67 @@ return {
["1HAxe"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["1HMace"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["1HSword"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["1HWeapon"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["2HAxe"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["2HMace"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["2HSword"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["2HWeapon"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["Bow"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["Claw"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["Dagger"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["Staff"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["Wand"] = {
["max"] = 40,
["min"] = 20,
["subType"] = "Rune",
["subType"] = "Rune Dagger",
},
["sign"] = "",
["specialCaseData"] = {
@@ -60850,17 +60847,14 @@ return {
["Chest"] = {
["max"] = 25,
["min"] = 4,
["subType"] = "Armour/Energy Shield",
},
["Gloves"] = {
["max"] = 25,
["min"] = 4,
["subType"] = "Armour/Energy Shield",
},
["Helmet"] = {
["max"] = 25,
["min"] = 4,
["subType"] = "Armour/Energy Shield",
},
["Ring"] = {
["max"] = 10,