Eldora
Banned User
- Joined
- Oct 19, 2009
- Messages
- 604
- Reaction score
- 26
Need help to add exhaustion for using shovel on ground ID: 231
Using Avesta server.
shovel.lua
Using Avesta server.
shovel.lua
Code:
local MUD_HOLE = 482
local duration = 1 * 60000 -- 3 minutes
function doTransformSandHole(parameters)
local thing = getTileItemById(parameters.pos, MUD_HOLE)
local newItem = doTransformItem(thing.uid, parameters.oldType)
end
function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 28 then
return 0
end
if item2.itemid == 468 then
doTransformItem(item2.uid,469)
doDecayItem(item2.uid)
elseif item2.itemid == 481 then
doTransformItem(item2.uid,482)
doDecayItem(item2.uid)
elseif (item2.itemid == 231 and item2.actionid == 4000) then
doSendMagicEffect(topos,2)
local randd = math.random(1,5)
if randd < 2 then
doTransformItem(item2.uid, 482)
addEvent(doTransformSandHole, duration, {oldType = item2.itemid, pos = topos})
doDecayItem(item2.uid)
doSendMagicEffect(topos,2)
end
elseif item2.itemid == 483 then
doTransformItem(item2.uid,484)
doDecayItem(item2.uid)
elseif item2.itemid == 231 then
rand = math.random(1,35)
if (rand == 20) then
doPlayerAddItem(cid,2159,1)
elseif (rand == 30) then
doSummonCreature("Scarab", topos)
else
doSendMagicEffect(topos,2)
end
else
return 0
end
return 1
end