From 5897252bd78197e723f69a7627875072a88844be Mon Sep 17 00:00:00 2001 From: Nostrademous Date: Fri, 18 Sep 2020 15:31:59 -0400 Subject: [PATCH 1/9] fixing stats; other stuff still broken --- Export/statdesc.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Export/statdesc.lua b/Export/statdesc.lua index a25af6b2a9..99f17cb5dd 100644 --- a/Export/statdesc.lua +++ b/Export/statdesc.lua @@ -85,7 +85,7 @@ for k, v in pairs(nk) do print("'"..k.."' = '"..v.."'") end -local function matchLimit(lang, val) +local function matchLimit(lang, val) for _, desc in ipairs(lang) do local match = true for i, limit in ipairs(desc.limit) do @@ -191,22 +191,22 @@ function describeStats(stats) val[spec.v].max = 100 + val[spec.v].max end end - local statDesc = desc.text:gsub("%%(%d)%%", function(n) - local v = val[tonumber(n)] + local statDesc = desc.text:gsub("{(%d)}", function(n) + local v = val[tonumber(n)+1] if v.min == v.max then return string.format("%"..v.fmt, v.min) else return string.format("(%"..v.fmt.."-%"..v.fmt..")", v.min, v.max) end - end):gsub("%%d", function() + end):gsub("{:(%+?)d}", function() local v = val[1] if v.min == v.max then return string.format("%"..v.fmt, v.min) else return string.format("(%"..v.fmt.."-%"..v.fmt..")", v.min, v.max) end - end):gsub("%%(%d)$(%+?)d", function(n, fmt) - local v = val[tonumber(n)] + end):gsub("{(%d):(%+?)d}", function(n, fmt) + local v = val[tonumber(n)+1] if v.min == v.max then return string.format("%"..fmt..v.fmt, v.min) elseif fmt == "+" then @@ -233,14 +233,18 @@ function describeStats(stats) end function describeMod(mod) + ConPrintf("HERE2") local stats = { } for i = 1, 6 do if mod["Stat"..i] then stats[mod["Stat"..i].Id] = { min = mod["Stat"..i.."Value"][1], max = mod["Stat"..i.."Value"][2] } + ConPrintf("Has Stat %d - %s %s %s", i, mod["Stat"..i].Id, mod["Stat"..i.."Value"][1], mod["Stat"..i.."Value"][2]) end end if mod.Type then + ConPrintf("HAS MOD TYPE: %s", mod.Type) stats.Type = mod.Type end + ConPrintf("HERE2 DONE") return describeStats(stats) end From 2436660fec21c2abc67add264c43259f40c1003f Mon Sep 17 00:00:00 2001 From: Nostrademous Date: Fri, 18 Sep 2020 15:33:37 -0400 Subject: [PATCH 2/9] removing prints --- Export/statdesc.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Export/statdesc.lua b/Export/statdesc.lua index 99f17cb5dd..a5983a39e1 100644 --- a/Export/statdesc.lua +++ b/Export/statdesc.lua @@ -233,18 +233,14 @@ function describeStats(stats) end function describeMod(mod) - ConPrintf("HERE2") local stats = { } for i = 1, 6 do if mod["Stat"..i] then stats[mod["Stat"..i].Id] = { min = mod["Stat"..i.."Value"][1], max = mod["Stat"..i.."Value"][2] } - ConPrintf("Has Stat %d - %s %s %s", i, mod["Stat"..i].Id, mod["Stat"..i.."Value"][1], mod["Stat"..i.."Value"][2]) end end if mod.Type then - ConPrintf("HAS MOD TYPE: %s", mod.Type) stats.Type = mod.Type end - ConPrintf("HERE2 DONE") return describeStats(stats) end From 39b121224bc7049f17468277441cd50549e18e18 Mon Sep 17 00:00:00 2001 From: Nostrademous Date: Fri, 18 Sep 2020 15:56:42 -0400 Subject: [PATCH 3/9] fixed mods --- Export/statdesc.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Export/statdesc.lua b/Export/statdesc.lua index a5983a39e1..5130650b1e 100644 --- a/Export/statdesc.lua +++ b/Export/statdesc.lua @@ -49,10 +49,11 @@ function loadStatFile(fileName) local desc = { text = text, limit = { } } for statLimit in statLimits:gmatch("[%d%-#|]+") do local limit = { } + if statLimit == "#" then limit[1] = "#" limit[2] = "#" - elseif statLimit:match("^%d+$") then + elseif statLimit:match("^%-?%d+$") then limit[1] = tonumber(statLimit) limit[2] = tonumber(statLimit) else @@ -198,7 +199,7 @@ function describeStats(stats) else return string.format("(%"..v.fmt.."-%"..v.fmt..")", v.min, v.max) end - end):gsub("{:(%+?)d}", function() + end):gsub("{:%+?d}", function() local v = val[1] if v.min == v.max then return string.format("%"..v.fmt, v.min) From 8fdbfffca350f74fa5bd3132a6f9f73de994924a Mon Sep 17 00:00:00 2001 From: Nostrademous Date: Fri, 18 Sep 2020 16:48:42 -0400 Subject: [PATCH 4/9] updated files to use new extractor --- Export/Classes/GGPKFile.lua | 5 ++++- Export/spec.lua | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Export/Classes/GGPKFile.lua b/Export/Classes/GGPKFile.lua index 233e3b2d57..f644382fba 100644 --- a/Export/Classes/GGPKFile.lua +++ b/Export/Classes/GGPKFile.lua @@ -59,7 +59,7 @@ function GGPKClass:ExtractFiles() fileList = fileList .. '"' .. fname .. '" ' end - cmd = 'cd ' .. self.oozPath .. '&& bun_extract_file.exe "' .. self.path .. '" . ' .. fileList + cmd = 'cd ' .. self.oozPath .. ' && bun_extract_file.exe extract-files "' .. self.path .. '" . ' .. fileList ConPrintf(cmd) os.execute(cmd) end @@ -243,6 +243,9 @@ function GGPKClass:GetNeededFiles() "Data/AlternatePassiveAdditions.dat", "Data/AlternatePassiveSkills.dat", "Data/AlternateTreeVersions.dat", + "Data/GrantedEffectQualityTypes.dat", + "Data/GrantedEffectQualityStats.dat", + "Data/GrantedEffectGroups.dat", } local txtFiles = { "Metadata/StatDescriptions/passive_skill_aura_stat_descriptions.txt", diff --git a/Export/spec.lua b/Export/spec.lua index 116c1b63b9..ac514222b5 100644 --- a/Export/spec.lua +++ b/Export/spec.lua @@ -619,7 +619,7 @@ return { name="Id", refTo="", type="String", - width=370 + width=480 }, [2]={ list=false, From c7c53d8f969fc719323032fdfe762d2b2c1c95e1 Mon Sep 17 00:00:00 2001 From: Nostrademous Date: Fri, 18 Sep 2020 20:04:04 -0400 Subject: [PATCH 5/9] working GrantedEffectQualityStats --- Export/Scripts/skills.lua | 6 ++-- Export/spec.lua | 68 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 67 insertions(+), 7 deletions(-) diff --git a/Export/Scripts/skills.lua b/Export/Scripts/skills.lua index aab1d3163d..67f6f33690 100644 --- a/Export/Scripts/skills.lua +++ b/Export/Scripts/skills.lua @@ -299,9 +299,9 @@ directiveTable.skill = function(state, args, out) end if not skill.qualityStats then skill.qualityStats = { } - for i, stat in ipairs(levelRow.QualityStats) do - table.insert(skill.qualityStats, { stat.Id, levelRow.QualityStatValues[i] / 1000 }) - end + --for i, stat in ipairs(levelRow.QualityStats) do + -- table.insert(skill.qualityStats, { stat.Id, levelRow.QualityStatValues[i] / 1000 }) + --end end end end diff --git a/Export/spec.lua b/Export/spec.lua index ac514222b5..7c45c253b6 100644 --- a/Export/spec.lua +++ b/Export/spec.lua @@ -2436,6 +2436,66 @@ return { }, GrantedEffectGroups={ }, + GrantedEffectQualityStats={ + [1]={ + list=false, + name="", + refTo="", + type="Int", + width=150 + }, + [2]={ + list=false, + name="", + refTo="", + type="Int", + width=150 + }, + [3]={ + list=false, + name="AlternateIndex", + refTo="", + type="Int", + width=150 + }, + [4]={ + list=false, + name="", + refTo="", + type="Int", + width=150 + }, + [5]={ + list=false, + name="", + refTo="", + type="Key", + width=150 + }, + [6]={ + list=false, + name="", + refTo="", + type="Int", + width=150 + }, + [7]={ + list=false, + name="", + refTo="", + type="Int", + width=150 + }, + [8]={ + list=false, + name="", + refTo="", + type="Int", + width=150 + } + }, + GrantedEffectQualityTypes={ + }, GrantedEffects={ [1]={ list=false, @@ -2777,14 +2837,14 @@ return { [25]={ list=true, name="QualityStats", - refTo="Stats", - type="Key", + refTo="GrantedEffectQualityStats", + type="Int", width=150 }, [26]={ - list=true, + list=false, name="QualityStatValues", - refTo="", + refTo="GrantedEffectQualityStats", type="Int", width=100 }, From f31a33cb4e19c140c3025c39e4b3582d3c1fb39a Mon Sep 17 00:00:00 2001 From: Nostrademous Date: Fri, 18 Sep 2020 20:53:09 -0400 Subject: [PATCH 6/9] fixed quality parsing --- Export/Scripts/skills.lua | 28 +++++++--- Export/spec.lua | 113 ++++++++++++++++++-------------------- 2 files changed, 73 insertions(+), 68 deletions(-) diff --git a/Export/Scripts/skills.lua b/Export/Scripts/skills.lua index 67f6f33690..e9dbd3aafa 100644 --- a/Export/Scripts/skills.lua +++ b/Export/Scripts/skills.lua @@ -147,7 +147,8 @@ directiveTable.skill = function(state, args, out) out:write('skills["', grantedId, '"] = {\n') local granted = dat("GrantedEffects"):GetRow("Id", grantedId) if not granted then - print('Unknown GE: "'..grantedId..'"') + ConPrintf('Unknown GE: "'..grantedId..'"') + return end local skillGem = dat("SkillGems"):GetRow("GrantedEffect", granted) or dat("SkillGems"):GetRow("SecondaryGrantedEffect", granted) local skill = { } @@ -297,11 +298,15 @@ directiveTable.skill = function(state, args, out) table.insert(skill.stats, { id = stat.Id }) end end - if not skill.qualityStats then - skill.qualityStats = { } - --for i, stat in ipairs(levelRow.QualityStats) do - -- table.insert(skill.qualityStats, { stat.Id, levelRow.QualityStatValues[i] / 1000 }) - --end + end + if not skill.qualityStats then + skill.qualityStats = { } + for _, qualityStatsRow in ipairs(dat("GrantedEffectQualityStats"):GetRowList("GrantedEffect", granted)) do + skill.qualityStats[qualityStatsRow.AlternateID] = { } + for i, stat in ipairs(qualityStatsRow.GrantedStats) do + table.insert(skill.qualityStats[qualityStatsRow.AlternateID], { stat.Id, qualityStatsRow.StatValues[i] / qualityStatsRow.Divisor }) + -- ConPrintf("%s %s", granted.ActiveSkill.DisplayName, stat.Id) + end end end end @@ -339,8 +344,15 @@ directiveTable.mods = function(state, args, out) end out:write('\t},\n') out:write('\tqualityStats = {\n') - for _, stat in ipairs(skill.qualityStats) do - out:write('\t\t{ "', stat[1], '", ', stat[2], ' },\n') + for _, alternates in ipairs(skill.qualityStats) do + for i, stat in ipairs(alternates) do + if i == 1 then + out:write('\t\tDefault = {\n') + else + out:write('\t\tAlternate%d = {\n', i-1) + end + out:write('\t\t\t{ "', stat[1], '", ', stat[2], ' },\n') + end end out:write('\t},\n') out:write('\tstats = {\n') diff --git a/Export/spec.lua b/Export/spec.lua index 7c45c253b6..a58de38a6c 100644 --- a/Export/spec.lua +++ b/Export/spec.lua @@ -2439,54 +2439,63 @@ return { GrantedEffectQualityStats={ [1]={ list=false, - name="", - refTo="", - type="Int", + name="GrantedEffect", + refTo="GrantedEffects", + type="Key", width=150 }, [2]={ list=false, - name="", + name="AlternateID", refTo="", type="Int", - width=150 + width=90 }, [3]={ - list=false, - name="AlternateIndex", - refTo="", - type="Int", - width=150 + list=true, + name="GrantedStats", + refTo="Stats", + type="Key", + width=460 }, [4]={ - list=false, - name="", + list=true, + name="StatValues", refTo="", type="Int", width=150 }, [5]={ list=false, - name="", + name="Divisor", refTo="", - type="Key", + type="Int", + width=90 + } + }, + GrantedEffectQualityTypes={ + [1]={ + list=false, + name="AlternateId", + refTo="", + type="Int", width=150 }, - [6]={ + [2]={ list=false, name="", refTo="", - type="Int", + type="String", width=150 }, - [7]={ + [3]={ list=false, name="", refTo="", type="Int", width=150 }, - [8]={ + [4]={ list=false, name="", refTo="", @@ -2494,8 +2503,6 @@ return { width=150 } }, - GrantedEffectQualityTypes={ - }, GrantedEffects={ [1]={ list=false, @@ -2744,110 +2751,110 @@ return { width=60 }, [12]={ + list=false, + name="StatEff9", + refTo="", + type="Float", + width=60 + }, + [13]={ list=true, name="EffectivenessCost", refTo="EffectivenessCostConstants", type="Key", width=250 }, - [13]={ + [14]={ list=false, name="Stat1", refTo="", type="Int", width=60 }, - [14]={ + [15]={ list=false, name="Stat2", refTo="", type="Int", width=60 }, - [15]={ + [16]={ list=false, name="Stat3", refTo="", type="Int", width=60 }, - [16]={ + [17]={ list=false, name="Stat4", refTo="", type="Int", width=60 }, - [17]={ + [18]={ list=false, name="Stat5", refTo="", type="Int", width=60 }, - [18]={ + [19]={ list=false, name="Stat6", refTo="", type="Int", width=60 }, - [19]={ + [20]={ list=false, name="Stat7", refTo="", type="Int", width=60 }, - [20]={ + [21]={ list=false, name="Stat8", refTo="", type="Int", width=60 }, - [21]={ + [22]={ + list=false, + name="Stat9", + refTo="", + type="Int", + width=60 + }, + [23]={ list=false, name="PlayerLevel", refTo="", type="Int", width=70 }, - [22]={ + [24]={ list=false, name="ManaMultiplier", refTo="", type="Int", width=80 }, - [23]={ + [25]={ list=false, name="", refTo="", type="Int", width=40 }, - [24]={ + [26]={ list=false, name="", refTo="", type="Int", width=40 }, - [25]={ - list=true, - name="QualityStats", - refTo="GrantedEffectQualityStats", - type="Int", - width=150 - }, - [26]={ - list=false, - name="QualityStatValues", - refTo="GrantedEffectQualityStats", - type="Int", - width=100 - }, [27]={ list=false, name="SpellCritChance", @@ -2989,20 +2996,6 @@ return { width=80 }, [47]={ - list=false, - name="StatEff9", - refTo="", - type="Float", - width=150 - }, - [48]={ - list=false, - name="Stat9", - refTo="", - type="Int", - width=150 - }, - [49]={ list=false, name="AttackSpeedMultiplier", refTo="", From 2ddd829bf403d72d883782a286041827e1214f00 Mon Sep 17 00:00:00 2001 From: Nostrademous Date: Fri, 18 Sep 2020 21:29:40 -0400 Subject: [PATCH 7/9] working skills --- Export/Scripts/skills.lua | 19 +++++++++++-------- Export/Skills/act_dex.txt | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Export/Scripts/skills.lua b/Export/Scripts/skills.lua index e9dbd3aafa..2e1c8b85af 100644 --- a/Export/Scripts/skills.lua +++ b/Export/Scripts/skills.lua @@ -301,11 +301,12 @@ directiveTable.skill = function(state, args, out) end if not skill.qualityStats then skill.qualityStats = { } - for _, qualityStatsRow in ipairs(dat("GrantedEffectQualityStats"):GetRowList("GrantedEffect", granted)) do - skill.qualityStats[qualityStatsRow.AlternateID] = { } - for i, stat in ipairs(qualityStatsRow.GrantedStats) do - table.insert(skill.qualityStats[qualityStatsRow.AlternateID], { stat.Id, qualityStatsRow.StatValues[i] / qualityStatsRow.Divisor }) - -- ConPrintf("%s %s", granted.ActiveSkill.DisplayName, stat.Id) + for i, qualityStatsRow in ipairs(dat("GrantedEffectQualityStats"):GetRowList("GrantedEffect", granted)) do + ConPrintf('i: %d', i) + skill.qualityStats[i] = { } + for j, stat in ipairs(qualityStatsRow.GrantedStats) do + table.insert(skill.qualityStats[i], { stat.Id, qualityStatsRow.StatValues[j] / qualityStatsRow.Divisor }) + --ConPrintf("[%d] %s %s", i, granted.ActiveSkill.DisplayName, stat.Id) end end end @@ -344,14 +345,16 @@ directiveTable.mods = function(state, args, out) end out:write('\t},\n') out:write('\tqualityStats = {\n') - for _, alternates in ipairs(skill.qualityStats) do - for i, stat in ipairs(alternates) do + for i, alternates in ipairs(skill.qualityStats) do + for _, stat in ipairs(alternates) do if i == 1 then out:write('\t\tDefault = {\n') else - out:write('\t\tAlternate%d = {\n', i-1) + local value = i - 1 + out:write('\t\tAlternate' .. value .. ' = {\n') end out:write('\t\t\t{ "', stat[1], '", ', stat[2], ' },\n') + out:write('\t\t},\n') end end out:write('\t},\n') diff --git a/Export/Skills/act_dex.txt b/Export/Skills/act_dex.txt index 65989895ae..f4b445b5eb 100644 --- a/Export/Skills/act_dex.txt +++ b/Export/Skills/act_dex.txt @@ -883,7 +883,7 @@ local skills, mod, flag, skill = ... #baseMod skill("radius", 40) #mods -#skill ProjectileWeakness +#skill SnipersMark #flags spell curse area duration statMap = { ["projectiles_always_pierce_you"] = { From d0e06deb5e72feb0f97a03976d9b5b3dc19ccbaf Mon Sep 17 00:00:00 2001 From: Nostrademous Date: Sat, 19 Sep 2020 00:01:51 -0400 Subject: [PATCH 8/9] fix skill alternate quality values --- Export/Scripts/skills.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Export/Scripts/skills.lua b/Export/Scripts/skills.lua index 2e1c8b85af..c331d698b0 100644 --- a/Export/Scripts/skills.lua +++ b/Export/Scripts/skills.lua @@ -301,11 +301,14 @@ directiveTable.skill = function(state, args, out) end if not skill.qualityStats then skill.qualityStats = { } + local divisor = nil for i, qualityStatsRow in ipairs(dat("GrantedEffectQualityStats"):GetRowList("GrantedEffect", granted)) do - ConPrintf('i: %d', i) skill.qualityStats[i] = { } + if not divisor then + divisor = qualityStatsRow.Divisor + end for j, stat in ipairs(qualityStatsRow.GrantedStats) do - table.insert(skill.qualityStats[i], { stat.Id, qualityStatsRow.StatValues[j] / qualityStatsRow.Divisor }) + table.insert(skill.qualityStats[i], { stat.Id, qualityStatsRow.StatValues[j] / divisor }) --ConPrintf("[%d] %s %s", i, granted.ActiveSkill.DisplayName, stat.Id) end end From c7e63dac60ad560472a1038bba18888a8c7e4bc7 Mon Sep 17 00:00:00 2001 From: Nostrademous Date: Sat, 19 Sep 2020 00:11:05 -0400 Subject: [PATCH 9/9] fixed quality scaling to be shown for 1% quality --- Export/Scripts/skills.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Export/Scripts/skills.lua b/Export/Scripts/skills.lua index c331d698b0..83b1ddbe15 100644 --- a/Export/Scripts/skills.lua +++ b/Export/Scripts/skills.lua @@ -305,7 +305,7 @@ directiveTable.skill = function(state, args, out) for i, qualityStatsRow in ipairs(dat("GrantedEffectQualityStats"):GetRowList("GrantedEffect", granted)) do skill.qualityStats[i] = { } if not divisor then - divisor = qualityStatsRow.Divisor + divisor = qualityStatsRow.Divisor * 20 end for j, stat in ipairs(qualityStatsRow.GrantedStats) do table.insert(skill.qualityStats[i], { stat.Id, qualityStatsRow.StatValues[j] / divisor })