KA
suporte otserv

(resolvido) Pokemon vai para o depot

Por kaleudd, 10 de dez. de 2016 em Resolvidos

otserv
45
12k
17 de dezembro de 2016 às 13:55
17 horas atrás, nociam disse:

se mudo certo e para apenas colocar o -1 na função doCreateItemEx(ballid-1).

quanto vc criar um pokemon na ball pelo comando ele buga no depot mais se vc abrir 1 vez o depot já não buga mais estranho isso, mas pelo cath normal ta funfando 100%.

 

estava testando em outro servidor vou ver o de vcs.

funciono,para que as boxs funcionam é só fazer o mesmo processo no ball = doCreateItemEx(b.ballid),ficando ball = doCreateItemEx(b.ballid-1)

17 horas atrás, nociam disse:

se mudo certo e para apenas colocar o -1 na função doCreateItemEx(ballid-1).

quanto vc criar um pokemon na ball pelo comando ele buga no depot mais se vc abrir 1 vez o depot já não buga mais estranho isso, mas pelo cath normal ta funfando 100%.

 

estava testando em outro servidor vou ver o de vcs.

só poderia me falar a função que é usada,para após abrir bau?

pois ao abrir um bau e o player tiver com 6 pokebag,o 7 poke que pegou no bau vai pro depot,porem morto,ai queria mudar isto tmb,vlw -)

wougoplexW
17 de dezembro de 2016 às 14:42
42 minutos atrás, kaleudd disse:

funciono,para que as boxs funcionam é só fazer o mesmo processo no ball = doCreateItemEx(b.ballid),ficando ball = doCreateItemEx(b.ballid-1)

só poderia me falar a função que é usada,para após abrir bau?

pois ao abrir um bau e o player tiver com 6 pokebag,o 7 poke que pegou no bau vai pro depot,porem morto,ai queria mudar isto tmb,vlw -)

aonde fica o da box ?

17 de dezembro de 2016 às 19:39
4 horas atrás, wougoplex disse:

aonde fica o da box ?

em data/actions/scripts/box.lua e faça o que comentei.

wougoplexW
17 de dezembro de 2016 às 19:40
Agora, kaleudd disse:

em data/actions/scripts/box.lua e faça o que comentei.

 

tem as box e essa function mais nada 

Spoiler

local happy = 1000 

         

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

         local b = a[item.itemid]                                    

               if not b then return true end

         local pokemon = b.pokemons[math.random(#b.pokemons)]

               if not pokes[pokemon] then return true end  

         

         doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!")

     doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon..", congratulations!")

     doSendMagicEffect(getThingPos(cid), 29)

               

         addPokeToPlayer(cid, pokemon, 0, nil, btype)     --alterado v1.9                                                 

         doRemoveItem(item.uid, 1)

                   if useOTClient then

                doCreatureExecuteTalkAction(cid, "/salvar")

    end

    

return true

 

17 de dezembro de 2016 às 19:48
4 minutos atrás, wougoplex disse:

 

tem as box e essa function mais nada 

  Ocultar conteúdo

local happy = 1000 

         

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

         local b = a[item.itemid]                                    

               if not b then return true end

         local pokemon = b.pokemons[math.random(#b.pokemons)]

               if not pokes[pokemon] then return true end  

         

         doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!")

     doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon..", congratulations!")

     doSendMagicEffect(getThingPos(cid), 29)

               

         addPokeToPlayer(cid, pokemon, 0, nil, btype)     --alterado v1.9                                                 

         doRemoveItem(item.uid, 1)

                   if useOTClient then

                doCreatureExecuteTalkAction(cid, "/salvar")

    end

    

return true

 

tente achar algo assim pareçido:

 

Spoiler

local a = {

[11638] = {balltype = "normal", ballid = 11826,

        pokemons = {"Pidgey", "Rattata", "Metapod", "Kakuna", "Spearow",

        "Diglett", "Zubat", "Paras", "Oddish", "Poliwag", "Bellsprout", "Magnemite", "Shellder",

        "Exeggcute"}},

[11639] = {balltype = "great", ballid = 11832,        --alterado v1.3

        pokemons = {"Bulbasaur", "Charmander", "Squirtle", "Pidgeotto", "Raticate", "Pikachu",

        "Butterfree", "Beedrill", "Ekans", "Arbok", "Gloom", "Nidoran Female", "Nidorina", "Nidoran Male", "Nidorino",

        "Golbat", "Clefairy", "Jigglypuff", "Venonat", "Sandshrew", "Vulpix", "Meowth", "Persian", "Psyduck", "Mankey",

        "Growlithe", "Poliwhirl", "Abra", "Machop", "Weepinbell", "Tentacool", "Geodude", "Ponyta", "Slowpoke", "Doduo",

        "Seel", "Grimer", "Muk", "Gastly", "Drowzee", "Voltorb", "Cubone", "Koffing", "Weezing", "Rhyhorn", "Seaking",

        "Staryu", "Eevee", "Omanyte", "Kabuto"}},

[11640] = {balltype = "super", ballid = 11835,

        pokemons = {"Ivysaur", "Charmeleon", "Wartortle", "Raichu", "Fearow", "Vileplume", "Venomoth",

        "Parasect", "Clefable", "Wigglytuff", "Sandslash", "Dugtrio", "Golduck", "Primeape", "Kadabra", "Machoke",

        "Victreebel", "Graveler", "Rapidash", "Slowbro", "Magneton", "Farfetch'd", "Dodrio", "Cloyster", "Haunter", "Onix",

        "Hypno", "Kingler", "Electrode", "Exeggutor", "Marowak", "Hitmonlee", "Hitmonchan", "Lickitung", "Chansey",

        "Tangela", "Kangaskhan", "Seadra", "Starmie", "Mr. Mime", "Pinsir", "Tauros", "Vaporeon", "Jolteon",

        "Flareon", "Porygon"}},

[11641] = {balltype = "ultra", ballid = 11829,

        pokemons = {"Venusaur", "Charizard", "Blastoise", "Pidgeot", "Nidoqueen", "Nidoking", "Ninetales",

        "Arcanine", "Poliwrath", "Alakazam", "Machamp", "Tentacruel", "Golem", "Dewgong", "Gengar", "Rhydon", "Scyther",

        "Jynx", "Electabuzz", "Magmar", "Gyarados", "Lapras", "Omastar", "Kabutops", "Aerodactyl", "Snorlax", "Dragonair",

        "Dragonite"}}

}

local extrastrength = 1.1        

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

         local b = a[item.itemid]                                    

               if not b then return true end

         local pokemon = b.pokemons[math.random(#b.pokemons)] --alterado v1.3

         local btype = b.balltype

               if not pokeballs[btype] then return true end

         local gender = getRandomGenderByName(pokemon)

         local happy = 220

         local leveltable = getPokemonExperienceTable(pokemon)

         

         local ball = 0

         local sendToDepot = false                                              --alterado v1.6          

         if getCreatureMana(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then

               sendToDepot = true

               ball = doCreateItemEx(b.ballid-1)    --alterado v1.3

         else

               ball = item.uid

         end  

         

           doItemSetAttribute(ball, "poke", pokemon)

           doItemSetAttribute(ball, "hp", 1)

           doItemSetAttribute(ball, "happy", happy)

           doItemSetAttribute(ball, "gender", gender)

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

              doItemSetAttribute(ball, "hands", 0)

           end

           doItemSetAttribute(ball, "description", "Contains a "..pokemon..".")

           doItemSetAttribute(ball, "fakedesc", "Contains a "..pokemon..".")    

 

         doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!")

         doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon..", congratulations!")

         

         if sendToDepot then

               doPlayerSendMailByName(getCreatureName(cid), ball, 1)  --alterado v1.3

               doPlayerSendTextMessage(cid, 27, "You are already holding six pokemons, so your new pokemon was sent to your depot.")

               doRemoveItem(item.uid)

         else

               doTransformItem(ball, pokeballs[btype].on)

         end

         

         doSendMagicEffect(getThingPos(cid), 29)

return true

end

 

Editado Dezembro 17 por kaleudd

wougoplexW
17 de dezembro de 2016 às 20:10
17 minutos atrás, kaleudd disse:

tente achar algo assim pareçido:

 

  Ocultar conteúdo

local a = {

[11638] = {balltype = "normal", ballid = 11826,

        pokemons = {"Pidgey", "Rattata", "Metapod", "Kakuna", "Spearow",

        "Diglett", "Zubat", "Paras", "Oddish", "Poliwag", "Bellsprout", "Magnemite", "Shellder",

        "Exeggcute"}},

[11639] = {balltype = "great", ballid = 11832,        --alterado v1.3

        pokemons = {"Bulbasaur", "Charmander", "Squirtle", "Pidgeotto", "Raticate", "Pikachu",

        "Butterfree", "Beedrill", "Ekans", "Arbok", "Gloom", "Nidoran Female", "Nidorina", "Nidoran Male", "Nidorino",

        "Golbat", "Clefairy", "Jigglypuff", "Venonat", "Sandshrew", "Vulpix", "Meowth", "Persian", "Psyduck", "Mankey",

        "Growlithe", "Poliwhirl", "Abra", "Machop", "Weepinbell", "Tentacool", "Geodude", "Ponyta", "Slowpoke", "Doduo",

        "Seel", "Grimer", "Muk", "Gastly", "Drowzee", "Voltorb", "Cubone", "Koffing", "Weezing", "Rhyhorn", "Seaking",

        "Staryu", "Eevee", "Omanyte", "Kabuto"}},

[11640] = {balltype = "super", ballid = 11835,

        pokemons = {"Ivysaur", "Charmeleon", "Wartortle", "Raichu", "Fearow", "Vileplume", "Venomoth",

        "Parasect", "Clefable", "Wigglytuff", "Sandslash", "Dugtrio", "Golduck", "Primeape", "Kadabra", "Machoke",

        "Victreebel", "Graveler", "Rapidash", "Slowbro", "Magneton", "Farfetch'd", "Dodrio", "Cloyster", "Haunter", "Onix",

        "Hypno", "Kingler", "Electrode", "Exeggutor", "Marowak", "Hitmonlee", "Hitmonchan", "Lickitung", "Chansey",

        "Tangela", "Kangaskhan", "Seadra", "Starmie", "Mr. Mime", "Pinsir", "Tauros", "Vaporeon", "Jolteon",

        "Flareon", "Porygon"}},

[11641] = {balltype = "ultra", ballid = 11829,

        pokemons = {"Venusaur", "Charizard", "Blastoise", "Pidgeot", "Nidoqueen", "Nidoking", "Ninetales",

        "Arcanine", "Poliwrath", "Alakazam", "Machamp", "Tentacruel", "Golem", "Dewgong", "Gengar", "Rhydon", "Scyther",

        "Jynx", "Electabuzz", "Magmar", "Gyarados", "Lapras", "Omastar", "Kabutops", "Aerodactyl", "Snorlax", "Dragonair",

        "Dragonite"}}

}

local extrastrength = 1.1        

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

         local b = a[item.itemid]                                    

               if not b then return true end

         local pokemon = b.pokemons[math.random(#b.pokemons)] --alterado v1.3

         local btype = b.balltype

               if not pokeballs[btype] then return true end

         local gender = getRandomGenderByName(pokemon)

         local happy = 220

         local leveltable = getPokemonExperienceTable(pokemon)

         

         local ball = 0

         local sendToDepot = false                                              --alterado v1.6          

         if getCreatureMana(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then

               sendToDepot = true

               ball = doCreateItemEx(b.ballid-1)    --alterado v1.3

         else

               ball = item.uid

         end  

         

           doItemSetAttribute(ball, "poke", pokemon)

           doItemSetAttribute(ball, "hp", 1)

           doItemSetAttribute(ball, "happy", happy)

           doItemSetAttribute(ball, "gender", gender)

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

              doItemSetAttribute(ball, "hands", 0)

           end

           doItemSetAttribute(ball, "description", "Contains a "..pokemon..".")

           doItemSetAttribute(ball, "fakedesc", "Contains a "..pokemon..".")    

 

         doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!")

         doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon..", congratulations!")

         

         if sendToDepot then

               doPlayerSendMailByName(getCreatureName(cid), ball, 1)  --alterado v1.3

               doPlayerSendTextMessage(cid, 27, "You are already holding six pokemons, so your new pokemon was sent to your depot.")

               doRemoveItem(item.uid)

         else

               doTransformItem(ball, pokeballs[btype].on)

         end

         

         doSendMagicEffect(getThingPos(cid), 29)

return true

end

 

Nao achei nada

nociamN
17 de dezembro de 2016 às 20:53

e a na função addPokeToPlayer(cid, pokemon, 0, nil, btype)     que tem que arrumar.    

 

 

wougoplexW
17 de dezembro de 2016 às 21:01
3 minutos atrás, nociam disse:

e a na função addPokeToPlayer(cid, pokemon, 0, nil, btype)     que tem que arrumar.    

 

 

eu botei assim  addPokeToPlayer(cid, pokemon, -1, nil, btype)  deu erro na distro e o poke continuava indo morto pro depot

nociamN
17 de dezembro de 2016 às 21:04

vc tem que procurar aonde fica a função addPokeToPlayer na lib e mudar la.

wougoplexW
17 de dezembro de 2016 às 21:07
Agora, nociam disse:

vc tem que procurar aonde fica a função addPokeToPlayer na lib e mudar la.

aonde na lib ? qual lua

nociamN
17 de dezembro de 2016 às 21:10

ai eu não sei se tem que procurar ai.

no caso aqui o servidor que tenho esta em some functions.lua

wougoplexW
17 de dezembro de 2016 às 21:20
6 minutos atrás, nociam disse:

ai eu não sei se tem que procurar ai.

no caso aqui o servidor que tenho esta em some functions.lua

Achei isso 

Spoiler

function addPokeToPlayer(cid, pokemon, boost, gender, ball)             --alterado v1.9 \/ peguem ele todo...

local genders = {

["male"] = 4,

["female"] = 3,

[1] = 4,

[0] = 3,

[4] = 4,

[3] = 3,

}

if not isCreature(cid) then return false end

local pokemon = doCorrectString(pokemon)

if not pokes[pokemon] then return false end

   local GENDER = (gender and genders[gender]) and genders[gender] or getRandomGenderByName(pokemon)

   local btype = (ball and pokeballs[ball]) and ball or isShinyName(pokemon) and "shinynormal" or "normal"

   local happy = 250

   

   if icons[pokemon] then

      id = icons[pokemon].on

   else

      id = pokeballs[btype].on

   end

   if (getPlayerFreeCap(cid) >= 6 and not isInArray({5, 6}, getPlayerGroupId(cid))) or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then 

      item = doCreateItemEx(id)

   else

      item = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, id, 1)   

   end

   if not item then return false end

   doItemSetAttribute(item, "poke", pokemon)

   doItemSetAttribute(item, "hp", 1)

   doItemSetAttribute(item, "happy", happy)

   doSetItemAttribute(item, "hands", 0)

   doItemSetAttribute(item, "description", "Contains a "..pokemon..".")

   doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".") 

   doItemSetAttribute(item, "defeated", "no")

   doItemSetAttribute(item, "ball", btype)

   if boost and tonumber(boost) and tonumber(boost) > 0 and tonumber(boost) <= 50 then

      doItemSetAttribute(item, "boost", boost)

   end

 

DrenksD
17 de dezembro de 2016 às 21:20

@nociam me pode ajuda nao posso resolver, Eu fiz o que você dissena catch system mais nada.

17 de dezembro de 2016 às 22:07

@nociam

tenho este em some,poderia falar onde mudar neste script aqui:

 

Spoiler

function addPokeToPlayer(cid, pokemon, boost, gender, ball, unique)             --alterado v1.9 \/ peguem ele todo...
local genders = {
["male"] = 4,
["female"] = 3,
[1] = 4,
[0] = 3,
[4] = 4,
[3] = 3,
}
if not isCreature(cid) then return false end

local pokemon = doCorrectString(pokemon)
if not pokes[pokemon] then return false end

   local GENDER = (gender and genders[gender]) and genders[gender] or getRandomGenderByName(pokemon)
   local btype = (ball and pokeballs[ball]) and ball or isShinyName(pokemon) and "shinynormal" or "normal"
   local happy = 250

   if (getPlayerFreeCap(cid) >= 6 and not isInArray({5, 6}, getPlayerGroupId(cid))) or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then
      item = doCreateItemEx(11826)
   else
      item = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, 11826, 1)   
   end
   if not item then return false end

 

consegui arrumar,topico reportado para ser movido.

PoccnnP
17 de dezembro de 2016 às 22:48

Caro membro, seu tópico foi movido de Otserv > Suporte Otserv para Suporte Otserv > Otserv > Pedidos e Dúvidas Resolvidos.