Ir para conteúdo

Featured Replies

Postado

como adiciono status pokemon a pokedex 

 

aqui eel lua de pokedex system 

Spoiler

function showPokedex()
    if pokedexWindow then
        pokedexWindow:destroy()
    end
    pokedexWindow = g_ui.displayUI('game_pokedex')
end

function terminate()
    disconnect(g_game, { onEditText = showPokemonDescription, onGameEnd = hide } )
end

function hide()
    pokedexWindow:destroy()
end

function Painel.show(childName)    
    pokedexWindow:getChildById('pnlDescricao'):getChildById('lblConteudo'):setText(Painel.pokedex['pnlDescricao'])
    pokedexWindow:getChildById('pnlAtaques'):getChildById('lblConteudo'):setText(Painel.pokedex['pnlAtaques'])
    pokedexWindow:getChildById('pnlHabilidades'):getChildById('lblConteudo'):setText(Painel.pokedex['pnlHabilidades'])
    pokedexWindow:getChildById('pnlDescricao'):setVisible(false)
    pokedexWindow:getChildById('scrDescricao'):setVisible(false)
    pokedexWindow:getChildById('pnlAtaques'):setVisible(false)
    pokedexWindow:getChildById('scrAtaques'):setVisible(false)
    pokedexWindow:getChildById('pnlHabilidades'):setVisible(false)
    pokedexWindow:getChildById('scrHabilidades'):setVisible(false)
    
    pokedexWindow:getChildById(childName):setVisible(true)
    pokedexWindow:getChildById('scr'..childName:sub(4,#childName)):setVisible(true)
    
end

function showPokemonDescription(id, itemId, maxLength, texto, writter, time)
    if not g_game.isOnline() then return end    --Se nao estiver online
    local name = texto:match('Name: (.-)\n')
    local type = texto:match('Type: (.-)\n')
    --Se for chamada de pokedex
    if name and type then 
        showPokedex()
        
        --Required Level
        local requieredLevel = texto:match('Required level: (.-)\n')
        
        --Evolution Description
        local evoDesc = texto:match('\nEvolutions:\n(.-)\n')
        
        --MOVES
        local moves = texto:match('\nMoves:\n(.-)\nAbility:')
        
        --Ability
        local ability = texto:sub(texto:find('Ability:\n')+9,#texto)
        
        pokedexWindow:getChildById('lblPokeName'):setText(name)
        if name:find("Shiny") then
            name = name:sub(7,#name)
            pokedexWindow:getChildById('lblPokeName'):setColor("red")
        end
        local f = io.open("modules/game_pokedex/imagens/pokemons/"..name..".png","r");
        if not f then
            print("Not found poke image called "..name)
        else
            f:close()
            pokedexWindow:getChildById('imgPokemon'):setImage("/game_pokedex/imagens/pokemons/"..name..".png")
        end
        Painel.pokedex["pnlDescricao"] = "Tipo: "..type.."\nNivel Requerido: "..requieredLevel.."\n\nEvolucoes:\n"..evoDesc
        Painel.pokedex["pnlAtaques"] = moves
        Painel.pokedex["pnlHabilidades"] = ability
        Painel.show('pnlDescricao')
    end
end

 

Postado
12 horas atrás, Samuelithou disse:

como adiciono status pokemon a pokedex 

 

aqui eel lua de pokedex system 

  Ocultar conteúdo

function showPokedex()
    if pokedexWindow then
        pokedexWindow:destroy()
    end
    pokedexWindow = g_ui.displayUI('game_pokedex')
end

function terminate()
    disconnect(g_game, { onEditText = showPokemonDescription, onGameEnd = hide } )
end

function hide()
    pokedexWindow:destroy()
end

function Painel.show(childName)    
    pokedexWindow:getChildById('pnlDescricao'):getChildById('lblConteudo'):setText(Painel.pokedex['pnlDescricao'])
    pokedexWindow:getChildById('pnlAtaques'):getChildById('lblConteudo'):setText(Painel.pokedex['pnlAtaques'])
    pokedexWindow:getChildById('pnlHabilidades'):getChildById('lblConteudo'):setText(Painel.pokedex['pnlHabilidades'])
    pokedexWindow:getChildById('pnlDescricao'):setVisible(false)
    pokedexWindow:getChildById('scrDescricao'):setVisible(false)
    pokedexWindow:getChildById('pnlAtaques'):setVisible(false)
    pokedexWindow:getChildById('scrAtaques'):setVisible(false)
    pokedexWindow:getChildById('pnlHabilidades'):setVisible(false)
    pokedexWindow:getChildById('scrHabilidades'):setVisible(false)
    
    pokedexWindow:getChildById(childName):setVisible(true)
    pokedexWindow:getChildById('scr'..childName:sub(4,#childName)):setVisible(true)
    
end

function showPokemonDescription(id, itemId, maxLength, texto, writter, time)
    if not g_game.isOnline() then return end    --Se nao estiver online
    local name = texto:match('Name: (.-)\n')
    local type = texto:match('Type: (.-)\n')
    --Se for chamada de pokedex
    if name and type then 
        showPokedex()
        
        --Required Level
        local requieredLevel = texto:match('Required level: (.-)\n')
        
        --Evolution Description
        local evoDesc = texto:match('\nEvolutions:\n(.-)\n')
        
        --MOVES
        local moves = texto:match('\nMoves:\n(.-)\nAbility:')
        
        --Ability
        local ability = texto:sub(texto:find('Ability:\n')+9,#texto)
        
        pokedexWindow:getChildById('lblPokeName'):setText(name)
        if name:find("Shiny") then
            name = name:sub(7,#name)
            pokedexWindow:getChildById('lblPokeName'):setColor("red")
        end
        local f = io.open("modules/game_pokedex/imagens/pokemons/"..name..".png","r");
        if not f then
            print("Not found poke image called "..name)
        else
            f:close()
            pokedexWindow:getChildById('imgPokemon'):setImage("/game_pokedex/imagens/pokemons/"..name..".png")
        end
        Painel.pokedex["pnlDescricao"] = "Tipo: "..type.."\nNivel Requerido: "..requieredLevel.."\n\nEvolucoes:\n"..evoDesc
        Painel.pokedex["pnlAtaques"] = moves
        Painel.pokedex["pnlHabilidades"] = ability
        Painel.show('pnlDescricao')
    end
end

 

 

data/lib/pokedexsystem.lua

 

procure por isso: table.insert(stt, "\nMoves:")

 

Em Cima  dessa linha adiciona isso:

 

table.insert(stt, "\nPoke-Status:\nOffense: "..getPlayerStorageValue(item2.uid,1001).."\nDefense: "..getPlayerStorageValue(item2.uid,1002).."\nSpeed: "..getPlayerStorageValue(item2.uid,1003).."\nVitality: "..getPlayerStorageValue(item2.uid,1004).."\nSpecial-Attack: "..getPlayerStorageValue(item2.uid,1005).."\n")

 

 

Pronto , ja esta Funcionando o Status do Pokemon [summon e Wild] da Ate vergonha de postar pois e 1 linha somente mais e muito util para quem quer ver a força do Pokemon!

 

autor e  criador do codigo: Nextbr

 

espero q tenha ajudado. rep+

 

 

post-59798-0-84408800-1443477078.png

Editado por DarkRed (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo