Jump to content
  • 0

Chat Color Change


Question

Posted (edited)

Can someone help me with changing character name color for gm level 0?

I want multi color, i am working on something which is like

SELECT color from Char

if color=0 Red Color,

if color=1 Blue Color

if color=2 Green Color

if color=3 Yellow Color

Only names should be displayed in that color, not chat.

Can someone help me to do that?

Edited by dastgirpojee

Recommended Posts

Posted

I believe this is source code related ...

and I also remember brainstorm reply something it have to be done inside clif.c something ...

weirdly, I can't get the topic now using search button...

Posted (edited)

Any info how to make it work with @send command?

"0195 <unit id>.L <char name>.24B <party name>.24B <guild name>.24B <position name>.24B"

What's unit id?

Please Help me to use @send!

Edited by dastgirpojee
Posted

You can't do it without client reverse engineering. Brainstorm's assumption is totally false, ^COLOR is option for Ragnarok's dialog parser, and \033[1;37 is only for console.

Posted

Can someone help me with changing chat color for players?

I want multi color, i am working on something which is like

SELECT color from Char

if color=0 Red Color,

if color=1 Blue Color

if color=2 Green Color

if color=3 Yellow Color

Chat should be changed.

Can someone help me to do that?

Posted

You would have to wait that diff patch release and it affect ALL PLAYERS, not sure if source edit on clif.c can fake player's chat as Announce Color, GM Color, Dispbottom Color.

Posted

Use 0x2C1 packet instead of 0x8d in function 'clif_parse_GlobalMessage' (clif.c), then add

unsigned long color1 = strtoul("0xFF0000",NULL,0); // for red messages.
...
if(pc_get_group_level(sd) >= 99)// only Admin's messages have red color.
WFIFOL(fd,8) = (color1&0x0000FF)<<16|(color1&0x00FF00)|(color1&0xFF0000)>>16;

Posted (edited)

Thanks for the code Lililth :D

But it seems the code is not completed yet, because it still has a bug.

For example:

I create a char named "One Two" on a GM(99) account, then create another char named "Char02" on a non-GM account.

1. When char One Two talk, it shows white on overhead chat, and green on chat log. In Char02 client window, it only shows "Two: aaaaaa" with red color both on overhead chat and chat log.

2. When Char02 talk, it shows white on overhead chat, and green on chat log. In One Two client window, the color turns black both on overhead chat and chat log.

In short, the GM name is cropped, and the non GM name doesn't show at all.

Anyway, how do you know which packet should be used? (In this case 0x2C1).

Maybe it shows black because currently the code doesn't have an 'else' for char below gmlevel(99).

I add some lines to compensate the color for char with gmlevel < 99 with:

unsigned long color2 = strtoul("0x00FF00",NULL,0);
//...
WFIFOL(fd,8) = (color1&0x0000FF)<<16|(color1&0x00FF00)|(color1&0xFF0000)>>16;
else WFIFOL(fd,8) = (color2&0x0000FF)<<16|(color2&0x00FF00)|(color2&0xFF0000)>>16;

Edited by nanakiwurtz
Posted (edited)

Suggestion:

How bout adding it on DB folder name_color.txt and chat_color.txt to make it more user friendly.

Ex:

<group_id>,<color>

99,FF0000 //GM level 99 would have a red name.

<group_id>,<color>

99,FF0000 //GM level 99 would have a red chat .

Edited by Lanz

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...