Welcome to the Builder Academy

Question How to group charmies of other followers?

More
02 Oct 2022 17:21 #10186 by Nero
I will check it out and thanks to you the node stuff is working perfectly!

Please Log in or Create an account to join the conversation.

More
05 Oct 2022 21:23 - 05 Oct 2022 22:35 #10191 by Nero
So I was able to get this working but is there a way to integrate promote?
I have it to where promote works but the problem is it removes the leader and the promoter from the current group and creates a new group with the new leader
but anyone else still in the old leaders group remains.
what I want to happen is the new group gets created under the new leader and everyone is removed as a member from the old group and it is removed from the list
OR just have it to where everyone stays in the same group but the promoter becomes the new leader and anyone following the old leader now follows the new leader.
Code:
ACMD(do_promote) {   char buf[MAX_INPUT_LENGTH];   struct follow_type *f, *next_fol;   struct char_data *tch, *nf;   int present = 0, awake = 0;   struct group_data *group;   struct iterator_data Iterator;     one_argument(argument, buf);   if (ch->master || !(AFF_FLAGGED(ch, AFF_GROUP))) {     send_to_char(ch, "You must be the leader of a group to promote a new group leader.\r\n");     return;   }   if (!*buf) {     send_to_char(ch, "Who will you promote?\r\n");     return;   }   if (!(tch = get_char_room_vis(ch, buf))) {     send_to_char(ch, "You must first be present with them to pass the torch of leadership.\r\n");     return;   }   if (IS_NPC(tch)) {     send_to_char(ch, "Only a player may be the leader of a group.\r\n");     return;   }   if (!(AFF_FLAGGED(tch, AFF_GROUP))) {     send_to_char(ch, "Only a group member may be promoted to group the position of group leader.\r\n");     return;   }   if (tch->master != ch) {     send_to_char(ch, "That person is not following you!\r\n");     return;   }   if (tch == ch) {     send_to_char(ch, "You are already the group leader.\r\n");     return;   }   if (IS_FIGHTING(ch)) {     send_to_char(ch, "You are too busy fighting to promote a new group leader!\r\n");     return;   }   if (IS_FIGHTING(tch)) {     send_to_char(ch, "They are too busy fighting to be promoted to the group leader position!\r\n");     return;   }   if (IN_ROOM(ch) != IN_ROOM(tch)) {     send_to_char(ch, "All group members must be present to execute a group leadership change.\r\n");     return;   }   if (GET_POS(ch) != POS_STANDING) {     send_to_char(ch, "You must be awake, standing, and out of combat to execute a group leadership change.\r\n");     return;   }   if (GET_POS(tch) != POS_STANDING) {     send_to_char(ch, "All group members must be awake, standing, and out of combat to execute a group leadership change.\r\n");     return;   }   for (f = ch->followers; f; f = next_fol) {       next_fol = f->next;       nf = f->follower;       if (f->follower == tch)       continue;       if (f->follower == ch)       continue;       if (AFF_FLAGGED(f->follower, AFF_CHARM))       continue;       if (!AFF_FLAGGED(f->follower, AFF_GROUP))       continue;       if (IN_ROOM(nf) != IN_ROOM(ch))         present += 1;       if (GET_POS(nf) != POS_STANDING)         awake += 1;     }   if (present >= 1) {     send_to_char(ch, "All group members must be present to execute a group leadership change.\r\n");     return;   }   if (awake >= 1) {     send_to_char(ch, "All group members must be awake, standing, and out of combat to execute a group leadership change.\r\n");     return;   }   for (f = ch->followers; f; f = next_fol) {       next_fol = f->next;       nf = f->follower;       if (f->follower == tch)       continue;       if (f->follower == ch)       continue;       if (AFF_FLAGGED(f->follower, AFF_CHARM))       continue;       if (!AFF_FLAGGED(f->follower, AFF_GROUP))       continue;       send_to_char(nf, "%s has promoted %s to the position of group leader.\r\n", GET_NAME(ch), GET_NAME(tch));     }   send_to_char(tch, "%s has promoted you to the position of group leader.\r\n", GET_NAME(ch));   send_to_char(ch, "You have promoted %s to the position of group leader.\r\n", GET_NAME(tch));   for (f = ch->followers; f; f = next_fol) {       next_fol = f->next;       nf = f->follower;       if (f->follower == tch)       continue;       if (f->follower == ch)       continue;       if (AFF_FLAGGED(f->follower, AFF_CHARM))       continue;       if (!AFF_FLAGGED(f->follower, AFF_GROUP))       continue;       send_to_char(nf, "%s has promoted %s to the position of group leader.\r\n", GET_NAME(ch), GET_NAME(tch));     }   for (f = ch->followers; f; f = next_fol) {       next_fol = f->next;       nf = f->follower;       if (f->follower == tch)       continue;       if (f->follower == ch)       continue;       if (AFF_FLAGGED(f->follower, AFF_CHARM))       continue;       if (!AFF_FLAGGED(f->follower, AFF_GROUP))       continue;                 stop_follower(nf);           add_follower(nf, tch);           SET_BIT_AR(AFF_FLAGS(nf), AFF_GROUP);     }   stop_follower(tch);   stop_follower(ch);   add_follower(ch, tch);   leave_group(ch);   create_group(tch);   join_group(ch, GROUP(tch));   SET_BIT_AR(AFF_FLAGS(tch), AFF_GROUP);   SET_BIT_AR(AFF_FLAGS(ch), AFF_GROUP);   GET_WAIT_STATE(ch) = 2 * PULSE_VIOLENCE;   return; }
Attachments:
Last edit: 05 Oct 2022 22:35 by Nero.

Please Log in or Create an account to join the conversation.

Time to create page: 0.184 seconds