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
AncientCowboymf2112Mr2150Avenger_teambgAbelbrusCrevsDaakKurona

Comments

  • AncientCowboyAncientCowboy Member Posts: 199
    Excellent! Imoen is sandpapering her fingertips as we speak :smile:
    mf2112Mr2150CrevsDaak
  • Mr2150Mr2150 Member Posts: 1,170
    Ha... you did it... and a very clever solution adding the items to a custom table like that...
    CrevsDaak
  • lefreutlefreut Member Posts: 1,462
    edited November 2019
    ***
    Post edited by lefreut on
    Mr2150CrevsDaak
  • AbelAbel Member Posts: 752
    What a brilliant idea! I was just about to go shopping in Athkatla!
    CrevsDaak
  • AncientCowboyAncientCowboy Member Posts: 199
    @lefreut - This is next on my list. May I add it to EEUITweaks?
    CrevsDaak
  • lefreutlefreut Member Posts: 1,462
    edited November 2019
    ***
    Post edited by lefreut on
    AncientCowboyCrevsDaak
  • AncientCowboyAncientCowboy Member Posts: 199
    Thanks!
  • ConjurerDragonConjurerDragon Member Posts: 109
    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?
    CrevsDaak
  • lefreutlefreut Member Posts: 1,462
    edited November 2019
    ***
    Post edited by lefreut on
    ConjurerDragonAncientCowboyCrevsDaak
Sign In or Register to comment.