Skip to content

Allow stealing of multiple items at once

lefreutlefreut Member Posts: 1,462
edited July 2016 in UI Modding
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:
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

Comments

  • AncientCowboyAncientCowboy Member Posts: 199
    Excellent! Imoen is sandpapering her fingertips as we speak :smile:
  • Mr2150Mr2150 Member Posts: 1,170
    Ha... you did it... and a very clever solution adding the items to a custom table like that...
  • lefreutlefreut Member Posts: 1,462
    edited November 2019
    ***
    Post edited by lefreut on
  • AbelAbel Member Posts: 785
    What a brilliant idea! I was just about to go shopping in Athkatla!
  • AncientCowboyAncientCowboy Member Posts: 199
    @lefreut - This is next on my list. May I add it to EEUITweaks?
  • lefreutlefreut Member Posts: 1,462
    edited November 2019
    ***
    Post edited by lefreut on
  • AncientCowboyAncientCowboy Member Posts: 199
    Thanks!
  • ConjurerDragonConjurerDragon Member Posts: 110
    That adds utility when a thief can do that instead of stealing only 1 item - however shouldn´t trying to steal several items be harder than just 1? Does your tweak change anything regarding the needed pickpocket skill or the difficulty check?
  • lefreutlefreut Member Posts: 1,462
    edited November 2019
    ***
    Post edited by lefreut on
Sign In or Register to comment.