Postado Abril 30, 2013 12 anos Iaae galera suave? Hoje venho trazer á vocês 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: Mostrar conteúdo oculto function onUse(cid, item, item2) local cfg = { listas = { chance100 = {2494, 2492, 2646}, -- Demon Armor, DSA, Golden Boots chance75 = {2400, 2472, 2470}, -- SOV, MPA, Golden Legs chance50 = {2466, 2514, 2640}, -- Golden Armor, MMS, Soft Boots chance30 = {2487, 2498, 2491}, -- Crown Armor, RH, Crown Helmet chance10 = {4, 8, 10, 30, 50, 80}, -- Crystal coins (40k, 80k, 100k...) } } if getPlayerFreeCap(cid) < 150 then doPlayerSendCancel(cid, "Lack cap!") return true end if math.random(1, 100) <= 10 then doPlayerAddItem(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 then doPlayerAddItem(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 then doPlayerAddItem(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 then doPlayerAddItem(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 then doPlayerAddItem(cid, cfg.listas.chance100[math.random(1, #cfg.listas.chance100)]) doCreatureSay(cid, "Rolled [Chance 100%]", TALKTYPE_ORANGE_1) end doSendMagicEffect(getCreaturePosition(cid), 26) doRemoveItem(item.uid, 1) return true end Agora em actions.xml adicione essa tag: Mostrar conteúdo oculto <action itemid="5792" event="script" value="dice.lua"> Configurando: Mostrar conteúdo oculto local cfg = { listas = { chance100 = {2494, 2492, 2646}, -- Demon Armor, DSA, Golden Boots chance75 = {2400, 2472, 2470}, -- SOV, MPA, Golden Legs chance50 = {2466, 2514, 2640}, -- Golden Armor, MMS, Soft Boots chance30 = {2487, 2498, 2491}, -- Crown Armor, RH, Crown Helmet chance10 = {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 Creditos; Kaiotp Roksas .
Postado Abril 30, 2013 12 anos Legal o sistema. Bem prático, quando o pessoal for fazer o joguinho do dado, é melhor este sistema que botar item e dado encima do dp, as vezes ocorre uns problemas com isso... Boa cara, depois irei testar.
Postado Abril 30, 2013 12 anos Créditos todos ao roksas !Quer crédito a você de aperta CTRL + C CTRL + V ? Editado Abril 30, 2013 12 anos por Luquinha (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.