Ir para conteúdo

Featured Replies

  • 3 months later...
Postado
  • Autor

local a = {
[13524] = {balltype = "ultra", ballid = 11829,
        pokemons = {"Alfa Zekron"}}
}

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
         local gender = getRandomGenderByName(pokemon)
         local happy = 220
         
         local ball = 0
         local sendToDepot = false                                                        --alterado v1.6
         if getCreatureMana(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then
               sendToDepot = true
               ball = doCreateItemEx(b.ballid)   --alterado v1.3
         else
               ball = item.uid
         end 
         
           doItemSetAttribute(ball, "poke", pokemon)
           doItemSetAttribute(ball, "hp", 1)
           doItemSetAttribute(ball, "happy", happy)
           doItemSetAttribute(ball, "gender", gender)
           if pokemon == "Hitmonchan" or pokemon == "Shiny Hitmonchan" then
              doItemSetAttribute(ball, "hands", 0)
           end
           doItemSetAttribute(ball, "description", "Contains a "..pokemon..".")
           doItemSetAttribute(ball, "fakedesc", "Contains a "..pokemon..".")

           doItemSetAttribute(ball, "boost", 100)    
  
         doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!")
         doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon..", congratulations!")
         
         if sendToDepot then
            doPlayerSendMailByName(getCreatureName(cid), ball, 1)    --alterado v1.3
            doPlayerSendTextMessage(cid, 27, "You are already holding six pokemons, so your new pokemon was sent to your depot.")
            doCreatureExecuteTalkAction(cid, "!save")
            doRemoveItem(item.uid)
         else
             doTransformItem(ball, pokeballs[btype].on)
         end
         
         doSendMagicEffect(getThingPos(cid), 29)
return true
end

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo