My Tercer Aporte :d

jhon44370
em Actions e Talkactions

jhon44370

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 07/11/10Posts: 11Gênero: MasculinoChar 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

Vodkart

Sumus Validus
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 21/05/10Posts: 3406Gênero: Masculino

hello friend,thanks for your contribution,most already exists this same script here...

bossisg.png

Faisher

avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 20/11/10Posts: 35Char no Tibia: Peei

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

jhon44370

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 07/11/10Posts: 11Gênero: MasculinoChar no Tibia: Lart Pirio

hello friend,thanks for your contribution,most already exists this same script here...

 

 

 

 

because it does what it can: D

Vodkart

Sumus Validus
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 21/05/10Posts: 3406Gênero: Masculino

@up

 

then in this case do not waste your time..

bossisg.png