Ir para conteúdo
  • Cadastre-se

(Resolvido)[AJUDA] Addon System


Ir para solução Resolvido por Orochi Elf,

Posts Recomendados

 Primeiramente, Bom dia, Boa tarde, Boa noite. Galera esta é a minha 1° Vez postando no Tk, e queria uma ajuda eu adicionei um system de addons no meu server mas quando utiliza, o Addon não aparece .

 

addon.lua

function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local addons = {
        [751] = {pokemon= "Electabuzz" , looktype = 1911, count = 1},
        [748] = {pokemon= "Charizard" , looktype = 1910, count = 1},
        [755] = {pokemon= "Blastoise" , looktype = 1909, count = 1},
        [754] = {pokemon= "Shiny Nidoking" , looktype = 1914, count = 1},
        [753] = {pokemon= "Arcanine" , looktype = 1908, count = 1},
        [752] = {pokemon= "Shiny Golem" , looktype = 1913, count = 1},
    }
 
    if #getCreatureSummons(cid) > 0 then
        doPlayerSendCancel(cid, "Please back your pokemon.")
        return false
    end
 
    local numero = addons[item.itemid].looktype
    local count = addons[item.itemid].count
 
    local pb = getPlayerSlotItem(cid, 8).uid
    local pk = addons[item.itemid].pokemon
 
    if pb <= 0 then
        doPlayerSendCancel(cid, "Desculpe, você não tem um "..pk.." no slot")
        return false
    end
 
    if getItemAttribute(pb,"poke") ~= pk then
        doPlayerSendCancel(cid, "Desculpe, você não pode usar esse addon nesse pokemon.")
        return false
    end
 
    local addon = tonumber(getItemAttribute(pb,"addon"))
    if not addon or addon < 1 then
        if doRemoveItem(item.uid, count) then
            doPlayerSendTextMessage(cid, 27, "Parabéns, você executou isso com sucesso. Para remover seu addon diga !addons remove")
            doSetItemAttribute(pb,"addon", numero)
        else
            doPlayerSendCancel(cid, "Você não tem o necessário para adicionar no seu "..pk..".")
        end
        return true
    end
    
    return true
end

Gostaria que me ajudassem a resolver este problema.

 

+REP pra quem ajudar!

Link para o post
Compartilhar em outros sites

Cade o script do item?

 

poste tudo se possivel para 1 suporte melhor

Meus Trabalhos
 
Tudo em Desenvolvimento mais att em breve
Estou parado
 
Tudo Removido
Link para o post
Compartilhar em outros sites

@ricksi2012

 

Está e a tag do actions.xml :D

 

<action itemid="751,748,755,754,753,752" event="script" value="addon.lua" allowfaruse="1" blockwalls="1"/>

 

Link para o post
Compartilhar em outros sites

<action itemid="748,751,752,753,754,755" event="script" value="addon.lua" allowfaruse="1" blockwalls="1"/>

 

Coloque essa tag nova para evitar bugs futuros

 

e cade a parte do itens.xml?

Meus Trabalhos
 
Tudo em Desenvolvimento mais att em breve
Estou parado
 
Tudo Removido
Link para o post
Compartilhar em outros sites

<action itemid="748,751,752,753,754,755" event="script" value="addon.lua" allowfaruse="1" blockwalls="1"/>

 

Coloque essa tag nova para evitar bugs futuros

 

e cade a parte do itens.xml?

Ok vlw o intens.xml está ai <item id="751" article="a" name="Addon Electabuzz">

        <attribute key="description" value="A peculiar stone that may cause some pokemon to evolve." />

    </item>

 

Link para o post
Compartilhar em outros sites

o item "751" não tem 1 função não ?

Meus Trabalhos
 
Tudo em Desenvolvimento mais att em breve
Estou parado
 
Tudo Removido
Link para o post
Compartilhar em outros sites

O tópico foi movido para a área correta, preste mais atenção da próxima vez!

Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680

Este tópico foi movido:

De: "OTServScriptingActions e TalkActions"

Para: "OTServSuporte OTServSuporte de Scripts"

Link para o post
Compartilhar em outros sites

O único arquivo que precisa ser modificado no "Addon System", é o Go-Back, pra ele soltar o pokemon e colocar o addon, caso ele tenha.

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

 

O único arquivo que precisa ser modificado no "Addon System", é o Go-Back, pra ele soltar o pokemon e colocar o addon, caso ele tenha.

 

Não tenho ele poderia me mandar? :(estou precisando muito:unsure:Se puder me Ajudar Agradeço! :D;)   +REP

Editado por Darwin Watterson (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

 

Posta o seu goback ai, vou ver se consigo adaptar kkk

 

Actions/Goback Está ai :D

 

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 true                                                                                                                        

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 thishp <= 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

----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------

if not isInArray({5, 6}, getPlayerGroupId(cid)) then

   local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

   local low = {}

   local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}

   if #balls >= 1 then

      for _, uid in ipairs(balls) do

          local nome = getItemAttribute(uid, "poke")

          if not isInArray(lowPokes, pokemon) and nome == pokemon then

             return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")

          else

             if nome == pokemon then

                table.insert(low, nome)

             end

          end

      end

   end

if #low >= 3 then

   return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")

end   

end

---------------------------------------------------------------------------------------------------------------------------------------------------

    local x = pokes[pokemon]

    local boost = getItemAttribute(item.uid, "boost") or 0

    if getPlayerLevel(cid) < (x.level+boost) then

       doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")

       return true

    end

    

    ---------------------------- Sistema pokes de clan --------------------------------------

    local shinysClan = {

    ["Shiny Fearow"] = {4, "Wingeon"},

    ["Shiny Flareon"] = {1, "Volcanic"},

    ["Shiny Vaporeon"] = {2, "Seavel"},

    ["Shiny Jolteon"] = {9, "Raibolt"},

    ["Shiny Hypno"] = {7, "Psycraft"},           

    ["Shiny Golem"] = {3, "Orebound"},

    ["Shiny Vileplume"] = {8, "Naturia"},

    ["Shiny Nidoking"] = {5, "Malefic"},

    ["Shiny Hitmontop"] = {6, "Gardestrike"},   --alterado v1.4

    }

    

    if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then  --alterado v1.9 \/

       if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then

          doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")

          return true   

       elseif getPlayerClanRank(cid) ~= 5 then

          doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")

          return true

       end

    end

    --------------------------------------------------------------------------------------

    doSummonMonster(cid, pokemon)

    local pk = getCreatureSummons(cid)[1]

    if not isCreature(pk) then return true end

    

    ------------------------passiva hitmonchan------------------------------

    if isSummon(pk) then                                                  --alterado v1.8 \/

       if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then

          if not getItemAttribute(item.uid, "hands") then

             doSetItemAttribute(item.uid, "hands", 0)

          end

          local hands = getItemAttribute(item.uid, "hands")

          doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)

       end

    end

    -------------------------------------------------------------------------

    ---------movement magmar, jynx-------------

    if EFFECTS[getCreatureName(pk)] then             

       markPosEff(pk, getThingPos(pk))

       sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))  

    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)

    adjustStatus(pk, item.uid, true, true, true)

    doRegenerateWithY(getCreatureMaster(pk), pk)

    doAddPokemonInOwnList(cid, pokemon)

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

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

    local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)

    doCreatureSay(cid, mgo, TALKTYPE_SAY)

    

    doSendMagicEffect(getCreaturePosition(pk), effect)

    

    if useOTClient then

       doPlayerSendCancel(cid, '12//,show') --alterado v1.7

    end

    

else

    doPlayerSendCancel(cid, "This pokemon is fainted.")

end

    if useKpdoDlls then

        doUpdateMoves(cid)

    end

return true

end

 

Link para o post
Compartilhar em outros sites
  • Solução

Não testei.

 

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 true                                                                                                                        
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 thishp <= 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

----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------
if not isInArray({5, 6}, getPlayerGroupId(cid)) then
   local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
   local low = {}
   local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}
   if #balls >= 1 then
      for _, uid in ipairs(balls) do
          local nome = getItemAttribute(uid, "poke")
          if not isInArray(lowPokes, pokemon) and nome == pokemon then
             return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")
          else
             if nome == pokemon then
                table.insert(low, nome)
             end
          end
      end
   end
if #low >= 3 then
   return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")
end   
end
---------------------------------------------------------------------------------------------------------------------------------------------------

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

    if getPlayerLevel(cid) < (x.level+boost) then
       doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")
       return true
    end
    
    ---------------------------- Sistema pokes de clan --------------------------------------
    local shinysClan = {
    ["Shiny Fearow"] = {4, "Wingeon"},
    ["Shiny Flareon"] = {1, "Volcanic"},
    ["Shiny Vaporeon"] = {2, "Seavel"},
    ["Shiny Jolteon"] = {9, "Raibolt"},
    ["Shiny Hypno"] = {7, "Psycraft"},           
    ["Shiny Golem"] = {3, "Orebound"},
    ["Shiny Vileplume"] = {8, "Naturia"},
    ["Shiny Nidoking"] = {5, "Malefic"},
    ["Shiny Hitmontop"] = {6, "Gardestrike"},   --alterado v1.4
    }
    
    if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then  --alterado v1.9 \/
       if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then
          doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")
          return true   
       elseif getPlayerClanRank(cid) ~= 5 then
          doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")
          return true
       end
    end
    --------------------------------------------------------------------------------------

    doSummonMonster(cid, pokemon)

    local pk = getCreatureSummons(cid)[1]
    if not isCreature(pk) then return true end
    
    ------------------------passiva hitmonchan------------------------------
    if isSummon(pk) then                                                  --alterado v1.8 \/
       if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then
          if not getItemAttribute(item.uid, "hands") then
             doSetItemAttribute(item.uid, "hands", 0)
          end
          local hands = getItemAttribute(item.uid, "hands")
          doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)
       end
    end
    -------------------------------------------------------------------------
    -------- OrochiElf ----------
    if getItemAttribute(item.uid, "addon") > 0 then
        local pokeOut = getCreatureOutfit(pk)
        pokeOut.lookType = getItemAttribute(item.uid, "addon")
        
        doCreatureChangeOutfit(pk, pokeOut)
    end
    ----------------------------
    
    ---------movement magmar, jynx-------------
    if EFFECTS[getCreatureName(pk)] then             
       markPosEff(pk, getThingPos(pk))
       sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))  
    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)

    adjustStatus(pk, item.uid, true, true, true)
    doRegenerateWithY(getCreatureMaster(pk), pk)
    doAddPokemonInOwnList(cid, pokemon)

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

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

    local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
    doCreatureSay(cid, mgo, TALKTYPE_SAY)
    
    doSendMagicEffect(getCreaturePosition(pk), effect)
    
    if useOTClient then
       doPlayerSendCancel(cid, '12//,show') --alterado v1.7
    end
    
else

    doPlayerSendCancel(cid, "This pokemon is fainted.")

end

    if useKpdoDlls then
        doUpdateMoves(cid)
    end
return true
end

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

 

Não testei.

 

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 true                                                                                                                        

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 thishp <= 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

----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------

if not isInArray({5, 6}, getPlayerGroupId(cid)) then

   local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

   local low = {}

   local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}

   if #balls >= 1 then

      for _, uid in ipairs(balls) do

          local nome = getItemAttribute(uid, "poke")

          if not isInArray(lowPokes, pokemon) and nome == pokemon then

             return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")

          else

             if nome == pokemon then

                table.insert(low, nome)

             end

          end

      end

   end

if #low >= 3 then

   return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")

end   

end

---------------------------------------------------------------------------------------------------------------------------------------------------

    local x = pokes[pokemon]

    local boost = getItemAttribute(item.uid, "boost") or 0

    if getPlayerLevel(cid) < (x.level+boost) then

       doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")

       return true

    end

    

    ---------------------------- Sistema pokes de clan --------------------------------------

    local shinysClan = {

    ["Shiny Fearow"] = {4, "Wingeon"},

    ["Shiny Flareon"] = {1, "Volcanic"},

    ["Shiny Vaporeon"] = {2, "Seavel"},

    ["Shiny Jolteon"] = {9, "Raibolt"},

    ["Shiny Hypno"] = {7, "Psycraft"},           

    ["Shiny Golem"] = {3, "Orebound"},

    ["Shiny Vileplume"] = {8, "Naturia"},

    ["Shiny Nidoking"] = {5, "Malefic"},

    ["Shiny Hitmontop"] = {6, "Gardestrike"},   --alterado v1.4

    }

    

    if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then  --alterado v1.9 \/

       if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then

          doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")

          return true   

       elseif getPlayerClanRank(cid) ~= 5 then

          doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")

          return true

       end

    end

    --------------------------------------------------------------------------------------

    doSummonMonster(cid, pokemon)

    local pk = getCreatureSummons(cid)[1]

    if not isCreature(pk) then return true end

    

    ------------------------passiva hitmonchan------------------------------

    if isSummon(pk) then                                                  --alterado v1.8 \/

       if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then

          if not getItemAttribute(item.uid, "hands") then

             doSetItemAttribute(item.uid, "hands", 0)

          end

          local hands = getItemAttribute(item.uid, "hands")

          doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)

       end

    end

    -------------------------------------------------------------------------

    -------- OrochiElf ----------

    if getItemAttribute(item.uid, "addon") > 0 then

        local pokeOut = getCreatureOutfit(pk)

        pokeOut.lookType = getItemAttribute(item.uid, "addon")

        

        doCreatureChangeOutfit(pk, pokeOut)

    end

    ----------------------------

    

    ---------movement magmar, jynx-------------

    if EFFECTS[getCreatureName(pk)] then             

       markPosEff(pk, getThingPos(pk))

       sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))  

    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)

    adjustStatus(pk, item.uid, true, true, true)

    doRegenerateWithY(getCreatureMaster(pk), pk)

    doAddPokemonInOwnList(cid, pokemon)

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

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

    local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)

    doCreatureSay(cid, mgo, TALKTYPE_SAY)

    

    doSendMagicEffect(getCreaturePosition(pk), effect)

    

    if useOTClient then

       doPlayerSendCancel(cid, '12//,show') --alterado v1.7

    end

    

else

    doPlayerSendCancel(cid, "This pokemon is fainted.")

end

    if useKpdoDlls then

        doUpdateMoves(cid)

    end

return true

end

 

Obrigado Amigo Você e Foda Muito Obrigado Mesmo Topico Resolvido :D  +REP

Link para o post
Compartilhar em outros sites

Tipo a Addon Funfo Negocio que ta dando erro quando abre o poke :v

 

[09/01/2015 21:48:03] [Error - Action Interface]
[09/01/2015 21:48:03] data/actions/scripts/goback.lua:onUse
[09/01/2015 21:48:03] Description:
[09/01/2015 21:48:03] data/actions/scripts/goback.lua:162: attempt to compare number with nil
[09/01/2015 21:48:03] stack traceback:
[09/01/2015 21:48:03]     data/actions/scripts/goback.lua:162: in function <data/actions/scripts/goback.lua:10>

Link para o post
Compartilhar em outros sites

É verdade, eu já imaginava que isso iria acontecer kkk.

 

Arrumado

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 true                                                                                                                        
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 thishp <= 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

----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------
if not isInArray({5, 6}, getPlayerGroupId(cid)) then
   local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
   local low = {}
   local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}
   if #balls >= 1 then
      for _, uid in ipairs(balls) do
          local nome = getItemAttribute(uid, "poke")
          if not isInArray(lowPokes, pokemon) and nome == pokemon then
             return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")
          else
             if nome == pokemon then
                table.insert(low, nome)
             end
          end
      end
   end
if #low >= 3 then
   return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")
