local a = {
[11638] = {balltype = "normal", ballid = 11826,
        pokemons = {"Shiny Venomoth"}},
[11639] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Dragonite", "Snorlax", "Snorlax", "Omastar", "Onix", "Onix", "Scyther", "Scyther",
        "Lapras", "Gyarados", "Jynx", "Scyther", "Kangaskhan", "Golem", "Venusaur", 
        "Machamp", "Poliwrath", "Arcanine", "Nidoking", "Nidoqueen", "Charizard", "Blastoise", "Tentacruel", 
        "Gengar", "Rhydon"}},
[11641] = {balltype = "super", ballid = 11835,
        pokemons = {"Tyranitar", "High Alakazam"}},
[13100] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Entei"}},
[13101] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Darkrai"}},
[13102] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Raikou"}},
[13103] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Mew"}},
[13104] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Articuno", "Moltres", "Zapdos"}},
[13105] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Deoxys"}},
[13106] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Uxie", "Mesprit"}},
[13107] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Dialga"}},
[13108] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Palkia"}},
[13130] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Lugia", "Ho-Oh"}},
[13109] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Giratina", "Groudon"}},
[13173] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Shiny Magmortar", "Shiny Electivire", "Shiny Lucario"}},
[13174] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Attack Deoxys", "Defense Deoxys", "Speed deoxys"}},
[13175] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Xerneas", "Yveltal"}},
[13176] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Black Kyurem", "White Kyurem", "Cresselia"}},
[13177] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Supreme Charizard", "Supreme Blastoise"}},
[12331] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Shiny Venusaur", "Shiny Charizard", "Shiny Blastoise", "Shiny Arcanine",  "Shiny Alakazam", "Shiny Scyther",
	"Shiny Gengar", "Shiny Electabuzz", "Shiny Dratini", "Shiny Venomoth", "Shiny Venomoth", "Shiny Onix"}}

}     

local happy = 220 
         
function onUse(cid, item, frompos, item2, topos)
         local b = a[item.itemid]                                    
               if not b then return true end
         local pokemon = b.pokemons[math.random(#b.pokemons)]
         local btype = b.balltype
               if not pokeballs[btype] then return true end    
         
         doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!")
	     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The prize pokemon was a "..pokemon..", congratulations!")
	     doSendMagicEffect(getThingPos(cid), 29)
               
         addPokeToPlayer(cid, pokemon, 0, nil, btype)     --alterado v1.9                                                 
         doRemoveItem(item.uid, 1)
	     
return true
end