-- Mining made by [email][email protected][/email] --
-- TODO: -- edit your caveIds
local config = {
caveIds = {5815, 8347, 6476, 8362, 8916},
rateSkill = getConfigValue("rateSkill"),
randomsize = 500,
v = {
[{1, 2}] = {level = 50, monster = "Slime", msg = "A fierce Slime came out of the pile of rocks!"},
[{3, 5}] = {level = 50, monster = "Demon Skeleton", msg = "A fierce Demon Skeleton came out of the pile of rocks!"},
[{6, 8}] = {level = 50, monster = "Dwarf Guard", msg = "A fierce dwarf guard came out of the pile of rocks!"},
[{9, 11}] = {level = 30, monster = "Demon", msg = "You hit the rock to hard making a hole, A Demon comes up striaght from hell!", bc = true},
[{12, 15}] = {level = 10, monster = "Troll", msg = "A weak troll has appeared from the pile of rocks!"},
[{16, 18}] = {level = 20, monster = "Dwarf Soldier", msg = "A dwarf soldier came out of the pile of rocks!"},
[{19, 22}] = {level = 20, itemId = "2157", countId = "1", msg = "You\'ve found a golden nugget."},
[{23, 27}] = {level = 20, itemId = "2145", countId = "1", msg = "You\'ve found a diamond."},
[{28, 32}] = {level = 20, itemId = "2225", countId = "1", msg = "Omg. You\'ve FOUND A PIECE OF IRON!!"},
[{33, 37}] = {level = 20, itemId = "2152", countId = "1", msg = "That\'s good!"},
[{38, 41}] = {level = 20, itemId = "2147", countId = "1", msg = "You\'ve found a ruby."},
[{42, 48}] = {level = 20, itemToRemove = "2553", countId = "1", msg = "Your pick has been heavily damaged and broke..."},
[{49, 52}] = {level = 20, itemId = "2225", countId = "5", msg = "Omg. You\'ve FOUND A PIECE OF IRON!!"},
[{53, 55}] = {level = 20, itemId = "2152", countId = "4", msg = "That\'s good!"},
[{56, 58}] = {level = 20, itemId = "2152", countId = "3", msg = "That\'s good!"},
[{59, 62}] = {level = 20, itemId = "2152", countId = "2", msg = "That\'s good!"}
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isInArray(config.caveIds, itemEx.itemid) then
return false
end
if math.random((100 + (getPlayerSkillLevel(cid, SKILL_CLUB) / 20))) < getPlayerSkillLevel(cid, SKILL_CLUB) then
doPlayerAddSkillTry(cid, SKILL_CLUB, 1)
local formula, lvl, club = math.random(config.randomsize), getPlayerLevel(cid), getPlayerSkillLevel(cid, SKILL_CLUB)
for range, inf in pairs(config.v) do
if formula >= range[1] and formula <= range[2] and lvl >= inf.level then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, inf.msg)
if inf.bc then
doBroadcastMessage(getPlayerName(cid) .. " Is mining, GET HIM!", 22)
if inf.monster then
doSummonCreature(inf.monster, getThingPos(cid))
elseif inf.itemId and inf.countId then
doPlayerAddItem(cid, inf.itemId, inf.countId)
elseif inf.itemToRemove and inf.countId then
doPlayerRemoveItem(cid, itemToRemove, inf.countId)
end
break
end
end
end
doSendMagicEffect(toPosition, 3)
return true
end
end