Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pokemons = {
- -- [chance em porcentagem] = {"Nome do Pokemon", "nome do pokemon 2"}
- [80] = {"Caterpie", "Weedle", "Noctowl"},
- }
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local e = {2,3,4,5,6,9}
- local t = {}
- for _, v in pairs(pokemons) do
- table.insert(t, _)
- end
- table.sort(t)
- for _, v in pairs(t) do
- if math.random(1, 100) < v then
- c = v
- break
- end
- end
- local m = pokemons[c][math.random(1,#pokemons[c])]
- local monster = doCreateMonster(m, getPlayerPosition(cid))
- doSendMagicEffect(getCreaturePosition(monster), CONST_ME_TELEPORT)
- doSendMagicEffect(toPosition, e[math.random(1,#e)])
- doCreatureSay(monster, m.." Um pokemon foi encontrado!", TALKTYPE_ORANGE_1)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement