script II
local holes = {15469, 15460}function onUse(cid, item, fromPosition, itemEx, toPosition)if getPlayerStorageValue (cid, 54548) < 1 then ---- nova storage de aventureirodoPlayerSendCancel(cid, "Voce precisa ser Teacher!")return trueendif getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 orgetPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 or getPlayerStorageValue (cid, 98752) >= 1 then --alterado v1.9 return doPlayerSendCancel(cid, "impossivel fazer isso agora.")endif(isInArray (holes, itemEx.itemid)) then if not isCreature(itemEx.uid) then if not (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1) then toPos = getThingPosition(itemEx.uid) fromPos = getCreaturePosition(cid) if getDirectionTo(fromPos, toPos) == getCreatureLookDirection(cid) then --quantItem = math.random(1, ProfessionLib.quantMax) doCreatureSetNoMove(cid, true) local tmp = getCreatureOutfit(cid)if getPlayerSex(cid) == 1 thentmp.lookType = 2508elsetmp.lookType = 2509end doSetCreatureOutfit(cid, tmp, -1) setPlayerStorageValue(cid, 98752, 1) local newId = itemEx.itemid + 1-------------------------------------------------- function fim(cid,toPos) local rand = math.random(2, 6) doPlayerAddItem(cid, 15457, rand) doRemoveCondition(cid, CONDITION_OUTFIT) doCreatureSetNoMove(cid, false) setPlayerStorageValue(cid, 98752, -1) doTransformItem(getThingFromPos(toPos).uid, newId) doDecayItem(getThingFromPos(toPos).uid)end addEvent(fim, 8*1000,cid,toPos) -------------------------------------------------- else doPlayerSendCancel(cid, "Voce percisa ficar de frente para esse item!") end else doPlayerSendCancel(cid, "Voce so pode cavar de frente!") end else doPlayerSendCancel(cid, "Voce precisa ser proficional na area para fazer isso!") end else doPlayerSendCancel(cid, "isso nao e erva!") end return trueend