Welcome to the Builder Academy

Question Gossip

More
18 Feb 2026 19:31 #10984 by JTP
Gossip was created by JTP
Hi

I would like to change gossip so that immortal gossip shows a different “gossip” message, but mortal can still just say gossip

But looking in the files I can’t seem to find where to edit the code

Anyone who can point me in the right direction pls ?

Please Log in or Create an account to join the conversation.

More
Yesterday 11:48 #10985 by WhiskyTest
Replied by WhiskyTest on topic Gossip
act.comm.c

ACMD(do_gen_comm)

This is where all the different channels are coded.
The message gets built up into buf1 and buf2 (from about line 480) so you could manipulate that depending on what you want it to look like

Please Log in or Create an account to join the conversation.

More
Yesterday 13:37 #10986 by JTP
Replied by JTP on topic Gossip
But wont that change all, shout, gossip etc ?

I would like only the gossip to look different for immortals ?

Please Log in or Create an account to join the conversation.

More
Yesterday 14:40 - Yesterday 14:40 #10987 by thomas
Replied by thomas on topic Gossip
Here's how I'd do it.


First, add another string to the com_msgs matrix:
Code:
  /* com_msgs: [0] Message if you can't perform the action because of noshout   *          [1] name of the action   *          [2] message if you're not on the channel -  *          [3] a color string. */ +  *          [3] a color string.   *          [4] name of the action if the noise is made by an imm. */   const char *com_msgs[][4] = {     {"You cannot holler!!\r\n",       "holler",       "", -      KYEL}, +      KYEL, +      NULL},     {"You cannot shout!!\r\n",       "shout",       "Turn off your noshout flag first!\r\n", -      KYEL}, +      KYEL, +      NULL},     {"You cannot gossip!!\r\n",       "gossip",       "You aren't even on the channel!\r\n", -      KYEL}, +      KYEL, +    "immgossip"},     {"You cannot auction!!\r\n",       "auction",       "You aren't even on the channel!\r\n", -      KMAG}, +      KMAG, +      NULL},     {"You cannot congratulate!\r\n",       "congrat",       "You aren't even on the channel!\r\n", -      KGRN}, +      KGRN, +      NULL},     {"You cannot gossip your emotions!\r\n",       "gossip",       "You aren't even on the channel!\r\n", -    KYEL} +    KYEL,   +    NULL}   };

And then below, add another check:
Code:
- snprintf(buf1, sizeof(buf1), "%sYou %s, '%s%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "", -        com_msgs[subcmd][1], argument, COLOR_LEV(ch) >= C_CMP ? color_on : "", CCNRM(ch, C_CMP)); + snprintf(buf1, sizeof(buf1), "%sYou %s, '%s%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "", +        (com_msgs[subcmd][4] != NULL && !IS_NPC(ch) && GET_LEVEL(ch) >= LVL_IMMORT) ? com_msgs[subcmd][4] : com_msgs[subcmd][1], +        argument, COLOR_LEV(ch) >= C_CMP ? color_on : "", CCNRM(ch, C_CMP));

And similarly a little further down:
Code:
- snprintf(buf1, sizeof(buf1), "$n %ss, '%s'", com_msgs[subcmd][1], argument); + snprintf(buf1, sizeof(buf1), "$n %ss, '%s'", +        (com_msgs[subcmd][4] != NULL && !IS_NPC(ch) && GET_LEVEL(ch) >= LVL_IMMORT) ? com_msgs[subcmd][4] : com_msgs[subcmd][1], + argument);

I hope you see what I'm going for here?
Last edit: Yesterday 14:40 by thomas. Reason: formatting

Please Log in or Create an account to join the conversation.

Time to create page: 0.173 seconds