[Suggestion] displaybottom & message colors

Jedzkie

The Master of White Spaces
Messages
632
Points
0
Age
33
Location
Philippines
Discord
✪ Jedzkie#0662
IRC Nickname
Jedzkie
Github
Jedzkie
Emulator
Client Version
2016-03-16 RE
hi! can i suggest that the displaybottom & message script can set its desired message color? for example.

*displaybottom <message>,<color>;

*message <message>,<color>;

 
Agree
default_biggrin.png


 
hi! can i suggest that the displaybottom & message script can set its desired message color? for example.

*displaybottom <message>,<color>;

*message <message>,<color>;
if I remember correctly, the message color can only be set towhite (normal chat)

violet (battleground chat)

red (party chat)

green (guild chat)

these 4 colors only

the reason is because of the packet limitation the client can do

however I also quite favor this to have dispbottom can use all these 4 kinds of color

dispbottom <message>{, <type> };

where <type> can be

CHAT_GREEN 0

CHAT_WHITE 1

CHAT_RED 2

CHAT_VIOLET 3

type will always resort to CHAT_GREEN as default, as we always have

but make it enable optional field to allow them to display in other colors we can have

btw, is there other color that the client can do ?

 
hi! can i suggest that the displaybottom & message script can set its desired message color? for example.

*displaybottom <message>,<color>;

*message <message>,<color>;
if I remember correctly, the message color can only be set towhite (normal chat)

violet (battleground chat)

red (party chat)

green (guild chat)

these 4 colors only

the reason is because of the packet limitation the client can do

however I also quite favor this to have dispbottom can use all these 4 kinds of color

dispbottom <message>{, <type> };

where <type> can be

CHAT_GREEN 0

CHAT_WHITE 1

CHAT_RED 2

CHAT_VIOLET 3

type will always resort to CHAT_GREEN as default, as we always have

but make it enable optional field to allow them to display in other colors we can have

btw, is there other color that the client can do ?
as far i as know, my friend told me that "CaseRO", uses rAmod, have these. i'll post a screenshots later.

 
hi! can i suggest that the displaybottom & message script can set its desired message color? for example.

*displaybottom <message>,<color>;

*message <message>,<color>;
if I remember correctly, the message color can only be set towhite (normal chat)

violet (battleground chat)

red (party chat)

green (guild chat)

these 4 colors only

the reason is because of the packet limitation the client can do

however I also quite favor this to have dispbottom can use all these 4 kinds of color

dispbottom <message>{, <type> };

where <type> can be

CHAT_GREEN 0

CHAT_WHITE 1

CHAT_RED 2

CHAT_VIOLET 3

type will always resort to CHAT_GREEN as default, as we always have

but make it enable optional field to allow them to display in other colors we can have

btw, is there other color that the client can do ?
I'm not sure if the two are related, but the #channel system employed in-game currently can display any color the user designates in the conf file (save for #FF00FF I imagine?). I recall the old limitations, but perhaps if they were able to get any color to display in the channel system (replacement for @main; originally released here on Hercules) they can do the same for dispbottom. It'd be nice at least. +1 from me!

 
I'm not sure if the two are related, but the #channel system employed in-game currently can display any color the user designates in the conf file (save for #FF00FF I imagine?). I recall the old limitations, but perhaps if they were able to get any color to display in the channel system (replacement for @main; originally released here on Hercules) they can do the same for dispbottom. It'd be nice at least. +1 from me!
OMFG !!totally forgotten about channel system

you are right, NO LIMITATION

I used rathena emulator to get this working fine

