Aviso!
NÃO CRIE TÓPICOS DE SUPORTE NESTA SEÇÃO
Menu -> Fóruns -> Tutoriais e Suporte
PRESTE MAIS ATENÇÃO DA PROXIMA VEZ
Algum Coordernador mova o tópico fazendo favor.
Por Bodak Reborn, 26 de abr. de 2016 em Scripts
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

Aviso!
NÃO CRIE TÓPICOS DE SUPORTE NESTA SEÇÃO
Menu -> Fóruns -> Tutoriais e Suporte
PRESTE MAIS ATENÇÃO DA PROXIMA VEZ
Algum Coordernador mova o tópico fazendo favor.
info
Grupo: Campones
Registrado: 26/04/16
Posts: 90
Reputação: +28
Gênero: Masculino

Sorry,
era pro titulo ser "Ajuda para complementar + código", postei aqui porque se alguém precisasse desse script, não procuraria na área de suporte.
Perdão novamente.
Que tal primeiro reduzir o code usando loops e matematica?
function getStoneCountByLevel(fromLevel, toLevel, increase_interval) local sum = 0 local a = math.ceil(fromLevel/increase_interval) for i = fromLevel, toLevel do sum = sum + a if (i % increase_interval) == 0 then a = a + 1 end endend
E sim, voce pode fazer pegando o master da creature, porem leve em conta que nem todos os pokemons tem master, alguns sao selvagens, logo em alguns não deve ser exibido o boost.
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

1 minuto atrás, Bodak Reborn disse:Sorry,
era pro titulo ser "Ajuda para complementar + código", postei aqui porque se alguém precisasse desse script, não procuraria na área de suporte.
Perdão novamente.
Entendo, normal postar na área errado. Todo mundo tem sua primeira vez certo? Mais não seria melhor resolver o que você estava querendo primeiro que no caso seria na área de suporte e quando consiguisse resolver você criava um tópico aqui e postasse o seu código completo + explicação?
Até eu estou confuso hehe
Espero que alguém consiga te ajudar, boa sorte! xD
info
Grupo: Campones
Registrado: 26/04/16
Posts: 90
Reputação: +28
Gênero: Masculino

1 hora atrás, dalvorsn disse:Que tal primeiro reduzir o code usando loops e matematica?
function getStoneCountByLevel(fromLevel, toLevel, increase_interval) local sum = 0 local a = math.ceil(fromLevel/increase_interval) for i = fromLevel, toLevel do sum = sum + a if (i % increase_interval) == 0 then a = a + 1 end endendE sim, voce pode fazer pegando o master da creature, porem leve em conta que nem todos os pokemons tem master, alguns sao selvagens, logo em alguns não deve ser exibido o boost.
Perdão pela demora, não tinha visto.
Bom, eu sou iniciante em lua, faz uns 3 dias que comecei a mexer em códigos de fato e isso é avançado demais para mim, mas obrigado pelo código, vou estudá-lo!
Em pokedex system.lua, embaixo de
table.insert(stt, "Name: "..name.."\n")
eu coloquei
table.insert(stt, "Boost level: +"..boost..".\n"..calculo.." stones left to +50.")
apenas para testar e apareceu lá, só estava com o problema que eu citei no tópico.
Tem alguma função para saber se o pokémon é selvagem? Se tiver, com getCreatureMaster e essa função funcionaria perfeitamente.
info
Grupo: Conde
Registrado: 07/04/15
Posts: 926
Reputação: +335
Gênero: Masculino

@Yan Liima, aprecio sua vontade de manter a comunidade em ordem, mas cuidado com sub-moderação. Peço pra que qnd vc encontrar algo fora das regras, apenas utilize o botão de Denunciar post e informe o ocorrido. ^^
@Bodak Reborn, mais atenção na hora de criar tópicos amigo, por favor.
Agradeço a compreensão.
Tópico movido para a área correta.
3 hours ago, Bodak Reborn said:Perdão pela demora, não tinha visto.
Bom, eu sou iniciante em lua, faz uns 3 dias que comecei a mexer em códigos de fato e isso é avançado demais para mim, mas obrigado pelo código, vou estudá-lo!
Em pokedex system.lua, embaixo de
table.insert(stt, "Name: "..name.."\n")
eu coloquei
table.insert(stt, "Boost level: +"..boost..".\n"..calculo.." stones left to +50.")
apenas para testar e apareceu lá, só estava com o problema que eu citei no tópico.
Tem alguma função para saber se o pokémon é selvagem? Se tiver, com getCreatureMaster e essa função funcionaria perfeitamente.
faz um if com o getCreatureMaster(pokemon_uid), caso atrelado ao isPlayer. Inclusive faça os calculos dentro do if, porque eles dependem da existencia do master pra procurar a pokebola.
if isPlayer(getCreatureMaster(pokemon_uid)) then table.insert(stt, "Boost level: +"..boost..".\n"..calculo.." stones left to +50.")end
info
Grupo: Campones
Registrado: 26/04/16
Posts: 90
Reputação: +28
Gênero: Masculino

Eu fiz o que você disse, deu esse erro na distro:
(luaGetCreatureMaster) Creature not found
E continua com o mesmo erro
Editado Abril 27 por Bodak Reborn
tu por acaso trocou pokemon_uid para o uid do pokemon? caso tenha dificuldade de encontrar, poste o script da pokedex
info
Grupo: Campones
Registrado: 26/04/16
Posts: 90
Reputação: +28
Gênero: Masculino

