View attachment 40460
does that knight byte having the same id as knight outfit (in decimal) just a coincidence? (yes I'm really trying to hex things by trial and error lmao)
No it isn't a coincidence it is just how protobuf saves int's let me just try to illustrate you how it is:
12 E0 0B 08 83 01
12 - is protobuf tag which identifies as
repeated .tibia.protobuf.appearances.Appearance outfit = 2;
E0 0B(1504) - is size of protobuf.Appearance class
08 - is protobuf tag to identify the next value as
optional uint32 id = 1;
83 01(131) - is outfit id
so how to read protobuf values?:
Code:
uint32_t result = firstByte;
if(result < 128)
return ressult;
uint32_t readSecond = secondByte;
result += (readSecond - 1) << 7;
if(readSecond < 128)
return result;
and you're going this way until the last byte has value < 128.
If you are interested I can write simple program that will swap outfit ids.
Edit:
if it is a for fun project, yes, if too much hassle (money involved/time consumption) then there is no need, but thanks a lot for taking your time already to explain this to me
Yes, I have done it for fun and for free.
Here are download for this tool:
MEGA (https://mega.nz/#!oIIV2ahZ!hyEDZoHPaRezsnIEPBUId4ryvTQHPPrypehAKcqJVWg)
As you can see in source it is really simple tool that are meant to swap outfit ids in protobuf structure.
Example usage(can be done with ids too but I added string hash map for outfits that I have on my pc(surely there's lacking few outfits)):
Code:
swap "male knight" "orc warlord"
compile appearances-c6e3edc34874850404d474bff8d73228326c12e9dca425e15acb059e12622777.dat
exit
(I recommend using it on clean appearances file otherwise it'll swap already swapped outfits)
How it looks ingame: