Welcome to the Builder Academy

Question Restore All option

More
25 Mar 2018 23:52 #7800 by Nero
Restore All option was created by Nero
I want to be able to add a restore all option to the function do_restore in act.wizard.c.
I want this to be able to restore all hp/mana/moves to all people online. Currently it only works for one designated person.
How could I resolve this?
Code:
ACMD(do_restore) { char buf[MAX_INPUT_LENGTH]; struct char_data *vict; int i; one_argument(argument, buf); if (!*buf) send_to_char(ch, "Whom do you wish to restore?\r\n"); else if (!(vict = get_char_vis(ch, buf, NULL, FIND_CHAR_WORLD))) send_to_char(ch, "%s", CONFIG_NOPERSON); else if (!IS_NPC(vict) && ch != vict && GET_LEVEL(vict) >= GET_LEVEL(ch)) send_to_char(ch, "They don't need your help.\r\n"); else { if (!IS_NPC(vict) && GET_LEVEL(ch) >= LVL_GRGOD) { if (GET_LEVEL(vict) >= LVL_IMMORT) for (i = 1; i <= MAX_SKILLS; i++) SET_NAT_PSKILL(vict, i, MAX_PROFICIENCY); if (GET_LEVEL(vict) >= LVL_GRGOD) { for (i = 0; i < NUM_ABILITIES; i++) GET_STAT_MAX(vict, i) = MAX_STAT_ATTRIBUTE; GET_NAT_STR(vict) = MAX_STAT_ATTRIBUTE; GET_NAT_ADD(vict) = GET_STAT_MAX(vict, ABILITY_ADD) = 0; GET_NAT_INT(vict) = MAX_STAT_ATTRIBUTE; GET_NAT_WIS(vict) = MAX_STAT_ATTRIBUTE; GET_NAT_DEX(vict) = MAX_STAT_ATTRIBUTE; GET_NAT_STR(vict) = MAX_STAT_ATTRIBUTE; GET_NAT_CON(vict) = MAX_STAT_ATTRIBUTE; GET_NAT_CHA(vict) = MAX_STAT_ATTRIBUTE; GET_NAT_HIT(vict) = MAX_HIT; GET_NAT_MANA(vict) = MAX_MANA; GET_NAT_MOVE(vict) = MAX_MOVE; GET_MANA_GAIN(vict) = MAX_MANA_GAIN; GET_MOVE_GAIN(vict) = MAX_MOVE_GAIN; GET_HIT_GAIN(vict) = MAX_HIT_GAIN; GET_NAT_AP(vict) = MIN_AP; } } update_pos(vict); adjust_hits_and_attacks(vict, TRUE); affect_total(vict); send_to_char(ch, "%s", CONFIG_OK); act("You have been fully healed by $N!", FALSE, vict, 0, ch, TO_CHAR); } }

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

More
26 Mar 2018 00:03 #7801 by rudeboyrave
Replied by rudeboyrave on topic Restore All option
one_argument(argument, buf);
if (!*buf)
send_to_char(ch, "Whom do you wish to restore?\r\n");
else if (is_abbrev(buf, "all"))
{
for (j = descriptor_list; j; j = j->next)
{
if (!IS_PLAYING(j) || !(vict = j->character) || GET_LEVEL(vict) >= LVL_IMMORT)
continue;

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.
The following user(s) said Thank You: thomas

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

More
26 Mar 2018 23:05 #7811 by Nero
Replied by Nero on topic Restore All option
Thanks, TBA had the code the whole time in there silly me asking questions before looking. But it works so thanks for sharing!

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

Time to create page: 0.188 seconds