- no action.xml
- coloque isso aqui.
<action itemid="11638;11639;11640;11641;12227" event="script" value="box.lua"/>
info
Grupo: Campones
Registrado: 28/07/12
Posts: 43
Reputação: +29

- no action.xml
- coloque isso aqui.
<action itemid="11638;11639;11640;11641;12227" event="script" value="box.lua"/>
Não deu cara tipo clica ctrl + esquerdo do mouse e não faz nada '-'
info
Grupo: Campones
Registrado: 12/12/12
Posts: 20
Reputação: +4
Char no Tibia: Não lembro

fas uma nova coloca esse no action.xml
<action itemid="12784;12783;12782;12781;12331" event="script" value="box.lua"/>
<action itemid="11641;11640;11639;11638;12780" event="script" value="box2.lua"/>local a = {
[12781] = {level = {70, 80}, balltype = "ultra",
pokemons = {"Scizor", "Snorlax", "Raichu", "Electvire", "Magmortar", "Blissey"}},
[12782] = {level = {80, 85}, balltype = "ultra",
pokemons = {"Venusaur", "Charizard", "Gyarados", "Skarmory", "Raticate", "Tentacruel",
"Arcanine", "Ninetales", "Thyplosion", "Feraligatr", "Meganium"}},
[12783] = {level = {85, 95}, balltype = "ultra",
pokemons = {"Shiny Bulbasaur", "Shiny Charizard", "Shiny blastoise", "Shiny mamoswine", "Shiny Pidgeot", "Shiny Gengar", "Shiny Alakazam",
"Shiny Gyarados", "Shiny Golem", "Shiny Ditto", "Shiny Starmie", "Shiny clefable", "Shiny toxicroak", "Shiny Machamp", "Shiny Lapras", "shiny Arcanine"}},
[12784] = {level = {99, 100}, balltype = "ultra",
pokemons = {"Mew", "Mewtwo", "Articuno", "Zapdos", "Moltres", "Shiny mew", "Shiny mewtwo", "Shiny articuno", "Shiny zapdos", "Shiny moltres"}},
[12331] = {level = {99, 100}, balltype = "ultra",
pokemons = {"Salamence", "Shiny tropius", "Ditto"}},
}
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, "Você abriu a caixa +"..item.itemid - (11637).."!")
doPlayerSendTextMessage(cid, 27, "Você ganhou um "..pokemon.." (level "..level.."), parabéns!!")
if sendToDepot then
doPlayerSendMailByName(getCreatureName(cid), ball, 1)
doTransformItem(ball, pokeballs[btype].on)
doPlayerSendTextMessage(cid, 27, "Você ja tem 6 pokemon, coloque um no DP.")
doRemoveItem(item.uid)
else
doTransformItem(ball, pokeballs[btype].on)
end
doSendMagicEffect(getThingPos(cid), 29)
return true
end
e cria um la com o nome box2.lua e cola la essa
local a = {
[12781] = {level = {70, 80}, balltype = "ultra",
pokemons = {"Scizor", "Snorlax", "Raichu", "Electvire", "Magmortar", "Blissey"}},
[12782] = {level = {80, 85}, balltype = "ultra",
pokemons = {"Venusaur", "Charizard", "Gyarados", "Skarmory", "Raticate", "Tentacruel",
"Arcanine", "Ninetales", "Thyplosion", "Feraligatr", "Meganium"}},
[12783] = {level = {85, 95}, balltype = "ultra",
pokemons = {"Shiny Bulbasaur", "Shiny Charizard", "Shiny blastoise", "Shiny mamoswine", "Shiny Pidgeot", "Shiny Gengar", "Shiny Alakazam",
"Shiny Gyarados", "Shiny Golem", "Shiny Ditto", "Shiny Starmie", "Shiny clefable", "Shiny toxicroak", "Shiny Machamp", "Shiny Lapras", "shiny Arcanine"}},
[12784] = {level = {99, 100}, balltype = "ultra",
pokemons = {"Mew", "Mewtwo", "Articuno", "Zapdos", "Moltres", "Shiny mew", "Shiny mewtwo", "Shiny articuno", "Shiny zapdos", "Shiny moltres"}},
[12331] = {level = {99, 100}, balltype = "ultra",
pokemons = {"Salamence", "Shiny tropius", "Ditto"}},
}
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, "Você abriu a caixa +"..item.itemid - (11637).."!")
doPlayerSendTextMessage(cid, 27, "Você ganhou um "..pokemon.." (level "..level.."), parabéns!!")
if sendToDepot then
doPlayerSendMailByName(getCreatureName(cid), ball, 1)
doTransformItem(ball, pokeballs[btype].on)
doPlayerSendTextMessage(cid, 27, "Você ja tem 6 pokemon, coloque um no DP.")
doRemoveItem(item.uid)
else
doTransformItem(ball, pokeballs[btype].on)
end
doSendMagicEffect(getThingPos(cid), 29)
return true
end
depois so e mudar os pokemons, e colocar de sua preferencia ![]()
meu poke não tem salamence so johto e kanto
info
Grupo: Campones
Registrado: 12/12/12
Posts: 20
Reputação: +4
Char no Tibia: Não lembro

Como Falei Amigo, Mude Só Os Pokes
Coloque os de sua preferencia
DUVIDA SANADA ? REP+?VAMOS BRIDAR INT
info
Grupo: Infante
Registrado: 28/01/12
Posts: 1.6k
Reputação: +262
Gênero: Masculino

Tenta ai.
Tag em actions.xml.
<action itemid="11638-11641;12227" event="script" value="box.lua"/>
Box.lua:
local a = {
[11638] = {balltype = "normal", ballid = 11826,
pokemons = {"Slowpoke", "Cyndaquil", "Chikorita", "Totodile", "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 = 11826, --alterado v1.3
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", "Tyrogue", "Charmeleon", "Wartortle", "Ivysaur"}},
[11640] = {balltype = "super", ballid = 11826,
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", "Hitmontop", "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"}},
[12227] = {balltype = "ultra", ballid = 11829,
pokemons = {"Shiny Charizard", "Shiny Venusaur", "Shiny Mr. Mime", "Shiny Blastoise", "Shiny Arcanine", "Shiny Hitmontop", "Shiny Tangela", "Shiny Electabuzz",
"Shiny Gengar", "Shiny Tentacruel", "Shiny Marowak", "Aerodactyl", "Shiny Dragonair", "Shiny Jynx", "Shiny Scyther", "Shiny Seadra", "Shiny Electrode",
"Shiny Raticate", "Shiny Parasect", "Shiny Alakazam", "Shiny Gyarados", "Shiny Beedrill", "Shiny Kingler", "Shiny Magneton", "Shiny Onix",
"Shiny Pidgeot", "Shiny Venomoth", "Shiny Muk", "Shiny Butterfree", "Shiny Golbat", "Shiny Farfetch'd", "Shiny Pinsir", "Shiny Raichu"}}
}
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 --alterado v1.3
local gender = getRandomGenderByName(pokemon)
local happy = 220
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
doItemSetAttribute(ball, "morta", "no")
doItemSetAttribute(ball, "icone", "yes")
doItemSetAttribute(ball, "ball", getItemNameById(ballid))
doTransformItem(ball, icons[getItemAttribute(ball, "poke")].on)
doPlayerSendTextMessage(cid, 27, "You are already holding six pokemons, so your new pokemon was sent to your depot.")
doRemoveItem(item.uid)
else
doItemSetAttribute(ball, "morta", "no")
doItemSetAttribute(ball, "icone", "yes")
doItemSetAttribute(ball, "ball", getItemNameById(ballid))
doTransformItem(ball, icons[getItemAttribute(ball, "poke")].on)
end
doSendMagicEffect(getThingPos(cid), 29)
return true
end
Editado Fevereiro 14 por FlamesAdmin
@Destruidorbk sqn pq n deo, tipo tem chance de o box não estar no items.xml ou não estiver para abrir no item.otb?
Flameadmin tbm n deo isso eu ja tinha tentado sl uq deo nisso kk
Na pasta items.xml ta assim o box
No otb editor ele ta certo '-' sl uq deo
Editado Fevereiro 13 por xandeloko
info
Grupo: Campones
Registrado: 21/01/13
Posts: 17
Reputação: 0
Char no Tibia: vendi tudo meus char

estou com o msm problema se alguem ajudar ja e 2 rep +
info
Grupo: Infante
Registrado: 28/01/12
Posts: 1.6k
Reputação: +262
Gênero: Masculino

@Destruidorbk sqn pq n deo, tipo tem chance de o box não estar no items.xml ou não estiver para abrir no item.otb?
Flameadmin tbm n deo isso eu ja tinha tentado sl uq deo nisso kk
Na pasta items.xml ta assim o box
<item id="11638" article="a" name="pokemon box 1"><attribute key="description" value="What poke surprise is hidden in this box?" /></item><item id="11639" article="a" name="pokemon box 2"><attribute key="description" value="What poke surprise is hidden in this box?" /></item><item id="11640" article="a" name="pokemon box 3"><attribute key="description" value="What poke surprise is hidden in this box?" /></item><item id="11641" article="a" name="pokemon box 4"><attribute key="description" value="What poke surprise is hidden in this box?" /></item>
No otb editor ele ta certo '-' sl uq deo
Deu algum erro ao usar a box ?
info
Grupo: Campones
Registrado: 12/12/12
Posts: 20
Reputação: +4
Char no Tibia: Não lembro

Entao coloca la no Intem.xml
<item id="11638" article="a" name="pokemon prize box +1">
<attribute key="description" value="What poke surprise is hidden in this box?" />
</item>
<item id="11639" article="a" name="pokemon prize box +2">
<attribute key="description" value="What poke surprise is hidden in this box?" />
</item>
<item id="11640" article="a" name="pokemon prize box +3">
<attribute key="description" value="What poke surprise is hidden in this box?" />
</item>
<item id="11641" article="a" name="pokemon prize box +4">
<attribute key="description" value="What poke surprise is hidden in this box?" />
</item>
<item id="12781" article="a" name="pokemon prize box +5">
<attribute key="description" value="What poke surprise is hidden in this box?" />
</item>
<item id="12782" article="a" name="pokemon prize box +6">
<attribute key="description" value="What poke surprise is hidden in this box?" />
</item>
<item id="12783" article="a" name="pokemon prize box +7">
<attribute key="description" value="What poke surprise is hidden in this box?" />
</item>
<item id="12784" article="a" name="pokemon prize box +8">
<attribute key="description" value="What poke surprise is hidden in this box?" />
</item>
<item id="12780" article="a" name="pokemon prize box +0">
<attribute key="description" value="What poke surprise is hidden in this box?" />
</item>no xml ta certo kra e não da erro ao usar ela, ela apenas não abre
info
Grupo: Infante
Registrado: 28/01/12
Posts: 1.6k
Reputação: +262
Gênero: Masculino

no xml ta certo kra e não da erro ao usar ela, ela apenas não abre
Substitui essa tag que eu te mandei pela qual vc ta usando.
info
Grupo: Campones
Registrado: 12/12/12
Posts: 20
Reputação: +4
Char no Tibia: Não lembro

Se vc adiciono aquela script que mandei primeiro vc tem que adicionar essa no item.xml
vai la testa que deve funcionar
info
Grupo: Campones
Registrado: 23/01/13
Posts: 96
Reputação: +2
Char no Tibia: Krepr
Bom galera tem como alguém em ajudar ai ;D
Actions Tag
: -- -- POKEMON PRIZE BOXES / RARE CANDY
Actions/scripts/box.lua
local a = {
[11638] = {balltype = "normal", ballid = 11826,
pokemons = {"Slowpoke", "Cyndaquil", "Chikorita", "Totodile", "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 = 11826, --alterado v1.3
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", "Tyrogue", "Charmeleon", "Wartortle", "Ivysaur"}},
[11640] = {balltype = "super", ballid = 11826,
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", "Hitmontop", "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"}},
[12227] = {balltype = "ultra", ballid = 11826,
pokemons = {"Shiny Charizard", "Shiny Venusaur", "Shiny Mr. Mime", "Shiny Blastoise", "Shiny Arcanine", "Shiny Hitmontop", "Shiny Tangela", "Shiny Electabuzz",
"Shiny Gengar", "Shiny Tentacruel", "Shiny Marowak", "Aerodactyl", "Shiny Dragonair", "Shiny Jynx", "Shiny Scyther", "Shiny Seadra", "Shiny Electrode",
"Shiny Raticate", "Shiny Parasect", "Shiny Alakazam", "Shiny Gyarados", "Shiny Beedrill", "Shiny Kingler", "Shiny Magneton", "Shiny Onix",
"Shiny Pidgeot", "Shiny Venomoth", "Shiny Muk", "Shiny Butterfree", "Shiny Golbat", "Shiny Farfetch'd", "Shiny Pinsir", "Shiny Raichu"}}
}
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 --alterado v1.3
local gender = getRandomGenderByName(pokemon)
local happy = 220
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
doItemSetAttribute(ball, "morta", "no")
doItemSetAttribute(ball, "icone", "yes")
doItemSetAttribute(ball, "ball", getItemNameById(ballid))
doTransformItem(ball, icons[getItemAttribute(ball, "poke")].on)
doPlayerSendTextMessage(cid, 27, "You are already holding six pokemons, so your new pokemon was sent to your depot.")
doRemoveItem(item.uid)
else
doItemSetAttribute(ball, "morta", "no")
doItemSetAttribute(ball, "icone", "yes")
doItemSetAttribute(ball, "ball", getItemNameById(ballid))
doTransformItem(ball, icons[getItemAttribute(ball, "poke")].on)
end
doSendMagicEffect(getThingPos(cid), 29)
return true
end
Editado Fevereiro 13 por xandeloko