end   
end
---------------------------------------------------------------------------------------------------------------------------------------------------

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

    if getPlayerLevel(cid) < (x.level+boost) then
       doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")
       return true
    end
    
    ---------------------------- Sistema pokes de clan --------------------------------------
    local shinysClan = {
    ["Shiny Fearow"] = {4, "Wingeon"},
    ["Shiny Flareon"] = {1, "Volcanic"},
    ["Shiny Vaporeon"] = {2, "Seavel"},
    ["Shiny Jolteon"] = {9, "Raibolt"},
    ["Shiny Hypno"] = {7, "Psycraft"},           
    ["Shiny Golem"] = {3, "Orebound"},
    ["Shiny Vileplume"] = {8, "Naturia"},
    ["Shiny Nidoking"] = {5, "Malefic"},
    ["Shiny Hitmontop"] = {6, "Gardestrike"},   --alterado v1.4
    }
    
    if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then  --alterado v1.9 \/
       if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then
          doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")
          return true   
       elseif getPlayerClanRank(cid) ~= 5 then
          doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")
          return true
       end
    end
    --------------------------------------------------------------------------------------

    doSummonMonster(cid, pokemon)

    local pk = getCreatureSummons(cid)[1]
    if not isCreature(pk) then return true end
    
    ------------------------passiva hitmonchan------------------------------
    if isSummon(pk) then                                                  --alterado v1.8 \/
       if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then
          if not getItemAttribute(item.uid, "hands") then
             doSetItemAttribute(item.uid, "hands", 0)
          end
          local hands = getItemAttribute(item.uid, "hands")
          doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)
       end
    end
    -------------------------------------------------------------------------
    -------- OrochiElf ----------
    local addon = getItemAttribute(item.uid, "addon") or 0
    if getItemAttribute(item.uid, "addon") > 0 then
        local pokeOut = getCreatureOutfit(pk)
        pokeOut.lookType = getItemAttribute(item.uid, "addon")
        
        doCreatureChangeOutfit(pk, pokeOut)
    end
    ----------------------------
    
    ---------movement magmar, jynx-------------
    if EFFECTS[getCreatureName(pk)] then             
       markPosEff(pk, getThingPos(pk))
       sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))  
    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)

    adjustStatus(pk, item.uid, true, true, true)
    doRegenerateWithY(getCreatureMaster(pk), pk)
    doAddPokemonInOwnList(cid, pokemon)

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

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

    local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
    doCreatureSay(cid, mgo, TALKTYPE_SAY)
    
    doSendMagicEffect(getCreaturePosition(pk), effect)
    
    if useOTClient then
       doPlayerSendCancel(cid, '12//,show') --alterado v1.7
    end
    
else

    doPlayerSendCancel(cid, "This pokemon is fainted.")

end

    if useKpdoDlls then
        doUpdateMoves(cid)
    end
return true
end

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

 

É verdade, eu já imaginava que isso iria acontecer kkk.

 

Arrumado

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 true                                                                                                                        

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 thishp <= 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

----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------

if not isInArray({5, 6}, getPlayerGroupId(cid)) then

   local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

   local low = {}

   local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}

   if #balls >= 1 then

      for _, uid in ipairs(balls) do

          local nome = getItemAttribute(uid, "poke")

          if not isInArray(lowPokes, pokemon) and nome == pokemon then

             return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")

          else

             if nome == pokemon then

                table.insert(low, nome)

             end

          end

      end

   end

if #low >= 3 then

   return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")

end   

end

---------------------------------------------------------------------------------------------------------------------------------------------------

    local x = pokes[pokemon]

    local boost = getItemAttribute(item.uid, "boost") or 0

    if getPlayerLevel(cid) < (x.level+boost) then

       doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")

       return true

    end

    

    ---------------------------- Sistema pokes de clan --------------------------------------

    local shinysClan = {

    ["Shiny Fearow"] = {4, "Wingeon"},

    ["Shiny Flareon"] = {1, "Volcanic"},

    ["Shiny Vaporeon"] = {2, "Seavel"},

    ["Shiny Jolteon"] = {9, "Raibolt"},

    ["Shiny Hypno"] = {7, "Psycraft"},           

    ["Shiny Golem"] = {3, "Orebound"},

    ["Shiny Vileplume"] = {8, "Naturia"},

    ["Shiny Nidoking"] = {5, "Malefic"},

    ["Shiny Hitmontop"] = {6, "Gardestrike"},   --alterado v1.4

    }

    

    if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then  --alterado v1.9 \/

       if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then

          doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")

          return true   

       elseif getPlayerClanRank(cid) ~= 5 then

          doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")

          return true

       end

    end

    --------------------------------------------------------------------------------------

    doSummonMonster(cid, pokemon)

    local pk = getCreatureSummons(cid)[1]

    if not isCreature(pk) then return true end

    

    ------------------------passiva hitmonchan------------------------------

    if isSummon(pk) then                                                  --alterado v1.8 \/

       if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then

          if not getItemAttribute(item.uid, "hands") then

             doSetItemAttribute(item.uid, "hands", 0)

          end

          local hands = getItemAttribute(item.uid, "hands")

          doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)

       end

    end

    -------------------------------------------------------------------------

    -------- OrochiElf ----------

    local addon = getItemAttribute(item.uid, "addon") or 0

    if getItemAttribute(item.uid, "addon") > 0 then

        local pokeOut = getCreatureOutfit(pk)

        pokeOut.lookType = getItemAttribute(item.uid, "addon")

        

        doCreatureChangeOutfit(pk, pokeOut)

    end

    ----------------------------

    

    ---------movement magmar, jynx-------------

    if EFFECTS[getCreatureName(pk)] then             

       markPosEff(pk, getThingPos(pk))

       sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))  

    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)

    adjustStatus(pk, item.uid, true, true, true)

    doRegenerateWithY(getCreatureMaster(pk), pk)

    doAddPokemonInOwnList(cid, pokemon)

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

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

    local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)

    doCreatureSay(cid, mgo, TALKTYPE_SAY)

    

    doSendMagicEffect(getCreaturePosition(pk), effect)

    

    if useOTClient then

       doPlayerSendCancel(cid, '12//,show') --alterado v1.7

    end

    

else

    doPlayerSendCancel(cid, "This pokemon is fainted.")

end

    if useKpdoDlls then

        doUpdateMoves(cid)

    end

return true

end

 

vlw manin você e 1000000000000 :D Parabéns! :D +REP

Link para o post
Compartilhar em outros sites

Tem como adptar o meu tbm?

 

ou me amostra oque vc adiciona?

 

local EFFECTS = {


--[OutfitID] = {Effect}
["Magmar"] = 35,
["Shiny Magmar"] = 35,
["Shiny Magmortar"] = 35,
["Shiny Electivire"] = 48,
["Magmortar"] = 35,
["Electivire"] = 48,
["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 true
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 thishp <= 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

----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------
if not isInArray({5, 6}, getPlayerGroupId(cid)) then
local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
local low = {}
local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}
if #balls >= 1 then
for _, uid in ipairs(balls) do
local nome = getItemAttribute(uid, "poke")
if not isInArray(lowPokes, pokemon) and nome == pokemon then
return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")
else
if nome == pokemon then
table.insert(low, nome)
end
end
end
end
if #low >= 3 then
return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")
end
end
---------------------------------------------------------------------------------------------------------------------------------------------------

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

if getPlayerLevel(cid) < (x.level+boost) then
doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")
return true
end

---------------------------- Sistema pokes de clan --------------------------------------
local shinysClan = {
["Shiny Fearow"] = {4, "Wingeon"},
["Shiny Flareon"] = {1, "Volcanic"},
["Shiny Vaporeon"] = {2, "Seavel"},
["Shiny Jolteon"] = {9, "Raibolt"},
["Shiny Hypno"] = {7, "Psycraft"},
["Shiny Golem"] = {3, "Orebound"},
["Shiny Vileplume"] = {8, "Naturia"},
["Shiny Nidoking"] = {5, "Malefic"},
["Shiny Hitmontop"] = {6, "Gardestrike"}, --alterado v1.4
}

if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then --alterado v1.9 \/
if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then
doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")
return true
elseif getPlayerClanRank(cid) ~= 5 then
doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")
return true
end
end
--------------------------------------------------------------------------------------

doSummonMonster(cid, pokemon)

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

------------------------passiva hitmonchan------------------------------
if isSummon(pk) then --alterado v1.8 \/
if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then
if not getItemAttribute(item.uid, "hands") then
doSetItemAttribute(item.uid, "hands", 0)
end
local hands = getItemAttribute(item.uid, "hands")
doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)
end
end
-------------------------------------------------------------------------
---------movement magmar, jynx-------------
if EFFECTS[getCreatureName(pk)] then
markPosEff(pk, getThingPos(pk))
sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))
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)

adjustStatus(pk, item.uid, true, true, true)
doRegenerateWithY(getCreatureMaster(pk), pk)
doCureWithY(getCreatureMaster(pk), pk)

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

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

local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
doCreatureSay(cid, mgo, TALKTYPE_SAY)

doSendMagicEffect(getCreaturePosition(pk), effect)

if useOTClient then
doPlayerSendCancel(cid, '12//,show') --alterado v1.7
end

else

doPlayerSendCancel(cid, "This pokemon is fainted.")

end

if useKpdoDlls then
doUpdateMoves(cid)
end
return true
end

Meus Trabalhos
 
Tudo em Desenvolvimento mais att em breve
Estou parado
 
Tudo Removido
Link para o post
Compartilhar em outros sites

Tem como adptar o meu tbm?

 

ou me amostra oque vc adiciona?

 

local EFFECTS = {

--[OutfitID] = {Effect}

["Magmar"] = 35,

["Shiny Magmar"] = 35,

["Shiny Magmortar"] = 35,

["Shiny Electivire"] = 48,

["Magmortar"] = 35,

["Electivire"] = 48,

["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 true

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 thishp <= 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

----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------

if not isInArray({5, 6}, getPlayerGroupId(cid)) then

local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

local low = {}

local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}

if #balls >= 1 then

for _, uid in ipairs(balls) do

local nome = getItemAttribute(uid, "poke")

if not isInArray(lowPokes, pokemon) and nome == pokemon then

return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")

else

if nome == pokemon then

table.insert(low, nome)

end

end

end

end

if #low >= 3 then

return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")

end

end

---------------------------------------------------------------------------------------------------------------------------------------------------

local x = pokes[pokemon]

local boost = getItemAttribute(item.uid, "boost") or 0

if getPlayerLevel(cid) < (x.level+boost) then

doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")

return true

end

---------------------------- Sistema pokes de clan --------------------------------------

local shinysClan = {

["Shiny Fearow"] = {4, "Wingeon"},

["Shiny Flareon"] = {1, "Volcanic"},

["Shiny Vaporeon"] = {2, "Seavel"},

["Shiny Jolteon"] = {9, "Raibolt"},

["Shiny Hypno"] = {7, "Psycraft"},

["Shiny Golem"] = {3, "Orebound"},

["Shiny Vileplume"] = {8, "Naturia"},

["Shiny Nidoking"] = {5, "Malefic"},

["Shiny Hitmontop"] = {6, "Gardestrike"}, --alterado v1.4

}

if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then --alterado v1.9 \/

if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then

doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")

return true

elseif getPlayerClanRank(cid) ~= 5 then

doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")

return true

end

end

--------------------------------------------------------------------------------------

doSummonMonster(cid, pokemon)

local pk = getCreatureSummons(cid)[1]

if not isCreature(pk) then return true end

------------------------passiva hitmonchan------------------------------

if isSummon(pk) then --alterado v1.8 \/

if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then

if not getItemAttribute(item.uid, "hands") then

doSetItemAttribute(item.uid, "hands", 0)

end

local hands = getItemAttribute(item.uid, "hands")

doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)

end

end

-------------------------------------------------------------------------

---------movement magmar, jynx-------------

if EFFECTS[getCreatureName(pk)] then

markPosEff(pk, getThingPos(pk))

sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))

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)

adjustStatus(pk, item.uid, true, true, true)

doRegenerateWithY(getCreatureMaster(pk), pk)

doCureWithY(getCreatureMaster(pk), pk)

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

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

local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)

doCreatureSay(cid, mgo, TALKTYPE_SAY)

doSendMagicEffect(getCreaturePosition(pk), effect)

if useOTClient then

doPlayerSendCancel(cid, '12//,show') --alterado v1.7

end

else

doPlayerSendCancel(cid, "This pokemon is fainted.")

end

if useKpdoDlls then

doUpdateMoves(cid)

end

return true

end

 

 

Tenta assim

local EFFECTS = {

--[OutfitID] = {Effect}

["Magmar"] = 35,

["Shiny Magmar"] = 35,

["Shiny Magmortar"] = 35,

["Shiny Electivire"] = 48,

["Magmortar"] = 35,

["Electivire"] = 48,

["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 true

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 thishp <= 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

----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------

if not isInArray({5, 6}, getPlayerGroupId(cid)) then

local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

local low = {}

local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}

if #balls >= 1 then

for _, uid in ipairs(balls) do

local nome = getItemAttribute(uid, "poke")

if not isInArray(lowPokes, pokemon) and nome == pokemon then

return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")

else

if nome == pokemon then

table.insert(low, nome)

end

end

end

end

if #low >= 3 then

return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")

end

end

---------------------------------------------------------------------------------------------------------------------------------------------------

local x = pokes[pokemon]

local boost = getItemAttribute(item.uid, "boost") or 0

if getPlayerLevel(cid) < (x.level+boost) then

doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")

return true

end

---------------------------- Sistema pokes de clan --------------------------------------

local shinysClan = {

["Shiny Fearow"] = {4, "Wingeon"},

["Shiny Flareon"] = {1, "Volcanic"},

["Shiny Vaporeon"] = {2, "Seavel"},

["Shiny Jolteon"] = {9, "Raibolt"},

["Shiny Hypno"] = {7, "Psycraft"},

["Shiny Golem"] = {3, "Orebound"},

["Shiny Vileplume"] = {8, "Naturia"},

["Shiny Nidoking"] = {5, "Malefic"},

["Shiny Hitmontop"] = {6, "Gardestrike"}, --alterado v1.4

}

if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then --alterado v1.9 \/

if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then

doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")

return true

elseif getPlayerClanRank(cid) ~= 5 then

doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")

return true

end

end

--------------------------------------------------------------------------------------

doSummonMonster(cid, pokemon)

local pk = getCreatureSummons(cid)[1]

if not isCreature(pk) then return true end

------------------------passiva hitmonchan------------------------------

if isSummon(pk) then --alterado v1.8 \/

if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then

if not getItemAttribute(item.uid, "hands") then

doSetItemAttribute(item.uid, "hands", 0)

end

local hands = getItemAttribute(item.uid, "hands")

doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)

end

end

-------------------------------------------------------------------------

-------- OrochiElf ----------

local addon = getItemAttribute(item.uid, "addon") or 0

if getItemAttribute(item.uid, "addon") > 0 then

    local pokeOut = getCreatureOutfit(pk)

    pokeOut.lookType = getItemAttribute(item.uid, "addon")

    

    doCreatureChangeOutfit(pk, pokeOut)

end

----------------------------

---------movement magmar, jynx-------------

if EFFECTS[getCreatureName(pk)] then

markPosEff(pk, getThingPos(pk))

sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))

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)

adjustStatus(pk, item.uid, true, true, true)

doRegenerateWithY(getCreatureMaster(pk), pk)

doCureWithY(getCreatureMaster(pk), pk)

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

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

local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)

doCreatureSay(cid, mgo, TALKTYPE_SAY)

doSendMagicEffect(getCreaturePosition(pk), effect)

if useOTClient then

doPlayerSendCancel(cid, '12//,show') --alterado v1.7

end

else

doPlayerSendCancel(cid, "This pokemon is fainted.")

end

if useKpdoDlls then

doUpdateMoves(cid)

end

return true

end

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

 

Tenta assim

local EFFECTS = {

--[OutfitID] = {Effect}

["Magmar"] = 35,

["Shiny Magmar"] = 35,

["Shiny Magmortar"] = 35,

["Shiny Electivire"] = 48,

["Magmortar"] = 35,

["Electivire"] = 48,

["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 true

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 thishp <= 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

----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------

if not isInArray({5, 6}, getPlayerGroupId(cid)) then

local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

local low = {}

local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}

if #balls >= 1 then

for _, uid in ipairs(balls) do

local nome = getItemAttribute(uid, "poke")

if not isInArray(lowPokes, pokemon) and nome == pokemon then

return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")

else

if nome == pokemon then

table.insert(low, nome)

end

end

end

end

if #low >= 3 then

return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")

end

end

---------------------------------------------------------------------------------------------------------------------------------------------------

local x = pokes[pokemon]

local boost = getItemAttribute(item.uid, "boost") or 0

if getPlayerLevel(cid) < (x.level+boost) then

doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")

return true

end

---------------------------- Sistema pokes de clan --------------------------------------

local shinysClan = {

["Shiny Fearow"] = {4, "Wingeon"},

["Shiny Flareon"] = {1, "Volcanic"},

["Shiny Vaporeon"] = {2, "Seavel"},

["Shiny Jolteon"] = {9, "Raibolt"},

["Shiny Hypno"] = {7, "Psycraft"},

["Shiny Golem"] = {3, "Orebound"},

["Shiny Vileplume"] = {8, "Naturia"},

["Shiny Nidoking"] = {5, "Malefic"},

["Shiny Hitmontop"] = {6, "Gardestrike"}, --alterado v1.4

}

if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then --alterado v1.9 \/

if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then

doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")

return true

elseif getPlayerClanRank(cid) ~= 5 then

doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")

return true

end

end

--------------------------------------------------------------------------------------

doSummonMonster(cid, pokemon)

local pk = getCreatureSummons(cid)[1]

if not isCreature(pk) then return true end

------------------------passiva hitmonchan------------------------------

if isSummon(pk) then --alterado v1.8 \/

if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then

if not getItemAttribute(item.uid, "hands") then

doSetItemAttribute(item.uid, "hands", 0)

end

local hands = getItemAttribute(item.uid, "hands")

doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)

end

end

-------------------------------------------------------------------------

-------- OrochiElf ----------

local addon = getItemAttribute(item.uid, "addon") or 0

if getItemAttribute(item.uid, "addon") > 0 then

    local pokeOut = getCreatureOutfit(pk)

    pokeOut.lookType = getItemAttribute(item.uid, "addon")

    

    doCreatureChangeOutfit(pk, pokeOut)

end

----------------------------

---------movement magmar, jynx-------------

if EFFECTS[getCreatureName(pk)] then

markPosEff(pk, getThingPos(pk))

sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))

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)

adjustStatus(pk, item.uid, true, true, true)

doRegenerateWithY(getCreatureMaster(pk), pk)

doCureWithY(getCreatureMaster(pk), pk)

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

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

local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)

doCreatureSay(cid, mgo, TALKTYPE_SAY)

doSendMagicEffect(getCreaturePosition(pk), effect)

if useOTClient then

doPlayerSendCancel(cid, '12//,show') --alterado v1.7

end

else

doPlayerSendCancel(cid, "This pokemon is fainted.")

end

if useKpdoDlls then

doUpdateMoves(cid)

end

return true

end

 

Bugou

 

[09/01/2015 16:30:48] [Error - Action Interface] 
[09/01/2015 16:30:48] data/actions/scripts/goback.lua:onUse
[09/01/2015 16:30:48] Description: 
[09/01/2015 16:30:48] data/actions/scripts/goback.lua:168: attempt to compare number with nil
[09/01/2015 16:30:48] stack traceback:
[09/01/2015 16:30:48] data/actions/scripts/goback.lua:168: in function <data/actions/scripts/goback.lua:15>
 
O pokemon sai da pokebola nao aparece no icone e nem aparece skill e ele fica com 1 de vida
Meus Trabalhos
 
Tudo em Desenvolvimento mais att em breve
Estou parado
 
