Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sign = {{level = {0,9}, percent = 25},
- {level = {10,14}, percent = 30},
- {level = {15,19}, percent = 35},
- {level = {20,24}, percent = 40},
- {level = {25,29}, percent = 45},
- {level = {30,34}, percent = 50},
- {level = {35,39}, percent = 50},
- {level = {40,44}, percent = 50},
- {level = {45,49}, percent = 50},
- {level = {50,54}, percent = 50},
- {level = {55,59}, percent = 50},
- {level = {60,64}, percent = 50},
- {level = {70, 1000}, percent = 50}}
- local itemids = {1293, 1294, 1295, 2150, 2149, 2146, 2147, 9970, 2145, 2157, 2154, 2156, 2153, 2155, 2177}
- local start = 3
- function sign:new(uid, toPosition)
- setPlayerStorageValue(uid, 101, getPlayerStorageValue(uid, 101)+1)
- for l, info in ipairs(self) do
- if getPlayerStorageValue(uid, 102) >= info.level[1] and getPlayerStorageValue(uid, 102) <= info.level[2] then
- if math.random(1, 100) <= info.percent then
- doPlayerAddItem(uid, itemids[math.random(1, start+l-1)], 1)
- else
- doSendAnimatedText(toPosition, 'Tick', 210)
- end
- break
- end
- end
- self:setFormule(uid)
- end
- function sign:setFormule(uid)
- if getPlayerStorageValue(uid, 101) == getPlayerStorageValue(uid, 103) + getPlayerStorageValue(uid, 104) then
- setPlayerStorageValue(uid, 102, getPlayerStorageValue(uid, 102)+1)
- doPlayerSendTextMessage(uid, MESSAGE_EVENT_ADVANCE, 'Você avançou sua habilidade em mineração para o nível '.. getPlayerStorageValue(uid, 102) .. '.')
- setPlayerStorageValue(uid, 103, getPlayerStorageValue(uid, 103) + getPlayerStorageValue(uid, 104))
- setPlayerStorageValue(uid, 104, getPlayerStorageValue(uid, 104) + getPlayerStorageValue(uid, 105))
- setPlayerStorageValue(uid, 105, getPlayerStorageValue(uid, 105) + 10)
- end
- end
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- if itemEx.actionid == 1515 then
- sign:new(cid, toPosition)
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement