HolyMaN 14 Postado Outubro 15, 2012 Share Postado Outubro 15, 2012 (editado) queria uma talkactions (!fishing) parecido com !spells de tibia, que mostrasse qual peixe vc pode pegar até o fishing do player e em qual fishing começo a pegar aquele peixe.. exemplo: obs: o quote seria uma janelinha... Player: !fishing Seu fishing é: 41 Você pode pescar esses pokemons: Magikarp Lv 1 Poliwag Lv 11 Hosea Lv 14 Krabby Lv 17 Editado Outubro 15, 2012 por GOD Gniu Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/ Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Outubro 15, 2012 Share Postado Outubro 15, 2012 ta ae.. esse eh pro serv com lvl.. se tiver usando o sem lvl me avisa... local fishing = { ["Magikarp"] = {skill = 0, level = 1}, ["Qwilfish"] = {skill = 18, level = 3}, ["Remoraid"] = {skill = 16, level = 2}, ["Staryu"] = {skill = 22, level = 6}, ["Tentacool"] = {skill = 20, level = 7}, ["Goldeen"] = {skill = 17, level = 5}, ["Krabby"] = {skill = 14, level = 2}, ["Horsea"] = {skill = 16, level = 3}, ["Poliwag"] = {skill = 15, level = 2}, ["Marill"] = {skill = 21, level = 3}, ["Azumarill"] = {skill = 37, level = 16}, ["Kingler"] = {skill = 35, level = 14}, ["Seaking"] = {skill = 28, level = 11}, ["Starmie"] = {skill = 49, level = 20}, ["Chinchou"] = {skill = 23, level = 6}, ["Poliwhirl"] = {skill = 27, level = 9}, ["Seadra"] = {skill = 41, level = 15}, ["Lanturn"] = {skill = 38, level = 14}, ["Octillery"] = {skill = 30, level = 9}, ["Corsola"] = {skill = 46, level = 16}, } function onSay(cid, words, param) local fishes = {} for a, b in pairs (fishing) do if getPlayerSkillLevel(cid, 6) >= b.skill then table.insert(fishes, a) end end local str = "Your fishing level is: ".. getPlayerSkillLevel(cid, 6).."\n" str = str.."You can fish this pokemons:\n" for i = 1, #fishes do str = str..""..fishes.." Lvl "..fishing[fishes].level.."\n" end doShowTextDialog(cid, 2395, str) return true end Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1364244 Compartilhar em outros sites More sharing options...
HolyMaN 14 Postado Outubro 15, 2012 Autor Share Postado Outubro 15, 2012 (editado) poe pra sem lvl tbm? por favor ? ^^ ahh testei aqui, funciono direitinho, mais teria como fazer em orden crescente? Editado Outubro 15, 2012 por GOD Gniu Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1364416 Compartilhar em outros sites More sharing options...
zerefshirou 112 Postado Outubro 15, 2012 Share Postado Outubro 15, 2012 poe pra sem lvl tbm? por favor ? ^^ ahh testei aqui, funciono direitinho, mais teria como fazer em orden crescente? Pelo que parece, segue a ordem da tabela, então só arrumar ali em ordem Pra sem level, é só tirar a parte que mostra o lvl do bixo e.e Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1364430 Compartilhar em outros sites More sharing options...
HolyMaN 14 Postado Outubro 15, 2012 Autor Share Postado Outubro 15, 2012 (editado) @Zeref, acho que ñ está certo na ordem.. olha na imagem, eu coloquei na ordem de 1 à 12, e troquei level por skill... PDA com lv 2.7 aaa ñ sei se altera, mais to usando OtClient Editado Outubro 15, 2012 por GOD Gniu Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1364437 Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Outubro 15, 2012 Share Postado Outubro 15, 2012 n ta na ordem pq o 'in pairs' nao percorre a tabela em ordem... ;x e o 'in ipairs' n funciona com esse tpw de tabela... entao achu q n da pra por em ordem... ;/ Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1364455 Compartilhar em outros sites More sharing options...
zerefshirou 112 Postado Outubro 15, 2012 Share Postado Outubro 15, 2012 (editado) Slicer, mais facil fazer do jeito simples e.e tabela0 = {"Magikarp"}, tabela20 = {"Krabby", "Kingler"} tabela40 = {"Mewtwo"} Assim ele poderia colocar na ordem que quiser e do jeito que quiser. Vou tomar banho, depois editou ou faço outro post mostrando o jeito que eu faria fish0 = {"Magikarp"} fish20 = {"Goldeen","Krabby","Horsea","Poliwag"} fish30 = {"Poliwhirl", "Psyduck"} fish40 = {"Seel", "Squirtle", "Staryu", "Tentacool"} fish50 = {"Kingler", "Seaking", "Wartortle"} fish60 = {"Golduck", "Starmie", "Seadra"} fish70 = {"Dewgong", "Poliwrath"} fish80 = {"Tentacruel", "Blastoise"} fish90 = {"Lapras", "Gyarados"} fishes = {} if getPlayerSkillLevel(cid, 6) < 20 then table.insert(fishes, fish0) end if getPlayerSkillLevel(cid, 6) < 30 then table.insert(fishes, fish20) end if getPlayerSkillLevel(cid, 6) < 40 then table.insert(fishes, fish30) end if getPlayerSkillLevel(cid, 6) < 50 then table.insert(fishes, fish40) end if getPlayerSkillLevel(cid, 6) < 60 then table.insert(fishes, fish50) end if getPlayerSkillLevel(cid, 6) < 70 then table.insert(fishes, fish60) end if getPlayerSkillLevel(cid, 6) < 80 then table.insert(fishes, fish70) end if getPlayerSkillLevel(cid, 6) < 90 then table.insert(fishes, fish80) end if getPlayerSkillLevel(cid, 6) >= 90 then table.insert(fishes, fish90) end local str = "Your fishing level is: ".. getPlayerSkillLevel(cid, 6).."\n" str = str.."You can fish this pokemons:\n" for i = 1, #fishes do str = str..""..fishes[i].."\n" end Vai ficar maior? Sim, mas deve funcionar do jeito que ele quer, e outra coisa VAI FUNCIONAR é oque importa. Obs: Fiz rapido e no bloco de notas, qualquer erro é comum. Obs²: Mentira não foi no bloco de notas foi no editor daqui mesmo Obs³: Spoiler bugado aqui e.e Editado Outubro 15, 2012 por ZerefShirou Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1364547 Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Outubro 16, 2012 Share Postado Outubro 16, 2012 (editado) achu q assim fica melhor zeref... '--' ps: aprendi agora a usar o table.sort kkk bem util ate... local fishing = { ["Magikarp"] = {skill = 0, level = 1}, ["Qwilfish"] = {skill = 18, level = 3}, ["Remoraid"] = {skill = 16, level = 2}, ["Staryu"] = {skill = 22, level = 6}, ["Tentacool"] = {skill = 20, level = 7}, ["Goldeen"] = {skill = 17, level = 5}, ["Krabby"] = {skill = 14, level = 2}, ["Horsea"] = {skill = 16, level = 3}, ["Poliwag"] = {skill = 15, level = 2}, ["Marill"] = {skill = 21, level = 3}, ["Azumarill"] = {skill = 37, level = 16}, ["Kingler"] = {skill = 35, level = 14}, ["Seaking"] = {skill = 28, level = 11}, ["Starmie"] = {skill = 49, level = 20}, ["Chinchou"] = {skill = 23, level = 6}, ["Poliwhirl"] = {skill = 27, level = 9}, ["Seadra"] = {skill = 41, level = 15}, ["Lanturn"] = {skill = 38, level = 14}, ["Octillery"] = {skill = 30, level = 9}, ["Corsola"] = {skill = 46, level = 16}, } function onSay(cid, words, param) local fishes = {} for a, b in pairs (fishing) do if getPlayerSkillLevel(cid, 6) >= b.skill then table.insert(fishes, {a, b.level}) end end table.sort(fishes, function(a, b) return (a[2] < b[2]) end) local str = "Your fishing level is: ".. getPlayerSkillLevel(cid, 6).."\n" str = str.."You can fish this pokemons:\n" for i = 1, #fishes do str = str..""..fishes[1].." Lvl "..fishes[2].."\n" end doShowTextDialog(cid, 2395, str) return true end Editado Outubro 16, 2012 por Slicer Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1364701 Compartilhar em outros sites More sharing options...
zerefshirou 112 Postado Outubro 16, 2012 Share Postado Outubro 16, 2012 Que isso bruxaria? OMG "Pobre se contenta com pouco" é oque meu script significa hUAHSUHAUSUSAHUhsau, no caso pobre é quem não sabe de nada ou sabe pouco Posta função do sort ai como ela é Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1364710 Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Outubro 16, 2012 Share Postado Outubro 16, 2012 (editado) table.sort(table[, comp]) se n por o 'comp' ele soh vai ver se um 'conteudo' da tabela eh menor q o outro e vai por na ordem... tpw.. t = {10, 5, 20, 60} vai por na ordem de 5, 10, 20, 60... e o comp tem q ser uma function q retorne true/false... no caso eu usei.. function(a, b) return (a[2] < b[2]) end nesse caso ele vai pegar o 1* valor da tabela e vai comparar com o 2* vendo o lvl dos pokes ta tabela fishing... se um valor for menor q o outro vai pra cima na tabela... -eh algu +/- assim kkkk- Editado Outubro 16, 2012 por Slicer Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1364715 Compartilhar em outros sites More sharing options...
zerefshirou 112 Postado Outubro 16, 2012 Share Postado Outubro 16, 2012 Entendo mas prefiro meu troço lá, mais simples e menos palavrão hausahuussa Agora só esperar para ver se o dono do topico teste e peça para fechar o topico caso seja oque ele queira Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1364724 Compartilhar em outros sites More sharing options...
Stigal 585 Postado Abril 20, 2018 Share Postado Abril 20, 2018 A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta. + Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda. * Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado. Link para o comentário https://xtibia.com/forum/topic/196555-encerrado-pedidotalkaction-fishing/#findComment-1731091 Compartilhar em outros sites More sharing options...
Posts Recomendados