void do_group( CHAR_DATA * ch, char * argument ) { CHAR_DATA * victim; char buf[ MAX_STRING_LENGTH ]; char arg[ MAX_INPUT_LENGTH ]; one_argument( argument, arg ); if ( arg[ 0 ] == '\0' ) { CHAR_DATA * gch; CHAR_DATA * leader; leader = ( ch->leader ) ? ch->leader : ch; sprintf( buf, "%s's group:\n\r", visible_name( leader, ch, TRUE ) ); send_to_char( AT_DGREEN, buf, ch ); for ( gch = char_list; gch; gch = gch->next ) { if ( gch->deleted ) { continue; } if ( is_same_group( gch, ch ) ) { sprintf( buf, "[&R%2d %s&G] %-12s &Y%4d/%4d &Ghp &C%4d/%4d &Gmana &P%4d/%4d &Gmv &R%5d &Gxp\n\r", gch->level, IS_NPC( gch ) ? "Mob" : class_table[ prime_class( gch ) ].who_name, capitalize( visible_name( gch, ch, TRUE ) ), gch->hit, MAX_HIT( gch ), gch->mana, MAX_MANA( gch ), gch->move, MAX_MOVE( gch ), gch->exp ); if ( gch->gspell && gch->gspell->timer > 0 ) { send_to_char( AT_YELLOW, buf, ch ); } else { send_to_char( AT_GREEN, buf, ch ); } } } return; } if ( !( victim = get_char_room( ch, arg ) ) ) { send_to_char( AT_DGREEN, "They aren't here.\n\r", ch ); return; } if ( ch->master || ( ch->leader && ch->leader != ch ) ) { send_to_char( AT_DGREEN, "But you are following someone else!\n\r", ch ); return; } if ( victim->master != ch && ch != victim ) { act( AT_DGREEN, "$N isn't following you.", ch, NULL, victim, TO_CHAR ); return; } if ( is_same_group( victim, ch ) && ch != victim ) { victim->leader = NULL; act( AT_GREEN, "You remove $N from your group.", ch, NULL, victim, TO_CHAR ); act( AT_GREEN, "$n removes you from $s group.", ch, NULL, victim, TO_VICT ); act( AT_GREEN, "$n removes $N from $s group.", ch, NULL, victim, TO_NOTVICT ); return; } if ( ch->level - victim->level < -8 || ch->level - victim->level > 8 ) { act( AT_DGREEN, "$N cannot join your group.", ch, NULL, victim, TO_CHAR ); act( AT_DGREEN, "You cannot join $n's group.", ch, NULL, victim, TO_VICT ); act( AT_DGREEN, "$N cannot join $n's group.", ch, NULL, victim, TO_NOTVICT ); return; } victim->leader = ch; act( AT_GREEN, "$N joins your group.", ch, NULL, victim, TO_CHAR ); act( AT_GREEN, "You join $n's group.", ch, NULL, victim, TO_VICT ); act( AT_GREEN, "$N joins $n's group.", ch, NULL, victim, TO_NOTVICT ); return; }
void do_mpstat(CHAR_DATA * ch, char *argument) { char buf[MAX_STRING_LENGTH]; char arg[MAX_INPUT_LENGTH]; MPROG_DATA *mprg; CHAR_DATA *victim; one_argument(argument, arg); if (arg[0] == '\0') { send_to_char(C_DEFAULT, "MobProg stat whom?\n\r", ch); return; } if ((victim = get_char_world(ch, arg)) == NULL) { send_to_char(C_DEFAULT, "They aren't here.\n\r", ch); return; } if (!IS_NPC(victim)) { send_to_char(C_DEFAULT, "Only Mobiles can have Programs!\n\r", ch); return; } if (!(victim->pIndexData->progtypes)) { send_to_char(C_DEFAULT, "That Mobile has no Programs set.\n\r", ch); return; } sprintf(buf, "Name: %s. Vnum: %d.\n\r", victim->name, victim->pIndexData->vnum); send_to_char(C_DEFAULT, buf, ch); sprintf(buf, "Short description: %s.\n\rLong description: %s", victim->short_descr, victim->long_descr[0] != '\0' ? victim->long_descr : "(none).\n\r"); send_to_char(C_DEFAULT, buf, ch); sprintf(buf, "Hp: %d/%d(%d). Mana: %d/%d(%d). Move: %d/%d(%d).\n\r", victim->hit, victim->perm_hit, MAX_HIT(victim), victim->mana, victim->perm_mana, MAX_MANA(victim), victim->move, victim->perm_move, MAX_MOVE(victim)); send_to_char(C_DEFAULT, buf, ch); #ifdef NEW_MONEY sprintf(buf, "Lv: %d. Class: %s. Align: %d. AC: %d. Exp: %d.\n\r", victim->level, class_numbers(victim, FALSE), victim->alignment, GET_AC(victim), victim->exp); send_to_char(C_DEFAULT, buf, ch); sprintf(buf, "Gold: %d Silver: %d Copper: %d.\n\r", victim->money.gold, victim->money.silver, victim->money.copper); send_to_char(C_DEFAULT, buf, ch); #else sprintf(buf, "Lv: %d. Class: %s. Align: %d. AC: %d. Gold: %d. Exp: %d.\n\r", victim->level, class_numbers(victim, FALSE), victim->alignment, GET_AC(victim), victim->gold, victim->exp); send_to_char(C_DEFAULT, buf, ch); #endif for (mprg = victim->pIndexData->mobprogs; mprg != NULL; mprg = mprg->next) { sprintf(buf, ">%s %s\n\r%s\n\r\n\r", mprog_type_to_name(mprg->type), mprg->arglist, mprg->comlist); send_to_char(C_DEFAULT, buf, ch); } return; }