Eldora
Banned User
- Joined
- Oct 19, 2009
- Messages
- 604
- Reaction score
- 26
Need to add this function:
into this action script:
Lua:
function onUseShovel(player, item, fromPosition, target, toPosition, isHotkey)
local targetId, targetActionId = target.itemid, target.actionid
if isInArray(holes, targetId) then
target:transform(targetId + 1)
target:decay()
elseif isInArray({231, 9059}, targetId) then
local rand = math.random(100)
if target.actionid == 100 and rand <= 20 then
target:transform(489)
target:decay()
elseif rand == 1 then
Game.createItem(2159, 1, toPosition)
elseif rand > 95 then
Game.createMonster("Scarab", toPosition)
end
toPosition:sendMagicEffect(CONST_ME_POFF)
into this action script:
Lua:
local holes = {468, 481, 483, 7932}
local holeId = {294, 369, 370, 383, 392, 408, 409, 427, 428, 430, 462, 469, 470, 482, 484, 485, 489, 924, 3135, 3136}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local groundTile = getThingfromPos(toPosition)
if isInArray(holes, itemEx.itemid) == TRUE then
doTransformItem(itemEx.uid, itemEx.itemid + 1)
doDecayItem(itemEx.uid)
elseif itemEx.itemid == 2739 then
doTransformItem(itemEx.uid, 2737)
doCreateItem(2694, 1, toPosition)
doDecayItem(itemEx.uid)
elseif itemEx.itemid == 2782 then
doTransformItem(itemEx.uid, 2781)
doDecayItem(itemEx.uid)
elseif itemEx.itemid == 1499 then
doRemoveItem(itemEx.uid)
elseif (itemEx.uid <= 65535 or itemEx.actionid > 0) and (itemEx.itemid == 355 or itemEx.itemid == 9025) then
doTransformItem(itemEx.uid, 392)
doDecayItem(itemEx.uid)
elseif itemEx.uid == 60001 then
doTeleportThing(cid, {x=329, y=772, z=10})
doSendMagicEffect({x=329, y=772, z=10},10)
elseif groundTile.itemid == 384 or groundTile.itemid == 418 or groundTile.itemid == 8278 then
doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, FALSE)
elseif isInArray(holeId, itemEx.itemid) == TRUE then
toPosition.z = toPosition.z + 1
tile = Tile(toPosition)
if tile then
local thing = tile:getTopVisibleThing()
if thing:isPlayer() or thing:isMonster() then
if Tile(toPosition:moveUpstairs()):hasFlag(TILESTATE_PROTECTIONZONE) and thing:isPzLocked() then
return false
end
return thing:teleportTo(toPosition, false)
end
if thing:isItem() and thing:getType():isMovable() then
return thing:moveTo(toPosition:moveUpstairs())
end
end
doPlayerSendCancel(cid, "Sorry, not possible.")
return true
end
return TRUE
end