Tudo Removido
Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Imperius
      Olá! Estou disponibilizando um NPC que desenvolvi. Porém, devo avisar que só testei em TFS 0.4, e não posso garantir que funcionará em outras versões.
       
      Sobre:
       
      O NPC em questão é o "Gênio da Lâmpada". Para chegar até ele, o jogador precisa ter a "Lâmpada Mágica", que pode ser adquirida através de uma quest ou em algum evento do servidor, por exemplo.
       
      A lâmpada pode ser usada apenas uma vez e, mesmo que o jogador obtenha outra lâmpada, não poderá usá-la novamente. Ao usar a Lâmpada, o jogador será teleportado para a sala do Gênio. Lá, ele não poderá sair até realizar os três desejos.
       
      O Gênio pode atender desejos como "entregar itens", "reiniciar tasks", "completar addons" e até mesmo "matar um jogador". Você pode personalizar o NPC para oferecer outras recompensas, como "vip days", "premium points" ou "remover redskull". Seja criativo! :)
       
      Após o Gênio realizar os três desejos, o jogador será teleportado para o seu templo de origem.
       
       
      Vídeo demonstrativo:
       
       
       
       
      data > actions > actions.xml
       
       
       
      data > actions > lampadaDoGenio.lua
       
       
       
      data > npc > Genio.xml
       
       
       
      data > npc > scripts > Genio.lua
       
       
       
      Isso é tudo! Se tiverem sugestões ou dúvidas, estou à disposição!
    • Por MatheusVidaLoka
      Fala galera do Tibia King, hoje venho trazer um actions a vocês, queria dizer que essa action já é velha, mas dei uma olhada no TK e não vi nada a respeito da action, então decidi postar para vocês.




      Qual a função da Action?



      É um novo tipo de gold que cada um vale 1kk, funcionando normal nas compras e vendas de itens em npcs, e nas trocas de crystal coin para o golda nugget (novo gold).




      Bom vamos ao script.




      Vá em data/actions/scripts e abra o arquivo crystal.lua, apague tudo o que está dentro, logo em seguida cole o script abaixo:









      Traduzindo:
      Vermelho: É o id da crystal coin, e a quantidade a ser trocada por 1 gold nugget (Novo Gold).
      Azul: É o id da gold nugget, e a quantidade de gold nugget.




      Logo em seguida, vá novamente em data/actions/scripts copie qualquer arquivo.lua e cole, em seguida renomeie-o para "goldnuggets" sem aspas, abra-o, apague tudo, e cole o script abaixo.




      Traduzindo:
      Laranja: É o que vai dizer quando o player trocar 1 gold nugget por 100 crystal coins.
      Verde: É o id da crystal coin, e a quantidade equivalente a 1 gold nugget.



      Logo em seguida, abra data/actions/actions.xml e adicione a tag abaixo.









      Traduzindo:
      Rosa: É o id do gold nuggets.
      Azul: O nome do arquivo.lua que você salvou.




      Depois disso abra data/items/items.xml, aperte CTRL + F, e digite 2157, ai você vai achar o item Gold Nugget que vai estar assim:








      Substitua tudo por isso:



      <item id="2157" article="a" name="gold nugget" plural="gold nuggets">
      <attribute key="weight" value="10"/>
      <attribute key="worth" value="1000000" />




      Traduzindo:
      Vermelho: Peso do gold nugget.
      Azul: Valor do item (como 1 crystal coin = 10k , 1 gold nugget = 1kk)




      Logo depois vá data/actions/scripts/other e abra o arquivo changegold.lua, susbistitua tudo oque está la dentro por esse script a seguir, e salve:




      -- By MatheusVidaLoka
      local coins = {
      [iTEM_GOLD_COIN] = {
      to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
      },
      [iTEM_PLATINUM_COIN] = {
      from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
      },
      [iTEM_CRYSTAL_COIN] = {
      from = ITEM_PLATINUM_COIN, to = 2157, effect = TEXTCOLOR_LIGHTBLUE
      },
      [2157] = {
      from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL
      }



      }



      function onUse(cid, item, fromPosition, itemEx, toPosition)
      if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
      return false
      end



      local coin = coins[item.itemid]
      if(not coin) then
      return false
      end



      if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
      doChangeTypeItem(item.uid, item.type - item.type)
      doPlayerAddItem(cid, coin.to, 1)
      doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
      elseif(coin.from ~= nil) then
      doChangeTypeItem(item.uid, item.type - 1)
      doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
      doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
      end
      return true
      end



      Traduzindo:
      Vermelho: É o id do Gold Nugget.




      Por fim vá em data/actions/actions.xml, pule uma linha qualquer e cole isso, e salve:



      <action itemid="2157" event="script" value="other/changegold.lua"/>




      Traduzindo:
      Azul: É o id do gold nugget.
      Verde: O nome do arquivo que você salvou.

      Server testado em Ot 8.60 e funcionou corretamente.



      Creditos:



      MatheusVidaLoka



      JFLNT




      Se enfringi alguma regra do TK por favor me reporte.




      Desculpe-me pelos mal usos das ferramentas do TK (quotes,spoiler,CODES,etc) pois estou com certos problemas.

    • Por pabloxp
      gostaria que alguem me ajuda-se!! queria 1 sistema ou script que o trenó (Sled) se movimentase qnd o char fica-se em cima dele e ele controlase o trenó para as direçoes segurando CTRL + a direção desejada
      +rep pra qm ajudar
    • Por jonei
      Olá Tibiakinguianos, meu OT tem uma coisa que eu não entendo pra que...
      Vip system
      Premmium system
       
      Pelo que eu sei o premmium system é aquele no qual tu pode tocar as spells, usar barco, comprar casa entre outros
       
      o Vip system... Ai é que esta o problema, eu não sei nem pra que serve o Vip system. então estou aqui pedindo pra que alguém me explique a diferença entre estes

      Desde já agradeço
    • Por Sekk
      Bom gente, eu tenho um sistema no meu ot de Multi Element Shield, eu postei aqui no TK alguns dias atras, porém, sempre aparece isso no distro:
      Eu já to ficando com raiva disso, o distro não aparece nenhum erro, mas essa droga fica me atrapalhando a visão kkkk
       
      Se quiserem dar uma olhada nos scripts, ai vai:
      Meu actions.xml


        Agora o script do arquivo transformshield.lua que está em data/actions/scripts
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo