Re: [NEWBIE] Making npc's gos when they kill other npc's

From: Alysia (alysia@speedconnect.com)
Date: 04/06/02


Where does this code sit? extract? die? somewhere in mobact.c?

> --Ziz

here is the snippet,
 Bragging Npc's - A ButterMud Production
Made by: jacobin@bellatlantic.net
W hen someone on the mud dies
at the hands of an Npc, they end up having to suffer the humiliation of
the npc's taunts on the gossip channel!


Add the following to comm.h

__comm.h__

void    brag(struct char_data *ch, struct char_data *victim);
__

Add the following to fight.c

__fight.c__

/* External procedures */
void brag(struct char_data * ch, struct char_data * victim);

_Now call the brag fuction whenever an npc kills a player character.  I
added it within the following conditional, and works like a charm.

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);
    if (IS_NPC(ch))
      brag(ch, victim);    /* <- Insert brag call here */
      if (MOB_FLAGGED(ch, MOB_MEMORY))
        forget(ch, victim);
    }

__

Now add the following function to the end of comm.c

__comm.c__

void brag(struct char_data *ch, struct char_data *vict)
{

 /* Npc taunts slayed player characters.  Text goes out through gossip
    channel.  Muerte - telnet://betterbox.net:4000                     */

struct descriptor_data *i;
char brag[256]={"       "};

   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;
  }

   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))  {

      act(brag, FALSE, ch, 0, i->character, TO_VICT | TO_SLEEP);

   }
}

__

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT