[Encerrado] Pedido box system

hamud
Por hamud
em Tópicos Sem Resposta

hamud

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/11/08Posts: 25

Ola, Quero um box system compatível com PDA, de repente parou de funcionar :/, se alguém puder me ajudar agradeceria vlwws :D

Malusz

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 08/11/13Posts: 86

box.lua

 

 

local a = {

[11638] = {balltype = "normal", ballid = 11826,
pokemons = {"Caterpie", "Weedle", "Pidgey", "Rattata", "Metapod", "Kakuna", "Spearow",
"Diglett", "Zubat", "Paras", "Oddish", "Poliwag", "Bellsprout", "Magnemite", "Shellder", "Krabby", "Horsea",
"Goldeen", "Magikarp", "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", "Ditto", "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) --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

 

 

 

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

MaxxSilva

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 08/06/13Posts: 274

melhora essa tag <action itemid="11638-11641" event="script" value="box.lua"/>

se o cara não funcionar tenta essa

 

 

local a = {
[11638] = {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] = {balltype = "great", ballid = 11832,
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] = {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] = {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 happy = 220

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 btype = b.balltype
if not pokeballs[btype] 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)

return true
end

 

hamud

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/11/08Posts: 25

melhora essa tag <action itemid="11638-11641" event="script" value="box.lua"/>

se o cara não funcionar tenta essa

 

 

local a = {

[11638] = {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] = {balltype = "great", ballid = 11832,

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] = {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] = {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 happy = 220

 

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 btype = b.balltype

if not pokeballs[btype] 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)

 

return true

end

 

Cara fiz tudo como mandado das tags ao script... aparece o seguinte erro,

mh4e.png

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Provavelmente, é problema do item em si. Tenta com outro itemid na tag (que não seja entre 11638 e 11641).

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Malusz

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 08/11/13Posts: 86

Tá dando algum erro no change log?

hamud

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/11/08Posts: 25

Provavelmente, é problema do item em si. Tenta com outro itemid na tag (que não seja entre 11638 e 11641).

Criei um novo item, e funcionou obrigado :D Pedido e Duvida Resolvida.

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Tópico movido para a seção de dúvidas e pedidos resolvidos.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Stigal

don't ever stop...
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 28/11/10Posts: 3402Gênero: Masculino
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.

VI6MDIG.png

 

"O fracasso é a oportunidade de se começar de novo inteligentemente"

Minhas Redes Sociais: Youtube | Página & Grupo | Steam  | Discord Xtibia | Skype: @mrooger

 

OTpanel