First note. Some of my questions on 8.70 0.4 based have been removed. If my threads are removed, I would like an explanation as to why. Be courteous.
Now, the problem. I compiled rev 4267 which is 8.71
Everything works fine but ladders. I double checked, they (item 1386) are in the items.xml
they are in the actions folder/actions.xml, tied to other/teleport.lua
Teleport.lua is present (below)
but they simply dont work.
I am not sure which rev this data pack was hosted on before but teleport.lua and functions should not have changed between 8.70 and 8.71 right? Meanwhile im digging for the answer as to why this is happening.
Now, the problem. I compiled rev 4267 which is 8.71
Everything works fine but ladders. I double checked, they (item 1386) are in the items.xml
they are in the actions folder/actions.xml, tied to other/teleport.lua
Teleport.lua is present (below)
but they simply dont work.
I am not sure which rev this data pack was hosted on before but teleport.lua and functions should not have changed between 8.70 and 8.71 right? Meanwhile im digging for the answer as to why this is happening.
PHP:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035}
local FIELDS = {1497, 1499, 11095, 11096}
local DRAW_WELL = 1369
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
return false
end
local check = false
fromPosition.stackpos = STACKPOS_GROUND
if(isInArray(UP_FLOORS, item.itemid)) then
fromPosition.z = fromPosition.z - 1
fromPosition.y = fromPosition.y + 1
if(doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
fromPosition.y = fromPosition.y - 2
else
check = true
end
end
else
fromPosition.z = fromPosition.z + 1
end
if(not check and doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
return false
end
end
local pos, dir = getCreaturePosition(cid), SOUTH
if(pos.x < fromPosition.x) then
dir = EAST
elseif(pos.x == fromPosition.x) then
if(pos.y == fromPosition.y) then
dir = getCreatureLookDirection(cid)
elseif(pos.y > fromPosition.y) then
dir = NORTH
end
elseif(pos.x > fromPosition.x) then
dir = WEST
end
doTeleportThing(cid, fromPosition, false)
doCreatureSetLookDirection(cid, dir)
return true
end
Last edited: