[NEWBIE] [CODE] Group Problems

From: Corey Elliott (strmchsr@arn.net)
Date: 03/06/99


Sorry, a newbie coder here, below code is really hacked.

I just came up with some code that ALMOST works for what I have it
planned for! This is used in a mobs spec_proc and is used to send a
message to the room.  If the person is in a group, sends it to everyone
in the group, if not, just to the person.  Everyone else doesn't see what
is being said, just that their is talking going on. The problem I am having
is
if there are 2 groups in the room at the same time, I can't figure out how
to display to the by-standing group what is going on. Understand????

void quest_say (struct char_data * ch, char *questname, char *message)
{
  struct char_data *k;
  struct char_data *i;
  struct follow_type *f;

 if (!AFF_FLAGGED(ch, AFF_GROUP)){
  send_to_char("TEMP MESSAGE ** You are not grouped! ** TEMP MESSAGE\r\n",
ch);
  sprintf(buf, "%s tells you, '%s'", questname, message);
  act(buf, FALSE, ch, 0, 0, TO_CHAR);
        sprintf(buf, "%s talks to $n.", questname);
  act(buf, FALSE, ch, 0, 0, TO_ROOM);
  }
 if (AFF_FLAGGED(ch, AFF_GROUP)){
      if (ch->master)
        k = ch->master;
      else
        k = ch;

  }
 for (i = world[ch->in_room].people; i; i = i->next_in_room)
  if (!AFF_FLAGGED(i, AFF_GROUP)) {
    sprintf(buf, "%s talks to a group of people.\r\n", questname);
   send_to_char(buf, i);

 }
    sprintf(buf, "%s tells the group, '%s'", questname, message);

    if (AFF_FLAGGED(k, AFF_GROUP) && (k != ch->master))
  act(buf, FALSE, ch, 0, k, TO_VICT | TO_SLEEP);
 for (f = k->followers; f; f = f->next)
  if (AFF_FLAGGED(f->follower, AFF_GROUP) && (f->follower != ch))
   act(buf, FALSE, ch, 0, f->follower, TO_VICT | TO_SLEEP);
}

Corey Elliott
strmchsr@arn.net


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



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