# There are two more other 'receive item' methods, you'll have to add the edits to each of them before the 'return false'.
# If this don't work, oh well. You'll get a sense of what you should do and likely make it work.
def pbReceiveItem(item,quantity=1)
item = GameData::Item.get(item)
return false if !item || quantity<1
itemname = (quantity>1) ? item.name_plural : item.name
pocket = item.pocket
move = item.move
meName = (item.is_key_item?) ? "Key item get" : "Item get"
if item == :LEFTOVERS
pbMessage(_INTL("\\me[{1}]You obtained some \\c[1]{2}\\c[0]!\\wtnp[30]",meName,itemname))
elsif item.is_machine? # TM or HM
pbMessage(_INTL("\\me[{1}]You obtained \\c[1]{2} {3}\\c[0]!\\wtnp[30]",meName,itemname,GameData::Move.get(move).name))
elsif quantity>1
pbMessage(_INTL("\\me[{1}]You obtained {2} \\c[1]{3}\\c[0]!\\wtnp[30]",meName,quantity,itemname))
elsif itemname.starts_with_vowel?
pbMessage(_INTL("\\me[{1}]You obtained an \\c[1]{2}\\c[0]!\\wtnp[30]",meName,itemname))
else
pbMessage(_INTL("\\me[{1}]You obtained a \\c[1]{2}\\c[0]!\\wtnp[30]",meName,itemname))
end
if $PokemonBag.pbStoreItem(item,quantity) # If item can be added
pbMessage(_INTL("You put the {1} away\\nin the <icon=bagPocket{2}>\\c[1]{3} Pocket\\c[0].",
itemname,pocket,PokemonBag.pocketNames()[pocket]))
return true
end
# Edits Starts Here. After the previous line of code, the original method will return false, indicating item cannot be added to bag, the 'custom edits' here tells the game to try to store it to PC before that return false.
if $PokemonGlobal.pcItemStorage(item,quantity)
pbMessage(_INTL("Your bag is full, the {1} have been sent to PC storage instead.",
itemname))
return true
else
pbMessage(_INTL("Your bag and PC is full, {1} could not be obtained.",
itemname))
end
# Edits Ends Here
return false # Can't add the item
end