Terotrificy
Veteran OT User
I'm using Othire 1.0.
How it is supposed to work:
You can't use rope if creature or item is on rope spot, fluids like blood doesn't prevent you of using rope spot.
Problem:
When fluid is on rope spot, you can use rope even if creature or item is above it.
Action Script:
PD: POOLS, OPENED_HOLE and DOWN_LADDER tables are working just fine.
How it is supposed to work:
You can't use rope if creature or item is on rope spot, fluids like blood doesn't prevent you of using rope spot.
Problem:
When fluid is on rope spot, you can use rope even if creature or item is above it.
Action Script:
Lua:
-- Rope for 7.4 protocol.
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(POOLS, 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
doPlayerSendCancel(cid, "You cannot use this object.")
end
end
return true
end
PD: POOLS, OPENED_HOLE and DOWN_LADDER tables are working just fine.