Ir para conteúdo

[Encerrado] Box Com Pokemon Dentro


abmauromacedo

Posts Recomendados

Cara, é só ir em data/actions/scripts e pegar la, a box +1 ou outra qualquer como base...

Se não tiver ai, baixe o PDA ou o Centurion... Qualquer um deles já tem as box, só pegar os scripts e editar!! XD

Só não passo o system agora, pq to na casa da tia e num posso baixar nada =//

Link para o comentário
Compartilhar em outros sites

Então já tem os script's todos prontos!!!

Para saber id deles, é só ir nos items.xml e procurar por "box +1 ou +2 ou +3 ou +4" !!! XD

Para edita-los, vai nada pasta data/actions/scripts e procure por lá o script da box que quer ver...

Caso queira criar uma nova, é só copiar o arquivo de alguma box, editar os que vêm nada box, e id do item no data/actions/actions.xml!!! =]

Link para o comentário
Compartilhar em outros sites

Bom cara para vc Add faz o Seguinte:

 

local a = {

[11638] = {level = {5, 10}, balltype = "normal", ballid = 11826,

pokemons = {"Slowpoke", "Magnemite", "Doduo", "Seel", "Grimer", "Gastly", "Drowzee", "Voltorb", "Cubone", "Koffing",

"Goldeen", "Vulpix", "Tentacool", "Bulbasaur", "Charmander", "Squirtle", "Butterfree", "Beedrill", "Metapod", "Kakuna",

"Raticate", "Spearow", "Ekans", "Abra", "Mankey", "Psyduck", "Pikachu", "Sandshrew", "Nidoran Female",

"Nidoran Male", "Zubat", "Diglett", "Venonat", "Meowth", "Poliwag", "Growlithe", "Machop", "Ponyta", "Geodude"}},

[11639] = {level = {21, 30}, balltype = "great", ballid = 11832, --alterado v1.5

pokemons = {"Pidgeotto", "Weepinbell", "Clefairy", "Omanyte", "Kabuto", "Arbok", "Raichu", "Nidorino", "Nidorina",

"Dodrio", "Muk", "Golbat", "Gloom", "Parasect", "Venomoth", "Dugtrio", "Persian", "Poliwhirl", "Victreebel", "Machoke",

"Graveler", "Slowbro", "Magneton", "Farfetch'd", "Haunter", "Kingler", "Electrode", "Weezing", "Rhyhorn", "Seadra",

"Jigglypuff", "Seaking", "Tauros", "Starmie", "Eevee", "Dratini", "Charmeleon", "Wartortle", "Ivysaur"}},

[11640] = {level = {40, 50}, balltype = "super", ballid = 11835,

pokemons = {"Pidgeot", "Fearow", "Sandslash", "Ninetales", "Vileplume", "Primeape", "Golduck", "Kadabra", "Rapidash",

"Clefable", "Wigglytuff", "Dewgong", "Onix", "Cloyster", "Hypno", "Exeggutor", "Marowak", "Hitmonchan", "Hitmonlee",

"Lickitung", "Chansey", "Tangela", "Mr. Mime", "Pinsir", "Vaporeon", "Jolteon", "Flareon", "Porygon", "Dragonair"}},

[11641] = {level = {70, 80}, balltype = "ultra", ballid = 11829,

pokemons = {"Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Abra", "Dragonite", "Snorlax", "Kabutops", "Omastar",

"Ditto", "Lapras", "Gyarados", "Magmar", "Electabuzz", "Jynx", "Scyther", "Kangaskhan", "Golem", "Venusaur",

"Machamp", "Poliwrath", "Arcanine", "Nidoking", "Nidoqueen", "Charizard", "Blastoise", "Tentacruel", "Alakazam",

"Gengar", "Rhydon"}}

}

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)]

local pokeinfo = getPokemonStatus(pokemon)

if not pokeinfo then return true end

local btype = b.balltype

if not pokeballs[btype] then return true end

local gender = getRandomGenderByName(pokemon)

local level = math.random(b.level[1], b.level[2])

local offense = pokeinfo.off * level * extrastrength

local defense = pokeinfo.def * level * extrastrength

local agility = pokeinfo.agi * level * extrastrength

local spatk = pokeinfo.spatk * level * extrastrength

local vit = pokeinfo.vit * level * extrastrength

local happy = 180

local leveltable = getPokemonExperienceTable(pokemon)

 

local ball = 0

local sendToDepot = false --alterado v2.6

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

sendToDepot = true

ball = doCreateItemEx(b.ballid) --alterado v1.5

else

ball = item.uid

end

 

doItemSetAttribute(ball, "poke", pokemon)

doItemSetAttribute(ball, "hp", 1)

doItemSetAttribute(ball, "level", level)

doItemSetAttribute(ball, "exp", leveltable[level])

doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level])

doItemSetAttribute(ball, "offense", offense)

doItemSetAttribute(ball, "defense", defense)

doItemSetAttribute(ball, "speed", agility)

doItemSetAttribute(ball, "vitality", vit)

doItemSetAttribute(ball, "specialattack", spatk)

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.." (level "..level.."), congratulations!")

 

if sendToDepot then --alterado v1.5

doPlayerSendMailByName(getCreatureName(cid), ball, 1)

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

 

 

a parte Vermelha é o ID da Box que vc vai usar

 

 

e add isso no actions.xml

 

<action itemid="[/color][color=#ff0000]11638-11641[/color][color=#000000]" event="script" value="box.lua"/>

 

o Vermelho é a ID da Box

 

ai Para vc add mais Uma Box 1° se Cria A Sprite e cria o ID dela e depois Vai em Items.xml e add ela no seu Server asim:

 

<item id="[/color][color=#ff0000]11638[/color][color=#000000]" article="a" name="[/color][color=#0000ff]pokemon prize box +1[/color][color=#000000]">
   <attribute key="description" value="[/color][color=#008000]What poke surprise is hidden in this box?[/color][color=#000000]" />
</item>

 

em vermelho é o ID da Box

em azul é o Nome do item Aconcelho a mudar Só a parte do +1 para a box que vc quiser

em verde é a descrição da Sua box deixe asim mesmo

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

Configurando Sua Box:

local a = {

[11638] = {level = {5, 10}, balltype = "normal", ballid = 11826,

pokemons = {"Slowpoke", "Magnemite", "Doduo", "Seel", "Grimer", "Gastly", "Drowzee", "Voltorb", "Cubone", "Koffing",

"Goldeen", "Vulpix", "Tentacool", "Bulbasaur", "Charmander", "Squirtle", "Butterfree", "Beedrill", "Metapod", "Kakuna",

"Raticate", "Spearow", "Ekans", "Abra", "Mankey", "Psyduck", "Pikachu", "Sandshrew", "Nidoran Female",

"Nidoran Male", "Zubat", "Diglett", "Venonat", "Meowth", "Poliwag", "Growlithe", "Machop", "Ponyta", "Geodude"}},

[11639] = {level = {21, 30}, balltype = "great", ballid = 11832, --alterado v1.5

pokemons = {"Pidgeotto", "Weepinbell", "Clefairy", "Omanyte", "Kabuto", "Arbok", "Raichu", "Nidorino", "Nidorina",

"Dodrio", "Muk", "Golbat", "Gloom", "Parasect", "Venomoth", "Dugtrio", "Persian", "Poliwhirl", "Victreebel", "Machoke",

"Graveler", "Slowbro", "Magneton", "Farfetch'd", "Haunter", "Kingler", "Electrode", "Weezing", "Rhyhorn", "Seadra",

"Jigglypuff", "Seaking", "Tauros", "Starmie", "Eevee", "Dratini", "Charmeleon", "Wartortle", "Ivysaur"}},

[11640] = {level = {40, 50}, balltype = "super", ballid = 11835,

pokemons = {"Pidgeot", "Fearow", "Sandslash", "Ninetales", "Vileplume", "Primeape", "Golduck", "Kadabra", "Rapidash",

"Clefable", "Wigglytuff", "Dewgong", "Onix", "Cloyster", "Hypno", "Exeggutor", "Marowak", "Hitmonchan", "Hitmonlee",

"Lickitung", "Chansey", "Tangela", "Mr. Mime", "Pinsir", "Vaporeon", "Jolteon", "Flareon", "Porygon", "Dragonair"}},

[11641] = {level = {70, 80}, balltype = "ultra", ballid = 11829,

pokemons = {"Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Abra", "Dragonite", "Snorlax", "Kabutops", "Omastar",

"Ditto", "Lapras", "Gyarados", "Magmar", "Electabuzz", "Jynx", "Scyther", "Kangaskhan", "Golem", "Venusaur",

"Machamp", "Poliwrath", "Arcanine", "Nidoking", "Nidoqueen", "Charizard", "Blastoise", "Tentacruel", "Alakazam",

"Gengar", "Rhydon"}}

[xxx] = {level = {90, 100} balltype = "ultra", ballid = 11829,

pokemons = {" editado com Preferencia"}}

}

 

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)]

local pokeinfo = getPokemonStatus(pokemon)

if not pokeinfo then return true end

local btype = b.balltype

if not pokeballs[btype] then return true end

local gender = getRandomGenderByName(pokemon)

local level = math.random(b.level[1], b.level[2])

local offense = pokeinfo.off * level * extrastrength

local defense = pokeinfo.def * level * extrastrength

local agility = pokeinfo.agi * level * extrastrength

local spatk = pokeinfo.spatk * level * extrastrength

local vit = pokeinfo.vit * level * extrastrength

local happy = 180

local leveltable = getPokemonExperienceTable(pokemon)

 

local ball = 0

local sendToDepot = false --alterado v2.6

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

sendToDepot = true

ball = doCreateItemEx(b.ballid) --alterado v1.5

else

ball = item.uid

end

 

doItemSetAttribute(ball, "poke", pokemon)

doItemSetAttribute(ball, "hp", 1)

doItemSetAttribute(ball, "level", level)

doItemSetAttribute(ball, "exp", leveltable[level])

doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level])

doItemSetAttribute(ball, "offense", offense)

doItemSetAttribute(ball, "defense", defense)

doItemSetAttribute(ball, "speed", agility)

doItemSetAttribute(ball, "vitality", vit)

doItemSetAttribute(ball, "specialattack", spatk)

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.." (level "..level.."), congratulations!")

 

if sendToDepot then --alterado v1.5

doPlayerSendMailByName(getCreatureName(cid), ball, 1)

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

 

 

em xxx é o ID novo da Sua Box

e em {level = {90, 100} balltype = "ultra", ballid = 11829,

/\ level que vc usar a box /\ Tipo da Pokebola que ele vai sair /\ Id da Pokebola

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

agora coloke No Actions.xml a Seguinte tag:

 

<action itemid="11638-11641;xxx" event="script" value="box.lua"/>

 

xxx id da Sua box e seja feliz com sua Nova box add vlw xD se ajudei rep++

até amigo

 

Link para o comentário
Compartilhar em outros sites

cara ainda não da certo na hora de carregar aperece esse erro:

 

[10/12/2012 13:25:38] [Error - LuaScriptInterface::loadFile] data/actions/scripts/box.lua:28: '}' expected (to close '{' at line 1) near '['

[10/12/2012 13:25:38] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/box.lua)

[10/12/2012 13:25:38] data/actions/scripts/box.lua:28: '}' expected (to close '{' at line 1) near '['

 

 

script box

 

local a = {

[11638] = {level = {5, 10}, balltype = "normal",

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

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

"Goldeen", "Magikarp", "Exeggcute"}},

