groups

From: Ludovic Chataigner (lchataig@ensem.u-nancy.fr)
Date: 01/25/94


	Hi,

Here is a modification I've made on my mud. I've often seen very high lvl
players helping middle level players, and it seems bad. I think the groups have 
to be balanced so, I 've made some modifications in the function do_group in
act.other.c (of course, helping newbies is still allowed):

ACMD(do_group) /* modified by Ludo (can't group with difference of lvl) */
{
   struct char_data *victim, *k;
   struct follow_type *f;
   bool found;

   one_argument(argument, buf);

   if (!*buf) {
      if (!IS_AFFECTED(ch, AFF_GROUP)) {
	 send_to_char("But you are not the member of a group!\n\r", ch);
      } else {
	 send_to_char("Your group consists of:\n\r", ch);

	 k = (ch->master ? ch->master : ch);

	 if (IS_AFFECTED(k, AFF_GROUP)) {
	    sprintf(buf, "     [%3dH %3dM %2dV] [%2d %s] $N (Head of group)",
	        GET_HIT(k), GET_MANA(k), GET_MOVE(k), GET_LEVEL(k), CLASS_ABBR(k));
	    act(buf, FALSE, ch, 0, k, TO_CHAR);
	 }

	 for (f = k->followers; f; f = f->next)
	    if (IS_AFFECTED(f->follower, AFF_GROUP)) {
	       sprintf(buf, "     [%3dH %3dM %2dV] [%2d %s] $N",
	           GET_HIT(f->follower), GET_MANA(f->follower),
	           GET_MOVE(f->follower), GET_LEVEL(f->follower),
	           CLASS_ABBR(f->follower));
	       act(buf, FALSE, ch, 0, f->follower, TO_CHAR);
	    }
      }

      return;
   }

   if (ch->master) {
      act("You can not enroll group members without being head of a group.",
          FALSE, ch, 0, 0, TO_CHAR);
      return;
   }

   if (!str_cmp(buf, "all")) {
      SET_BIT(ch->specials.affected_by, AFF_GROUP);
      for (f = ch->followers; f; f = f->next) {
	 victim = f->follower;
	 if (!IS_AFFECTED(victim, AFF_GROUP)) {
	    if ((abs(GET_LEVEL(ch)-GET_LEVEL(victim))<5) || (GET_LEVEL(victim)<=5))
	 {
	    act("$N is now a member of your group.", FALSE, ch, 0, victim, TO_CHAR);
	    act("You are now a member of $n's group.", FALSE, ch, 0, victim, TO_VICT);
	    act("$N is now a member of $n's group.", FALSE, ch, 0, victim, TO_NOTVICT);
	    SET_BIT(victim->specials.affected_by, AFF_GROUP);
	 }
	 else
	 {
	    act("You can't group $N, because of the difference of level.", FALSE, ch, 0, victim, TO_CHAR);
	    act("You can't be in $n's group, because of the difference of level.", FALSE, ch, 0, victim, TO_VICT);
	    act("$N can't be in $n's group, because of the difference of level.", FALSE, ch, 0, victim, TO_NOTVICT);
         }
	}
	}
      return;
   }

   if (!(victim = get_char_room_vis(ch, buf))) {
      send_to_char("No one here by that name.\n\r", ch);
   } else {
      found = FALSE;

      if (victim == ch)
	 found = TRUE;
      else {
	 for (f = ch->followers; f; f = f->next) {
	    if (f->follower == victim) {
	       found = TRUE;
	       break;
	    }
	 }
      }

      if (found) {
	 if (IS_AFFECTED(victim, AFF_GROUP)) {
	    act("$N is no longer a member of your group.", FALSE, ch, 0, victim, TO_CHAR);
	    act("You have been kicked out of $n's group!", FALSE, ch, 0, victim, TO_VICT);
	    act("$N has been kicked out of $n's group!", FALSE, ch, 0, victim, TO_NOTVICT);
	    REMOVE_BIT(victim->specials.affected_by, AFF_GROUP);
	 } else {
	    if ((abs(GET_LEVEL(ch)-GET_LEVEL(victim))<5) || (GET_LEVEL(victim)<=5))
	 {
	    act("$N is now a member of your group.", FALSE, ch, 0, victim, TO_CHAR);
	    act("You are now a member of $n's group.", FALSE, ch, 0, victim, TO_VICT);
	    act("$N is now a member of $n's group.", FALSE, ch, 0, victim, TO_NOTVICT);
	    SET_BIT(victim->specials.affected_by, AFF_GROUP);
         }
	    else
	 {  
	    act("You can't group $N, because of the difference of level.", FALSE, ch, 0, victim, TO_CHAR);
	    act("You can't be in $n's group, because of the difference of level.", FALSE, ch, 0, victim, TO_VICT);
	    act("$N can't be in $n's group, because of the difference of level.", FALSE, ch, 0, victim, TO_NOTVICT);
	 }
	}
      } else
	 act("$N must follow you to enter your group.", FALSE, ch, 0, victim, TO_CHAR);
   }
}

Ludo, implementor of Ensem Mud (relax.ensem.u-nancy.fr 4000)

--------------------------------------------------------------------------------
Ludovic CHATAIGNER               |   e-mail adress : lchataig@ensem.u-nancy.fr
                                 |
Ensem 3A (ISA Instrumentation 91)|       v                       v        \|/  
                                 |                     v                  -O- 
                                 |                                        /|\
2 rue de la foret de haye        |   /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\      
                                 |    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/      
54500 VANDOEUVRE LES NANCY       |   /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
--------------------------------------------------------------------------------



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