Okay, i think I did it.
I will try to explain how i did it.
Let's suppose i have this player:
Name : X
Level : 12
Class: Body Warrior (skill_group + job)
skill_level: SELECT HEX(skill_level) FROM player WHERE name='X';
000000000000000400000000000100000000000100000000000400000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000032800000000032800000000000B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Now, from the above result we need to remove the first four 0s;
(in JS I could do something like this : data.substr(4); )
After this, you need to divide every group of the recod, so you can find the spells .
To do this you could loop the string by 12 chars at a time.
Example:
arrayskills=[]; vnum=0;
for(let i = 0; i< data.length; i+=12) {
arrayskills[vnum]=data.substr(i,12);
vnum++;
}
You loop the new array to remove from the zeros every element.
arrayskillsNew[i]=arrayskills[i].substr(9,12);
--> This way you will have something like this : [0. 1 . 2 .3][SPELL LEVEL]
[ M G P][FROM 0 TO 40 - you need to convert it from HEX to DEC]
Based on the index of the first array (vnum) you can find what spell it is by looking in the skilldesc.txt file from the client. That ID is the same as the index of the spell array.
The final result could be something like this : for me "id" is the id of the spell and "spell" is the level of the spell xD
{
"id": 1,
"spell": "004"
},
{
"id": 2,
"spell": "001"
},
{
"id": 3,
"spell": "001"
},
{
"id": 4,
"spell": "004"
},
{
"id": 5,
"spell": "001"
}
I did my best to explain this possible solution. Hope it could be useful for somebody.
Sources that helped me to understand how the hex worked:
link removed by moderator