[11639] = {level = {11, 20}, balltype = "super",

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] = {level = {21, 30}, balltype = "great",

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", "Ditto", "Vaporeon", "Jolteon",

"Flareon", "Porygon"}},

[11641] = {level = {31, 40}, balltype = "ultra",

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"}},

[12784] = {level = {80, 100}, balltype = "ultra",

pokemons = {"Metagross", "Rhyperior", "Aggron", "Salamence", "Hariyama", "Mightyena", "Flygon",

"Dusclops", "Mamoswine", "Claydol", "Milotic", "Dragonite"}}

[12794] = {level = {90, 100} balltype = "ultra", pokemons = {"Milotic"}}

}

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)]

local pokeinfo = getPokemonStatus(pokemon)

if not pokeinfo then return true end

local btype = b.balltype

if not pokeballs[btype] then return true end

local gender = getRandomGenderByName(pokemon)

local level = math.random(b.level[1], b.level[2])

local offense = pokeinfo.off * level * extrastrength

local defense = pokeinfo.def * level * extrastrength

local agility = pokeinfo.agi * level * extrastrength

local spatk = pokeinfo.spatk * level * extrastrength

local vit = pokeinfo.vit * level * extrastrength

local happy = 180

local leveltable = getPokemonExperienceTable(pokemon)

local ball = 0

local sendToDepot = false

if getCreatureMana(cid) >= 6 then

sendToDepot = true

ball = doCreateItemEx(2219)

else

ball = item.uid

end

doItemSetAttribute(ball, "poke", pokemon)

doItemSetAttribute(ball, "hp", 1)

doItemSetAttribute(ball, "level", level)

doItemSetAttribute(ball, "exp", leveltable[level])

doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level])

doItemSetAttribute(ball, "offense", offense)

doItemSetAttribute(ball, "defense", defense)

doItemSetAttribute(ball, "speed", agility)

doItemSetAttribute(ball, "vitality", vit)

doItemSetAttribute(ball, "specialattack", spatk)

doItemSetAttribute(ball, "happy", happy)

doItemSetAttribute(ball, "gender", gender)

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.." (level "..level.."), congratulations!")

if sendToDepot then

doPlayerSendMailByName(getCreatureName(cid), ball, 1)

doTransformItem(ball, pokeballs[btype].on)

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

 

 

Tag

 

<action itemid="12784;11638;11639;11640;11641;12794" event="script" value="box.lua"/>

 

Editado por abmauromacedo
Link para o comentário
Compartilhar em outros sites

Tenta assim:

 

 

 

local a = {

[11638] = {level = {5, 10}, balltype = "normal",pokemons = {"Caterpie", "Weedle", "Pidgey", "Rattata", "Metapod", "Kakuna", "Spearow",

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

"Goldeen", "Magikarp", "Exeggcute"}},

[11639] = {level = {11, 20}, balltype = "super",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] = {level = {21, 30}, balltype = "great",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", "Ditto", "Vaporeon", "Jolteon",

"Flareon", "Porygon"}},

[11641] = {level = {31, 40}, balltype = "ultra",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"}},

[12784] = {level = {80, 100}, balltype = "ultra",pokemons = {"Metagross", "Rhyperior", "Aggron", "Salamence", "Hariyama", "Mightyena", "Flygon","Dusclops", "Mamoswine", "Claydol", "Milotic", "Dragonite"}},

[12794] = {level = {90, 100}, balltype = "ultra", pokemons = {"Milotic", "Metagross"}},

}

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)]

local pokeinfo = getPokemonStatus(pokemon)

if not pokeinfo then return true end

local btype = b.balltype

if not pokeballs[btype] then return true end

local gender = getRandomGenderByName(pokemon)

local level = math.random(b.level[1], b.level[2])

local offense = pokeinfo.off * level * extrastrength

local defense = pokeinfo.def * level * extrastrength

local agility = pokeinfo.agi * level * extrastrength

local spatk = pokeinfo.spatk * level * extrastrength

local vit = pokeinfo.vit * level * extrastrength

local happy = 180

local leveltable = getPokemonExperienceTable(pokemon)

local ball = 0

local sendToDepot = false

if getCreatureMana(cid) >= 6 then

sendToDepot = true

ball = doCreateItemEx(2219)

else

ball = item.uid

end

doItemSetAttribute(ball, "poke", pokemon)

doItemSetAttribute(ball, "hp", 1)

doItemSetAttribute(ball, "level", level)

doItemSetAttribute(ball, "exp", leveltable[level])

doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level])

doItemSetAttribute(ball, "offense", offense)

doItemSetAttribute(ball, "defense", defense)

doItemSetAttribute(ball, "speed", agility)

doItemSetAttribute(ball, "vitality", vit)

doItemSetAttribute(ball, "specialattack", spatk)

doItemSetAttribute(ball, "happy", happy)

doItemSetAttribute(ball, "gender", gender)

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.." (level "..level.."), congratulations!")

if sendToDepot then

doPlayerSendMailByName(getCreatureName(cid), ball, 1)

doTransformItem(ball, pokeballs[btype].on)

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

 

Link para o comentário
Compartilhar em outros sites

Tenta assim:

 

 

 

local a = {

[11638] = {level = {5, 10}, balltype = "normal",pokemons = {"Caterpie", "Weedle", "Pidgey", "Rattata", "Metapod", "Kakuna", "Spearow",

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

"Goldeen", "Magikarp", "Exeggcute"}},

[11639] = {level = {11, 20}, balltype = "super",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] = {level = {21, 30}, balltype = "great",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", "Ditto", "Vaporeon", "Jolteon",

"Flareon", "Porygon"}},

[11641] = {level = {31, 40}, balltype = "ultra",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"}},

[12784] = {level = {80, 100}, balltype = "ultra",pokemons = {"Metagross", "Rhyperior", "Aggron", "Salamence", "Hariyama", "Mightyena", "Flygon","Dusclops", "Mamoswine", "Claydol", "Milotic", "Dragonite"}},

[12794] = {level = {90, 100}, balltype = "ultra", pokemons = {"Milotic", "Metagross"}},

}

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)]

local pokeinfo = getPokemonStatus(pokemon)

if not pokeinfo then return true end

local btype = b.balltype

if not pokeballs[btype] then return true end

local gender = getRandomGenderByName(pokemon)

local level = math.random(b.level[1], b.level[2])

local offense = pokeinfo.off * level * extrastrength

local defense = pokeinfo.def * level * extrastrength

local agility = pokeinfo.agi * level * extrastrength

local spatk = pokeinfo.spatk * level * extrastrength

local vit = pokeinfo.vit * level * extrastrength

local happy = 180

local leveltable = getPokemonExperienceTable(pokemon)

local ball = 0

local sendToDepot = false

if getCreatureMana(cid) >= 6 then

sendToDepot = true

ball = doCreateItemEx(2219)

else

ball = item.uid

end

doItemSetAttribute(ball, "poke", pokemon)

doItemSetAttribute(ball, "hp", 1)

doItemSetAttribute(ball, "level", level)

doItemSetAttribute(ball, "exp", leveltable[level])

doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level])

doItemSetAttribute(ball, "offense", offense)

doItemSetAttribute(ball, "defense", defense)

doItemSetAttribute(ball, "speed", agility)

doItemSetAttribute(ball, "vitality", vit)

doItemSetAttribute(ball, "specialattack", spatk)

doItemSetAttribute(ball, "happy", happy)

doItemSetAttribute(ball, "gender", gender)

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.." (level "..level.."), congratulations!")

if sendToDepot then

doPlayerSendMailByName(getCreatureName(cid), ball, 1)

doTransformItem(ball, pokeballs[btype].on)

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

 

valew deu certo valew,valew,valew

 

 

Untitled-1.jpg

Link para o comentário
Compartilhar em outros sites

  • 5 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

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