@dalvorsn, eu tentei com item2.uid e getPlayerSlotItem(cid,8).uid.
Ambos não funcionaram, mas o item2.uid não deu aquele erro na distro.
Não entendi muito bem o código que tu mandou, ainda tenho aprofundar mais um pouco nos meus estudos... então usei o código que eu fiz.
Código da pokedex:
local skills = specialabilities --alterado v1.9 \/ peguem tudo!function doAddPokemonInDexList(cid, poke)if getPlayerInfoAboutPokemon(cid, poke).dex then return true end local a = newpokedex[poke] local b = getPlayerStorageValue(cid, a.storage) setPlayerStorageValue(cid, a.storage, b.." dex,")endfunction getPokemonEvolutionDescription(name, next) local kev = poevo[name] local stt = {} if isInArray(specialevo, name) then if name == "Poliwhirl" then if next then return "\nPoliwrath or Politoed, requires level 65." end table.insert(stt, "Evolve Stone: Water Stone and Punch Stone or Water Stone and Earth Stone\n\n") table.insert(stt, "Evolutions:\nPoliwrath, requires level 65.\nPolitoed, requires level 65.") elseif name == "Gloom" then if next then return "\nVileplume or Bellossom, requires level 50." end table.insert(stt, "Evolve Stone: 2 Leaf Stone or Leaf Stone and Venom Stone\n\n") table.insert(stt, "Evolutions:\nVileplume, requires level 50.\nBellossom, requires level 50.") elseif name == "Slowpoke" then if next then return "\nSlowbro, requires level 45.\nSlowking, requires level 100." end table.insert(stt, "Evolve Stone: Enigma Stone or Ancient Stone\n\n") table.insert(stt, "Evolutions:\nSlowbro, requires level 45.\nSlowking, requires level 100.") elseif name == "Eevee" then if next then return "\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55." end table.insert(stt, "Evolve Stone: Water Stone or Thunder Stone or Fire Stone or Darkness Stone or Enigma Stone\n\n") table.insert(stt, "Evolutions:\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55.") elseif name == "Tyrogue" then if next then return "\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60." end table.insert(stt, "Evolve Stone: Punch Stone\n\n") table.insert(stt, "Evolutions:\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60.") end elseif kev then if next then table.insert(stt, "\n"..kev.evolution..", requires level "..kev.level..".") return table.concat(stt) end local id = tonumber(kev.stoneid) local id2 = tonumber(kev.stoneid2) local stone = "" if tonumber(kev.count) == 2 then stone = doConvertStoneIdToString(id).." (2x)" else stone = id2 == 0 and doConvertStoneIdToString(id) or doConvertStoneIdToString(id).." and "..doConvertStoneIdToString(id2) end table.insert(stt, "Evolve Stone: "..stone.."\n\n") table.insert(stt, "Evolutions:\n"..kev.evolution..", requeris level "..kev.level..".") table.insert(stt, getPokemonEvolutionDescription(kev.evolution, true)) else if not next then table.insert(stt, "Evolutions:\nIt doen't evolve.") end end return table.concat(stt)endlocal function getMoveDexDescr(cid, name, number) local x = movestable[name] if not x then return "" end local z = "\n" local tables = {x.move1, x.move2, x.move3, x.move4, x.move5, x.move6, x.move7, x.move8, x.move9, x.move10, x.move11, x.move12} local y = tables[number] if not y then return "" end if getTableMove(cid, y.name) == "" then print(""..y.name.." faltando") return "unknown error"endlocal txt = ""..z..""..y.name.." - m"..number.." - level "..y.level.." - "..(y.t) return txtend --alterado v1.8local skillcheck = {"fly", "ride", "surf", "teleport", "rock smash", "cut", "dig", "light", "blink", "control mind", "transform", "levitate_fly"}local passivas = {["Shock Counter"] = {"Electabuzz", "Shiny Electabuzz", "Elekid", "Raikou", tpw = "electric"},["Lava-Counter"] = {"Magmar", "Magby", "Entei", tpw = "fire"},["Counter Helix"] = {"Scyther", "Shiny Scyther", tpw = "bug"},["Giroball"] = {"Pineco", "Forretress", tpw = "steel"},["Counter Claw"] = {"Scizor", tpw = "bug"},["Counter Spin"] = {"Hitmontop", "Shiny Hitmontop", tpw = "fighting"},["Demon Kicker"] = {"Hitmonlee", "Shiny Hitmonlee", tpw = "fighting"},["Demon Puncher"] = {"Hitmonchan", "Shiny Hitmonchan", tpw = "unknow"}, --alterado v1.6["Stunning Confusion"] = {"Psyduck", "Golduck", "Wobbuffet", tpw = "psychic"},["Groundshock"] = {"Kangaskhan", tpw = "normal"},["Electric Charge"] = {"Pikachu", "Raichu", "Shiny Raichu", tpw = "electric"},["Melody"] = {"Wigglytuff", tpw = "normal"},["Dragon Fury"] = {"Dratini", "Dragonair", "Dragonite", "Shiny Dratini", "Shiny Dragonair", "Shiny Dragonite", tpw = "dragon"},["Fury"] = {"Persian", "Raticate", "Shiny Raticate", tpw = "normal"},["Mega Drain"] = {"Oddish", "Gloom", "Vileplume", "Kabuto", "Kabutops", "Parasect", "Tangela", "Shiny Vileplume", "Shiny Tangela", tpw = "grass"},["Spores Reaction"] = {"Oddish", "Gloom", "Vileplume", "Shiny Vileplume", tpw = "grass"},["Amnesia"] = {"Wooper", "Quagsire", "Swinub", "Piloswine", tpw = "psychic"},["Zen Mind"] = {"Slowking", tpw = "psychic"}, ["Mirror Coat"] = {"Wobbuffet", tpw = "psychic"},["Lifesteal"] = {"Zubat", "Golbat", "Crobat", "Shiny Zubat", "Shiny Golbat", "Shiny Crobat", tpw = "poison"},["Evasion"] = {"Scyther", "Scizor", "Hitmonlee", "Hitmonchan", "Hitmontop", "Tyrogue", "Shiny Scyther", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Ledian", "Ledyba", "Sneasel", tpw = "normal"},["Foresight"] = {"Machamp", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Hitmontop", "Hitmonlee", "Hitmonchan", tpw = "fighting"},["Levitate"] = {"Gengar", "Haunter", "Gastly", "Misdreavus", "Weezing", "Koffing", "Unown", "Shiny Gengar", tpw = "ghost"},["Bone Spin"] = {"Cubone", "Marowak", "Shiny Cubone", "Shiny Marowak", tpw = "rock"},}function doShowPokedexRegistration(cid, pokemon, ball)local item2 = pokemonlocal virtual = false if type(pokemon) == "string" then virtual = true endlocal myball = balllocal name = virtual and pokemon or getCreatureName(item2.uid)local v = fotos[name]local stt = {}table.insert(stt, "Name: "..name.."\n")if isPlayer(getCreatureMaster(item2.uid)) then local gastostones = { [0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 6, [6] = 8, [7] = 10, [8] = 12, [9] = 15, [10] = 18, [11] = 21, [12] = 24, [13] = 28, [14] = 32, [15] = 36, [16] = 40, [17] = 45, [18] = 50, [19] = 55, [20] = 60, [21] = 66, [22] = 72, [23] = 78, [24] = 84, [25] = 91, [26] = 98, [27] = 105, [28] = 112, [29] = 120, [30] = 128, [31] = 136, [32] = 144, [33] = 153, [34] = 162, [35] = 171, [36] = 180, [37] = 190, [38] = 200, [39] = 210, [40] = 220, [41] = 231, [42] = 242, [43] = 253, [44] = 264, [45] = 276, [46] = 288, [47] = 300, [48] = 312, [49] = 325, [50] = 338, } local thing = getPlayerSlotItem(cid, 8) local boost = getItemAttribute(thing.uid, "boost") or 0 local stones = gastostones[boost] local calculo = 338 - stones table.insert(stt, "Boost level: +"..boost..".\n"..calculo.." stones left to +50.")endif pokes[name].type2 and pokes[name].type2 ~= "no type" then table.insert(stt, "Type: "..pokes[name].type.."/"..pokes[name].type2)else table.insert(stt, "Type: "..pokes[name].type)endif virtual then table.insert(stt, "\nRequired level: "..pokes[name].level.."\n")else table.insert(stt, "\nRequired level: ".. getPokemonLevel(item2.uid, true) .."\n") --alterado v1.9endtable.insert(stt, "\n"..getPokemonEvolutionDescription(name).."\n")table.insert(stt, "\nMoves:")if name == "Ditto" then if virtual then table.insert(stt, "\nIt doesn't use any moves until transformed.") elseif getPlayerStorageValue(item2.uid, 1010) == "Ditto" or getPlayerStorageValue(item2.uid, 1010) == -1 then table.insert(stt, "\nIt doesn't use any moves until transformed.") else for a = 1, 15 do table.insert(stt, getMoveDexDescr(item2.uid, getPlayerStorageValue(item2.uid, 1010), a)) end endelse for a = 1, 15 do table.insert(stt, getMoveDexDescr(item2.uid, name, a)) endendfor e, f in pairs(passivas) do if isInArray(passivas[e], name) then local tpw = passivas[e].tpw if name == "Pineco" and passivas[e] == "Giroball" then tpw = "bug" end table.insert(stt, "\n"..e.." - passive - "..tpw) endend table.insert(stt, "\n\nAbility:\n") local abilityNONE = true --alterado v1.8 \/ for b, c in pairs(skills) do if isInArray(skillcheck, b) then if isInArray(c, name) then table.insert(stt, (b == "levitate_fly" and "Levitate" or doCorrectString(b)).."\n") abilityNONE = false end endendif abilityNONE then table.insert(stt, "None")end if string.len(table.concat(stt)) > 8192 then print("Error while making pokedex info with pokemon named "..name..".\n Pokedex registration has more than 8192 letters (it has "..string.len(stt).." letters), it has been blocked to prevent fatal error.") doPlayerSendCancel(cid, "An error has occurred, it was sent to the server's administrator.") return trueend doShowTextDialog(cid, v, table.concat(stt))end
Editado Abril 27 por Bodak Reborn
Certo, tinha uma coisa que eu não previa, o parametro usado pra o uid algumas vezes pode ser uma string, no caso de serem virtuais(não tenho certeza mas talvez os selvagens ele considere como "virtuais". A função faz exatamente a mesma coisa, so que ela tem parametros extra, que é o level de destino, caso queira usar e nao for 50, e o intervalo em de boost que ele usa pra incrementar uma stone. Na tabela que tu fez de 4 em 4 boost ele aumenta uma stone no numero necessario para adicionar o boost. De todo modo simplifiquei a função, deixando os dois parametros como opcionais e com valores default de 50 e 4;
Segue o codigo ajustado, credio que agora funcione
function getStoneCountByLevel(fromLevel, toLevel, increase_interval) local sum = 0 if not increase_interval then increase_interval = 4 end if not toLevel then toLevel = 50 end local a = math.ceil(fromLevel/increase_interval) for i = fromLevel, toLevel do sum = sum + a if (i % increase_interval) == 0 then a = a + 1 end endendlocal skills = specialabilities --alterado v1.9 \/ peguem tudo!function doAddPokemonInDexList(cid, poke)if getPlayerInfoAboutPokemon(cid, poke).dex then return true end local a = newpokedex[poke] local b = getPlayerStorageValue(cid, a.storage) setPlayerStorageValue(cid, a.storage, b.." dex,")endfunction getPokemonEvolutionDescription(name, next) local kev = poevo[name] local stt = {} if isInArray(specialevo, name) then if name == "Poliwhirl" then if next then return "\nPoliwrath or Politoed, requires level 65." end table.insert(stt, "Evolve Stone: Water Stone and Punch Stone or Water Stone and Earth Stone\n\n") table.insert(stt, "Evolutions:\nPoliwrath, requires level 65.\nPolitoed, requires level 65.") elseif name == "Gloom" then if next then return "\nVileplume or Bellossom, requires level 50." end table.insert(stt, "Evolve Stone: 2 Leaf Stone or Leaf Stone and Venom Stone\n\n") table.insert(stt, "Evolutions:\nVileplume, requires level 50.\nBellossom, requires level 50.") elseif name == "Slowpoke" then if next then return "\nSlowbro, requires level 45.\nSlowking, requires level 100." end table.insert(stt, "Evolve Stone: Enigma Stone or Ancient Stone\n\n") table.insert(stt, "Evolutions:\nSlowbro, requires level 45.\nSlowking, requires level 100.") elseif name == "Eevee" then if next then return "\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55." end table.insert(stt, "Evolve Stone: Water Stone or Thunder Stone or Fire Stone or Darkness Stone or Enigma Stone\n\n") table.insert(stt, "Evolutions:\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55.") elseif name == "Tyrogue" then if next then return "\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60." end table.insert(stt, "Evolve Stone: Punch Stone\n\n") table.insert(stt, "Evolutions:\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60.") end elseif kev then if next then table.insert(stt, "\n"..kev.evolution..", requires level "..kev.level..".") return table.concat(stt) end local id = tonumber(kev.stoneid) local id2 = tonumber(kev.stoneid2) local stone = "" if tonumber(kev.count) == 2 then stone = doConvertStoneIdToString(id).." (2x)" else stone = id2 == 0 and doConvertStoneIdToString(id) or doConvertStoneIdToString(id).." and "..doConvertStoneIdToString(id2) end table.insert(stt, "Evolve Stone: "..stone.."\n\n") table.insert(stt, "Evolutions:\n"..kev.evolution..", requeris level "..kev.level..".") table.insert(stt, getPokemonEvolutionDescription(kev.evolution, true)) else if not next then table.insert(stt, "Evolutions:\nIt doen't evolve.") end end return table.concat(stt)endlocal function getMoveDexDescr(cid, name, number) local x = movestable[name] if not x then return "" end local z = "\n" local tables = {x.move1, x.move2, x.move3, x.move4, x.move5, x.move6, x.move7, x.move8, x.move9, x.move10, x.move11, x.move12} local y = tables[number] if not y then return "" end if getTableMove(cid, y.name) == "" then print(""..y.name.." faltando") return "unknown error" end local txt = ""..z..""..y.name.." - m"..number.." - level "..y.level.." - "..(y.t) return txtend --alterado v1.8local skillcheck = {"fly", "ride", "surf", "teleport", "rock smash", "cut", "dig", "light", "blink", "control mind", "transform", "levitate_fly"}local passivas = {["Shock Counter"] = {"Electabuzz", "Shiny Electabuzz", "Elekid", "Raikou", tpw = "electric"},["Lava-Counter"] = {"Magmar", "Magby", "Entei", tpw = "fire"},["Counter Helix"] = {"Scyther", "Shiny Scyther", tpw = "bug"},["Giroball"] = {"Pineco", "Forretress", tpw = "steel"},["Counter Claw"] = {"Scizor", tpw = "bug"},["Counter Spin"] = {"Hitmontop", "Shiny Hitmontop", tpw = "fighting"},["Demon Kicker"] = {"Hitmonlee", "Shiny Hitmonlee", tpw = "fighting"},["Demon Puncher"] = {"Hitmonchan", "Shiny Hitmonchan", tpw = "unknow"}, --alterado v1.6["Stunning Confusion"] = {"Psyduck", "Golduck", "Wobbuffet", tpw = "psychic"},["Groundshock"] = {"Kangaskhan", tpw = "normal"},["Electric Charge"] = {"Pikachu", "Raichu", "Shiny Raichu", tpw = "electric"},["Melody"] = {"Wigglytuff", tpw = "normal"},["Dragon Fury"] = {"Dratini", "Dragonair", "Dragonite", "Shiny Dratini", "Shiny Dragonair", "Shiny Dragonite", tpw = "dragon"},["Fury"] = {"Persian", "Raticate", "Shiny Raticate", tpw = "normal"},["Mega Drain"] = {"Oddish", "Gloom", "Vileplume", "Kabuto", "Kabutops", "Parasect", "Tangela", "Shiny Vileplume", "Shiny Tangela", tpw = "grass"},["Spores Reaction"] = {"Oddish", "Gloom", "Vileplume", "Shiny Vileplume", tpw = "grass"},["Amnesia"] = {"Wooper", "Quagsire", "Swinub", "Piloswine", tpw = "psychic"},["Zen Mind"] = {"Slowking", tpw = "psychic"}, ["Mirror Coat"] = {"Wobbuffet", tpw = "psychic"},["Lifesteal"] = {"Zubat", "Golbat", "Crobat", "Shiny Zubat", "Shiny Golbat", "Shiny Crobat", tpw = "poison"},["Evasion"] = {"Scyther", "Scizor", "Hitmonlee", "Hitmonchan", "Hitmontop", "Tyrogue", "Shiny Scyther", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Ledian", "Ledyba", "Sneasel", tpw = "normal"},["Foresight"] = {"Machamp", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Hitmontop", "Hitmonlee", "Hitmonchan", tpw = "fighting"},["Levitate"] = {"Gengar", "Haunter", "Gastly", "Misdreavus", "Weezing", "Koffing", "Unown", "Shiny Gengar", tpw = "ghost"},["Bone Spin"] = {"Cubone", "Marowak", "Shiny Cubone", "Shiny Marowak", tpw = "rock"},}function doShowPokedexRegistration(cid, pokemon, ball) local item2 = pokemon local virtual = false if type(pokemon) == "string" then virtual = true end local myball = ball local name = virtual and pokemon or getCreatureName(item2.uid) local v = fotos[name] local stt = {} table.insert(stt, "Name: "..name.."\n") if not virtual and isPlayer(getCreatureMaster(item2.uid)) then local boost = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "boost") or 0 local calculo = getStoneCountByLevel(boost) table.insert(stt, "Boost level: +"..boost..".\n"..calculo.." stones left to +50.") endendif pokes[name].type2 and pokes[name].type2 ~= "no type" then table.insert(stt, "Type: "..pokes[name].type.."/"..pokes[name].type2)else table.insert(stt, "Type: "..pokes[name].type)endif virtual then table.insert(stt, "\nRequired level: "..pokes[name].level.."\n")else table.insert(stt, "\nRequired level: ".. getPokemonLevel(item2.uid, true) .."\n") --alterado v1.9endtable.insert(stt, "\n"..getPokemonEvolutionDescription(name).."\n")table.insert(stt, "\nMoves:")if name == "Ditto" then if virtual then table.insert(stt, "\nIt doesn't use any moves until transformed.") elseif getPlayerStorageValue(item2.uid, 1010) == "Ditto" or getPlayerStorageValue(item2.uid, 1010) == -1 then table.insert(stt, "\nIt doesn't use any moves until transformed.") else for a = 1, 15 do table.insert(stt, getMoveDexDescr(item2.uid, getPlayerStorageValue(item2.uid, 1010), a)) end endelse for a = 1, 15 do table.insert(stt, getMoveDexDescr(item2.uid, name, a)) endendfor e, f in pairs(passivas) do if isInArray(passivas[e], name) then local tpw = passivas[e].tpw if name == "Pineco" and passivas[e] == "Giroball" then tpw = "bug" end table.insert(stt, "\n"..e.." - passive - "..tpw) endend table.insert(stt, "\n\nAbility:\n") local abilityNONE = true --alterado v1.8 \/ for b, c in pairs(skills) do if isInArray(skillcheck, b) then if isInArray(c, name) then table.insert(stt, (b == "levitate_fly" and "Levitate" or doCorrectString(b)).."\n") abilityNONE = false end endendif abilityNONE then table.insert(stt, "None")end if string.len(table.concat(stt)) > 8192 then print("Error while making pokedex info with pokemon named "..name..".\n Pokedex registration has more than 8192 letters (it has "..string.len(stt).." letters), it has been blocked to prevent fatal error.") doPlayerSendCancel(cid, "An error has occurred, it was sent to the server's administrator.") return trueend doShowTextDialog(cid, v, table.concat(stt))end
info
Grupo: Campones
Registrado: 26/04/16
Posts: 90
Reputação: +28
Gênero: Masculino

removi o end que estava fechando a função e dando o bug na distro
if not virtual and isPlayer(getCreatureMaster(item2.uid)) then local boost = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "boost") or 0 local calculo = getStoneCountByLevel(boost) table.insert(stt, "Boost level: +"..boost..".\n"..calculo.." stones left to +50.") endend --esse aqui
e dei return sum na função getStoneCountByLevel, já que o calculo tava dando nulo.
Primeiro erro:
Continua com o mesmo erro quando outros players dão dex.
Segundo erro:
O calculo da função tá errado, eu testei com um pokémon +4 e no código dizia faltavam 335 stones para o +50, o certo seria 334.
Editado Abril 27 por Bodak Reborn
info
Grupo: Campones
Registrado: 26/04/16
Posts: 90
Reputação: +28
Gênero: Masculino

