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

Commit b609d17

Browse files
Merge pull request #21 from deathbeam/levlelvs
Add support for parsing elemental spell levels
2 parents 0e636f4 + b3c9446 commit b609d17

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/Data/ModCache.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ c["+3 to Level of all Defiance Banner Skills"]={{[1]={flags=0,keywordFlags=0,nam
202202
c["+3 to Level of all Demon Form Skills"]={{[1]={flags=0,keywordFlags=0,name="GemProperty",type="LIST",value={key="level",keyword="demon form",value=3}}},nil}
203203
c["+3 to Level of all Despair Skills"]={{[1]={flags=0,keywordFlags=0,name="GemProperty",type="LIST",value={key="level",keyword="despair",value=3}}},nil}
204204
c["+3 to Level of all Detonate Dead Skills"]={{[1]={flags=0,keywordFlags=0,name="GemProperty",type="LIST",value={key="level",keyword="detonate dead",value=3}}},nil}
205-
c["+3 to Level of all Detonate Minion Skills"]={{[1]={flags=0,keywordFlags=0,name="GemProperty",type="LIST",value={key="level",keyword="detonate minion",value=3}}},nil}
205+
c["+3 to Level of all Detonate Minion Skills"]={{[1]={flags=0,keywordFlags=0,name="GemProperty",type="LIST",value={key="level",keywordList={[1]="detonate",[2]="minion"},value=3}}},nil}
206206
c["+3 to Level of all Detonating Arrow Skills"]={{[1]={flags=0,keywordFlags=0,name="GemProperty",type="LIST",value={key="level",keyword="detonating arrow",value=3}}},nil}
207207
c["+3 to Level of all Discipline Skills"]={{[1]={flags=0,keywordFlags=0,name="GemProperty",type="LIST",value={key="level",keyword="discipline",value=3}}},nil}
208208
c["+3 to Level of all Dread Banner Skills"]={{[1]={flags=0,keywordFlags=0,name="GemProperty",type="LIST",value={key="level",keyword="dread banner",value=3}}},nil}

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)