Lua Ladder Problem TFS 0.4

zufux

Excellent OT User
Joined
Sep 1, 2008
Messages
221
Reaction score
4
Hello,

I got a Problem with my ladders... the ladder is working fine, but if there is a item on ground I can't use it.

I allrady tested few teleport scripts, but I can't solve it.

I use 7.4 Items, without any problems... Only this ladder problem, wich i can't solve by my self.

Maybe anyone have a good idea, how i can solve it.

TFS 0.4 downgraded to 7.72 witch use 7.4 items protocol.

Code:
local UP_FLOORS = {1386, 3678}
local FIELDS = {1497, 1499}
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) ~= 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) ~= 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
 
OP
zufux

zufux

Excellent OT User
Joined
Sep 1, 2008
Messages
221
Reaction score
4
bump no ideas?

I tested it with a other item protocol... 7.7 Items otb is working, but if i change it for 7.4 the ladders still bugged
 
OP
zufux

zufux

Excellent OT User
Joined
Sep 1, 2008
Messages
221
Reaction score
4
please help me out:)
 
OP
zufux

zufux

Excellent OT User
Joined
Sep 1, 2008
Messages
221
Reaction score
4
I need a item.otb editor for 7.4 anyone have one?
 
OP
zufux

zufux

Excellent OT User
Joined
Sep 1, 2008
Messages
221
Reaction score
4
there is a ladder, i can use it... But if i put a item like a gold coin at this point, ladder is not working.
 

CipsoftStinks

www.relicaria.com
Joined
Oct 1, 2016
Messages
911
Reaction score
113
Location
Chile
there is a ladder, i can use it... But if i put a item like a gold coin at this point, ladder is not working.
that is because was a old functions if you drop things under holes , ladders they can't be used because its like you were to trying to use the bag.. or the goldcoin etc
you have to source edit try to check what file you have to edit using some 8.6 source
which source file is? i have no idea mate
 
OP
zufux

zufux

Excellent OT User
Joined
Sep 1, 2008
Messages
221
Reaction score
4
that is because was a old functions if you drop things under holes , ladders they can't be used because its like you were to trying to use the bag.. or the goldcoin etc
you have to source edit try to check what file you have to edit using some 8.6 source
which source file is? i have no idea mate
But if i use 7.72 Items otb it works all fine... there is somethink wrong maybe with the items otb 7.4 but i allrady tested a other items otb but still not working.
 

CipsoftStinks

www.relicaria.com
Joined
Oct 1, 2016
Messages
911
Reaction score
113
Location
Chile
But if i use 7.72 Items otb it works all fine... there is somethink wrong maybe with the items otb 7.4 but i allrady tested a other items otb but still not working.
im not with my files atm maybe try to check the diferences between the attributes in items otb regarding the ladders and holes

also maybe is a better idea use 7.72 items.otb and change graphics with object builder 7.72 have direxct9 more monsters also port hope etc
im not sure but i think that atm doesnt exist an item.otb for 7.4 soits totally a better idea use 7,72
pd: was just an advice
 

ond

Legendary OT User
Joined
Mar 24, 2008
Messages
2,661
Reaction score
393
Location
Sweden
Game.cpp:

Item* topOrderItem = tile->getItemByTopOrder(2);
to
Item* topOrderItem = tile->getItemByTopOrder(1);
 
OP
zufux

zufux

Excellent OT User
Joined
Sep 1, 2008
Messages
221
Reaction score
4
Game.cpp:

Item* topOrderItem = tile->getItemByTopOrder(2);
to
Item* topOrderItem = tile->getItemByTopOrder(1);
thanks ond I'll try it out :)
 
OP
zufux

zufux

Excellent OT User
Joined
Sep 1, 2008
Messages
221
Reaction score
4
im not with my files atm maybe try to check the diferences between the attributes in items otb regarding the ladders and holes

also maybe is a better idea use 7.72 items.otb and change graphics with object builder 7.72 have direxct9 more monsters also port hope etc
im not sure but i think that atm doesnt exist an item.otb for 7.4 soits totally a better idea use 7,72
pd: was just an advice
yea, if I don#t get it to run... I'll change my files to 7.72
 
OP
zufux

zufux

Excellent OT User
Joined
Sep 1, 2008
Messages
221
Reaction score
4
Game.cpp:

Item* topOrderItem = tile->getItemByTopOrder(2);
to
Item* topOrderItem = tile->getItemByTopOrder(1);
thanks works fine :) closed
 
Top