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

TFS 1.X+ Creating / adding custom new skill

So you didnt edit otclient protocol? Your otclient needs to know how many skills you send from server, currently you are sending one more, but otc still thinks its one less. That's why you get parse message exception.
 
in ProtocolGame::parsePlayerSkills
change
int lastSkill = Otc::Fishing + 1;
to
int lastSkill = Otc::Mining + 1;

In tfs add that mining skill to 0xA1 opcode.

look for and update all onSkillChange/onBaseSkillChange lua events.
 
Did you change SKILL_LAST in tfs? It's fishing by default. If you don't you are sending one skill less from server.
 
For me it seems that this new skill is not covered properly in skills module (that is onSkillChange event)

You can try to debug LocalPlayer::setSkill method in OTC and check what values are there when skill == Otc::Mining.

And for debug purposes you can edit tfs message to something like this, it will always send the Mining skill at 123lv with 36% to go, if after that change OTC still isn't working, this is otc-sided fault (which I'm 98% sure it is).
C++:
void ProtocolGame::AddPlayerSkills(NetworkMessage& msg)
{
    msg.addByte(0xA1);
    for (uint8_t i = SKILL_FIRST; i < SKILL_LAST; ++i) {
        msg.addByte(std::min<int32_t>(player->getSkillLevel(i), std::numeric_limits<uint16_t>::max()));
        msg.addByte(player->getSkillPercent(i));
    }
    msg.addByte(123);
    msg.addByte(36);
}
 
Back
Top