iubantot Posted May 25, 2016 Group: Members Topic Count: 117 Topics Per Day: 0.03 Content Count: 312 Reputation: 34 Joined: 10/15/12 Last Seen: Friday at 05:43 AM Share Posted May 25, 2016 /*========================================== * npctalk (sends message to surrounding area) * usage: npctalk "<message>"{,"<npc name>"}; *------------------------------------------*/ BUILDIN(npctalk) { struct npc_data* nd; const char *str = script_getstr(st,2); if (script_hasdata(st, 3)) { nd = npc->name2id(script_getstr(st, 3)); } else { nd = map->id2nd(st->oid); } if (nd != NULL) { char name[NAME_LENGTH], message[256]; safestrncpy(name, nd->name, sizeof(name)); strtok(name, "#"); // discard extra name identifier if present safesnprintf(message, sizeof(message), "%s : %s", name, str); clif->disp_overhead(&nd->bl, message); } return true; } How about implementing this on rathena? --------------------------------------- *npctalk "<message>"{,"<npc name>"}; This command will display a message to the surrounding area as if the NPC object running it was a player talking - that is, above their head and in the chat window. The display name of the NPC will get appended in front of the message to complete the effect. // This will make everyone in the area see the NPC greet the character // who just invoked it. npctalk "Hello "+strcharinfo(0)+", how are you?"; npctalk "Hello "+strcharinfo(0)+", how are you?","Another_NPC_Name"; --------------------------------------- Link to comment Share on other sites More sharing options...
Secrets Posted May 25, 2016 Group: Developer Topic Count: 36 Topics Per Day: 0.01 Content Count: 588 Reputation: 437 Joined: 01/26/16 Last Seen: Wednesday at 03:00 PM Share Posted May 25, 2016 We do have the command. However I don't think we support the additional "<npc name>" parameter. Link to comment Share on other sites More sharing options...
iubantot Posted May 25, 2016 Group: Members Topic Count: 117 Topics Per Day: 0.03 Content Count: 312 Reputation: 34 Joined: 10/15/12 Last Seen: Friday at 05:43 AM Author Share Posted May 25, 2016 We do have the command. However I don't think we support the additional "<npc name>" parameter. i guess it's easier to make a dialogue for instance when there is a <npc name> parameter. i hope they will add this sometime ) Link to comment Share on other sites More sharing options...
iubantot Posted August 18, 2016 Group: Members Topic Count: 117 Topics Per Day: 0.03 Content Count: 312 Reputation: 34 Joined: 10/15/12 Last Seen: Friday at 05:43 AM Author Share Posted August 18, 2016 can we expand our npctalk like in herc? //from herc *npctalk "<message>"{,"<npc name>"}; This command will display a message to the surrounding area as if the NPC object running it was a player talking - that is, above their head and in the chat window. The display name of the NPC will get appended in front of the message to complete the effect. // This will make everyone in the area see the NPC greet the character // who just invoked it. npctalk "Hello "+strcharinfo(0)+", how are you?"; npctalk "Hello "+strcharinfo(0)+", how are you?","Another_NPC_Name"; source : https://github.com/HerculesWS/Hercules/blob/master/doc/script_commands.txt i think this is very useful in making instance scripts Link to comment Share on other sites More sharing options...
Jey Posted August 18, 2016 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 249 Reputation: 73 Joined: 10/20/12 Last Seen: August 16, 2018 Share Posted August 18, 2016 (edited) *npctalk "<message>";This command will display a message to the surrounding area as if the NPC object running it was a player talking - that is, above their head and in the chat window. The display name of the NPC won't get appended in front of the message. // This will make everyone in the area see the NPC greet the character // who just invoked it. npctalk "Hello "+strcharinfo(0)+", how are you?"; So simply use it like: npctalk "MyCoolNPCName: ..."; Edit: Just realized that I didn't understand the request. Sorry for that. Edited August 31, 2016 by Jey Link to comment Share on other sites More sharing options...
Secrets Posted August 20, 2016 Group: Developer Topic Count: 36 Topics Per Day: 0.01 Content Count: 588 Reputation: 437 Joined: 01/26/16 Last Seen: Wednesday at 03:00 PM Share Posted August 20, 2016 For further reference: You can use this regular expression in Find and Replace (Regex mode) function of Notepad++ to easily convert Herc scripts. Find : npctalk "(.+)",(.+); Replace with : npctalk $2 + " : $1"; There might be some calls which are not covered by this regex, such as calls with no string literals. Anyways, this should speed you up 1 Link to comment Share on other sites More sharing options...
Lemongrass Posted August 31, 2016 Group: Developer Topic Count: 28 Topics Per Day: 0.01 Content Count: 547 Reputation: 270 Joined: 11/08/11 Last Seen: June 10, 2024 Share Posted August 31, 2016 Implemented in cd5dbe2 Link to comment Share on other sites More sharing options...
Recommended Posts