Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit 7ce3ebd

Browse files
committed
Add support for parsing elemental spell levels
Closes PathOfBuildingCommunity/PathOfBuilding-PoE2#213 Signed-off-by: Tomas Slusny <[email protected]>
1 parent 79e757d commit 7ce3ebd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/Modules/ModParser.lua

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,25 +2840,25 @@ local specialModList = {
28402840
["has no attribute requirements"] = { flag("NoAttributeRequirements") },
28412841
-- Skill modifiers
28422842
["([%+%-]%d+)%% to quality of all skills"] = function(num) return { mod("GemProperty", "LIST", { keyword = "grants_active_skill", key = "quality", value = num, keyOfScaledMod = "value" }) } end,
2843-
["([%+%-]%d+)%%? to (%a+) of all ?([%a%- ]*) skills"] = function(num, _, property, type)
2843+
["([%+%-]%d+)%%? to (%a+) of all ?([%a%-' ]*) skills"] = function(num, _, property, type)
28442844
if type == "" then type = "all" end
2845-
return { mod("GemProperty", "LIST", { keyword = type, key = property, value = num, keyOfScaledMod = "value" }) }
2845+
if gemIdLookup[type] or gemIdLookup["load " .. type] or gemIdLookup[type .. " minion"] then
2846+
return { mod("GemProperty", "LIST", {keyword = type, key = "level", value = num }) }
2847+
end
2848+
local wordList = {}
2849+
for tag in type:gmatch("%w+") do
2850+
table.insert(wordList, tag)
2851+
end
2852+
if #wordList == 1 then
2853+
return { mod("GemProperty", "LIST", { keyword = wordList[1], key = property, value = num }) }
2854+
end
2855+
return { mod("GemProperty", "LIST", { keywordList = wordList, key = property, value = num }) }
28462856
end,
28472857
["grants level (%d+) snipe skill"] = function(num) return {
28482858
mod("ExtraSkill", "LIST", { skillId = "Snipe", level = num }),
28492859
mod("ExtraSupport", "LIST", { skillId = "ChannelledSnipeSupport", level = num }, { type = "SocketedIn", slotName = "{SlotName}" }),
28502860
} end,
28512861
-- Global gem modifiers
2852-
["([%+%-]%d+)%%? to (%a+) of all (.+) skills"] = function(num, _, property, skill)
2853-
if gemIdLookup[skill] then
2854-
return { mod("GemProperty", "LIST", {keyword = skill, key = "level", value = num, keyOfScaledMod = "value" }) }
2855-
end
2856-
local wordList = {}
2857-
for tag in skill:gmatch("%w+") do
2858-
table.insert(wordList, tag)
2859-
end
2860-
return { mod("GemProperty", "LIST", {keywordList = wordList, key = property, value = num, keyOfScaledMod = "value" }) }
2861-
end,
28622862
["gems socketed in red sockets have [%+%-](%d+) to level"] = function(num) return { mod("GemProperty", "LIST", { keyword = "all", key = "level", value = num, keyOfScaledMod = "value" }, { type = "SocketedIn", slotName = "{SlotName}", socketColor = "R" }) } end,
28632863
["gems socketed in green sockets have [%+%-](%d+)%% to quality"] = function(num) return { mod("GemProperty", "LIST", { keyword = "all", key = "quality", value = num, keyOfScaledMod = "value" }, { type = "SocketedIn", slotName = "{SlotName}", socketColor = "G" }) } end,
28642864
["%+(%d+)%% to fire resistance when socketed with a red gem"] = function(num) return { mod("SocketProperty", "LIST", { value = mod("FireResist", "BASE", num) }, { type = "SocketedIn", slotName = "{SlotName}", keyword = "strength", sockets = {1} }) } end,

0 commit comments

Comments
 (0)