Ir para conteúdo

Featured Replies

Postado

Ola estava olhando a aba de MoDs e encontrei um bem legal so que tem um problema ao relogar buga o pokemon.!

Pois usa esta função: 

local item = getPokeOutLive(cid)[1]


e no tibia normal não tem.

tibiaking.com/forum/forums/topic/51450-sistema-de-pokemon-no-tibia/

 

 

function onLogout(cid)
local health,maxhealth = getSummonLifes(cid)
    if getPlayerStorageValue(cid, 61204) >= 1 and getPlayerStorageValue(cid, 63215) <= 0 and getPlayerStorageValue(cid, 62314) <= 0 and getPlayerStorageValue(cid, 59987) <= 0 then
        setPlayerStorageValue(cid, 61205, health)
        setPlayerStorageValue(cid, 61206, maxhealth)
        setPlayerStorageValue(cid, 61204, 0)
        setPlayerStorageValue(cid, 61207, 1)
    end
    
    if getPlayerStorageValue(cid, 62314) >= 1 then
        pos = getCreaturePosition(cid)
        for i = 1,8 do
            doRemoveTile(getPosDirs(getCreaturePosition(cid), i))
        end
        doRemoveTile(getCreaturePosition(cid))
        setPlayerStorageValue(cid, 61941, pos.x)
        setPlayerStorageValue(cid, 61942, pos.y)
        setPlayerStorageValue(cid, 61943, pos.z) 
    end
return TRUE
end

function onLogin(cid)
    local pokes = {
    ["Dragon"] = {lookType=267, speed = 1500},
    ["Rat"] = {lookType=267, speed = 500},
    }

    local pokesfly = {
    ["Dragon"] = {lookType = 216, speed = 500},
    }

    local pokesride = {
    ["Dragon Lord"] = {lookType=4, speed = 3000},
    ["Dragon"] = {lookType=4, speed = 500},
    }
    
    if getPlayerStorageValue(cid, 62314) >= 1 then
        doCreateTile(460, {x=getPlayerStorageValue(cid, 61941), y=getPlayerStorageValue(cid, 61942), z=getPlayerStorageValue(cid, 61943)})
        doTeleportThing(cid, {x=getPlayerStorageValue(cid, 61941), y=getPlayerStorageValue(cid, 61942), z=getPlayerStorageValue(cid, 61943)}) 
        for i = 1,8 do
            doItem(getPosDirs(getCreaturePosition(cid), i), 65119+i)
        end
        local item = getPokeOutLive(cid)[1]
        local a = getItemAttribute(item, "poke"):match("This is (.-)'s pokeball.")
        doSetCreatureOutfit(cid, pokesfly[tostring(a)], -1)
        doChangeSpeed(cid, pokesfly[tostring(a)].speed)
        registerCreatureEvent(cid, "PlayerPokeDeath")  
    end

    if getPlayerStorageValue(cid, 63215) >= 1 then
        local item = getPokeOutLive(cid)[1]
        local a = getItemAttribute(item, "poke"):match("This is (.-)'s pokeball.")
        doSetCreatureOutfit(cid, pokes[tostring(a)], -1)
        doChangeSpeed(cid, pokes[tostring(a)].speed)
        registerCreatureEvent(cid, "PlayerPokeDeath")
    end

    if getPlayerStorageValue(cid, 59987) >= 1 then
        local item = getPokeOutLive(cid)[1]
        local a = getItemAttribute(item, "poke"):match("This is (.-)'s pokeball.")
        doSetCreatureOutfit(cid, pokesride[tostring(a)], -1)
        doChangeSpeed(cid, pokesride[tostring(a)].speed)
        registerCreatureEvent(cid, "PlayerPokeDeath")
    end

    if getPlayerStorageValue(cid, 61207) >= 1 then
        local item = getPokeOutLive(cid)[1]
        doTransformItem(item, pokein)
        doRemoveCondition(cid, CONDITION_OUTFIT)
        doItemSetAttribute(item, "poke", getItemAttribute(item, "poke"):sub(#getItemAttribute(item, "poke")) ~= "]" and getItemAttribute(item, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]" or getItemAttribute(item, "poke"))
        setPlayerStorageValue(cid, 61207, 0)
    end

return TRUE
end

function onDeath(cid, deathList)
    local owner = getCreatureMaster(cid)
    doPlayerSendTextMessage(owner, 22, "Your pokemon died.")
    
    for slot = CONST_SLOT_FIRST, CONST_SLOT_LAST do
        local item = getPlayerSlotItem(owner, slot)
        if isContainer(item.uid) then
            local items = getItemsInContainerById(item.uid, pokeout)
            for _, ui in pairs(items) do
                if getItemAttribute(ui, "poke"):sub(#getItemAttribute(ui, "poke")) == "." then
                    local maxh = tonumber(getItemAttribute(ui, "poke"):match("/(.+)]"))
                    doItemSetAttribute(ui, "poke", getItemAttribute(ui, "poke"):sub(1, findLetter(getItemAttribute(ui, "poke"), ".")) .. " HP = [0/"..getCreatureMaxHealth(cid).."]")
                end
            end
       end
       
       if item.itemid == pokeout then
            if getItemAttribute(item.uid, "poke"):sub(#getItemAttribute(item.uid, "poke")) == "." then
                local maxh = tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]"))
                doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = [0/"..getCreatureMaxHealth(cid).."]")
            end
       end
    end
    doRemoveCreature(cid)
    setPlayerStorageValue(owner, 61207, 0)
    setPlayerStorageValue(owner, 61204, 0)
return FALSE
end 

 

 

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

  • Respostas 7
  • Visualizações 334
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor
  Em 21/01/2017 em 14:06, Noob II disse:

Qual o problema? algum erro na distro? 

http://i.imgur.com/6dKwkVW.png

@EDIT , Bug Concertado obrigado a você @Noob II pela tentativa de ajudar.!

( o Post do cara que fez o "Sistema" esta com muitos erros msm faltando alguns arquivos e configurações.... Fui no Site original e la esta certo e consegui arrumar).

Postado
  • Autor
  Em 21/01/2017 em 14:25, Noob II disse:

Era a função que faltava né? Dei uma olhada e tá faltando algumas coisas mesmo

a Lib do cara ta errada , falta 1 ou 2 função e ele esqueceu de colocar pra resgistrar o Catch.lua , coisa simples mas nem todos sabem

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