pbStoreItem seems to send an item to your Bag discreetly.
I've seen pbStoreItem in mainly two places, which are both located in PItem_Bag.
I use $PokemonBag.pbStoreItem(:item,quantity) to call it.
Code:
def initialize
@items = []
# Start storage with a Potion
if hasConst?(PBItems,:POTION)
pbStoreItem(getConst(PBItems,:POTION))
end
end
I've tried to modify these, because it's the same code that sends a Potion to your PC at the beginning of game. I can't call it on command.
Code:
def pbStoreItem(item,qty=1)
if item.is_a?(String) || item.is_a?(Symbol)
item = getID(PBItems,item)
end
if !item || item<1
raise ArgumentError.new(_INTL("Item number {1} is invalid.",item))
return false
end
pocket = pbGetPocket(item)
maxsize = maxPocketSize(pocket)
maxsize = @pockets[pocket].length+1 if maxsize<0
return ItemStorageHelper.pbStoreItem(@pockets[pocket],maxsize,BAGMAXPERSLOT,item,qty,true)
end
This seems to be what's storing items into the Bag. It's not what I want, but it works, so I've been looking at it too.