Advertisement
Kevick

Headbuttheld.lua

Sep 28th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local pokemons = {
  2.     -- [chance em porcentagem] = {"Nome do Pokemon", "nome do pokemon 2"}
  3.     [80] = {"Caterpie", "Weedle", "Noctowl"},
  4. }
  5.  
  6. function onUse(cid, item, fromPosition, itemEx, toPosition)
  7.     local e = {2,3,4,5,6,9}
  8.     local t = {}
  9.     for _, v in pairs(pokemons) do
  10.         table.insert(t, _)
  11.     end
  12.     table.sort(t)
  13.     for _, v in pairs(t) do
  14.         if math.random(1, 100) < v then
  15.             c = v
  16.             break
  17.         end
  18.     end
  19.     local m = pokemons[c][math.random(1,#pokemons[c])]
  20.     local monster = doCreateMonster(m, getPlayerPosition(cid))
  21.     doSendMagicEffect(getCreaturePosition(monster), CONST_ME_TELEPORT)
  22.     doSendMagicEffect(toPosition, e[math.random(1,#e)])
  23.     doCreatureSay(monster, m.." Um pokemon foi encontrado!", TALKTYPE_ORANGE_1)
  24.     return true
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement