Distribution: The forgotten server 1.2
Hello
i'm looking for help with my rope script, this script is simulating the old rope 7.4...
the script is working, but my problem with this script is the part "allowed_items_inway"...
{2886, 2887, 2889, 2890, 2891, 2895, 2896, 2897, 2898, 2899, 2890} this is pool ids... ok my rope just work with pool ids in hole.
The problem is, if have a pool of blood, wine, etc... in hole, and i put other item "not allowed" on pool my rope is working too...
How can i find a solution for this?
My rope script
thanks so much
Hello
i'm looking for help with my rope script, this script is simulating the old rope 7.4...
the script is working, but my problem with this script is the part "allowed_items_inway"...
{2886, 2887, 2889, 2890, 2891, 2895, 2896, 2897, 2898, 2899, 2890} this is pool ids... ok my rope just work with pool ids in hole.
The problem is, if have a pool of blood, wine, etc... in hole, and i put other item "not allowed" on pool my rope is working too...
How can i find a solution for this?
My rope script
LUA:
local OPENED_HOLE = {293, 294, 385, 476, 435, 482, 483, 594, 595, 607, 609, 610, 615, 385, 387, 394}
local OPENED_TRAP = {462, 435}
local DOWN_LADDER = {369, 370, 408, 409, 427, 428, 3135, 3136, 5545, 5763, 412, 432, 433, 435}
local ROPE_SPOT = {386, 421}
local allowed_items_inway = {2886, 2887, 2889, 2890, 2891, 2895, 2896, 2897, 2898, 2899, 2890}
function onUse(cid, item, frompos, item2, topos)
newPos = {x = topos.x, y = topos.y, z = topos.z, stackpos = 0}
groundItem = getThingfromPos(newPos)
blockingItem = getThingfromPos({x = topos.x, y = topos.y, z = topos.z, stackpos = 1})
if(isInArray(ROPE_SPOT, groundItem.itemid) == TRUE) then
newPos.y = newPos.y + 1
newPos.z = newPos.z - 1
if((blockingItem.itemid > 0 and not isInArray(allowed_items_inway, blockingItem.itemid)) or isCreature(groundItem.uid)) then
doPlayerSendCancel(cid, "You cannot use this object.")
else
doTeleportThing(cid, newPos)
end
elseif(isInArray(OPENED_HOLE, groundItem.itemid) == TRUE or isInArray(OPENED_HOLE, item2.itemid) == TRUE or isInArray(OPENED_TRAP, groundItem.itemid) == TRUE or isInArray(DOWN_LADDER, groundItem.itemid) == TRUE) then
newPos.y = newPos.y + 1
downPos = {x = topos.x, y = topos.y, z = topos.z + 1, stackpos = 255}
downItem = getThingfromPos(downPos)
if(downItem.itemid > 0) then
doTeleportThing(downItem.uid, newPos)
else
end
end
return true
end
thanks so much