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

2 questions about OTClient

jestem pro

That is the question
Joined
Apr 20, 2013
Messages
650
Solutions
14
Reaction score
87
Hello, I have 2 fundamental questions .

1) How can I get player vocation? I mean how to use function getPlayerVocation in creature.cpp
if m_localPlayer->getVocation() == 2 ????

2) And how that all shit is made? How and where it is parsed for example: skulls or soul functions.
parsed OTClient with TFS, of course.

Thanks.
 
TFS send vocation as integer, you'll never receive strict string vocation name because there is no need for that from the client side. When you are inspecting other player, your client does not receive vocation name, the whole string "You see [...]" is generated in server and send as whole string to the client that only job is to display it. It works the same with items, client DOES NOT KNOW about particular item atk/def/name, because client does not need that so why bother with sending additional data?

Please be more specific with your second question. If you mean exact files, most of the parsing is done in protocolgame.cpp on the server side, and protocolgameparse/send.cpp on the client side.
 
Last edited:
yeah I meant what you said about the second question.

And can you tell me something more about the first? for example if a player has vocationid 2, his name turns to red. I tried but without success.
 
yeah I meant what you said about the second question.

And can you tell me something more about the first? for example if a player has vocationid 2, his name turns to red. I tried but without success.

If vocations are not changing in-game (if name colors will always be the same from login to logout) then the case is fairly easy.
Add information about nick color in AddCreature method in TFS protocolgame.cpp
something like: msg.addByte(creature->getNickColor());
Then you must implement that method and equivalent fields.
Then in OTC protocolgameparse.cpp getCreature method read that colors byte, assert it to correct property, do coloring in creature.cpp drawInformation method and voilà, your client knows about each creature name color.

If vocation changes in-game you must additionaly add another opcode like doSendNameColor and correctly handle it on the client side, then hook that send method to setVocation in player.cpp
 
Last edited:
okay thanks for your time. it explained me a little .xddd
 
Back
Top