Allow stealing of multiple items at once
lefreut
Member Posts: 1,462
This tweak will allow thief to attempt to steal multiple items at once in shops. It should work for BG1EE, SoD and BG2EE.
First, search "name 'STORE_BUYSELL'" and before the menu section (before the `), add this function:
Then search for the steal button (search "STEAL_BUTTON") and change the clickable and action lines with these:
First, search "name 'STORE_BUYSELL'" and before the menu section (before the `), add this function:
function canSteal()
local nb = 0
for _, v in pairs(store.storeItems) do
if v.highlight == 1 then
nb = nb + 1
end
end
return nb > 0 and nb + #store.groupItems <= 16
end
Then search for the steal button (search "STEAL_BUTTON") and change the clickable and action lines with these:
clickable lua "canSteal()"
action
"
local toSteal = {}
for k, v in pairs(store.storeItems) do
if v.highlight == 1 then
table.insert(toSteal, v.item.name)
for i=2, v.amountSelected do table.insert(toSteal, v.item.name) end
storeScreen:SelectStoreItem(k - 1, false)
end
end
for _, name in pairs(toSteal) do
local steal = 0
for k, v in pairs(store.storeItems) do
if v.highlight == 1 then
steal = 0
break
end
if v.item.name == name then
steal = k
end
end
if steal == 0 then
break
end
storeScreen:SelectStoreItem(steal - 1, true)
storeScreen:OnStealItemButtonClick()
end
"
Post edited by lefreut on
12
Comments