Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(player, item, fromPos, itemEx, toPos)
- if getTileInfo(player:getPosition()).protection or #player:getSummons() >= 1 and getTileInfo(player:getPosition(player:getSummons()[1])).protection then
- return true
- end
- local pokemons ={
- [1] = {name = "Magikarp", qnt = 4},
- [2] = {name = "Squirtle", qnt = 2},
- [3] = {name = "Staryu", qnt = 3},
- }
- local config = {
- waters = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621,4664, 4622, 4623, 4624, 4625, 7236, 10499, 15401, 15402},
- }
- local tabelas = {
- position = player:getPosition(),
- level = 15,
- fail = math.random(1, 100),
- r = math.random(1, #pokemons),
- playerpos = player:getPosition(),
- skill = player:getSkillLevel(SKILL_FISHING),
- }
- if not (isInArray(config.waters, itemEx.itemid)) then
- return player:sendCancelMessage("NOT IS POSSIBRU")
- end
- if(isInArray(config.waters, itemEx.itemid)) then
- if tabelas.fail >= 20 then
- toPos:sendEffect(2)
- return player:sendCancelMessage("FALHOU")
- end
- for i = 1,pokemons[tabelas.r].qnt do
- local pokemon = Game.createPokemon(pokemons[tabelas.r].name, tabelas.level, tabelas.position)
- if pokemon then
- toPos:sendEffect(2)
- toPos:sendEffect(CONST_ME_WATERSPLASH)
- pokemon:getPosition():sendEffect(943)
- player:addSkillTries(SKILL_FISHING, 1)
- else
- player:sendCancelMessage("There is not enough room.")
- tabelas.position:sendEffect(CONST_ME_POFF)
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement