[CODE] [!HYMEN] Npc 'brag' function

From: Cris Jacobin (jacobin@NETREACH.NET)
Date: 09/29/97


        Well I guess I'll break my, 'contribute to the list', cherry with
this function I whipped
up today.  When a npc kills a pc, he'll 'brag/taunt/humiliate' his victim.
You get the idea, it's
nothing new.

        One thing I must say, is that I originally wanted to just interface
with gen_comm, to
send it out over the gossip channel through normal means.  Besides there
being !NPC checks througout
the function, it was convulted in and of itself.  Not quite clear on these
SCMDS yet. :)

        Wouldn't this be cleaner, if it were replaced with a
send_to_channel(channel, mesg);
function or macro?

        I added this function to the end of comm.c, inserted all the proper
declarations in comm.*,
fight.c, etc. You'll also have to include screen.h to access the color
definitions, but that should be obvious.  Feel free to contact me if you
have any problems with it, or just want to offer me a few
better insults than the pitiful lot I threw together ;)

-jac 'emote needs builders, badly...'
ButterMud - telnet://betterbox.gameon.net:4000


I inserted a call to the function in the following place in fight.c.
_________________________

 if (!IS_NPC(victim)) {
      sprintf(buf2, "%s killed by %s at %s", GET_NAME(victim), GET_NAME(ch),
              world[victim->in_room].name);
      mudlog(buf2, BRF, LVL_IMMORT, TRUE);
+     brag(ch, victim);          /* Brag Function Call - Muerte 9/29/97 */
      if (MOB_FLAGGED(ch, MOB_MEMORY))
        forget(ch, victim);
    }

______Code Follows_______

void brag(struct char_data *ch, struct char_data *vict)
{
struct descriptor_data *i;
char brag[256]={"       "};

       /* Npc Bragging function -  Muerte  9/29/1997.  <- Y2K Compiant!
     ButterMud - telnet://betterbox.gameon.net:4000 */

    /*  _Pick Random Brag_
     Adjust frequency of brags by increasing this number above 11.  ie, a
value of
     22 will yield npc's bragging aprox 50% of the time, etc... */

   switch (number(0, 11)) {
  case 0:
   sprintf(brag, "$n brags, '%s was just too easy a kill!'", GET_NAME(vict));
  break;
  case 1:
   sprintf(brag, "$n brags, '%s was a tasty dinner, now who's for desert?
Muhaha!'", GET_NAME(vict));
  break;
  case 2:
   sprintf(brag, "$n brags, 'Bahaha! %s should stick to Odif's !'",
GET_NAME(vict));
  break;
  case 3:
   sprintf(brag, "$n brags, '%s is now in need of some exp...Muhaha!'",
GET_NAME(vict));
  break;
  case 4:
   sprintf(brag, "$n brags, '%s needs a hospital now. Muhaha!'",GET_NAME(vict));
  break;
  case 5:
   sprintf(brag, "$n brags, '%s's mother is a slut!  Muhaha!'", GET_NAME(vict));
  break;
  case 6:
   sprintf(brag, "$n brags, '%s is a punk, hits like a swampfly. Bah.'",
GET_NAME(vict));
  break;
  case 7:
   sprintf(brag, "$n brags, '%s, your life force has just run
out...Muahaha!'",GET_NAME(vict));
  break;
  case 8:
   sprintf(brag, "$n brags, 'Bah, %s should stick to the newbie zone!'",
GET_NAME(vict));
  break;
  case 9:
   sprintf(brag, "$n brags, '%s, give me your daughter's number and I might
return your corpse. Muhaha!'", GET_NAME(vict));
  break;
  case 10:
   sprintf(brag, "$n brags, 'Hey %s!  Come back, you dropped your corpse!
Muahaha'", GET_NAME(vict));
  break;
  case 11:
   sprintf(brag, "$n brags, 'I think %s wears pink chainmail.  Fights like
a girl!  Muhaha!'", GET_NAME(vict));
  break;
  }

    /*  Iterate through list of all active players, check if open to gossip */

   for (i = descriptor_list; i; i = i->next)
     if (!i->connected && i != ch->desc && i->character &&
        !PRF_FLAGGED(i->character, PRF_NOGOSS) &&
        !PLR_FLAGGED(i->character, PLR_WRITING) &&
        !ROOM_FLAGGED(i->character->in_room, ROOM_SOUNDPROOF))  {

   /* Display in Red if color is on */

     if (COLOR_LEV(i->character) >= C_NRM);
        send_to_char(CCRED(vict, C_NRM), i->character);
        act(brag, FALSE, ch, 0, i->character, TO_VICT | TO_SLEEP);
    if (COLOR_LEV(i->character) >= C_NRM);
        send_to_char(CCNRM(vict, C_NRM), vict);
   }
}


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST