Ir para conteúdo
  • 0

(resolvido) Pokemon vai para o depot


kaleudd

Pergunta

Posts Recomendados

  • 0
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 ?

Link para o comentário
Compartilhar em outros sites

  • 0
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

 

Link para o comentário
Compartilhar em outros sites

  • 0
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 por kaleudd
Link para o comentário
Compartilhar em outros sites

  • 0
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

Link para o comentário
Compartilhar em outros sites

  • 0
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

Link para o comentário
Compartilhar em outros sites

  • 0
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

 

Link para o comentário
Compartilhar em outros sites

  • 0

@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.

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...