Pode mover o tópico, dúvida sanada.
info
Grupo: Campones
Registrado: 26/04/16
Posts: 90
Reputação: +28
Gênero: Masculino
Hey,
então, o script da talkaction fui eu que fiz, tentei colocar na pokedex e não consegui.
O script da talkaction diz quantas stones faltam para seu pokémon chegar ao boost +50, a dex também funciona assim, mas caso algum jogador use a dex no seu pokémon, irá mostrar o boost do pokémon dele e quantas stones faltam para este chegar ao boost +50.
O dalvorsn me ajudou a colocar o script na pokedex e a simplificá-lo, então, créditos dele.
Muito obrigado, @dalvorsn!
Eu editei a pergunta, pois o dalvorsn me ajudou por mensagem.
Script para quem quiser:
data/lib/pokedex system.lua
coloquem isso nas primeiras linhas:
procure por
e embaixo coloque
em "local others ="
vocês vão colocar os pokémon que são boostados com Crystal/Metal/Ancient Stone, caso no seu ot tenha o sistema desse tipo de pokémon ser boostado com 1 stone por boost até o boost 30, e nos próximos boosts, ser boostado com 2 stones por boost.
Se você não quer esse sistema ou não tem esse sistema, deixe assim:
Caso você queira que seja por talkaction e não na dex, use esse script:
data/talkactions/scripts
crie um arquivo .lua
stonestofifty.lua:
talkactions.xml:
Editado Abril 27 por Bodak Reborn