So far so good. i now have it set up so that the follower list auto sets the Tank to last in the follow list. I have watched all the aggressives hit the tank now. Now to get the group to show the Tank last in the group list.
I think I have a few more ideas in mind. I think this is a great collaboration to add to the group.
Code:
if (GROUP(i)) {
if (GROUP(i) == GROUP(ch))
send_to_char(ch, "(%s%s%s) ", CBGRN(ch, C_NRM),
GROUP_LEADER(GROUP(i)) == i ? "leader" : GROUP_TANK(GROUP(i)) ? "Tank" : "group",
CCNRM(ch, C_NRM));
else
send_to_char(ch, "(%s%s%s) ", CBRED(ch, C_NRM),
GROUP_LEADER(GROUP(i)) == i ? "leader" : GROUP_TANK(GROUP(i)) ? "Tank" : "group",
CCNRM(ch, C_NRM));
}
if (IS_NPC(i) && i->player.long_descr && GET_POS(i) == GET_DEFAULT_POS(i)) {
Code:
void set_tank_followers(struct char_data *ch, struct char_data *victim)
{
struct follow_type *f;
struct char_data *Tank, *TempMoveChar;
for (f = ch->followers; f; f = f->next)
Tank = f->follower;
TempMoveChar = Tank;
Tank = victim;
if (ch->followers) {
for (f = ch->followers; f; f = f->next) {
if (f->follower == victim) {
f->follower = 0;
}
}
}
if (ch->followers) {
for (f = ch->followers; f; f = f->next) {
if (f->follower == TempMoveChar)
f->follower = victim;
if (f->follower == 0)
f->follower = TempMoveChar;
}
}
if (ch->followers) {
for (f = ch->followers; f; f = f->next) {
if (f->follower != ch) {
act ("$N has reordered the follow list.", FALSE, f->follower, 0, ch, TO_CHAR);
do_group (f->follower, "", 0, 0);
}
}
}
act ("You reorder the follow list.", FALSE, ch, 0, ch, TO_CHAR);
}
} else if (is_abbrev(buf, "tank")) {
skip_spaces(&argument);
if (!GROUP(ch) ) {
send_to_char(ch, "But you are not part of a group.\r\n");
return;
} else if (GROUP_LEADER(GROUP(ch)) != ch ) {
send_to_char(ch, "Only the group's leader can designate the tank.\r\n");
return;
} else if (!*argument) {
send_to_char(ch, "You have to specify the group TANK!\r\n");
return;
} else if (!(vict = get_char_vis(ch, argument, NULL, FIND_CHAR_ROOM))) {
send_to_char(ch, "The tank role has been removed from your group.\r\n");
GROUP_TANK(GROUP(ch)) = NULL;
return;
} else if (!vict) {
send_to_char(ch, "There is no one by that name in this room!.\r\n");
return;
} else if (GROUP(vict) != GROUP(ch)) {
act("$E$u is not a member of your group!", FALSE, ch, 0, vict, TO_CHAR);
return;
}
send_to_group(vict, GROUP(ch), "%s has been designated as the tank.\r\n", GET_NAME(vict));
send_to_char(vict, "You are the designated tank!\r\n");
GROUP_TANK(GROUP(ch)) = vict;
set_tank_followers(ch, vict);
} else if (is_abbrev(buf, "leave")) {