From 1b49aa7d6ae34c72076205586bd5c03afe5beb02 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Thu, 30 Jul 2026 00:23:07 -0500 Subject: [PATCH 1/2] Add support for Staff Life and Mana Mastery --- src/Classes/ModStore.lua | 17 +++++++++++++++++ src/Data/ModCache.lua | 2 +- src/Modules/ModParser.lua | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Classes/ModStore.lua b/src/Classes/ModStore.lua index fdf09770bc..23b96d2518 100644 --- a/src/Classes/ModStore.lua +++ b/src/Classes/ModStore.lua @@ -700,6 +700,23 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits) t_insert(matches, item.name and item.name:lower() == tag.nameCond:lower()) end end + if tag.socketCond then + for _, item in pairs(items) do + local matchSockets = tag.socketCond + for _, socket in ipairs(item.sockets) do + local i = 1 + + while socket.color ~= matchSockets:sub(i, i) and i < #matchSockets do + i = i + 1 + end + -- Removed matched socket until there are no more + if socket.color == matchSockets:sub(i, i) then + matchSockets = (i > 1 and matchSockets:sub(1, i - 1) or "") .. matchSockets:sub(i + 1) + end + end + t_insert(matches, #matchSockets == 0) + end + end local hasItems = false for _, item in pairs(items) do hasItems = true diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index 387ab4f047..7e714516d3 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -3051,7 +3051,7 @@ c["12% increased effect of Non-Curse Auras from your Skills"]={{[1]={[1]={skillT c["12% increased effect of Non-Curse Auras from your skills while your Ward is Broken"]={{[1]={[1]={skillType=43,type="SkillType"},[2]={neg=true,skillType=79,type="SkillType"},[3]={neg=true,type="Condition",var="UnbrokenWard"},flags=0,keywordFlags=0,name="AuraEffect",type="INC",value=12}},nil} c["12% increased maximum Energy Shield"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="EnergyShield",type="INC",value=12}},nil} c["12% increased maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="INC",value=12}},nil} -c["12% increased maximum Life and Mana if your equipped Staff has a Red and Blue Socket"]={{[1]={flags=0,keywordFlags=0,name="Life",type="INC",value=12}}," and Mana if your equipped Staff has a Red and Blue Socket "} +c["12% increased maximum Life and Mana if your equipped Staff has a Red and Blue Socket"]={{[1]={[1]={itemSlot="Weapon 1",socketCond="RB",type="ItemCondition"},flags=0,keywordFlags=0,name="Life",type="INC",value=12},[2]={[1]={itemSlot="Weapon 1",socketCond="RB",type="ItemCondition"},flags=0,keywordFlags=0,name="Mana",type="INC",value=12}},nil} c["12% increased maximum Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="INC",value=12}},nil} c["12% of Damage taken Recouped as Life"]={{[1]={flags=0,keywordFlags=0,name="LifeRecoup",type="BASE",value=12}},nil} c["12% of Damage taken Recouped as Mana"]={{[1]={flags=0,keywordFlags=0,name="ManaRecoup",type="BASE",value=12}},nil} diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 9b311b829f..627745248a 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -170,6 +170,8 @@ local modNameList = { ["maximum life"] = "Life", ["life regeneration rate"] = "LifeRegen", ["life regeneration also applies to energy shield"] = "LifeRegenAppliesToEnergyShield", + ["life and mana"] = { "Life", "Mana" }, + ["maximum life and mana"] = { "Life", "Mana" }, ["mana"] = "Mana", ["maximum mana"] = "Mana", ["mana regeneration"] = "ManaRegen", @@ -1608,6 +1610,7 @@ local modTagList = { ["if equipped ([%a%s]+) has an ([%a%s]+) modifier"] = function (_, itemSlotName, conditionSubstring) return { tag = { type = "ItemCondition", searchCond = conditionSubstring, itemSlot = itemSlotName } } end, ["if both equipped ([%a%s]+) have a?n? ?([%a%s]+) modifiers?"] = function (_, itemSlotName, conditionSubstring) return { tag = { type = "ItemCondition", searchCond = conditionSubstring, itemSlot = itemSlotName:sub(1, #itemSlotName - 1), bothSlots = true } } end, ["if both equipped left and right ([%a%s]+) have a?n? ?([%a%s]+) modifiers?"] = function (_, itemSlotName, conditionSubstring) return { tag = { type = "ItemCondition", searchCond = conditionSubstring, itemSlot = itemSlotName:sub(1, #itemSlotName - 1), bothSlots = true } } end, + ["if your equipped staff has a (%a+) and (%a+) socket"] = function (_, colorA, colorB) return { tag = { type = "ItemCondition", itemSlot = "Weapon 1", socketCond = colorA:sub(1,1):upper() .. colorB:sub(1,1):upper() } } end, ["if there are no ([%a%s]+) modifiers on equipped ([%a%s]+)"] = function (_, conditionSubstring, itemSlotName) return { tag = { type = "ItemCondition", searchCond = conditionSubstring, itemSlot = itemSlotName, neg = true } } end, ["if there are no (%a+) modifiers on other equipped items"] = function(_, conditionSubstring) return {tag = { type = "ItemCondition", searchCond = conditionSubstring, itemSlot = "{SlotName}", allSlots = true, excludeSelf = true, neg = true }} end, ["if corrupted"] = {tag = { type = "ItemCondition", itemSlot = "{SlotName}", corruptedCond = true}}, From 0b02549cf24c395be7cb0ddf8a2c1c69044a0ae1 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Thu, 30 Jul 2026 00:53:05 -0500 Subject: [PATCH 2/2] This already existed in a different form... --- src/Classes/ModStore.lua | 17 ----------------- src/Data/ModCache.lua | 2 +- src/Modules/ModParser.lua | 2 +- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/Classes/ModStore.lua b/src/Classes/ModStore.lua index 23b96d2518..fdf09770bc 100644 --- a/src/Classes/ModStore.lua +++ b/src/Classes/ModStore.lua @@ -700,23 +700,6 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits) t_insert(matches, item.name and item.name:lower() == tag.nameCond:lower()) end end - if tag.socketCond then - for _, item in pairs(items) do - local matchSockets = tag.socketCond - for _, socket in ipairs(item.sockets) do - local i = 1 - - while socket.color ~= matchSockets:sub(i, i) and i < #matchSockets do - i = i + 1 - end - -- Removed matched socket until there are no more - if socket.color == matchSockets:sub(i, i) then - matchSockets = (i > 1 and matchSockets:sub(1, i - 1) or "") .. matchSockets:sub(i + 1) - end - end - t_insert(matches, #matchSockets == 0) - end - end local hasItems = false for _, item in pairs(items) do hasItems = true diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index 7e714516d3..33911cef5d 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -3051,7 +3051,7 @@ c["12% increased effect of Non-Curse Auras from your Skills"]={{[1]={[1]={skillT c["12% increased effect of Non-Curse Auras from your skills while your Ward is Broken"]={{[1]={[1]={skillType=43,type="SkillType"},[2]={neg=true,skillType=79,type="SkillType"},[3]={neg=true,type="Condition",var="UnbrokenWard"},flags=0,keywordFlags=0,name="AuraEffect",type="INC",value=12}},nil} c["12% increased maximum Energy Shield"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="EnergyShield",type="INC",value=12}},nil} c["12% increased maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="INC",value=12}},nil} -c["12% increased maximum Life and Mana if your equipped Staff has a Red and Blue Socket"]={{[1]={[1]={itemSlot="Weapon 1",socketCond="RB",type="ItemCondition"},flags=0,keywordFlags=0,name="Life",type="INC",value=12},[2]={[1]={itemSlot="Weapon 1",socketCond="RB",type="ItemCondition"},flags=0,keywordFlags=0,name="Mana",type="INC",value=12}},nil} +c["12% increased maximum Life and Mana if your equipped Staff has a Red and Blue Socket"]={{[1]={[1]={threshold=1,type="MultiplierThreshold",var="RedSocketInWeapon 1"},[2]={threshold=1,type="MultiplierThreshold",var="BlueSocketInWeapon 1"},[3]={type="Condition",var="UsingStaff"},flags=0,keywordFlags=0,name="Life",type="INC",value=12},[2]={[1]={threshold=1,type="MultiplierThreshold",var="RedSocketInWeapon 1"},[2]={threshold=1,type="MultiplierThreshold",var="BlueSocketInWeapon 1"},[3]={type="Condition",var="UsingStaff"},flags=0,keywordFlags=0,name="Mana",type="INC",value=12}},nil} c["12% increased maximum Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="INC",value=12}},nil} c["12% of Damage taken Recouped as Life"]={{[1]={flags=0,keywordFlags=0,name="LifeRecoup",type="BASE",value=12}},nil} c["12% of Damage taken Recouped as Mana"]={{[1]={flags=0,keywordFlags=0,name="ManaRecoup",type="BASE",value=12}},nil} diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 627745248a..193dbb5d37 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -1610,7 +1610,7 @@ local modTagList = { ["if equipped ([%a%s]+) has an ([%a%s]+) modifier"] = function (_, itemSlotName, conditionSubstring) return { tag = { type = "ItemCondition", searchCond = conditionSubstring, itemSlot = itemSlotName } } end, ["if both equipped ([%a%s]+) have a?n? ?([%a%s]+) modifiers?"] = function (_, itemSlotName, conditionSubstring) return { tag = { type = "ItemCondition", searchCond = conditionSubstring, itemSlot = itemSlotName:sub(1, #itemSlotName - 1), bothSlots = true } } end, ["if both equipped left and right ([%a%s]+) have a?n? ?([%a%s]+) modifiers?"] = function (_, itemSlotName, conditionSubstring) return { tag = { type = "ItemCondition", searchCond = conditionSubstring, itemSlot = itemSlotName:sub(1, #itemSlotName - 1), bothSlots = true } } end, - ["if your equipped staff has a (%a+) and (%a+) socket"] = function (_, colorA, colorB) return { tag = { type = "ItemCondition", itemSlot = "Weapon 1", socketCond = colorA:sub(1,1):upper() .. colorB:sub(1,1):upper() } } end, + ["if your equipped staff has a red and blue socket"] = { tagList = { { type = "MultiplierThreshold", var = "RedSocketInWeapon 1", threshold = 1 }, { type = "MultiplierThreshold", var = "BlueSocketInWeapon 1", threshold = 1 }, { type = "Condition", var = "UsingStaff" } } }, ["if there are no ([%a%s]+) modifiers on equipped ([%a%s]+)"] = function (_, conditionSubstring, itemSlotName) return { tag = { type = "ItemCondition", searchCond = conditionSubstring, itemSlot = itemSlotName, neg = true } } end, ["if there are no (%a+) modifiers on other equipped items"] = function(_, conditionSubstring) return {tag = { type = "ItemCondition", searchCond = conditionSubstring, itemSlot = "{SlotName}", allSlots = true, excludeSelf = true, neg = true }} end, ["if corrupted"] = {tag = { type = "ItemCondition", itemSlot = "{SlotName}", corruptedCond = true}},