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

SPECIAL SKILLS (MANA LEECH & ETC)

lordposei

New Member
Joined
Jan 18, 2011
Messages
16
Reaction score
2
I've always changed the values, and never uint_8 / uint_16 and it doesn't give me the correct values within the game, what can I do? the closest I got was that.
Help me pls guys.

XML:
void ProtocolGame::AddPlayerSkills(NetworkMessage& msg)
{
    msg.addByte(0xA1);

    for (uint8_t i = SKILL_FIRST; i <= SKILL_LAST; ++i) {
        //msg.add<uint16_t>(std::min<int32_t>(player->getSkillLevel(i), std::numeric_limits<uint16_t>::max()));
        //msg.add<uint16_t>(player->getBaseSkill(i));
        msg.addByte(std::min<int32_t>(player->getSkillLevel(i), std::numeric_limits<uint8_t>::max()));
        msg.addByte(player->getSkillPercent(i));
    }

    for (uint8_t i = SPECIALSKILL_FIRST; i <= SPECIALSKILL_LAST; ++i) {
        msg.add<uint16_t>(std::min<uint16_t>(100, player->varSpecialSkills[i]));
        msg.add<uint16_t>(0);
    
}
}

skills1.pngskills2.png
 
I've always changed the values, and never uint_8 / uint_16 and it doesn't give me the correct values within the game, what can I do? the closest I got was that.
Help me pls guys.

XML:
void ProtocolGame::AddPlayerSkills(NetworkMessage& msg)
{
    msg.addByte(0xA1);

    for (uint8_t i = SKILL_FIRST; i <= SKILL_LAST; ++i) {
        //msg.add<uint16_t>(std::min<int32_t>(player->getSkillLevel(i), std::numeric_limits<uint16_t>::max()));
        //msg.add<uint16_t>(player->getBaseSkill(i));
        msg.addByte(std::min<int32_t>(player->getSkillLevel(i), std::numeric_limits<uint8_t>::max()));
        msg.addByte(player->getSkillPercent(i));
    }

    for (uint8_t i = SPECIALSKILL_FIRST; i <= SPECIALSKILL_LAST; ++i) {
        msg.add<uint16_t>(std::min<uint16_t>(100, player->varSpecialSkills[i]));
        msg.add<uint16_t>(0);
  
}
}

View attachment 74351View attachment 74352
the original code uncommented is correct.

this is what it looks like in blacktek and is working perfectly

1740465080660.webp
What do you mean its not working correctly? Your image shows the GM with 67 sword fighting, is that not correct? Or is the specific problem with the level 10 skills? It is a common thing for old account creators to start a player off with level 10 skills but with 0 skill points and so they player never gains points and never gets to skill level 10 to finally be able to progress pass that, and just using a command like addskills wouldn't fix the progression, it would only change the level... if that is the specific problem you are facing the solution is in the database, not in the source code. You need to put your source code back to the way it was, the way it is in my picture. If that is not the case, can you please elaborate more on "how" exactly it's broken, how you are getting the skills or adding them or what you have tried, the more information the better.
Post automatically merged:

why there is msg.add(0)? i dont think it should be like this
It's supposed to be there as like a "end" identifier for the parser on the other end.
 
the original code uncommented is correct.

this is what it looks like in blacktek and is working perfectly

View attachment 90520
What do you mean its not working correctly? Your image shows the GM with 67 sword fighting, is that not correct? Or is the specific problem with the level 10 skills? It is a common thing for old account creators to start a player off with level 10 skills but with 0 skill points and so they player never gains points and never gets to skill level 10 to finally be able to progress pass that, and just using a command like addskills wouldn't fix the progression, it would only change the level... if that is the specific problem you are facing the solution is in the database, not in the source code. You need to put your source code back to the way it was, the way it is in my picture. If that is not the case, can you please elaborate more on "how" exactly it's broken, how you are getting the skills or adding them or what you have tried, the more information the better.
Post automatically merged:


It's supposed to be there as like a "end" identifier for the parser on the other end.
Look at his ss. He has a 100% hit chance, 0% crit hit damage, and a 5% life chance.
He should have a 100% hit chance, 5% hit dmg and 100% life chance.
So the problem is in client since it's not parsing those values correctly
 
Look at his ss. He has a 100% hit chance, 0% crit hit damage, and a 5% life chance.
He should have a 100% hit chance, 5% hit dmg and 100% life chance.
So the problem is in client since it's not parsing those values correctly
In that case, it seems likely he added to the "special skills" enums, causing their values to change, because that c++ code is what is in everyone's code, because that's what works, there is no fault there, at least not his original code he posted...
 
the original code uncommented is correct.

this is what it looks like in blacktek and is working perfectly

View attachment 90520
What do you mean its not working correctly? Your image shows the GM with 67 sword fighting, is that not correct? Or is the specific problem with the level 10 skills? It is a common thing for old account creators to start a player off with level 10 skills but with 0 skill points and so they player never gains points and never gets to skill level 10 to finally be able to progress pass that, and just using a command like addskills wouldn't fix the progression, it would only change the level... if that is the specific problem you are facing the solution is in the database, not in the source code. You need to put your source code back to the way it was, the way it is in my picture. If that is not the case, can you please elaborate more on "how" exactly it's broken, how you are getting the skills or adding them or what you have tried, the more information the better.
Post automatically merged:


It's supposed to be there as like a "end" identifier for the parser on the other end.
I did some tests, and the server is correctly adding the special abilities, the problem is that the client is not "reading" them correctly, it has to do with something in the package. Because when I release the code, there are errors in the otclient console. I am using otclient v8 for version 772, i think that must be the problem

LUA:
g_game.enableFeature(GameAdditionalSkills)

Error console Otclient
Code:
ERROR: ProtocolGame parse message exception (3362 bytes, 222 unread, last opcode is 0x00 (0), prev opcode is 0xa1 (161)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 772)
 
Last edited:
Sorry, that's where I become of no use, I don't use OTCv8 or condone it's usage. I personally use cipsoft client for all my development and testing... my recommendation would be to try OTCR and see if you still have the same problem. If you don't, then you have two codebases to compare with each other to find the error if you wish to continue using the outdated version
 
Back
Top