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

Different colors

jestem pro

That is the question
Joined
Apr 20, 2013
Messages
650
Solutions
14
Reaction score
87
Hi, I saw somewhere, but now I cant find it.
I want to chamge the name color , these who has groupId 5. For example red.
Could somebody navigate me how to do that? I know it should be in creature.cpp in drawInformation.

Thanks
 
yeah but how can I include groupId instead creature name?
 
You need to send group_id from the server, then parse it in client and then make a function to colorize.
 
yeah I know. When is name I use m_name, but how when I want groupId?

@edit I didnt find anything about groupId in OTClient. Only about Id (getId, m_id), but I think it isnt related to group and just character number. isnt it?
 
Last edited:
There is no group id information on OTClient.
You should pass it by protocol from Server to Client (the list of "GameServer" protocols) and put it maybe on localPlayer.

After have the group id on OTClient, I recommend to search about "Otc::GameBlueNpcNameColor".
There is already a feature that change the names of NPCs there, so you will need just to copy and paste this line inside the if of the group ip.
The feature of blue name of NPCs is these lines:
// draw
if(g_game.getFeature(Otc::GameBlueNpcNameColor) && isNpc() && m_healthPercent == 100 && !useGray)
fillColor = Color(0x4b, 0xd0, 0xd2);

This color means the color RGB #4bd0d2 (I saw it on Photoshop: http://i.imgur.com/GDoGgPG.png).


If you really want something, you should take courage to do it by yourself.
Keep moving forward.
Good luck.
 
I know it about NPC. I may try with it. I would combine but compiling lasts very long and It would take me weeks.
 
Send if player has access on AddCreature and put it on creature class in OTC, after just make a function returning that bool var from creature class and use it for setting the color like @River_KA said.
j6durA9.png
 
yeah but it says me nothing. I'm working on otc not so long as you think guys. I would like to understand how this everything works but time is my enemy. xdd

@edit Alright I'll make it based on "vocation".
 
Last edited:
So guys when I added "groupId" in localplayer class in otc src where should I do next?

@edit Of course this don't work:
Code:
if(isLocalPlayer() && getGroupId() == 5){
       m_informationColor = Color(0xDC, 0xC8, 0x46);
   }
but how to do if player has vocation = 4, change his color name?
 
Last edited:
Back
Top