From: PD
Subject: Mob Stacking This is code to stack mobs, so instead of: a cityguard stands here. a cityguard stands here. a cityguard stands here. a cityguard stands here. a cityguard stands here. you get: a cityguard stands here.[4] Just like item stacks. Here's what you do: act.informative.c change the name of list_one_char to "list_all_char", and add an integer argument num: void list_one_char(struct char_data * i, struct char_data * ch) to void list_all_char(struct char_data * i, struct char_data * ch, int num) look for... else if (IS_GOOD(i)) strcat(buf, "(Blue Aura) "); } strcat(buf, i->player.long_descr); /* insert here */ if (num > 1) { while ((buf[strlen(buf)-1]=='\r') || (buf[strlen(buf)-1]=='\n') || (buf[strlen(buf)-1]==' ')) { buf[strlen(buf)-1] = '\0'; } sprintf(buf2," [%d]\n\r", num); strcat(buf, buf2); } /*end insert*/ then replace the function list_char_to_char(), with the below: void list_char_to_char(struct char_data *list, struct char_data *ch) { struct char_data *i, *plr_list[100]; int num, counter, locate_list[100], found=FALSE; num = 0; for (i=list; i; i = i->next_in_room) { if(i != ch) { if (CAN_SEE(ch, i)) { if (num< 100) { found = FALSE; for (counter=0;(counternr == plr_list[counter]->nr && /* for odd reasons, you may want to seperate same nr mobs by factors other than position, the aff flags, and the fighters. (perhaps you want to list switched chars differently.. or polymorphed chars?) */ (GET_POS(i) == GET_POS(plr_list[counter])) && (AFF_FLAGS(i)==AFF_FLAGS(plr_list[counter])) && (FIGHTING(i) == FIGHTING(plr_list[counter])) && !strcmp(GET_NAME(i), GET_NAME(plr_list[counter]))) { locate_list[counter] += 1; found=TRUE; } } if (!found) { plr_list[num] = i; locate_list[num] = 1; num++; } } else { list_all_char(i,ch,0); } } } } if (num) { for (counter=0; counter 1) { list_all_char(plr_list[counter],ch,locate_list[counter]); } else { list_all_char(plr_list[counter],ch,0); } } } }