Code:
BUILDIN_FUNC(dispbottom) {	TBL_PC *sd;	if ( script_hasdata(st,4) ) {		if ( data_isstring( script_getdata(st,4) ) )			sd = map_nick2sd( script_getstr(st,4) );		else			sd = map_id2sd( script_getnum(st,4) );	} else		sd = script_rid2sd(st);	if ( sd ) {		const char* msg = script_getstr(st,2);		unsigned short msg_len = strlen( msg ) +1;		unsigned int colorcode;		if ( script_hasdata(st,3) )			colorcode = script_getnum(st,3);		else			colorcode = 0xbbffbb;		WFIFOHEAD( sd->fd, msg_len + 12 );		WFIFOW(sd->fd,0) = 0x2C1;		WFIFOW(sd->fd,2) = msg_len + 12;		WFIFOL(sd->fd,4) = 0;		WFIFOL(sd->fd,8) = colorcode;		safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len);		WFIFOSET( sd->fd, msg_len + 12 );	}	return 0;}
Code:
BUILDIN_DEF(dispbottom,"s??"),
it works !
Code:
prontera,162,180,5	script	kjsdfhksdjf	100,{	dispbottom "test color";	dispbottom "test color", 0xff0000;	dispbottom "test color", 0x0000ff;	dispbottom "test color", 0xffffff;	dispbottom "test color", 0xff00ff;	end;}
screenrAthena020.jpg
 
Last edited by a moderator:
ok, I'm noob

lilith's post is the correct answer

hercules/rathena already have clif_colormes

https://github.com/HerculesWS/Hercules/blob/master/src/map/clif.c#L8352

so just need to tweak the script command a little bit and it shall be done

BUILDIN_FUNC(dispbottom2) { TBL_PC *sd; if ( script_hasdata(st,4) ) { if ( data_isstring( script_getdata(st,4) ) ) sd = map_nick2sd( script_getstr(st,4) ); else sd = map_id2sd( script_getnum(st,4) ); } else sd = script_rid2sd(st); if ( sd ) { unsigned int colorcode; if ( script_hasdata(st,3) ) colorcode = script_getnum(st,3); else colorcode = 0xbbffbb; clif_colormes( sd, colorcode, script_getstr(st,2) ); } return 0;}
but I dont think dispbottom color msg command really be needed
huh ? why not ? it looks cool ! xD

I have tried to do message2 which display color message overhead your character

however I have found no known way to display a color message on top of your own head

it seems possible for other players to see your color message, but not by your own

Code:
BUILDIN_FUNC(message2) {	TBL_PC *sd;	if ( data_isstring( script_getdata(st,2) ) )		sd = map_nick2sd( script_getstr(st,2) );	else		sd = map_id2sd( script_getnum(st,2) );	if ( sd ) {		unsigned int colorcode;		if ( script_hasdata(st,4) )			colorcode = script_getnum(st,4);		else			colorcode = 0x00ff00;		clif_messagecolor2( &sd->bl, colorcode, script_getstr(st,3) );	}	return 0;}
Code:
BUILDIN_DEF(message2,"vs?"),
clif.c
Code:
void clif_messagecolor2(struct block_list* bl, unsigned long color, const char* msg) {	unsigned short msg_len = strlen(msg) + 1;	uint8 buf[256];	color = (color & 0x0000FF) << 16 | (color & 0x00FF00) | (color & 0xFF0000) >> 16; // RGB to BGR	nullpo_retv(bl);	if( msg_len > sizeof(buf)-12 ) {		ShowWarning("clif_messagecolor: Truncating too long message '%s' (len=%u).n", msg, msg_len);		msg_len = sizeof(buf)-12;	}	WBUFW(buf,0) = 0x2C1;	WBUFW(buf,2) = msg_len + 12;	WBUFL(buf,4) = bl->id;	WBUFL(buf,8) = color;	memcpy(WBUFP(buf,12), msg, msg_len);	clif_send(buf, WBUFW(buf,2), bl, AREA);}
 
Last edited by a moderator:
^ Thanks for sharing but your snippets need some modification because Hercules is using different structure in source code. So its not compatible with Hercules
default_biggrin.png


and instead of editing src file, is it OK with you if convert it to Plugins?

 
Last edited by a moderator:
^ Nice try, that plugins is outdated
default_smile.png


will try to make it then.

 
Official iRO server does have a colore displaybottom

DE4xhed.jpg


 
our quest exp is already colored if I recall correctly

 
I can write this

http://upaste.me/de7c10577fd5ed9d5

there is a problem ...

prontera,162,180,5 script aasdf 100,{ dispbottom "test color"; dispbottom "test color", 0xFF0000; dispbottom "test color", 0x00FF00; dispbottom "test color", 0x0000FF; end;}I test with this scriptit seems only able to display RED correct ...

green and blue are not ...

I remember when I did with rathena emulator on my previous post here, I don't recall having this bug

 
Back
Top