Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

 

Qual o motivo deste tópico? 

 

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

2bugs causando (lags(travamentos)) vou mostrar nas fotos

 

Você tem o código disponível? Se tiver publique-o aqui: 

 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

erro 2.png

error.png

Postado

Goback:

Spoiler

local EFFECTS = {
    --[OutfitID] = {Effect}
    ["Magmar"] = 35,   
    ["Jynx"] = 17,          --alterado v1.5
    ["Shiny Jynx"] = 17, 
    ["Piloswine"] = 205,  --alterado v1.8
    ["Swinub"] = 205,   
}

function onUse(cid, item, frompos, item2, topos)

    if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end

    if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 
        or getPlayerStorageValue(cid, 75846) >= 1 or getPlayerStorageValue(cid, 5700) >= 1  then    --alterado v1.9 <<
        return false                                                                                                                        
    end

    local ballName = getItemAttribute(item.uid, "poke")
    local btype = getPokeballType(item.itemid)
    local usando = pokeballs[btype].use

    local effect = pokeballs[btype].effect
    if not effect then
        effect = 21
    end
        
    unLock(item.uid) --alterado v1.8

    if item.itemid == usando then                           
        if getPlayerStorageValue(cid, 990) == 1 then -- GYM
            doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")
            return true
        end
        if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then     --alterado v1.6
            if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then  
                BackTeam(cid)       
            end
        end   
        if #getCreatureSummons(cid) == 2 and getPlayerStorageValue(cid, 212124) >= 1 then
            doPlayerSendCancel(cid, "You can't do that while is controling a mind")
            return true     --alterado v1.5
        end
        if #getCreatureSummons(cid) <= 0 then
            if isInArray(pokeballs[btype].all, item.itemid) then
                doTransformItem(item.uid, pokeballs[btype].off)
                doItemSetAttribute(item.uid, "hp", 0)
                doPlayerSendCancel(cid, "This pokemon is fainted.")
                return true
            end
        end

        local cd = getCD(item.uid, "blink", 30)
        if cd > 0 then
           setCD(item.uid, "blink", 0)
        end
        
        local z = getCreatureSummons(cid)[1]

        if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then
           return true
        end
        doReturnPokemon(cid, z, item, effect)

    elseif item.itemid == pokeballs[btype].on then

        if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
            doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")
            return true
        end

        local thishp = getItemAttribute(item.uid, "hp")

        if getItemAttribute(item.uid, "hp") == 0 then
            if isInArray(pokeballs[btype].all, item.itemid) then
                doTransformItem(item.uid, pokeballs[btype].off)
                doItemSetAttribute(item.uid, "hp", 0)
                doPlayerSendCancel(cid, "This pokemon is fainted.")
                return true
            end
        end

        local pokemon = getItemAttribute(item.uid, "poke")

        if not pokes[pokemon] then
            return true
        end

        local x = pokes[pokemon]
        local boost = getItemAttribute(item.uid, "boost") or 0

        if getPlayerLevel(cid) < (x.level) then
           doPlayerSendCancel(cid, "You need level "..(x.level).." to use this pokemon.")
           return true
        end
        
        local pk = getCreatureSummons(cid)[1]
        
        doSummonMonster(cid, pokemon)
        doItemSetAttribute(item.uid, "pokeballusada", 0)

        local pk = getCreatureSummons(cid)[1]
        if not isCreature(pk) then return true end
        

        if getCreatureName(pk) == "Ditto" or getCreatureName(pk) == "Shiny Ditto" then --edited
            local left = getItemAttribute(item.uid, "transLeft")
            local name = getItemAttribute(item.uid, "transName")

            if left and left > 0 then
                setPlayerStorageValue(pk, 1010, name)
                doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)
                addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))
                doItemSetAttribute(item.uid, "transBegin", os.clock())
            else
                setPlayerStorageValue(pk, 1010, getCreatureName(pk) == "Ditto" and "Ditto" or "Shiny Ditto")     --edited
            end
        end

        if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end

        doCreatureSetLookDir(pk, 2)
        doCreatureSetNick(pk, nick)    
        
        adjustStatus(pk, item.uid, true, true, true)
        doAddPokemonInOwnList(cid, pokemon)

        doTransformItem(item.uid, item.itemid+1)
        

        local pokename = getPokeName(pk) --alterado v1.7 

        if getPlayerLanguage(cid) == 2 then
            local mgoen = gobackmsgsen[math.random(1, #gobackmsgsen)].go:gsub("doka", pokename)
            doCreatureSay(cid, mgoen, 19)
        elseif getPlayerLanguage(cid) == 0 then
            local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
            doCreatureSay(cid, mgo, 19)
        elseif getPlayerLanguage(cid) == 1 then
            local mgoes = gobackmsgses[math.random(1, #gobackmsgses)].go:gsub("doka", pokename)
            doCreatureSay(cid, mgoes, 19)
        end
    
        doSendMagicEffect(getCreaturePosition(pk), effect)
        
        if useOTClient then
           doPlayerSendCancel(cid, '12//,show') --alterado v1.7
        end
        
        -- ADDON SYSTEM
        local pk = getCreatureSummons(cid)[1]
        local pb = getPlayerSlotItem(cid, 8).uid
        local look = getAddonValue(pb, "addon")

        if look > 0 then
            doSetCreatureOutfit(pk, {lookType = look}, -1)
        end
    else
        doPlayerSendCancel(cid, "Seu pokémon está desmaiado.")
    end
    
    if useKpdoDlls then
        doUpdateMoves(cid)
        doUpdatePokemonsBar(cid)
        end
    return true
end

 

Move1:

 

Spoiler

local msgs = {"use ", ""}

function doAlertReady(cid, id, movename, n, cd)
    if not isCreature(cid) then return true end
    local myball = getPlayerSlotItem(cid, ?
    if myball.itemid > 0 and getItemAttribute(myball.uid, cd) == "cd:"..id.."" then
    return true
    end
    local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
    if not p or #p <= 0 then return true end
    for a = 1, #p do
        if getItemAttribute(p[a], cd) == "cd:"..id.."" then
        return true
        end
    end
end

function onSay(cid, words, param, channel)


    if param ~= "" then return true end
    if string.len(words) > 3 then return true end

    if #getCreatureSummons(cid) == 0 then
    doPlayerSendTextMessage(cid, 26, "Você precisa de um pokémon para usar moves.")
    return 0
    end
                      --alterado v1.5
local mypoke = getCreatureSummons(cid)[1]

    if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end
    if getCreatureName(mypoke) == "Evolution" then return true end

    if getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny Ditto" then
       name = getPlayerStorageValue(mypoke, 1010)   --edited
    else
       name = getCreatureName(mypoke)
    end  
    
    --local name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke)

local it = string.sub(words, 2, 3)
local move = movestable[name].move1
if getPlayerStorageValue(mypoke, 212123) >= 1 then
   cdzin = "cm_move"..it..""
else
   cdzin = "move"..it..""       --alterado v1.5
end

    if it == "2" then
        move = movestable[name].move2
    elseif it == "3" then
        move = movestable[name].move3
    elseif it == "4" then
        move = movestable[name].move4
    elseif it == "5" then
        move = movestable[name].move5
    elseif it == "6" then
        move = movestable[name].move6
    elseif it == "7" then
        move = movestable[name].move7
    elseif it == "8" then
        move = movestable[name].move8
    elseif it == "9" then
        move = movestable[name].move9
    elseif it == "10" then
        move = movestable[name].move10
    elseif it == "11" then
        move = movestable[name].move11
    elseif it == "12" then
        move = movestable[name].move12
    elseif it == "13" then
        move = movestable[name].move13
    end

    if not move then
        doPlayerSendTextMessage(cid, 26, "Seu pokémon não reconhece esse move.")
    return true
    end
    
    if getPlayerLevel(cid) < move.level then
       doPlayerSendTextMessage(cid, 26, "Você precisa ser level "..move.level.." para usar este move.")
       return true
    end

    if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (move.cd + 2) then
        doPlayerSendTextMessage(cid, 26, "Você tem que esperar "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." segundos para usar "..move.name.." novamente.")
    return true
    end

    if getTileInfo(getThingPos(mypoke)).protection then
        doPlayerSendCancel(cid, "Você não atacar em PZ.")
    return true
    end
                                      --alterado v1.6                  
    if (move.name == "Team Slice" or move.name == "Team Claw") and #getCreatureSummons(cid) < 2 then       
        doPlayerSendCancel(cid, "Os seus pokemon precisa estar em uma equipe para usar este move!")
    return true
    end
                                                                     --alterado v1.7 \/\/\/


if move.target == 1 then

    if not isCreature(getCreatureTarget(cid)) then
    doPlayerSendTextMessage(cid, 26, "Você não tem um alvo.")
    return 0
    end

    if getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then
    return 0
    end

    if getCreatureHealth(getCreatureTarget(cid)) <= 0 then
    doPlayerSendTextMessage(cid, 26, "Você já derrotou o seu alvo.")
    return 0
    end

    if not isCreature(getCreatureSummons(cid)[1]) then
    return true
    end

    if getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > move.dist then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Aproxime-se o alvo de usar este move.")
    return 0
    end

    if not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then
    return 0
    end
end

    local newid = 0
    
    if isSleeping(mypoke) or isSilence(mypoke) then  --alterado v1.5
            doPlayerSendTextMessage(cid, MESSAGE_ORANGE, "Sorry you can't do that right now.")
            return 0
        else
            newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd)
        end
        
    --doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..move.name.."!", 19)
    
    local summons = getCreatureSummons(cid) --alterado v1.6

    addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin)
    
    for i = 2, #summons do
       if isCreature(summons[i]) and getPlayerStorageValue(cid, 637501) >= 1 then
          docastspell(summons[i], move.name)        --alterado v1.6
       end
    end 

    docastspell(mypoke, move.name)

    if useKpdoDlls then
        doUpdateCooldowns(cid)
    end

return 0
end

 

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.6k

Informação Importante

Confirmação de Termo