Jedzkie 58 Posted January 12, 2014 hi! can i suggest that the displaybottom & message script can set its desired message color? for example. *displaybottom <message>,<color>; *message <message>,<color>; 1 evilpuncker reacted to this Quote Share this post Link to post Share on other sites
kyeme 71 Posted January 12, 2014 Agree 2 Jedzkie and Yamzkie reacted to this Quote Share this post Link to post Share on other sites
Angelmelody 221 Posted January 12, 2014 announce "12345", bc_self,0x00FFFF; Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted January 12, 2014 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 ? Quote Share this post Link to post Share on other sites
Jedzkie 58 Posted January 12, 2014 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. Quote Share this post Link to post Share on other sites
jTynne 101 Posted January 12, 2014 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! 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted January 12, 2014 (edited) 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 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;} BUILDIN_DEF(dispbottom,"s??"),it works !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;} Edited January 12, 2014 by AnnieRuru 2 kyeme and akbare reacted to this Quote Share this post Link to post Share on other sites
Angelmelody 221 Posted January 12, 2014 (edited) I have seen same color packet processing in rathena and eathena forum http://rathena.org/board/topic/72457-chat-color-change/?p=148488 http://www.eathena.ws/board/index.php?showtopic=278921 ,but I dont think dispbottom color msg command really be needed Edited January 12, 2014 by Angelmelody Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted January 12, 2014 (edited) 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 neededhuh ? 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 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;} BUILDIN_DEF(message2,"vs?"),clif.cvoid 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);} Edited January 12, 2014 by AnnieRuru 1 akbare reacted to this Quote Share this post Link to post Share on other sites
Mhalicot 392 Posted January 12, 2014 ^ Thanks for sharing but your snippets need some modification because Hercules is using different structure in source code. So its not compatible with Hercules and instead of editing src file, is it OK with you if convert it to Plugins? Quote Share this post Link to post Share on other sites
evilpuncker 503 Posted January 14, 2014 there is a plugin already! http://herc.ws/board/topic/974-script-cmddispbottomcolor/ Quote Share this post Link to post Share on other sites
Mhalicot 392 Posted January 15, 2014 ^ Nice try, that plugins is outdated will try to make it then. Quote Share this post Link to post Share on other sites
kyeme 71 Posted January 15, 2014 Official iRO server does have a colore displaybottom Quote Share this post Link to post Share on other sites
evilpuncker 503 Posted January 15, 2014 our quest exp is already colored if I recall correctly Quote Share this post Link to post Share on other sites
mkbu95 34 Posted January 21, 2014 I think it would be nice to have it as an optional parameter. Quote Share this post Link to post Share on other sites
pan 87 Posted January 22, 2014 I think it would be nice to have it as an optional parameter.Totally agree, if the syntax changes there won't be backwards compatibility Quote Share this post Link to post Share on other sites
Ind 945 Posted February 10, 2014 I think it would be nice to have it as an optional parameter.Totally agree, if the syntax changes there won't be backwards compatibility I do think so too. Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted February 10, 2014 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 1 evilpuncker reacted to this Quote Share this post Link to post Share on other sites
Ind 945 Posted February 10, 2014 colormes needs to be modified (or a new version since we rely on that for hardcoded things) 2 evilpuncker and AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
evilpuncker 503 Posted February 14, 2014 I support this addition! Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted November 9, 2015 (edited) so ... Haru has cleaned up the clif->colormes function https://github.com/HerculesWS/Hercules/commit/d66cc50af6d781d179f46ae67d74bf26bf5914e5 now its very easy to implement this suggestion pull request https://github.com/HerculesWS/Hercules/pull/858 and I just compared hercules and rathena script_commands.txt we are so behind them right now, missing so many script commands its not even funny I'm thinking maybe I should stop supporting on the forums .... until at least have hercules emulator on par with rathena standard EDIT: what the heck ? why when used 0x000000 it is display as white ?? or maybe just my hexed client maybe ? EDIT2: tested on rathena, they also having this same issue Edited November 9, 2015 by AnnieRuru Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted December 22, 2015 (edited) merge in https://github.com/HerculesWS/Hercules/commit/19d83e65e83887a9f15353e626eaab57d7f86a74 finally ... erm, I just saw messagecolor script command wait wait ... not finish yet ... hmm impossible, it require player to refresh the client #include <stdio.h>#include <stdlib.h>#include <string.h>#include "map/pc.h"#include "map/script.h"#include "common/HPMi.h"#include "common/socket.h"#include "common/strlib.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = { "messagecolor", SERVER_TYPE_MAP, "0.1", HPM_VERSION,};BUILDIN(messagecolor) { TBL_PC *sd = NULL; if (script_isstringtype(st,2)) sd = script->nick2sd(st, script_getstr(st,2)); else sd = script->id2sd(st, script_getnum(st,2)); if ( sd ) { const char *message = script_getstr(st,3); unsigned short msg_len = strlen( message ) +1; int color = script_getnum(st,4); WFIFOHEAD( sd->fd, msg_len + 12 ); WFIFOW( sd->fd, 0 ) = 0x2C1; WFIFOW( sd->fd, 2 ) = msg_len + 12; WFIFOL( sd->fd, 4 ) = sd->bl.id; WFIFOL( sd->fd, 8 ) = RGB2BGR(color); safestrncpy( (char*)WFIFOP( sd->fd,12 ), message, msg_len ); WFIFOL( sd->fd, 4 ) = -sd->bl.id; WFIFOSET( sd->fd, msg_len + 12 ); } return true;}HPExport void plugin_init (void) { addScriptCommand( "messagecolor", "vsi", messagecolor );}looks doesn't work ?prontera,159,185,5 script kjdsfkshfs 1_F_MARIA,{ messagecolor getcharid(3), "test yellow", C_YELLOW; end;}try @fontcolor bluethen type something click on the npc again, then it shows up the sd->fontcolor_tid seems to have something to do it here Edited December 22, 2015 by AnnieRuru 1 jTynne reacted to this Quote Share this post Link to post Share on other sites
Dastgir 1246 Posted December 25, 2015 Merged https://github.com/HerculesWS/Hercules/pull/858 Quote Share this post Link to post Share on other sites