Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Kernel.pbItemBall(item,quantity=1)
- 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 pocket == 8 # Key item
- sound = "Evolution start" # <--- swap this out with the name of whatever the key item sound should be. files for this are stored in the Audio/ME folder
- else # not a Key Item
- sound = "Item get" # <--- Keep this the same
- end
- if $PokemonBag.pbStoreItem(item,quantity) # If item can be picked up
- if isConst?(item,PBItems,:LEFTOVERS)
- Kernel.pbMessage(_INTL("\\me[#{sound}]You found some \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
- elsif pbIsMachine?(item) # TM or HM
- Kernel.pbMessage(_INTL("\\me[#{sound}]You found \\c[1]{1} {2}\\c[0]!\\wtnp[30]",itemname,PBMoves.getName(pbGetMachine(item))))
- elsif quantity>1
- Kernel.pbMessage(_INTL("\\me[#{sound}]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[#{sound}]You found an \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
- else
- Kernel.pbMessage(_INTL("\\me[#{sound}]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]))
- return true
- else # Can't add the item
- 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..."))
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment