hello friend,thanks for your contribution,most already exists this same script here...
- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- My Tercer Aporte :d
6
1.1k
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

22 de novembro de 2010 às 21:01
22 de novembro de 2010 às 21:01
I have posted on the other BR forum the same script but more simplified.
local pokes = {
[1] = {name = Pidgey, health = 100, maxhealth = 100},
[2] = {name = Caterpie, health = 100, maxhealth = 100},
[3] = {name = Rattata, health = 100, maxhealth = 100},
[4] = {name = Weedle, health = 100, maxhealth = 100},
}
function onUse(cid, item, frompos, item2, topos)
local s = doPlayerAddItem(cid, 2661)
local rand = pokes[math.random(1,4)]
if getPlayerLevel(cid) >= 5 then
if doPlayerRemoveItem(cid,7884,1) then
if rand then
doItemSetAttribute(s, "poke", "This is ".. rand.name .."'s pokeball. HP = ["..rand.health.."/"..rand.maxhealth.."]")
doItemSetAttribute(s, "description", "Contains a ".. rand.name ..".")
doSendMagicEffect(topos, 29)
doPlayerSendTextMessage(cid,22,"Você ganhou um ".. rand.name ..".")
end
else
doPlayerSendCancel(cid, "You do not have required item.")
end
else
doPlayerSendCancel(cid, "You must have level 5.")
end
return true
end
Editado Novembro 22 por Faisher
info
Grupo: Campones
Registrado: 06/11/10
Posts: 11
Reputação: 0
Gênero: Masculino
Char no Tibia: Lart Pirio

22 de novembro de 2010 às 22:54
hello friend,thanks for your contribution,most already exists this same script here...
because it does what it can: D
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

23 de novembro de 2010 às 16:32
@up
then in this case do not waste your time..





info
Grupo: Campones
Registrado: 06/11/10
Posts: 11
Reputação: 0
Gênero: Masculino
Char no Tibia: Lart Pirio
here I bring the box 1 as svke: D
your server / / data / / actions / / scripts ---
box with the name:
function onUse(cid, item, frompos, item2, topos)
r1 = math.random(1,17)
if getPlayerLevel(cid) >= 8 then
if doPlayerRemoveItem(cid,7884,1) == TRUE then
if r1 == 17 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Caterpie.")
doPlayerAddItem(cid,2128,1)
elseif r1 == 1 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Weedle.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 2 then
doPlayerSendTextMessage(cid,22,"Você ganhou um ratata.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 3 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Metapod.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 4 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Kakuna.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 5 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Spearow.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 6 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Diglett.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 7 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Zubat.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 8 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Paras.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 9 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Pidgey.")
doPlayerAddItem(cid,2130,1)
elseif r1 == 10 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Oddish.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 11 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Poliwag.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 12 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Krabby.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 13 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Exeggcute.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 14 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Horsea.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 15 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Goldeen.")
doPlayerAddItem(cid,2129,1)
elseif r1 == 16 then
doPlayerSendTextMessage(cid,22,"Você ganhou um Magikarp.")
doPlayerAddItem(cid,2129,1)
end
end
end
end
in actionsxml gently place:
itemid="7884" <action event="script" value="box.lua"/>
thanks: D when they want the other box ago as svke: D
Editado Novembro 22 por jhon44370