Ray Rewind
Doctor
Heya I wanna use the script that the items from Secret Service Whacking Driller of fate are usable as Shovel/Rope/Machete
Code:
local config = {
functions = {
[10511],
[10513],
[10515]
end
local spotId = {384, 418, 8278, 8592}
local holeId = {
294, 369, 370, 383, 392,
408, 409, 427, 428, 430,
462, 469, 470, 482, 484,
485, 489, 924, 3135, 3136,
7933, 7938, 8170, 8286, 8285,
8284, 8281, 8280, 8279, 8277,
8276, 8323, 8380, 8567, 8585,
8596, 8595, 8249, 8250, 8251,
8252, 8253, 8254, 8255, 8256,
8972, 9606, 9625
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(toPosition.x == CONTAINER_POSITION) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end
local itemGround = getThingFromPos(toPosition)
if(isInArray(spotId, itemGround.itemid)) then
doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
elseif(isInArray(holeId, itemEx.itemid)) then
local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
if(hole.itemid > 0) then
doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
else
return false
end
return true
if
local JUNGLE_GRASS = {2782, 3985}
local SPIDER_WEB = {7538, 7539}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(isInArray(JUNGLE_GRASS, itemEx.itemid)) then
doTransformItem(itemEx.uid, itemEx.itemid - 1)
doDecayItem(itemEx.uid)
return true
end
if(isInArray(SPIDER_WEB, itemEx.itemid)) then
doTransformItem(itemEx.uid, (itemEx.itemid + 6))
doDecayItem(itemEx.uid)
return true
end
if(itemEx.itemid == 1499) then
doSendMagicEffect(toPosition, CONST_ME_POFF)
doRemoveItem(itemEx.uid)
return true
end
return destroyItem(cid, itemEx, toPosition)
end
if
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(isInArray(holes, itemEx.itemid)) then
local newId = itemEx.itemid + 1
if(itemEx.itemid == 8579) then
newId = 8585
end
doTransformItem(itemEx.uid, newId)
doDecayItem(itemEx.uid)
elseif(isInArray(sand, itemEx.itemid)) then
local rand = math.random(1, 100)
if(itemEx.actionid == 100 and rand <= 20) then
doTransformItem(itemEx.uid, 489)
doDecayItem(itemEx.uid)
elseif(rand >= 1 and rand <= 5) then
doCreateItem(2159, 1, toPosition)
elseif(rand > 85) then
doCreateMonster("Scarab", toPosition, false)
end
doSendMagicEffect(toPosition, CONST_ME_POFF)
end
return true
end