def Kernel.pbItemBall(item,quantity=1,showMsg = true)
if item.is_a?(String) || item.is_a?(Symbol)
item = getID(PBItems,item)
end
return false if !item || item<=0 || quantity<1
itemname = (quantity>1) ? PBItems.getNamePlural(item) : PBItems.getName(item)
pocket = pbGetPocket(item)
if $PokemonBag.pbStoreItem(item,quantity) # If item can be picked up
if showMsg
if isConst?(item,PBItems,:LEFTOVERS)
Kernel.pbMessage(_INTL("\\me[Item get]You found some \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
elsif pbIsMachine?(item) # TM or HM
Kernel.pbMessage(_INTL("\\me[Item get]You found \\c[1]{1} {2}\\c[0]!\\wtnp[30]",itemname,PBMoves.getName(pbGetMachine(item))))
elsif quantity>1
Kernel.pbMessage(_INTL("\\me[Item get]You found {1} \\c[1]{2}\\c[0]!\\wtnp[30]",quantity,itemname))
elsif ['a','e','i','o','u'].include?(itemname[0,1].downcase)
Kernel.pbMessage(_INTL("\\me[Item get]You found an \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
else
Kernel.pbMessage(_INTL("\\me[Item get]You found a \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
end
Kernel.pbMessage(_INTL("You put the {1} away\\nin the <icon=bagPocket{2}>\\c[1]{3} Pocket\\c[0].",
itemname,pocket,PokemonBag.pocketNames()[pocket]))
end
return true
else # Can't add the item
if showMsg
if isConst?(item,PBItems,:LEFTOVERS)
Kernel.pbMessage(_INTL("You found some \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
elsif pbIsMachine?(item) # TM or HM
Kernel.pbMessage(_INTL("You found \\c[1]{1} {2}\\c[0]!\\wtnp[30]",itemname,PBMoves.getName(pbGetMachine(item))))
elsif quantity>1
Kernel.pbMessage(_INTL("You found {1} \\c[1]{2}\\c[0]!\\wtnp[30]",quantity,itemname))
elsif ['a','e','i','o','u'].include?(itemname[0,1].downcase)
Kernel.pbMessage(_INTL("You found an \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
else
Kernel.pbMessage(_INTL("You found a \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
end
Kernel.pbMessage(_INTL("But your Bag is full..."))
end
return false
end
end