Postado Setembro 13, 2017 7 anos Autor if (lvl >= 20 and rica) or (lvl >= 12 and lvl < 20 and special) or (not special and not rica and lvl < 12) then deixa assim
Postado Dezembro 7, 2017 7 anos Desculpe reviver algo tão antigo, mas seria possível acrescentar 10% de chance da picareta quebrar ? Muito obrigado =)
Postado Dezembro 7, 2017 7 anos Autor me manda o script q vc tá usando pq tem umas 10 versões aqui no tópico xD
Postado Dezembro 12, 2017 7 anos Em 07/12/2017 em 20:23, xWhiteWolf disse: me manda o script q vc tá usando pq tem umas 10 versões aqui no tópico xD Mostrar conteúdo oculto terra = {3607,3609,1359,3615,1353} levels = { [-1] = 2229, ---- skull [0] = 1294, --- small stone [1] = 3976, --- worm [10] = 2149, -- Small Emerald [12] = 2146, -- Small Sapphire [15] = 2145, -- Small Diamond [17] = 2150, -- Small Amethyst [20] = 2147, -- Small Ruby [25] = 2144, -- Black Pearls [27] = 2143, -- White Pearls [30] = 2157, -- Gold Nuggets [35] = 2156, --- red gem [36] = 2158, -- blue gem [37] = 2155, -- green gem [38] = 2153, -- violet gem [39] = 2154, -- yellow gem [40] = 2157, -- small enchanted emerald [42] = 2157, -- Small Enchanted Sapphiire [45] = 2158, -- Small Enchanted Amethyst [50] = 2161, -- Small Enchanted Ruby [70] = 2162 -- Life Crystal } local config = { storage = 19333, chance = 40, --- chance de achar um item ou não k = 2, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante) experience = 19334 } function onUse(cid, item, fromPosition, itemEx, toPosition) local drops = {} function getDrops(cid) for i= -1,getPlayerStorageValue(cid, config.storage) do if levels then table.insert(drops, levels) end end return true end if isInArray(terra, itemEx.itemid) then getDrops(cid) doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience)+1) local experience = getPlayerStorageValue(cid, config.experience) if experience >= (getPlayerStorageValue(cid, config.storage)^2)/config.k then doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+1) doPlayerSendTextMessage(cid, 27, "Congratulations, you have leveled! Your currect level is "..getPlayerStorageValue(cid, config.storage) ..".") if getPlayerStorageValue(cid, config.storage) == 50 then doPlayerSendTextMessage(cid, 20, "For reaching level "..getPlayerStorageValue(cid, config.storage) .." you have been awarded with Mining Helmet.") doPlayerAddItem(cid, 7497, 1, true) end end if config.chance >= math.random(1,100) then if #drops >= 1 then local item = drops[math.random(1,#drops)] doPlayerSendTextMessage(cid, 27, "You have found a "..getItemNameById(item)..".") doPlayerAddItem(cid, item, 1, true) end doSendMagicEffect(toPosition, 3) else doSendMagicEffect(toPosition, 2) return TRUE end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".") else return FALSE end return true end Se não fosse abusar da boa vontade, além da probabilidade da picareta quebrar, teria como o local craftado também sumir? Exemplo o player usa a picareta na stone ID 3607, e após algumas batidas (3 por exemplo) a stone "quebra" sumindo do mapa...seria como um campo de mineração.
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.