Peonso
Godly Member
- Joined
- Jan 14, 2008
- Messages
- 1,748
- Solutions
- 30
- Reaction score
- 1,528
First, thanks @Gesior.pl for all the help, you are the man!
I'm using OTClient to load and convert maps from different protocols, both from 10.98 to 7.6 or from 7.6 to OpenTibia Sprite Pack.
In OTClient sources, go to /src/client/item.h find:
Before it add:
At /src/client/item.cpp find:
Replace it with this lines:
Still in /src/client/item.cpp, after the last line add this function: replace.cpp · GitHub
At /src/client/mapio.cpp find:
Replace it with this lines:
Those are the source changes, compile it. You may want to change the replace function to match the version you want to change, or to something totally custom if using a custom sprite pack. In the last lines, keep it as:
If you want to keep an item which you don't have any conversion set, if you want to remove items you don't have a match in the conversion table, instead of it, use:
So all the items without a match become item id 29999 and an invalid item for RME, so you can use Map -> Cleanup... option to remove them from the map.
Now, you need to add to otclient/data folder #1 the map you want to convert (rename it to map.otbm), #2 the items.otb from the version you map is (rename it to items_from.otb), #3 the items.otb from the version you are converting to (rename it to items_to.otb), and to otclient/data/things #4 the spr and dat files from the version you converting from as you would to play with it version in otclient.
Now edit your otclientrc.lua file:
Just run otclient now, it will save it to '/home/linux_username/.otclient/converted_map.otbm' (linux) or 'C:\Users\windows_username\otclient\converted_map.otbm' (windows). Or something like that.
I'm using OTClient to load and convert maps from different protocols, both from 10.98 to 7.6 or from 7.6 to OpenTibia Sprite Pack.
In OTClient sources, go to /src/client/item.h find:
Code:
#pragma pack(pop)
#endif
Before it add:
Code:
int replaceCustom(uint16 itemId);
At /src/client/item.cpp find:
Code:
out->addU16(getServerId());
Replace it with this lines:
Code:
uint16 itemId = replaceCustom(getServerId());
out->addU16(itemId);
Still in /src/client/item.cpp, after the last line add this function: replace.cpp · GitHub
At /src/client/mapio.cpp find:
Code:
root->addU16(ground->getServerId());
Replace it with this lines:
Code:
uint16 itemId = replaceCustom(ground->getServerId());
root->addU16(itemId);
Those are the source changes, compile it. You may want to change the replace function to match the version you want to change, or to something totally custom if using a custom sprite pack. In the last lines, keep it as:
Code:
default:
newId = itemId;
break;
Code:
default:
newId = 29999;
break;
Now, you need to add to otclient/data folder #1 the map you want to convert (rename it to map.otbm), #2 the items.otb from the version you map is (rename it to items_from.otb), #3 the items.otb from the version you are converting to (rename it to items_to.otb), and to otclient/data/things #4 the spr and dat files from the version you converting from as you would to play with it version in otclient.
Now edit your otclientrc.lua file:
Code:
-- version you are converting from
g_game.setClientVersion(1098)
g_things.loadOtb('items_from.otb')
g_map.loadOtbm('map.otbm')
g_things.loadOtb('items_to.otb')
g_map.saveOtbm('converted_map.otbm')
Just run otclient now, it will save it to '/home/linux_username/.otclient/converted_map.otbm' (linux) or 'C:\Users\windows_username\otclient\converted_map.otbm' (windows). Or something like that.