Belloz Moderators
Premios :
Posts : 70 Points : 159 Reputation : 1 Join date : 13/07/2012
| Tema: [Action] Surprise Bag Vie Jul 13, 2012 10:33 pm | |
| Bueno estaba por otland y encontre estre script xD El scrip es bueno para algun evento o premio =) Puedes poner un mensaje cuando el player habra la bag Puedes poner cuantos regalos puede obtener el player Si quieres poner que el player puede conseguir 1,2 o 3 regalos , dependiendo de la suerte del player,puedes hacerlo, puedes poner el chance, Por ejemplo: Conseguir 1 item [50%] ; Conseguir 2 items [35%] ; Conseguir 3 item [15%]; Puedes hacer una lista de los items que el player puede conseguir Puedes cambiar el chance de conseguir cada item Bueno vamos al scrip :) Actions.xml - Código:
-
<action fromid="6570" toid="6571" event="script" value="surpbag.lua"/> surpbag.lua - Código:
-
-- [ Script made by Medargo ] -- function onUse(cid, item, frompos, item2, topos) local presentsa = presentn[math.random(1,#presentn)] -- Do not change! local msgs = {"TUF TUF", "HO HO HO!", "HAIL", "OTLAND", "CONGRATZ"} -- Displayed messages when opening the bag.. local msg_outside = "You have to put the surprise bag in your inventory in order to use it" -- Displayed messages when bag is not on inventory.. local effs = {29, 30} -- Effects sent when opening the bag.. local presentn = {1, 1, 1, 2, 2, 3} --[[ This is the chance of getting 1, 2 or 3 itens, more 1s means more chances of getting just 1 item, same for the other numbers, you can insert any number if you want! --]] local presents = { {id = 2160, quant = 2}, -- 2 Crystal Coin {id = 2152, quant = 30},-- 30 Platinum coin {id = 2152, quant = 30},-- 30 Platinum coin {id = 2152, quant = 30},-- 30 Platinum coin {id = 2534, quant = 1}, -- 1 Vampire Shield {id = 6132, quant = 1}} -- 1 Pair of Soft Boots -- Please note that you can increase the chance of getting determined item by repeting it on the table (as the 30 Platinum Coins) --------------------------------------------------- DO NOT CHANGE ANYTHING FROM THIS LINE DOWN! --------------------------------------------------- if getPlayerItemCount(cid, item.itemid) >= 1 then doPlayerSendTextMessage(cid, 25, "You received "..presentsa.." presents..") doSendMagicEffect(topos, effs[math.random(1,#effs)]) doSendAnimatedText(topos, msgs[math.random(1,#msgs)], 192) doPlayerRemoveItem(cid, item.itemid, 1) for quant = 1, presentsa do local rand = math.random(1,#presents) doPlayerAddItem(cid, presents[rand].id, presents[rand].quant) end else doPlayerSendTextMessage(cid, 25, msg_outside) doSendMagicEffect(topos, 2) end return true end Creditos : Medargo (Otland) 99,9% por el script que he posteado xD Yo 00,1 % por traerlo | |
|