From bdb6ce4e0d5edc63e6c741d3574394cea4852c8b Mon Sep 17 00:00:00 2001 From: Borna Ivankovic Date: Mon, 25 Dec 2023 22:46:39 +0100 Subject: [PATCH 1/6] Watcher's eye trade search --- src/Classes/TradeQueryGenerator.lua | 54 +- src/Data/QueryMods.lua | 1322 ++++++++++++++++++++++++++- 2 files changed, 1357 insertions(+), 19 deletions(-) diff --git a/src/Classes/TradeQueryGenerator.lua b/src/Classes/TradeQueryGenerator.lua index 8acb5fb978..044947d216 100644 --- a/src/Classes/TradeQueryGenerator.lua +++ b/src/Classes/TradeQueryGenerator.lua @@ -79,6 +79,7 @@ local tradeStatCategoryIndices = { ["Exarch"] = 3, ["Synthesis"] = 3, ["PassiveNode"] = 2, + ["WatchersEye"] = 2, } local influenceSuffixes = { "_shaper", "_elder", "_adjudicator", "_basilisk", "_crusader", "_eyrie"} @@ -401,6 +402,7 @@ function TradeQueryGeneratorClass:InitMods() ["Exarch"] = { }, ["Synthesis"] = { }, ["PassiveNode"] = { }, + ["WatchersEye"] = { }, } -- originates from: https://www.pathofexile.com/api/trade/data/stats @@ -459,6 +461,17 @@ function TradeQueryGeneratorClass:InitMods() end self:GenerateModData(clusterNotableMods, tradeQueryStatsParsed) + -- Watcher's Eye + local watchersEyeMods = {} + for _,v in pairs(data.uniqueMods["Watcher's Eye"]) do + if v.Id:find("SublimeVision") or v.Id:find("SummonArbalist") then + goto continue + end + watchersEyeMods[v.Id] = v.mod + watchersEyeMods[v.Id].type = "WatchersEye" + ::continue:: + end + self:GenerateModData(watchersEyeMods,tradeQueryStatsParsed,{ ["BaseJewel"] = true, ["AnyJewel"] = true },{["AnyJewel"]="AnyJewel"}) -- 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 if entry.implicit ~= nil then @@ -757,12 +770,35 @@ function TradeQueryGeneratorClass:StartQuery(slot, options) itemCategoryQueryStr = "jewel.abyss" itemCategory = "AbyssJewel" elseif slot.slotName:find("Jewel") ~= nil then - itemCategoryQueryStr = "jewel" - itemCategory = options.jewelType .. "Jewel" - if itemCategory == "AbyssJewel" then - itemCategoryQueryStr = "jewel.abyss" - elseif itemCategory == "BaseJewel" then - itemCategoryQueryStr = "jewel.base" + if options.jewelType == "Watcher's Eye" then + special={ + queryExtra = { + name = "Watcher's Eye" + }, + queryFilters = { + type_filters = { + filters = { + category = { + option = "jewel" + }, + rarity = { + option = "unique" + } + } + } + }, + watchersEye = true + } + itemCategory = "AnyJewel" + itemCategoryQueryStr = "jewel" + else + itemCategoryQueryStr = "jewel" + itemCategory = options.jewelType .. "Jewel" + if itemCategory == "AbyssJewel" then + itemCategoryQueryStr = "jewel.abyss" + elseif itemCategory == "BaseJewel" then + itemCategoryQueryStr = "jewel.base" + end end elseif slot.slotName:find("Flask") ~= nil then itemCategoryQueryStr = "flask" @@ -820,6 +856,10 @@ function TradeQueryGeneratorClass:ExecuteQuery() self:GeneratePassiveNodeWeights(self.modData.PassiveNode) return end + if self.calcContext.special.watchersEye then + self:GenerateModWeights(self.modData.WatchersEye) + return + end self:GenerateModWeights(self.modData["Explicit"]) self:GenerateModWeights(self.modData["Implicit"]) if self.calcContext.options.includeCorrupted then @@ -1017,7 +1057,7 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb end if isJewelSlot then - controls.jewelType = new("DropDownControl", {"TOPLEFT",lastItemAnchor,"BOTTOMLEFT"}, 0, 5, 100, 18, { "Any", "Base", "Abyss" }, function(index, value) end) + controls.jewelType = new("DropDownControl", {"TOPLEFT",lastItemAnchor,"BOTTOMLEFT"}, 0, 5, 110, 18, { "Any", "Base", "Abyss", "Watcher's Eye" }, function(index, value) end) controls.jewelType.selIndex = self.lastJewelType or 1 controls.jewelTypeLabel = new("LabelControl", {"RIGHT",controls.jewelType,"LEFT"}, -5, 0, 0, 16, "Jewel Type:") diff --git a/src/Data/QueryMods.lua b/src/Data/QueryMods.lua index 14aa763ca6..474fcffee5 100644 --- a/src/Data/QueryMods.lua +++ b/src/Data/QueryMods.lua @@ -2432,7 +2432,7 @@ return { ["specialCaseData"] = { }, ["tradeMod"] = { - ["id"] = "implicit.stat_2524254339", + ["id"] = "implicit.stat_1229298404", ["text"] = "Culling Strike", ["type"] = "implicit", }, @@ -42620,7 +42620,7 @@ return { ["specialCaseData"] = { }, ["tradeMod"] = { - ["id"] = "explicit.stat_2653955271", + ["id"] = "explicit.stat_1123291426", ["text"] = "Damage Penetrates #% Fire Resistance", ["type"] = "explicit", }, @@ -42654,7 +42654,7 @@ return { ["specialCaseData"] = { }, ["tradeMod"] = { - ["id"] = "explicit.stat_2653955271", + ["id"] = "explicit.stat_1123291426", ["text"] = "Damage Penetrates #% Fire Resistance", ["type"] = "explicit", }, @@ -58054,6 +58054,15 @@ return { ["type"] = "implicit", }, }, + ["implicit.stat_1229298404"] = { + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "implicit.stat_1229298404", + ["text"] = "Culling Strike", + ["type"] = "implicit", + }, + }, ["implicit.stat_1263158408"] = { ["1HAxe"] = { ["max"] = 1, @@ -60010,15 +60019,6 @@ return { ["type"] = "implicit", }, }, - ["implicit.stat_2524254339"] = { - ["specialCaseData"] = { - }, - ["tradeMod"] = { - ["id"] = "implicit.stat_2524254339", - ["text"] = "Culling Strike", - ["type"] = "implicit", - }, - }, ["implicit.stat_2530372417"] = { ["1HAxe"] = { ["max"] = 6, @@ -76369,4 +76369,1302 @@ return { }, }, }, + ["WatchersEye"] = { + ["1577_ZealotryMaximumEnergyShieldPerSecondToMaximumEnergyShieldLeechRate"] = { + ["AnyJewel"] = { + ["max"] = 30, + ["min"] = 30, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2731416566", + ["text"] = "#% increased Maximum total Energy Shield Recovery per second from Leech while affected by Zealotry", + ["type"] = "explicit", + }, + }, + ["1578_ZealotryMaximumEnergyShieldPerSecondToMaximumEnergyShieldLeechRateOld"] = { + ["AnyJewel"] = { + ["max"] = 30, + ["min"] = 30, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2731416566", + ["text"] = "#% increased Maximum total Energy Shield Recovery per second from Leech while affected by Zealotry", + ["type"] = "explicit", + }, + }, + ["4296_HatredAdditionalCriticalStrikeChance"] = { + ["AnyJewel"] = { + ["max"] = 1.8, + ["min"] = 1.2, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2753985507", + ["text"] = "+#% to Critical Strike Chance while affected by Hatred", + ["type"] = "explicit", + }, + }, + ["4322_DeterminationPhysicalDamageReduction"] = { + ["AnyJewel"] = { + ["max"] = 8, + ["min"] = 5, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1873457881", + ["text"] = "#% additional Physical Damage Reduction while affected by Determination", + ["type"] = "explicit", + }, + }, + ["4452_DeterminationAdditionalArmour"] = { + ["AnyJewel"] = { + ["max"] = 1000, + ["min"] = 600, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3742808908", + ["text"] = "+# to Armour while affected by Determination", + ["type"] = "explicit", + }, + }, + ["4540_PrecisionIncreasedAttackDamage"] = { + ["AnyJewel"] = { + ["max"] = 60, + ["min"] = 40, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2048747572", + ["text"] = "#% increased Attack Damage while affected by Precision", + ["type"] = "explicit", + }, + }, + ["4576_PrecisionIncreasedAttackSpeed"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3375743050", + ["text"] = "#% increased Attack Speed while affected by Precision", + ["type"] = "explicit", + }, + }, + ["4688_HatredPhysicalConvertedToCold"] = { + ["AnyJewel"] = { + ["max"] = 40, + ["min"] = 25, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_664849247", + ["text"] = "#% of Physical Damage Converted to Cold Damage while affected by Hatred", + ["type"] = "explicit", + }, + }, + ["4689_AngerPhysicalConvertedToFire"] = { + ["AnyJewel"] = { + ["max"] = 40, + ["min"] = 25, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3624529132", + ["text"] = "#% of Physical Damage Converted to Fire Damage while affected by Anger", + ["type"] = "explicit", + }, + }, + ["4690_WrathPhysicalConvertedToLightning"] = { + ["AnyJewel"] = { + ["max"] = 40, + ["min"] = 25, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2106756686", + ["text"] = "#% of Physical Damage Converted to Lightning Damage while affected by Wrath", + ["type"] = "explicit", + }, + }, + ["4858_GraceBlindEnemiesWhenHit"] = { + ["AnyJewel"] = { + ["max"] = 50, + ["min"] = 30, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2548097895", + ["text"] = "#% chance to Blind Enemies which Hit you while affected by Grace", + ["type"] = "explicit", + }, + }, + ["4866_DeterminationAdditionalBlock"] = { + ["AnyJewel"] = { + ["max"] = 8, + ["min"] = 5, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3692646597", + ["text"] = "+#% Chance to Block Attack Damage while affected by Determination", + ["type"] = "explicit", + }, + }, + ["4923_PrecisionCannotBeBlinded"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1653848515", + ["text"] = "Cannot be Blinded while affected by Precision", + ["type"] = "explicit", + }, + }, + ["4992_ZealotryCastSpeed"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2444534954", + ["text"] = "#% increased Cast Speed while affected by Zealotry", + ["type"] = "explicit", + }, + }, + ["5128_DisciplineAdditionalSpellBlock"] = { + ["AnyJewel"] = { + ["max"] = 8, + ["min"] = 5, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1313498929", + ["text"] = "+#% Chance to Block Spell Damage while affected by Discipline", + ["type"] = "explicit", + }, + }, + ["5149_GraceAdditionalChanceToEvade"] = { + ["AnyJewel"] = { + ["max"] = 8, + ["min"] = 5, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_969576725", + ["text"] = "+#% chance to Evade Attack Hits while affected by Grace", + ["type"] = "explicit", + }, + }, + ["5212_PurityOfElementsChaosResistance"] = { + ["AnyJewel"] = { + ["max"] = 50, + ["min"] = 30, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1138813382", + ["text"] = "+#% to Chaos Resistance while affected by Purity of Elements", + ["type"] = "explicit", + }, + }, + ["5279_HatredIncreasedColdDamage"] = { + ["AnyJewel"] = { + ["max"] = 60, + ["min"] = 40, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1413864591", + ["text"] = "#% increased Cold Damage while affected by Hatred", + ["type"] = "explicit", + }, + }, + ["5312_ZealotryConsecratedGroundEnemyDamageTaken"] = { + ["AnyJewel"] = { + ["max"] = 10, + ["min"] = 8, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2434030180", + ["text"] = "Consecrated Ground you create while affected by Zealotry causes enemies to take #% increased Damage", + ["type"] = "explicit", + }, + }, + ["5315_ZealotryConsecratedGroundEffectLingersForMsAfterLeavingTheArea"] = { + ["AnyJewel"] = { + ["max"] = 2, + ["min"] = 2, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2163419452", + ["text"] = "Effects of Consecrated Ground you create while affected by Zealotry Linger for # seconds", + ["type"] = "explicit", + }, + }, + ["5376_ZealotryCriticalStrikeChanceAgainstEnemiesOnConsecratedGround"] = { + ["AnyJewel"] = { + ["max"] = 120, + ["min"] = 100, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_214835567", + ["text"] = "#% increased Critical Strike Chance against Enemies on Consecrated Ground while affected by Zealotry", + ["type"] = "explicit", + }, + }, + ["5396_WrathIncreasedCriticalStrikeChance"] = { + ["AnyJewel"] = { + ["max"] = 100, + ["min"] = 70, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3357049845", + ["text"] = "#% increased Critical Strike Chance while affected by Wrath", + ["type"] = "explicit", + }, + }, + ["5422_AngerIncreasedCriticalStrikeMultiplier"] = { + ["AnyJewel"] = { + ["max"] = 50, + ["min"] = 30, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3627458291", + ["text"] = "+#% to Critical Strike Multiplier while affected by Anger", + ["type"] = "explicit", + }, + }, + ["5423_PrecisionIncreasedCriticalStrikeMultiplier"] = { + ["AnyJewel"] = { + ["max"] = 30, + ["min"] = 20, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1817023621", + ["text"] = "+#% to Critical Strike Multiplier while affected by Precision", + ["type"] = "explicit", + }, + }, + ["5436_ZealotryCriticalStrikesPenetratesElementalResistances"] = { + ["AnyJewel"] = { + ["max"] = 10, + ["min"] = 8, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2091518682", + ["text"] = "Critical Strikes Penetrate #% of Enemy Elemental Resistances while affected by Zealotry", + ["type"] = "explicit", + }, + }, + ["5538_ClarityDamageTakenFromManaBeforeLife"] = { + ["AnyJewel"] = { + ["max"] = 10, + ["min"] = 6, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2383304564", + ["text"] = "#% of Damage taken from Mana before Life while affected by Clarity", + ["type"] = "explicit", + }, + }, + ["5549_ClarityDamageTakenGainedAsMana"] = { + ["AnyJewel"] = { + ["max"] = 20, + ["min"] = 15, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_380220671", + ["text"] = "#% of Damage taken while affected by Clarity Recouped as Mana", + ["type"] = "explicit", + }, + }, + ["5588_HasteDebuffsExpireFaster"] = { + ["AnyJewel"] = { + ["max"] = 20, + ["min"] = 15, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_207635700", + ["text"] = "Debuffs on you expire #% faster while affected by Haste", + ["type"] = "explicit", + }, + }, + ["5689_MalevolenceDamageOverTimeMultiplier"] = { + ["AnyJewel"] = { + ["max"] = 22, + ["min"] = 18, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2736708072", + ["text"] = "+#% to Damage over Time Multiplier while affected by Malevolence", + ["type"] = "explicit", + }, + }, + ["5759_PurityOfElementsReducedReflectedElementalDamage"] = { + ["AnyJewel"] = { + ["max"] = 50, + ["min"] = 40, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_65331133", + ["text"] = "#% reduced Reflected Elemental Damage taken while affected by Purity of Elements", + ["type"] = "explicit", + }, + }, + ["5838_DisciplineFasterStartOfRecharge"] = { + ["AnyJewel"] = { + ["max"] = 40, + ["min"] = 30, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1016185292", + ["text"] = "#% faster start of Energy Shield Recharge while affected by Discipline", + ["type"] = "explicit", + }, + }, + ["5841_DisciplineEnergyShieldPerHit"] = { + ["AnyJewel"] = { + ["max"] = 30, + ["min"] = 20, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3765507527", + ["text"] = "Gain # Energy Shield per Enemy Hit while affected by Discipline", + ["type"] = "explicit", + }, + }, + ["5845_WrathLightningDamageESLeech"] = { + ["AnyJewel"] = { + ["max"] = 1.5, + ["min"] = 1, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_121436064", + ["text"] = "#% of Lightning Damage is Leeched as Energy Shield while affected by Wrath", + ["type"] = "explicit", + }, + }, + ["5858_DisciplineEnergyShieldRecoveryRate"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_80470845", + ["text"] = "#% increased Energy Shield Recovery Rate while affected by Discipline", + ["type"] = "explicit", + }, + }, + ["5864_DisciplineEnergyShieldRegen"] = { + ["AnyJewel"] = { + ["max"] = 2.5, + ["min"] = 1.5, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_991194404", + ["text"] = "Regenerate #% of Energy Shield per Second while affected by Discipline", + ["type"] = "explicit", + }, + }, + ["5930_DeterminationReducedExtraDamageFromCrits"] = { + ["AnyJewel"] = { + ["max"] = 60, + ["min"] = 40, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_68410701", + ["text"] = "You take #% reduced Extra Damage from Critical Strikes while affected by Determination", + ["type"] = "explicit", + }, + }, + ["5959_AngerIncreasedFireDamage"] = { + ["AnyJewel"] = { + ["max"] = 60, + ["min"] = 40, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3337107517", + ["text"] = "#% increased Fire Damage while affected by Anger", + ["type"] = "explicit", + }, + }, + ["6024_VitalityLifeRecoveryFromFlasks"] = { + ["AnyJewel"] = { + ["max"] = 70, + ["min"] = 50, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_362838683", + ["text"] = "#% increased Life Recovery from Flasks while affected by Vitality", + ["type"] = "explicit", + }, + }, + ["6100_ZealotryGainArcaneSurgeFor4SecondsWhenYouCreateConsecratedGround"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1919069577", + ["text"] = "Gain Arcane Surge for 4 seconds when you create Consecrated Ground while affected by Zealotry", + ["type"] = "explicit", + }, + }, + ["6158_HasteGainOnslaughtOnKill"] = { + ["AnyJewel"] = { + ["max"] = 4, + ["min"] = 4, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1424006185", + ["text"] = "You gain Onslaught for # seconds on Kill while affected by Haste", + ["type"] = "explicit", + }, + }, + ["6169_HasteGainPhasing"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1346311588", + ["text"] = "You have Phasing while affected by Haste", + ["type"] = "explicit", + }, + }, + ["6534_PurityOfIceImmuneToFreeze"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2720072724", + ["text"] = "Immune to Freeze while affected by Purity of Ice", + ["type"] = "explicit", + }, + }, + ["6537_PurityOfFireImmuneToIgnite"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_371612541", + ["text"] = "Immune to Ignite while affected by Purity of Fire", + ["type"] = "explicit", + }, + }, + ["6541_PurityOfLightningImmuneToShock"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_281949611", + ["text"] = "Immune to Shock while affected by Purity of Lightning", + ["type"] = "explicit", + }, + }, + ["6628_MalevolenceLifeAndEnergyShieldRecoveryRate"] = { + ["AnyJewel"] = { + ["max"] = 12, + ["min"] = 8, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3643449791", + ["text"] = "#% increased Recovery rate of Life and Energy Shield while affected by Malevolence", + ["type"] = "explicit", + }, + }, + ["6637_VitalityLifeGainPerHit"] = { + ["AnyJewel"] = { + ["max"] = 30, + ["min"] = 20, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_4259701244", + ["text"] = "Gain # Life per Enemy Hit while affected by Vitality", + ["type"] = "explicit", + }, + }, + ["6643_VitalityDamageLifeLeech"] = { + ["AnyJewel"] = { + ["max"] = 1.2, + ["min"] = 0.8, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3656959867", + ["text"] = "#% of Damage leeched as Life while affected by Vitality", + ["type"] = "explicit", + }, + }, + ["6650_AngerFireDamageLifeLeech"] = { + ["AnyJewel"] = { + ["max"] = 1.5, + ["min"] = 1, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2312747856", + ["text"] = "#% of Fire Damage Leeched as Life while affected by Anger", + ["type"] = "explicit", + }, + }, + ["6673_VitalityLifeRecoveryRate"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2690790844", + ["text"] = "#% increased Life Recovery Rate while affected by Vitality", + ["type"] = "explicit", + }, + }, + ["6683_VitalityFlatLifeRegen"] = { + ["AnyJewel"] = { + ["max"] = 140, + ["min"] = 100, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3489570622", + ["text"] = "Regenerate # Life per Second while affected by Vitality", + ["type"] = "explicit", + }, + }, + ["6690_VitalityPercentLifeRegen"] = { + ["AnyJewel"] = { + ["max"] = 1.5, + ["min"] = 1, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1165583295", + ["text"] = "Regenerate #% of Life per second while affected by Vitality", + ["type"] = "explicit", + }, + }, + ["6728_WrathIncreasedLightningDamage"] = { + ["AnyJewel"] = { + ["max"] = 60, + ["min"] = 40, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_418293304", + ["text"] = "#% increased Lightning Damage while affected by Wrath", + ["type"] = "explicit", + }, + }, + ["7388_WrathLightningDamageManaLeech"] = { + ["AnyJewel"] = { + ["max"] = 1.5, + ["min"] = 1, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2889601846", + ["text"] = "#% of Lightning Damage is Leeched as Mana while affected by Wrath", + ["type"] = "explicit", + }, + }, + ["7397_ClarityManaRecoveryRate"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_556659145", + ["text"] = "#% increased Mana Recovery Rate while affected by Clarity", + ["type"] = "explicit", + }, + }, + ["8232_ClarityManaAddedAsEnergyShield"] = { + ["AnyJewel"] = { + ["max"] = 10, + ["min"] = 6, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2831391506", + ["text"] = "Gain #% of Maximum Mana as Extra Maximum Energy Shield while affected by Clarity", + ["type"] = "explicit", + }, + }, + ["8282_HatredAddedColdDamage"] = { + ["AnyJewel"] = { + ["max"] = 87, + ["min"] = 73, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2643562209", + ["text"] = "Adds # to # Cold Damage while affected by Hatred", + ["type"] = "explicit", + }, + }, + ["8416_HasteCooldownRecoveryForMovementSkills"] = { + ["AnyJewel"] = { + ["max"] = 50, + ["min"] = 30, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3332055899", + ["text"] = "#% increased Cooldown Recovery Rate of Movement Skills used while affected by Haste", + ["type"] = "explicit", + }, + }, + ["8436_GraceIncreasedMovementSpeed"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3329402420", + ["text"] = "#% increased Movement Speed while affected by Grace", + ["type"] = "explicit", + }, + }, + ["8597_AngerPhysicalAddedAsFire"] = { + ["AnyJewel"] = { + ["max"] = 25, + ["min"] = 15, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_4245204226", + ["text"] = "Gain #% of Physical Damage as Extra Fire Damage while affected by Anger", + ["type"] = "explicit", + }, + }, + ["8600_WrathPhysicalAddedAsLightning"] = { + ["AnyJewel"] = { + ["max"] = 25, + ["min"] = 15, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2255914633", + ["text"] = "Gain #% of Physical Damage as Extra Lightning Damage while affected by Wrath", + ["type"] = "explicit", + }, + }, + ["8622_PurityOfElementsTakePhysicalAsCold"] = { + ["AnyJewel"] = { + ["max"] = 12, + ["min"] = 8, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1710207583", + ["text"] = "#% of Physical Damage from Hits taken as Cold Damage while affected by Purity of Elements", + ["type"] = "explicit", + }, + }, + ["8623_PurityOfIceTakePhysicalAsIce"] = { + ["AnyJewel"] = { + ["max"] = 10, + ["min"] = 6, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1779027621", + ["text"] = "#% of Physical Damage from Hits taken as Cold Damage while affected by Purity of Ice", + ["type"] = "explicit", + }, + }, + ["8624_PurityOfElementsTakePhysicalAsFire"] = { + ["AnyJewel"] = { + ["max"] = 12, + ["min"] = 8, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1722775216", + ["text"] = "#% of Physical Damage from Hits taken as Fire Damage while affected by Purity of Elements", + ["type"] = "explicit", + }, + }, + ["8625_PurityOfFireTakePhysicalAsFire"] = { + ["AnyJewel"] = { + ["max"] = 10, + ["min"] = 6, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1798459983", + ["text"] = "#% of Physical Damage from Hits taken as Fire Damage while affected by Purity of Fire", + ["type"] = "explicit", + }, + }, + ["8626_PurityOfElementsTakePhysicalAsLightning"] = { + ["AnyJewel"] = { + ["max"] = 12, + ["min"] = 8, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_873224517", + ["text"] = "#% of Physical Damage from Hits taken as Lightning Damage while affected by Purity of Elements", + ["type"] = "explicit", + }, + }, + ["8627_PurityOfLightningTakePhysicalAsLightning"] = { + ["AnyJewel"] = { + ["max"] = 10, + ["min"] = 6, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_254131992", + ["text"] = "#% of Physical Damage from Hits taken as Lightning Damage while affected by Purity of Lightning", + ["type"] = "explicit", + }, + }, + ["8675_PrideChanceForDoubleDamage"] = { + ["AnyJewel"] = { + ["max"] = 12, + ["min"] = 8, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3371719014", + ["text"] = "#% chance to deal Double Damage while using Pride", + ["type"] = "explicit", + }, + }, + ["8676_PrideChanceToImpale"] = { + ["AnyJewel"] = { + ["max"] = 25, + ["min"] = 25, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_4173751044", + ["text"] = "#% chance to Impale Enemies on Hit with Attacks while using Pride", + ["type"] = "explicit", + }, + }, + ["8677_PrideIntimidateOnHit"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3772848194", + ["text"] = "Your Hits Intimidate Enemies for 4 seconds while you are using Pride", + ["type"] = "explicit", + }, + }, + ["8681_PrideIncreasedPhysicalDamage"] = { + ["AnyJewel"] = { + ["max"] = 60, + ["min"] = 40, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_576528026", + ["text"] = "#% increased Physical Damage while using Pride", + ["type"] = "explicit", + }, + }, + ["8683_PrideImpaleAdditionalHits"] = { + ["AnyJewel"] = { + ["max"] = 2, + ["min"] = 2, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1011863394", + ["text"] = "Impales you inflict last # additional Hits while using Pride", + ["type"] = "explicit", + }, + }, + ["8778_PrecisionFlaskChargeOnCrit"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3772841281", + ["text"] = "Gain a Flask Charge when you deal a Critical Strike while affected by Precision", + ["type"] = "explicit", + }, + }, + ["8788_ClarityRecoverManaOnSkillUse"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1699077932", + ["text"] = "#% chance to Recover 10% of Mana when you use a Skill while affected by Clarity", + ["type"] = "explicit", + }, + }, + ["8814_HatredColdPenetration"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1222888897", + ["text"] = "Damage Penetrates #% Cold Resistance while affected by Hatred", + ["type"] = "explicit", + }, + }, + ["8816_AngerFirePenetration"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3111519953", + ["text"] = "Damage Penetrates #% Fire Resistance while affected by Anger", + ["type"] = "explicit", + }, + }, + ["8817_WrathLightningPenetration"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1077131949", + ["text"] = "Damage Penetrates #% Lightning Resistance while affected by Wrath", + ["type"] = "explicit", + }, + }, + ["8824_DeterminationReducedReflectedPhysicalDamage"] = { + ["AnyJewel"] = { + ["max"] = 50, + ["min"] = 40, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2457540491", + ["text"] = "#% reduced Reflected Physical Damage taken while affected by Determination", + ["type"] = "explicit", + }, + }, + ["8971_ClarityReducedManaCost"] = { + ["AnyJewel"] = { + ["max"] = 5, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2445618239", + ["text"] = "+# to Total Mana Cost of Skills while affected by Clarity", + ["type"] = "explicit", + }, + }, + ["8976_ClarityReducedManaCostNonChannelled"] = { + ["AnyJewel"] = { + ["max"] = 5, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1853636813", + ["text"] = "Non-Channelling Skills have +# to Total Mana Cost while affected by Clarity", + ["type"] = "explicit", + }, + }, + ["9070_GraceChanceToDodge"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 12, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_4071658793", + ["text"] = "+#% chance to Suppress Spell Damage while affected by Grace", + ["type"] = "explicit", + }, + }, + ["9071_HasteChanceToDodgeSpells"] = { + ["AnyJewel"] = { + ["max"] = 8, + ["min"] = 5, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2170859717", + ["text"] = "+#% chance to Suppress Spell Damage while affected by Haste", + ["type"] = "explicit", + }, + }, + ["9316_MalevolenceUnaffectedByBleeding"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_4104891138", + ["text"] = "Unaffected by Bleeding while affected by Malevolence", + ["type"] = "explicit", + }, + }, + ["9320_PurityOfFireUnaffectedByBurningGround"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3308185931", + ["text"] = "Unaffected by Burning Ground while affected by Purity of Fire", + ["type"] = "explicit", + }, + }, + ["9325_PurityOfIceUnaffectedByChilledGround"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2647344903", + ["text"] = "Unaffected by Chilled Ground while affected by Purity of Ice", + ["type"] = "explicit", + }, + }, + ["9326_PurityOfLightningUnaffectedByConductivity"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1567542124", + ["text"] = "Unaffected by Conductivity while affected by Purity of Lightning", + ["type"] = "explicit", + }, + }, + ["9331_PurityOfElementsUnaffectedByElementalWeakness"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3223142064", + ["text"] = "Unaffected by Elemental Weakness while affected by Purity of Elements", + ["type"] = "explicit", + }, + }, + ["9332_GraceUnaffectedByEnfeeble"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2365917222", + ["text"] = "Unaffected by Enfeeble while affected by Grace", + ["type"] = "explicit", + }, + }, + ["9333_PurityOfFireUnaffectedByFlammability"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_1173690938", + ["text"] = "Unaffected by Flammability while affected by Purity of Fire", + ["type"] = "explicit", + }, + }, + ["9335_PurityOfIceUnaffectedByFrostbite"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_4012281889", + ["text"] = "Unaffected by Frostbite while affected by Purity of Ice", + ["type"] = "explicit", + }, + }, + ["9339_MalevolenceUnaffectedByPoison"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_34059570", + ["text"] = "Unaffected by Poison while affected by Malevolence", + ["type"] = "explicit", + }, + }, + ["9345_PurityOfLightningUnaffectedByShockedGround"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2567659895", + ["text"] = "Unaffected by Shocked Ground while affected by Purity of Lightning", + ["type"] = "explicit", + }, + }, + ["9347_HasteUnaffectedByTemporalChains"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_2806391472", + ["text"] = "Unaffected by Temporal Chains while affected by Haste", + ["type"] = "explicit", + }, + }, + ["9348_DeterminationUnaffectedByVulnerability"] = { + ["AnyJewel"] = { + ["max"] = 1, + ["min"] = 1, + }, + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3207781478", + ["text"] = "Unaffected by Vulnerability while affected by Determination", + ["type"] = "explicit", + }, + }, + ["9497_MalevolenceYourAilmentsDealDamageFaster"] = { + ["AnyJewel"] = { + ["max"] = 15, + ["min"] = 10, + }, + ["sign"] = "", + ["specialCaseData"] = { + }, + ["tradeMod"] = { + ["id"] = "explicit.stat_3468843137", + ["text"] = "Damaging Ailments you inflict deal Damage #% faster while affected by Malevolence", + ["type"] = "explicit", + }, + }, + }, } \ No newline at end of file From 05c6930a12240df5a20518cb86a8c83f7930ccbe Mon Sep 17 00:00:00 2001 From: Borna Ivankovic Date: Tue, 30 Jan 2024 18:14:33 +0100 Subject: [PATCH 2/6] Improvements per comments - move find button to separate slot instead of using exisitng jewel sockets - use exisitng Watcher's Eye slot(if available) for usage in weight calculations with test item - added option to include rest of applicable mods from Watcher's Eye mod pool that have weight 0 in final query --- src/Classes/TradeQuery.lua | 27 +++++++- src/Classes/TradeQueryGenerator.lua | 99 +++++++++++++++++++---------- src/Launch.lua | 7 ++ src/Modules/ModParser.lua | 22 +++++++ 4 files changed, 121 insertions(+), 34 deletions(-) diff --git a/src/Classes/TradeQuery.lua b/src/Classes/TradeQuery.lua index 77a9b6a7b6..4a75a5d4ae 100644 --- a/src/Classes/TradeQuery.lua +++ b/src/Classes/TradeQuery.lua @@ -425,8 +425,14 @@ Highest Weight - Displays the order retrieved from trade]] local row_count = #slotTables + 1 self.slotTables[row_count] = { slotName = "Megalomaniac", unique = true, alreadyCorrupted = true } self:PriceItemRowDisplay(row_count, top_pane_alignment_ref, row_vertical_padding, row_height) + top_pane_alignment_ref[2] = self.controls["name"..row_count] row_count = row_count + 1 - + -- Watcher's Eye + if self:findValidSlotForWatchersEye() then + self.slotTables[row_count] = { slotName = "Watcher's Eye", unique = true } + self:PriceItemRowDisplay(row_count, top_pane_alignment_ref, row_vertical_padding, row_height) + row_count = row_count + 1 + end local effective_row_count = row_count + 2 + 2 -- Two top menu rows, two bottom rows local pane_height = (row_height + row_vertical_padding) * effective_row_count + 2 * pane_margins_vertical + row_height / 2 local pane_width = 850 @@ -784,13 +790,30 @@ function TradeQueryClass:addChaosEquivalentPriceToItems(items) return outputItems end +-- return valid slot for Watcher's Eye +function TradeQueryClass:findValidSlotForWatchersEye() + local tmpWE=nil + for _,v in ipairs(data.uniques.generated) do + if v:find("Watcher's Eye") then + tmpWE= new("Item",v) + break + end + end + for _,v in pairs(self.itemsTab.sockets) do + if not v.inactive then + if self.itemsTab:IsItemValidForSlot(tmpWE,v.slotName,self.itemsTab.activeItemSet) then + return self.itemsTab.sockets[v.nodeId] + end + end + end +end -- Method to generate pane elements for each item slot function TradeQueryClass:PriceItemRowDisplay(row_idx, top_pane_alignment_ref, row_vertical_padding, row_height) local controls = self.controls local slotTbl = self.slotTables[row_idx] local activeSlotRef = slotTbl.nodeId and self.itemsTab.activeItemSet[slotTbl.nodeId] or self.itemsTab.activeItemSet[slotTbl.slotName] - local activeSlot = slotTbl.nodeId and self.itemsTab.sockets[slotTbl.nodeId] or slotTbl.slotName and self.itemsTab.slots[slotTbl.slotName] + local activeSlot = slotTbl.nodeId and self.itemsTab.sockets[slotTbl.nodeId] or slotTbl.slotName and self.itemsTab.slots[slotTbl.slotName] or slotTbl.slotName == "Watcher's Eye" and self:findValidSlotForWatchersEye() local nameColor = slotTbl.unique and colorCodes.UNIQUE or "^7" controls["name"..row_idx] = new("LabelControl", top_pane_alignment_ref, 0, row_height + row_vertical_padding, 100, row_height - 4, nameColor..slotTbl.slotName) controls["bestButton"..row_idx] = new("ButtonControl", { "LEFT", controls["name"..row_idx], "LEFT"}, 100 + 8, 0, 80, row_height, "Find best", function() diff --git a/src/Classes/TradeQueryGenerator.lua b/src/Classes/TradeQueryGenerator.lua index 044947d216..1025f86023 100644 --- a/src/Classes/TradeQueryGenerator.lua +++ b/src/Classes/TradeQueryGenerator.lua @@ -686,6 +686,28 @@ function TradeQueryGeneratorClass:StartQuery(slot, options) calcNodesInsteadOfMods = true, } end + if options.special.itemName == "Watcher's Eye" then + special={ + queryExtra = { + name = "Watcher's Eye" + }, + queryFilters = { + type_filters = { + filters = { + category = { + option = "jewel" + }, + rarity = { + option = "unique" + } + } + } + }, + watchersEye = true + } + itemCategory = "AnyJewel" + itemCategoryQueryStr = "jewel" + end elseif slot.slotName == "Weapon 2" or slot.slotName == "Weapon 1" then if existingItem then if existingItem.type == "Shield" then @@ -770,35 +792,12 @@ function TradeQueryGeneratorClass:StartQuery(slot, options) itemCategoryQueryStr = "jewel.abyss" itemCategory = "AbyssJewel" elseif slot.slotName:find("Jewel") ~= nil then - if options.jewelType == "Watcher's Eye" then - special={ - queryExtra = { - name = "Watcher's Eye" - }, - queryFilters = { - type_filters = { - filters = { - category = { - option = "jewel" - }, - rarity = { - option = "unique" - } - } - } - }, - watchersEye = true - } - itemCategory = "AnyJewel" - itemCategoryQueryStr = "jewel" - else - itemCategoryQueryStr = "jewel" - itemCategory = options.jewelType .. "Jewel" - if itemCategory == "AbyssJewel" then - itemCategoryQueryStr = "jewel.abyss" - elseif itemCategory == "BaseJewel" then - itemCategoryQueryStr = "jewel.base" - end + itemCategoryQueryStr = "jewel" + itemCategory = options.jewelType .. "Jewel" + if itemCategory == "AbyssJewel" then + itemCategoryQueryStr = "jewel.abyss" + elseif itemCategory == "BaseJewel" then + itemCategoryQueryStr = "jewel.base" end elseif slot.slotName:find("Flask") ~= nil then itemCategoryQueryStr = "flask" @@ -877,6 +876,28 @@ function TradeQueryGeneratorClass:ExecuteQuery() end end +function TradeQueryGeneratorClass:addMoreWEMods() + local function getTableOfTradeModIds(tbl) + local tmpTable={} + for _,val in ipairs(tbl) do + table.insert(tmpTable,val.tradeModId) + end + return tmpTable + end + for _,skillGroup in ipairs(self.itemsTab.build.skillsTab.socketGroupList) do + for _,gem in ipairs(skillGroup.gemList) do + if gem.gemData.tags.aura and gem.enabled and gem.enableGlobal2 then + local tmpAura=gem.nameSpec:gsub("Vaal ",""):gsub("Impurity","Purity"):gsub("of","Of"):gsub(" ","") + for id,mod in pairs(self.modData.WatchersEye) do + if id:find(tmpAura) and not isValueInTable(getTableOfTradeModIds(self.modWeights),mod.tradeMod.id) then + table.insert(self.modWeights,{invert=false,meanStatDiff=0,weight=0,tradeModId=mod.tradeMod.id}) + end + end + end + end + end +end + function TradeQueryGeneratorClass:FinishQuery() -- Calc original item Stats without anoint or enchant, and use that diff as a basis for default min sum. local originalItem = self.calcContext.slot and self.itemsTab.items[self.calcContext.slot.selItemId] @@ -900,6 +921,10 @@ function TradeQueryGeneratorClass:FinishQuery() local originalOutput = originalItem and self.calcContext.calcFunc({ repSlotName = self.calcContext.slot.slotName, repItem = self.calcContext.testItem }, { nodeAlloc = true }) or self.calcContext.baseOutput local currentStatDiff = TradeQueryGeneratorClass.WeightedRatioOutputs(self.calcContext.baseOutput, originalOutput, self.calcContext.options.statWeights) * 1000 - (self.calcContext.baseStatValue or 0) + if self.calcContext.options.includeAllWEMods then + self:addMoreWEMods() + end + -- Sort by mean Stat diff rather than weight to more accurately prioritize stats that can contribute more table.sort(self.modWeights, function(a, b) return a.meanStatDiff > b.meanStatDiff @@ -1056,14 +1081,14 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb popupHeight = popupHeight + 23 end - if isJewelSlot then - controls.jewelType = new("DropDownControl", {"TOPLEFT",lastItemAnchor,"BOTTOMLEFT"}, 0, 5, 110, 18, { "Any", "Base", "Abyss", "Watcher's Eye" }, function(index, value) end) + if isJewelSlot and context.slotTbl.slotName ~= "Watcher's Eye" then + controls.jewelType = new("DropDownControl", {"TOPLEFT",lastItemAnchor,"BOTTOMLEFT"}, 0, 5, 100, 18, { "Any", "Base", "Abyss" }, function(index, value) end) controls.jewelType.selIndex = self.lastJewelType or 1 controls.jewelTypeLabel = new("LabelControl", {"RIGHT",controls.jewelType,"LEFT"}, -5, 0, 0, 16, "Jewel Type:") lastItemAnchor = controls.jewelType popupHeight = popupHeight + 23 - elseif slot and not isAbyssalJewelSlot then + elseif slot and not isAbyssalJewelSlot and context.slotTbl.slotName ~= "Watcher's Eye" then controls.influence1 = new("DropDownControl", {"TOPLEFT",lastItemAnchor,"BOTTOMLEFT"}, 0, 5, 100, 18, influenceDropdownNames, function(index, value) end) controls.influence1.selIndex = self.lastInfluence1 or 1 controls.influence1Label = new("LabelControl", {"RIGHT",controls.influence1,"LEFT"}, -5, 0, 0, 16, "Influence 1:") @@ -1136,6 +1161,13 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb end popupHeight = popupHeight + 4 + if context.slotTbl.slotName == "Watcher's Eye" then + controls.includeAllWEMods = new("CheckBoxControl", {"TOPRIGHT",lastItemAnchor,"BOTTOMRIGHT"}, 0, 5, 18, "Include all Watcher's Eye mods:", function(state) end) + controls.includeAllWEMods.tooltipText = "Include all Watcher's Eye mods in the generated query for which weights couldn't be calculated" + lastItemAnchor = controls.includeAllWEMods + popupHeight = popupHeight + 23 + end + controls.generateQuery = new("ButtonControl", { "BOTTOM", nil, "BOTTOM" }, -45, -10, 80, 20, "Execute", function() main:ClosePopup() @@ -1175,6 +1207,9 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb options.maxPrice = tonumber(controls.maxPrice.buf) options.maxPriceType = currencyTable[controls.maxPriceType.selIndex].id end + if controls.includeAllWEMods then + options.includeAllWEMods = controls.includeAllWEMods.state + end options.statWeights = statWeights self:StartQuery(slot, options) diff --git a/src/Launch.lua b/src/Launch.lua index 0775ec4dc2..b8ff97ca20 100644 --- a/src/Launch.lua +++ b/src/Launch.lua @@ -16,6 +16,13 @@ launch = { } SetMainObject(launch) function launch:OnInit() + -- This is the path to emmy_core.dll. The ?.dll at the end is intentional. + package.cpath = package.cpath .. ";C:/Users/borna/.vscode/extensions/tangzx.emmylua-0.5.19/debugger/emmy/windows/x86/?.dll" + local dbg = require("emmy_core") + -- This port must match the Visual Studio Code configuration. Default is 9966. + dbg.tcpListen("localhost", 9966) + -- Uncomment the next line if you want Path of Building to block until the debugger is attached + -- dbg.waitIDE() self.devMode = false self.installedMode = false self.versionNumber = "?" diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 692a44a1f8..ea7ef9432f 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -4840,6 +4840,28 @@ local specialModList = { ["nearby allies have (%d+)%% chance to block attack damage per (%d+) strength you have"] = function(block, _, str) return { mod("ExtraAura", "LIST", { onlyAllies = true, mod = mod("BlockChance", "BASE", block) }, { type = "PerStat", stat = "Str", div = tonumber(str) }), } end, + -- Watcher's Eye special cases + ["immune to ignite while affected by purity of fire"] = { flag("IgniteImmune", { type = "Condition", var = "AffectedByPurityofFire" }) }, + ["immune to freeze while affected by purity of ice"] = { flag("FreezeImmune", { type = "Condition", var = "AffectedByPurityofIce" }) }, + ["immune to shock while affected by purity of lightning"] = { flag("ShockImmune", { type = "Condition", var = "AffectedByPurityofLightning" }) }, + ["unaffected by vulnerability while affected by determination"] = { mod("CurseEffectOnSelf", "MORE", -100, { type = "SkillName", var = "Vulnerability" }, { type = "Condition", var = "AffectedByDetermination" }) }, + ["unaffected by enfeeble while affected by grace"] = { mod("CurseEffectOnSelf", "MORE", -100, { type = "SkillName", var = "Enfeeble" }, { type = "Condition", var = "AffectedByGrace" }) }, + ["unaffected by temporal chains while affected by haste"] = { mod("CurseEffectOnSelf", "MORE", -100, { type = "SkillName", skillName = "Temporal Chains" }, { type = "Condition", var = "AffectedByHaste" }) }, + ["unaffected by bleeding while affected by malevolence"] = { mod("SelfBleedEffect", "MORE", -100, { type = "Condition", var = "AffectedByMalevolence" }) }, + ["unaffected by poison while affected by malevolence"] = { mod("SelfPoisonEffect", "MORE", -100, { type = "Condition", var = "AffectedByMalevolence" }) }, + ["unaffected by elemental weakness while affected by purity of elements"] = { mod("CurseEffectOnSelf", "MORE", -100, { type = "SkillName", var = "Elemental Weakness" }, { type = "Condition", var = "AffectedByPurityofElements" }) }, + ["unaffected by flammability while affected by purity of fire"] = { mod("CurseEffectOnSelf", "MORE", -100, { type = "SkillName", var = "Flammability" }, { type = "Condition", var = "AffectedByPurityofFire" }) }, + ["unaffected by frostbite while affected by purity of ice"] = { mod("CurseEffectOnSelf", "MORE", -100, { type = "SkillName", var = "Frostbite" }, { type = "Condition", var = "AffectedByPurityofIce" }) }, + ["unaffected by conductivity while affected by purity of lightning"] = { mod("CurseEffectOnSelf", "MORE", -100, { type = "SkillName", var = "Conductivity" }, { type = "Condition", var = "AffectedByPurityofLightning" }) }, + ["cannot be blinded while affected by precision"] = { flag("Condition:CannotBeBlinded",{type = "Condition", var = "AffectedByPrecision"}) }, + ["your hits intimidate enemies for 4 seconds while you are using pride"] = { mod("EnemyModifier", "LIST", { mod = flag("Condition:Intimidated") }, { type = "Condition", var = "AffectedByPride" }) }, + ["(%d+)%% chance to blind enemies which hit you while affected by grace"] = function(num) return { mod("EnemyModifier","LIST",{mod=flag("Condition:Blinded")},{type="Condition",var="AffectedByGrace"}) } end, + ["debuffs on you expire (%d+)%% faster while affected by haste"] = function(num) return { mod("SelfDebuffExpirationRate", "BASE", num, {type = "Condition", var = "AffectedByHaste"}) } end, + ["(%d+)%% chance to recover 10%% of mana when you use a skill while affected by clarity"] = { mod("","", 0,{type="Condition",var="AffectedByClarity"})}, + ["effects of consecrated ground you create while affected by zealotry linger for 2 seconds"] = { mod("","", 0,{type="Condition",var="AffectedByZealotry"})}, + ["unaffected by shocked ground while affected by purity of lightning"] = { mod("","", 0,{type="Condition",var="AffectedByPurityofLightning"}) }, + ["unaffected by chilled ground while affected by purity of ice"] = { mod("","", 0,{type="Condition",var="AffectedByPurityofIce"}) }, + ["unaffected by burning ground while affected by purity of fire"] = { mod("","", 0,{type="Condition",var="AffectedByPurityofFire"}) }, } for _, name in pairs(data.keystones) do specialModList[name:lower()] = { mod("Keystone", "LIST", name) } From 0dd17a22d4a7fafe8d7df2bc4af5c24479a2f1ae Mon Sep 17 00:00:00 2001 From: Borna Ivankovic Date: Tue, 30 Jan 2024 20:05:54 +0100 Subject: [PATCH 3/6] fix merge mistake --- src/Classes/TradeQuery.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Classes/TradeQuery.lua b/src/Classes/TradeQuery.lua index 9e99baba83..56a65bcfeb 100644 --- a/src/Classes/TradeQuery.lua +++ b/src/Classes/TradeQuery.lua @@ -482,11 +482,6 @@ Highest Weight - Displays the order retrieved from trade]] return scrollBarShown end - - local effective_row_count = row_count + 2 + 2 -- Two top menu rows, two bottom rows - local pane_height = (row_height + row_vertical_padding) * effective_row_count + 2 * pane_margins_vertical + row_height / 2 - local pane_width = 850 - self.controls.fullPrice = new("LabelControl", {"BOTTOM", nil, "BOTTOM"}, 0, -row_height - pane_margins_vertical - row_vertical_padding, pane_width - 2 * pane_margins_horizontal, row_height, "") GlobalCache.useFullDPS = GlobalCache.numActiveSkillInFullDPS > 0 self.controls.close = new("ButtonControl", {"BOTTOM", nil, "BOTTOM"}, 0, -pane_margins_vertical, 90, row_height, "Done", function() From ef32c2c476f72dd68b644080651e240eb5cde4c6 Mon Sep 17 00:00:00 2001 From: Borna Ivankovic Date: Tue, 30 Jan 2024 20:14:29 +0100 Subject: [PATCH 4/6] remove debugger setup -.- --- src/Launch.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Launch.lua b/src/Launch.lua index b8ff97ca20..0775ec4dc2 100644 --- a/src/Launch.lua +++ b/src/Launch.lua @@ -16,13 +16,6 @@ launch = { } SetMainObject(launch) function launch:OnInit() - -- This is the path to emmy_core.dll. The ?.dll at the end is intentional. - package.cpath = package.cpath .. ";C:/Users/borna/.vscode/extensions/tangzx.emmylua-0.5.19/debugger/emmy/windows/x86/?.dll" - local dbg = require("emmy_core") - -- This port must match the Visual Studio Code configuration. Default is 9966. - dbg.tcpListen("localhost", 9966) - -- Uncomment the next line if you want Path of Building to block until the debugger is attached - -- dbg.waitIDE() self.devMode = false self.installedMode = false self.versionNumber = "?" From c2ce9d366b683bd45c7e43e5322b3455dcce35be Mon Sep 17 00:00:00 2001 From: Borna Ivankovic Date: Fri, 2 Feb 2024 20:37:05 +0100 Subject: [PATCH 5/6] Fix getting unweighted mods --- src/Classes/TradeQueryGenerator.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Classes/TradeQueryGenerator.lua b/src/Classes/TradeQueryGenerator.lua index 98e08b87d6..df76c6ff4c 100644 --- a/src/Classes/TradeQueryGenerator.lua +++ b/src/Classes/TradeQueryGenerator.lua @@ -887,14 +887,22 @@ function TradeQueryGeneratorClass:addMoreWEMods() end for _,skillGroup in ipairs(self.itemsTab.build.skillsTab.socketGroupList) do for _,gem in ipairs(skillGroup.gemList) do - if gem.gemData.tags.aura and gem.enabled and gem.enableGlobal2 then - local tmpAura=gem.nameSpec:gsub("Vaal ",""):gsub("Impurity","Purity"):gsub("of","Of"):gsub(" ","") - for id,mod in pairs(self.modData.WatchersEye) do - if id:find(tmpAura) and not isValueInTable(getTableOfTradeModIds(self.modWeights),mod.tradeMod.id) then - table.insert(self.modWeights,{invert=false,meanStatDiff=0,weight=0,tradeModId=mod.tradeMod.id}) - end + local tmpAura="" + if not gem.enabled then + goto continue + elseif gem.nameSpec:find("Vaal") and gem.enableGlobal2 then + tmpAura=gem.nameSpec:gsub("Vaal ",""):gsub("Impurity","Purity"):gsub("of","Of"):gsub(" ","") + elseif gem.gemData and gem.gemData.tags.aura or gem.fromItem then + tmpAura=gem.nameSpec:gsub("of","Of"):gsub(" ","") + else + goto continue + end + for id,mod in pairs(self.modData.WatchersEye) do + if id:find(tmpAura) and not isValueInTable(getTableOfTradeModIds(self.modWeights),mod.tradeMod.id) then + table.insert(self.modWeights,{invert=false,meanStatDiff=0,weight=0,tradeModId=mod.tradeMod.id}) end end + ::continue:: end end end From bbb26263d0dd709a985cc18064fc3ab99ca53936 Mon Sep 17 00:00:00 2001 From: Borna Ivankovic Date: Fri, 2 Feb 2024 21:09:43 +0100 Subject: [PATCH 6/6] Actually include corrupted mods --- src/Classes/TradeQueryGenerator.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Classes/TradeQueryGenerator.lua b/src/Classes/TradeQueryGenerator.lua index df76c6ff4c..e9c6d3e349 100644 --- a/src/Classes/TradeQueryGenerator.lua +++ b/src/Classes/TradeQueryGenerator.lua @@ -858,6 +858,9 @@ function TradeQueryGeneratorClass:ExecuteQuery() end if self.calcContext.special.watchersEye then self:GenerateModWeights(self.modData.WatchersEye) + if self.calcContext.options.includeCorrupted then + self:GenerateModWeights(self.modData["Corrupted"]) + end return end self:GenerateModWeights(self.modData["Explicit"])