Skip to content

Commit 5cc3923

Browse files
committed
AI Fix for some weird mods
1 parent c8a6f18 commit 5cc3923

2 files changed

Lines changed: 36 additions & 33 deletions

File tree

src/Data/ModRunes.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3268,8 +3268,8 @@ return {
32683268
},
32693269
["caster"] = {
32703270
type = "Rune",
3271-
"Flasks gain 0 charges per Second",
3272-
"Bonded: Charms gain 0 charges per Second",
3271+
"Flasks gain 0.2 charges per Second",
3272+
"Bonded: Charms gain 0.25 charges per Second",
32733273
statOrder = { 6865, 6866 },
32743274
tradeHashes = { [731781020] = { "Flasks gain 0.2 charges per Second" }, },
32753275
rank = { 15 },
@@ -3434,7 +3434,7 @@ return {
34343434
},
34353435
["staff"] = {
34363436
type = "Rune",
3437-
"Remnants you create have 25% increased effect",
3437+
"Remnants you create have 25% reduced effect",
34383438
"Remnants can be collected from 50% further away",
34393439
"Bonded: 20% increased Exposure Effect",
34403440
statOrder = { 9695, 9697, 6510 },

src/Export/Scripts/soulcores.lua

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -96,47 +96,50 @@ directiveTable.base = function(state, args, out)
9696
if next(stats) then
9797
for _, class in ipairs(classMap[soulCoreStat.Category.Id] or { string.lower(soulCoreStat.Category.Id) }) do
9898
printf("Category ID: " .. tostring(soulCoreStat.Category.Id))
99-
local stats, orders = describeStats(stats)
100-
local bondedStats, bondedOrders = describeStats(bondedStats)
101-
for i, stat in ipairs(bondedStats) do
102-
bondedStats[i] = "Bonded: " .. stat
99+
local statsCopy = {}
100+
for k, v in pairs(stats) do statsCopy[k] = { min = v.min, max = v.max } end
101+
local bondedStatsCopy = {}
102+
for k, v in pairs(bondedStats) do bondedStatsCopy[k] = { min = v.min, max = v.max, bonded = v.bonded } end
103+
local descStats, orders = describeStats(statsCopy)
104+
local descBondedStats, bondedOrders = describeStats(bondedStatsCopy)
105+
for i, stat in ipairs(descBondedStats) do
106+
descBondedStats[i] = "Bonded: " .. stat
103107
end
104-
for _, stat in ipairs(bondedStats) do
105-
table.insert(stats, stat)
108+
for _, stat in ipairs(descBondedStats) do
109+
table.insert(descStats, stat)
106110
end
107111
for _, order in ipairs(bondedOrders) do
108112
table.insert(orders, order)
109113
end
110114
if #orders > 0 then
111-
local modIdx = 1
112-
local tradeHashes = {}
113-
while soulCoreStat.Stats[modIdx] do
114-
local currentStats = {}
115-
local stat = soulCoreStat.Stats[modIdx]
116-
currentStats[stat.Id] = {
117-
min = soulCoreStat.StatValue[modIdx], max = soulCoreStat.StatValue[modIdx]
118-
}
119-
local bytes = intToBytes(stat.Hash)
120-
-- # to # stats consist of two different stats as the min and max have different ranges
121-
if stat.Id:match("minimum") then
122-
local nextStat = soulCoreStat.Stats[modIdx + 1]
123-
if nextStat and nextStat.Id:match("maximum") then
124-
modIdx = modIdx + 1
125-
bytes = bytes .. intToBytes(nextStat.Hash)
126-
currentStats[nextStat.Id] = {
127-
min = soulCoreStat.StatValue[modIdx], max = soulCoreStat.StatValue[modIdx]
128-
}
115+
local modIdx = 1
116+
local tradeHashes = {}
117+
while soulCoreStat.Stats[modIdx] do
118+
local currentStats = {}
119+
local stat = soulCoreStat.Stats[modIdx]
120+
currentStats[stat.Id] = {
121+
min = soulCoreStat.StatValue[modIdx], max = soulCoreStat.StatValue[modIdx]
122+
}
123+
local bytes = intToBytes(stat.Hash)
124+
-- # to # stats consist of two different stats as the min and max have different ranges
125+
if stat.Id:match("minimum") then
126+
local nextStat = soulCoreStat.Stats[modIdx + 1]
127+
if nextStat and nextStat.Id:match("maximum") then
128+
modIdx = modIdx + 1
129+
bytes = bytes .. intToBytes(nextStat.Hash)
130+
currentStats[nextStat.Id] = {
131+
min = soulCoreStat.StatValue[modIdx], max = soulCoreStat.StatValue[modIdx]
132+
}
133+
end
129134
end
135+
local description, _, _ = describeStats(currentStats)
136+
tradeHashes[murmurHash2(bytes, 0x02312233)] = description
137+
modIdx = modIdx + 1
130138
end
131-
132-
local description, _, _ = describeStats(currentStats)
133-
tradeHashes[murmurHash2(bytes, 0x02312233)] = description
134-
modIdx = modIdx + 1
135-
end
136139
local out = {
137140
type = soulCores.Type.Id,
138141
slotType = class,
139-
label = stats,
142+
label = descStats,
140143
statOrder = orders,
141144
rank = rank,
142145
tradeHashes = tradeHashes

0 commit comments

Comments
 (0)