• 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!

OpenTibia ClientID items.otb

E

Evil Puncker

Guest
REMEMBER IT IS FOR TESTING PURPOSES ONLY, THERE IS NO USE RIGHT NOW WITHOUT A CONVERTER

latest update: 12 may 2020
Tibia 12.31.9810 version


I'm releasing this in case anyone would like to try messing with items ID that match the client (tibia) ID, for example having gold coin ID 3031 and not 2148 etc

and maybe someone kind enough could create a tool to convert existing maps and items.xml to client ID, so we wouldn't need to worry about having different versions of items.otb everywhere, not compatible to each other...

if anyone is interested here and here there are some start point


what I did was:
  • Downgraded my updated Tibia assets folder into a Tibia.dat/spr using this (use it to generate your updated client files)
  • Used Item Editor to create a new items.otb from scratch, using the client ID

the file size: 1,421 KB
the item count: 34067 items

2020-05-28 21_37_37.png


MAKING IT WORK WITH RME:

go into your data/clients.xml search for the 10.98 entry and change it to:

<data format="10.57" dat="0x4A10" spr="0x59E48E02"/>

go into your data/1098 and replace the items.otb with the one downloaded here (make a backup just in case)


MAKING IT WORK WITH TFS:
go into your tfs/data/items and replace the items.otb with the one downloaded here (make a backup just in case), no further change is needed.


KNOWN ISSUES:
no item names since there is no items.xml compatible to it
RME brushes need to be updated as well


Enjoy it, I'll updated it every time new items are added

REMEMBER IT IS FOR TESTING PURPOSES ONLY, THERE IS NO USE RIGHT NOW WITHOUT A CONVERTER
 

Attachments

Last edited by a moderator:
If you don't want to use weird programs, you can do this conversion from itemId to clientId with a lua script:

How is it used?
create a folder named xmlConverter so it looks like this:
you must also create two folders inside it:
1) input
2) output

example:
1609089103919.png

now you can put your xml files in input folder
Note: files cannot be in subdirectories as lua vanilla does not have default functions for creating directories

now we go to the data/scripts folder and create a lua file with the name xmlConverter.lua

paste this code:
Lua:
--[[

    Credits: Sarah Wesker
    Version: 1.0
    Compat: TFS 1.3
    Create: December 2020

]]--

local function convertXmlFile(file)
    local f = io.open(file, 'r')
    if not f then
        return false
    end
    local newFile = io.open(file:gsub('input', 'output'), 'w')
    if not newFile then
        f:close()
        return false
    end
    local index = 0
    local lines = {}
    for line in f:lines() do
        local fromId
        local toId
        fromId = tonumber(line:match('id="(%d+)"'))
        if not fromId then
            fromId = tonumber(line:match('fromId="(%d+)"'))
            toId = tonumber(line:match('toId="(%d+)"'))
            if not fromId or not toId then
                goto continue
            end
        else
            toId = fromId
        end
        for _, itemId in pairs({fromId, toId}) do
            if itemId ~= 0 then
                local itemType = ItemType(itemId)
                if itemType then
                    local clientId = itemType:getClientId()
                    if clientId ~= 0 then
                        line = line:gsub(tostring(itemId), tostring(clientId))
                    end
                end
            end
        end
        ::continue::
        index = index +1
        lines[index] = line..'\n'
    end
    f:close()
    newFile:write(table.concat(lines))
    newFile:close()
    return true
end

local talkTest = TalkAction("/xmlConverter")
function talkTest.onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
    for file in io.popen([[dir "data\xmlConverter\input" /b /a /s]]):lines() do
        convertXmlFile(file)
    end
    player:popupFYI("The conversion from itemId to clientId was successful.")
    return false
end

talkTest:separator(" ")
talkTest:register()
Now we do /reload scripts and execute the command /xmlConverter with the god!
as a result you will have a copy of all the xml files that you put in the input folder, but in the output folder, but with all itemId changed to their respective clientId

This works for XML files with the following match:
XML:
id="0000"
examples:
1609089878786.png
1609089900051.png

------------------------------------------------------------------------------------------------------------------
It is not much what it offers, but it does save us time when changing all the server id to their respective clientId
It is also a simple code and not an external program that can bring us viruses
 
thanks for the lua converter, my buddy. becuz I lost the chance to download the program, since that was gone from the link of Github. Idk if it will stay like that forever. and I hope to convert EVERY map to Client ID for my canarý server.
 
If you don't want to use weird programs, you can do this conversion from itemId to clientId with a lua script:

How is it used?
create a folder named xmlConverter so it looks like this:
you must also create two folders inside it:
1) input
2) output

example:
View attachment 53032

now you can put your xml files in input folder
Note: files cannot be in subdirectories as lua vanilla does not have default functions for creating directories

now we go to the data/scripts folder and create a lua file with the name xmlConverter.lua

paste this code:
Lua:
--[[

    Credits: Sarah Wesker
    Version: 1.0
    Compat: TFS 1.3
    Create: December 2020

]]--

local function convertXmlFile(file)
    local f = io.open(file, 'r')
    if not f then
        return false
    end
    local newFile = io.open(file:gsub('input', 'output'), 'w')
    if not newFile then
        f:close()
        return false
    end
    local index = 0
    local lines = {}
    for line in f:lines() do
        local fromId
        local toId
        fromId = tonumber(line:match('id="(%d+)"'))
        if not fromId then
            fromId = tonumber(line:match('fromId="(%d+)"'))
            toId = tonumber(line:match('toId="(%d+)"'))
            if not fromId or not toId then
                goto continue
            end
        else
            toId = fromId
        end
        for _, itemId in pairs({fromId, toId}) do
            if itemId ~= 0 then
                local itemType = ItemType(itemId)
                if itemType then
                    local clientId = itemType:getClientId()
                    if clientId ~= 0 then
                        line = line:gsub(tostring(itemId), tostring(clientId))
                    end
                end
            end
        end
        ::continue::
        index = index +1
        lines[index] = line..'\n'
    end
    f:close()
    newFile:write(table.concat(lines))
    newFile:close()
    return true
end

local talkTest = TalkAction("/xmlConverter")
function talkTest.onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
    for file in io.popen([[dir "data\xmlConverter\input" /b /a /s]]):lines() do
        convertXmlFile(file)
    end
    player:popupFYI("The conversion from itemId to clientId was successful.")
    return false
end

talkTest:separator(" ")
talkTest:register()
Now we do /reload scripts and execute the command /xmlConverter with the god!
as a result you will have a copy of all the xml files that you put in the input folder, but in the output folder, but with all itemId changed to their respective clientId

This works for XML files with the following match:
XML:
id="0000"
examples:
View attachment 53034
View attachment 53035

------------------------------------------------------------------------------------------------------------------
It is not much what it offers, but it does save us time when changing all the server id to their respective clientId
It is also a simple code and not an external program that can bring us viruses
Such a beautiful code!
But my question is: It's possible to revert the clientId to serverId ?

Asking that, because Canary have an updated and most completed items.xml that I ever saw, and would be great to have that one converted

Canary items.xml -> https://raw.githubusercontent.com/opentibiabr/canary/main/data/items/items.xml
 
Back
Top