utofaery Posted February 11, 2019 Posted February 11, 2019 1. Can we change npctalk color when in script ? 2. cases on npc whisper function how do a player activate an npc that has whisper function this thing is a maze to me... Quote
0 AnnieRuru Posted February 11, 2019 Posted February 11, 2019 I vaguely remember we discuss about *dispbottom2 and *message2 custom script command during my stay on herculeshttp://herc.ws/board/topic/3899-suggestion-displaybottom-message-colors/?do=findComment&comment=25468 answer is yes, it just not implemented look at the npctalk inside script.cpp, it default to color_table[COLOR_WHITE], this value is hard-coded BUILDIN_FUNC(npctalk) { struct npc_data* nd = NULL; const char* str = script_getstr(st,2); if (script_hasdata(st, 3) && strlen(script_getstr(st,3)) > 0) nd = npc_name2id(script_getstr(st, 3)); else nd = (struct npc_data *)map_id2bl(st->oid); if (nd != NULL) { send_target target = AREA; char message[CHAT_SIZE_MAX]; if (script_hasdata(st, 4)) { switch(script_getnum(st, 4)) { case BC_ALL: target = ALL_CLIENT; break; case BC_MAP: target = ALL_SAMEMAP; break; case BC_SELF: target = SELF; break; case BC_AREA: default: target = AREA; break; } } safesnprintf(message, sizeof(message), "%s", str); if (target != SELF) clif_messagecolor(&nd->bl, color_table[COLOR_WHITE], message, false, target); else { TBL_PC *sd = map_id2sd(st->rid); if (sd == NULL) return SCRIPT_CMD_FAILURE; clif_messagecolor_target(&nd->bl, color_table[COLOR_WHITE], message, false, target, sd); } } return SCRIPT_CMD_SUCCESS; } so I play around again with it, Hercules plugin of course, #include "common/hercules.h" #include "map/clif.h" #include "map/script.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "messagecolor", SERVER_TYPE_MAP, "0.1", HPM_VERSION, }; BUILDIN(messagecolor) { struct block_list *bl = map->id2bl( script_getnum(st,2) ); if (!bl) { ShowWarning("buildin_messagecolor: Error in finding object GID %d!\n", script_getnum(st,2)); return false; } clif->messagecolor( bl, script_getnum(st,4), script_getstr(st,3) ); return true; } HPExport void plugin_init (void) { addScriptCommand( "messagecolor", "isi", messagecolor ); } prontera,155,185,5 script kjsdhfksjf 1_F_MARIA,{ // messagecolor getcharid(3), "asdfasdf", C_BLUE; <-- doesn't work messagecolor getnpcid(), "asdfasdf", C_BLUE; messagecolor getnpcid(), "asdfasdf", C_RED; messagecolor getnpcid(), "asdfasdf", C_YELLOW; messagecolor getnpcid(), "asdfasdf", C_PINK; messagecolor getnpcid(), "asdfasdf", C_PURPLE; messagecolor getnpcid(), "asdfasdf", C_ORANGE; end; } 2. forget the whisper feature, that thing is from the past everyone use *bindatcmd now https://github.com/rathena/rathena/blob/master/doc/whisper_sys.txt Quote
0 Elysium Posted February 11, 2019 Posted February 11, 2019 9 minutes ago, AnnieRuru said: I vaguely remember we discuss about *dispbottom2 and *message2 custom script command during my stay on herculeshttp://herc.ws/board/topic/3899-suggestion-displaybottom-message-colors/?do=findComment&comment=25468 answer is yes, it just not implemented look at the npctalk inside script.cpp, it default to color_table[COLOR_WHITE], this value is hard-coded BUILDIN_FUNC(npctalk) { struct npc_data* nd = NULL; const char* str = script_getstr(st,2); if (script_hasdata(st, 3) && strlen(script_getstr(st,3)) > 0) nd = npc_name2id(script_getstr(st, 3)); else nd = (struct npc_data *)map_id2bl(st->oid); if (nd != NULL) { send_target target = AREA; char message[CHAT_SIZE_MAX]; if (script_hasdata(st, 4)) { switch(script_getnum(st, 4)) { case BC_ALL: target = ALL_CLIENT; break; case BC_MAP: target = ALL_SAMEMAP; break; case BC_SELF: target = SELF; break; case BC_AREA: default: target = AREA; break; } } safesnprintf(message, sizeof(message), "%s", str); if (target != SELF) clif_messagecolor(&nd->bl, color_table[COLOR_WHITE], message, false, target); else { TBL_PC *sd = map_id2sd(st->rid); if (sd == NULL) return SCRIPT_CMD_FAILURE; clif_messagecolor_target(&nd->bl, color_table[COLOR_WHITE], message, false, target, sd); } } return SCRIPT_CMD_SUCCESS; } so I play around again with it, Hercules plugin of course, #include "common/hercules.h" #include "map/clif.h" #include "map/script.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "messagecolor", SERVER_TYPE_MAP, "0.1", HPM_VERSION, }; BUILDIN(messagecolor) { struct block_list *bl = map->id2bl( script_getnum(st,2) ); if (!bl) { ShowWarning("buildin_messagecolor: Error in finding object GID %d!\n", script_getnum(st,2)); return false; } clif->messagecolor( bl, script_getnum(st,4), script_getstr(st,3) ); return true; } HPExport void plugin_init (void) { addScriptCommand( "messagecolor", "isi", messagecolor ); } prontera,155,185,5 script kjsdhfksjf 1_F_MARIA,{ // messagecolor getcharid(3), "asdfasdf", C_BLUE; <-- doesn't work messagecolor getnpcid(), "asdfasdf", C_BLUE; messagecolor getnpcid(), "asdfasdf", C_RED; messagecolor getnpcid(), "asdfasdf", C_YELLOW; messagecolor getnpcid(), "asdfasdf", C_PINK; messagecolor getnpcid(), "asdfasdf", C_PURPLE; messagecolor getnpcid(), "asdfasdf", C_ORANGE; end; } 2. forget the whisper feature, that thing is from the past everyone use *bindatcmd now https://github.com/rathena/rathena/blob/master/doc/whisper_sys.txt Could you convert this plugin to rAthena please? instead of Hercules. Quote
0 AnnieRuru Posted February 11, 2019 Posted February 11, 2019 (edited) 46 minutes ago, Elysium said: Could you convert this plugin to rAthena please? instead of Hercules. BUILDIN_FUNC(messagecolor) { struct block_list *bl = map_id2bl( script_getnum(st,2) ); if (!bl) { ShowWarning("buildin_messagecolor: Error in finding object GID %d!\n", script_getnum(st,2)); return SCRIPT_CMD_FAILURE; } clif_messagecolor( bl, script_getnum(st,4), script_getstr(st,3), true, AREA); return SCRIPT_CMD_SUCCESS; } BUILDIN_DEF(messagecolor,"isi"), Remember the reason why it doesn't work on players, because "@fontcolor" uses a trick to disguise player as monsterhttps://github.com/HerculesWS/Hercules/issues/1217https://github.com/HerculesWS/Hercules/issues/1930 apparently rAthena "@fontcolor" is broken Edited February 11, 2019 by AnnieRuru Quote
0 Elysium Posted February 11, 2019 Posted February 11, 2019 2 minutes ago, AnnieRuru said: BUILDIN_FUNC(messagecolor) { struct block_list *bl = map_id2bl( script_getnum(st,2) ); if (!bl) { ShowWarning("buildin_messagecolor: Error in finding object GID %d!\n", script_getnum(st,2)); return SCRIPT_CMD_FAILURE; } clif_messagecolor( bl, script_getnum(st,4), script_getstr(st,3), true, AREA); return SCRIPT_CMD_SUCCESS; } BUILDIN_DEF(messagecolor,"isi"), Remember the reason why it doesn't work on players, because "@fontcolor" uses a trick to disguise player as monsterhttps://github.com/HerculesWS/Hercules/issues/1217https://github.com/HerculesWS/Hercules/issues/1930 Thank you Ma'dam! i'll test it Quote
0 utofaery Posted February 11, 2019 Author Posted February 11, 2019 (edited) 52 minutes ago, AnnieRuru said: 1. look at the npctalk inside script.cpp, it default to color_table[COLOR_WHITE], this value is hard-coded 2 so I play around again with it, Hercules plugin of course, 3. forget the whisper feature, that thing is from the past everyone use *bindatcmd now 1. nice npctalk white is messy and bad. now can change it... 2. thanks for that. 3. at the time it was still hot/ popular thing, I can barely get the concept of it ... that's why I am asking though. 4. wait a second what is "isi" ??? as in "Malay" language??? for content??? or it means??? Edited February 11, 2019 by utofaery Quote
0 AnnieRuru Posted February 11, 2019 Posted February 11, 2019 9 minutes ago, utofaery said: 4. wait a second what is "isi" ??? as in "Malay" language??? for content??? or it means??? /*========================================== * Added built-in functions *------------------------------------------*/ static void add_buildin_func(void) { int i; for( i = 0; buildin_func[i].func; i++ ) { // arg must follow the pattern: (v|s|i|r|l)*\?*\*? // 'v' - value (either string or int or reference) // 's' - string // 'i' - int // 'r' - reference (of a variable) // 'l' - label // '?' - one optional parameter // '*' - unknown number of optional parameters no idea what to say, its part of source modification Quote
0 Zell Posted February 11, 2019 Posted February 11, 2019 4 hours ago, utofaery said: 1. nice npctalk white is messy and bad. now can change it... 2. thanks for that. 3. at the time it was still hot/ popular thing, I can barely get the concept of it ... that's why I am asking though. 4. wait a second what is "isi" ??? as in "Malay" language??? for content??? or it means??? isi = integer, string, integer Quote
0 Ice Bear Posted January 5, 2020 Posted January 5, 2020 Spoiler @AnnieRuru is this possible to showscript too? Quote
0 Thinker Posted May 1, 2020 Posted May 1, 2020 On 1/5/2020 at 9:46 AM, Ice Bear said: Reveal hidden contents @AnnieRuru is this possible to showscript too? up Quote
0 amanikoko Posted April 21, 2023 Posted April 21, 2023 Quote 1@tnm3,176,172,5 script kjsdhfksjf 1_F_MARIA,{ messagecolor getcharid(3), "asdfasdf", C_BLUE; messagecolor getnpcid(0), "asdfasdf", C_BLUE; messagecolor getnpcid(0), "asdfasdf", C_RED; messagecolor getnpcid(0), "asdfasdf", C_YELLOW; messagecolor getnpcid(0), "asdfasdf", C_PINK; messagecolor getnpcid(0), "asdfasdf", C_PURPLE; messagecolor getnpcid(0), "asdfasdf", C_ORANGE; end; } Added the diff. for rathena recompiled & restarted server with the above script tested but apparently it is still showing white font instead of the specific color. Anyone mind to share the solution to this? Thanking you in advance for sharing. Cheers. Quote
Question
utofaery
1. Can we change npctalk color when in script ?
2. cases on npc whisper function
how do a player activate an npc that has whisper function this thing is a maze to me...
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.