TiuTalk
PHP Developer
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:
The titles.lua file:
Sory about my english...
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"/>
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...