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/Scripts/skills.lua b/Export/Scripts/skills.lua index aab1d3163d..83b1ddbe15 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,10 +298,18 @@ 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 + if not skill.qualityStats then + skill.qualityStats = { } + local divisor = nil + for i, qualityStatsRow in ipairs(dat("GrantedEffectQualityStats"):GetRowList("GrantedEffect", granted)) do + skill.qualityStats[i] = { } + if not divisor then + divisor = qualityStatsRow.Divisor * 20 + end + for j, stat in ipairs(qualityStatsRow.GrantedStats) do + table.insert(skill.qualityStats[i], { stat.Id, qualityStatsRow.StatValues[j] / divisor }) + --ConPrintf("[%d] %s %s", i, granted.ActiveSkill.DisplayName, stat.Id) end end end @@ -339,8 +348,17 @@ 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 i, alternates in ipairs(skill.qualityStats) do + for _, stat in ipairs(alternates) do + if i == 1 then + out:write('\t\tDefault = {\n') + else + 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') out:write('\tstats = {\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"] = { diff --git a/Export/spec.lua b/Export/spec.lua index 116c1b63b9..a58de38a6c 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, @@ -2436,6 +2436,73 @@ return { }, GrantedEffectGroups={ }, + GrantedEffectQualityStats={ + [1]={ + list=false, + name="GrantedEffect", + refTo="GrantedEffects", + type="Key", + width=150 + }, + [2]={ + list=false, + name="AlternateID", + refTo="", + type="Int", + width=90 + }, + [3]={ + list=true, + name="GrantedStats", + refTo="Stats", + type="Key", + width=460 + }, + [4]={ + list=true, + name="StatValues", + refTo="", + type="Int", + width=150 + }, + [5]={ + list=false, + name="Divisor", + refTo="", + type="Int", + width=90 + } + }, + GrantedEffectQualityTypes={ + [1]={ + list=false, + name="AlternateId", + refTo="", + type="Int", + width=150 + }, + [2]={ + list=false, + name="", + refTo="", + type="String", + width=150 + }, + [3]={ + list=false, + name="", + refTo="", + type="Int", + width=150 + }, + [4]={ + list=false, + name="", + refTo="", + type="Int", + width=150 + } + }, GrantedEffects={ [1]={ list=false, @@ -2684,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="Stats", - type="Key", - width=150 - }, - [26]={ - list=true, - name="QualityStatValues", - refTo="", - type="Int", - width=100 - }, [27]={ list=false, name="SpellCritChance", @@ -2929,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="", diff --git a/Export/statdesc.lua b/Export/statdesc.lua index a25af6b2a9..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 @@ -85,7 +86,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 +192,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