RevScript ShopBoxes / Donation

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Hola a todos,

Aqui les traigo el ShopBox Random Items, creado basicamente para crear eventos como en los juegos de telefono, de estilo durante 2 Dias puedes comprar unos coffres en la pagina web para obtener items aleatorios, contenido dentro de los coffres.

En el caso del ejemplo, fue utilizado la box 11402,

En local Jewel = Pondran los items mas facil de obtener
En local Reward = Pondran los items un poco mas difficil de obtener

El script lo pondran en data/scripts/actions y podran crear una carpeta llamada ShopBoxes

Código:
local storeBox = Action()

local JEWEL = {12654, 9932, 12644, 7455, 12642, 25523, 12643, 12645, 12647, 12649, 7431, 25522, 12646, 40353, 40349, 40350, 40357, 40356, 40351, 40354, 40355, 40352}
local REWARD = {37418, 40407, 25172, 25377, 34587, 24774, 2160}
function storeBox.onUse(cid, item, fromPosition, itemEx, toPosition)
      local randomChance = math.random(1, #REWARD)
      doPlayerAddItem(cid, REWARD[randomChance], 1)

local randomLoot = math.random(1,20)
    if randomLoot == 1 then
    doPlayerSendTextMessage(cid, 22, "You found an extra item!")
             local randomChance = math.random(1, #REWARD)
              doPlayerAddItem(cid, REWARD[randomChance], 1)
    end

local randomJewel = math.random(1,10)
    if randomJewel == 1 then
    doPlayerSendTextMessage(cid, 22, "You found an extra item!")
      local randomChance = math.random(1, #JEWEL)
      doPlayerAddItem(cid, JEWEL[randomChance], 1)
    end

doSendMagicEffect(getPlayerPosition(cid), 172)
   doRemoveItem(item.uid, 1)
   return true
end

storeBox:id(11402)
storeBox:register()

En el caso que desea utilizar otra ID de coffre, podran cambiar el 11402 abajo del script que corresponde al item que al darle click dara esos Items aleatorio, solamente da 1 item aleatorio por coffre con un porcentaje de dar un item del segundo reward.
 
Arriba