Dice System
Iaae galera suave? Hoje venho trazer á vocês meu novo sistema, é o sistema de Dice (o dado), nele você tem chance de 10%, 30%, 50%, 75% e 100% de cair X itens, tudo configurável.
Vamos á instalação
Siga para data/actions/scripts crie um arquivo chamado dice.lua e coloque dentro:
function onUse(cid, item, item2)local cfg = {listas = {chance100 = {2494, 2492, 2646}, -- Demon Armor, DSA, Golden Bootschance75 = {2400, 2472, 2470}, -- SOV, MPA, Golden Legschance50 = {2466, 2514, 2640}, -- Golden Armor, MMS, Soft Bootschance30 = {2487, 2498, 2491}, -- Crown Armor, RH, Crown Helmetchance10 = {4, 8, 10, 30, 50, 80}, -- Crystal coins (40k, 80k, 100k...)}}if getPlayerFreeCap(cid) < 150 then doPlayerSendCancel(cid, "Lack cap!") return true endif math.random(1, 100) <= 10 thendoPlayerAddItem(cid, 2160, cfg.listas.chance10[math.random(1, #cfg.listas.chance10)])doCreatureSay(cid, "Rolled [Chance 10%]", TALKTYPE_ORANGE_1)elseif math.random(1, 100) > 10 or math.random(1, 100) < 30 thendoPlayerAddItem(cid, cfg.listas.chance30[math.random(1, #cfg.listas.chance30)])doCreatureSay(cid, "Rolled [Chance 30%]", TALKTYPE_ORANGE_1)elseif math.random(1, 100) > 30 or math.random(1, 100) < 50 thendoPlayerAddItem(cid, cfg.listas.chance50[math.random(1, #cfg.listas.chance50)])doCreatureSay(cid, "Rolled [Chance 50%]", TALKTYPE_ORANGE_1)elseif math.random(1, 100) > 50 or math.random(1, 100) < 75 thendoPlayerAddItem(cid, cfg.listas.chance75[math.random(1, #cfg.listas.chance75)])doCreatureSay(cid, "Rolled [Chance 75%]", TALKTYPE_ORANGE_1)elseif math.random(1, 100) > 75 or math.random(1, 100) < 100 thendoPlayerAddItem(cid, cfg.listas.chance100[math.random(1, #cfg.listas.chance100)])doCreatureSay(cid, "Rolled [Chance 100%]", TALKTYPE_ORANGE_1)enddoSendMagicEffect(getCreaturePosition(cid), 26)doRemoveItem(item.uid, 1)return trueend
Agora em actions.xml adicione essa tag:
<action itemid="5792" event="script" value="dice.lua">
-
Configurando:
local cfg = {listas = {chance100 = {2494, 2492, 2646}, -- Demon Armor, DSA, Golden Bootschance75 = {2400, 2472, 2470}, -- SOV, MPA, Golden Legschance50 = {2466, 2514, 2640}, -- Golden Armor, MMS, Soft Bootschance30 = {2487, 2498, 2491}, -- Crown Armor, RH, Crown Helmetchance10 = {4, 8, 10, 30, 50, 80}, -- Crystal coins (40k, 80k, 100k...)}}
chance100 você coloca os Item IDS mais difíceis de pegar, os de chance 100%, chance75 os de 75% e assim sucessivamente
~~
É isso galera espero que tenham gostado e façam bom uso, vendam o Dice no Shopping, usem a criatividade rsrs. Dúvidas? Sugestões? Críticas/Bugs? Estou aqui para atendê-los!
Ideia by vital900