• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

movements.xml not working

TiuTalk

PHP Developer
Joined
Jan 7, 2009
Messages
89
Reaction score
0
Location
Rio de Janeiro - Brasil
Hi there...

I'm runing The Forgotten Server version 0.3.4 (Crying Damson) but when i walk into a depot title (426 or 446) it doesn't show "Your depot contains X items" message.

I made few modifications on titles.lua (in onStepIn function) and discovered that the function isn't called.

Part of movements.xml:
Code:
<!-- (Depot & Level) tiles -->
<movevent event="StepIn" itemid="416" script="tiles.lua"/>
<movevent event="StepOut" itemid="417" script="tiles.lua"/>
<movevent event="StepIn" itemid="426" script="tiles.lua"/>
<movevent event="StepOut" itemid="425" script="tiles.lua"/>
<movevent event="StepIn" itemid="446" script="tiles.lua"/>
<movevent event="StepOut" itemid="447" script="tiles.lua"/>
<movevent event="StepIn" itemid="3216" script="tiles.lua"/>
<movevent event="StepOut" itemid="3217" script="tiles.lua"/>
The titles.lua file:
Code:
local increasingItemID = {416, 426, 446, 3216}
local decreasingItemID = {417, 425, 447, 3217}
function onStepIn(cid, item, position, fromPosition)
    if isInArray(increasingItemID, item.itemid) == TRUE then
        doTransformItem(item.uid, item.itemid + 1)
        if item.actionid > 1000 then
            getLevelTile(cid, item, position)
        elseif getTilePzInfo(position) == TRUE then
            getDepotItems(cid, item)
        end
    elseif item.itemid == 426 then
        doTransformItem(item.uid, 425)
        if item.actionid > 1000 then
            getLevelTile(cid, item, position)
        elseif getTilePzInfo(position) == TRUE then
            getDepotItems(cid, item)
        end
    end
    return TRUE
end

function onStepOut(cid, item, position, fromPosition)
    if isInArray(decreasingItemID, item.itemid) == TRUE then
        doTransformItem(item.uid, item.itemid - 1)
    elseif item.itemid == 425 then
        doTransformItem(item.uid, item.itemid + 1)
    end
    return TRUE
end

function getLevelTile(cid, item, position)
    if isPlayer(cid) == TRUE then
        if getPlayerLevel(cid) < item.actionid - 1000 then
            doTeleportThing(cid, {x = getPlayerPosition(cid).x, y = getPlayerPosition(cid).y, z = getPlayerPosition(cid).z + 1}, FALSE)
            doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
        end
    end
    return TRUE
end

function getDepotItems(cid, item)
    if item.actionid > 100 then
        if isPlayer(cid) == TRUE then
            depotItems = getPlayerDepotItems(cid, item.actionid - 100)
            if depotItems < 2 then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your depot contains 1 item.")
            else
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your depot contains " ..depotItems.. " items.")
            end
        end
    end
    return TRUE
end

Sory about my english... :)
 
<!-- (Depot & Level) tiles -->
<movevent event="StepIn" itemid="416" script="tiles.lua"/>
<movevent event="StepOut" itemid="417" script="tiles.lua"/>
<movevent event="StepIn" itemid="426" script="tiles.lua"/>
<movevent event="StepOut" itemid="425" script="tiles.lua"/>
<movevent event="StepIn" itemid="446" script="tiles.lua"/>
<movevent event="StepOut" itemid="447" script="tiles.lua"/>
<movevent event="StepIn" itemid="3216" script="tiles.lua"/>
<movevent event="StepOut" itemid="3217" script="tiles.lua"/>

Change that to:

<!-- (Depot & Level) tiles -->
<movevent type="StepIn" itemid="416" event="script" value="tiles.lua"/>
<movevent type="StepOut" itemid="417" event="script" value="tiles.lua"/>
<movevent type="StepIn" itemid="426" event="script" value="tiles.lua"/>
<movevent type="StepOut" itemid="425" event="script" value="tiles.lua"/>
<movevent type="StepIn" itemid="446" event="script" value="tiles.lua"/>
<movevent type="StepOut" itemid="447" event="script" value="tiles.lua"/>
<movevent type="StepIn" itemid="3216" event="script" value="tiles.lua"/>
<movevent type="StepOut" itemid="3217" event="script" value="tiles.lua"/>
 
Back
Top