void show_pfiles (CHAR_DATA *ch, char *x) { DIR *dp; struct dirent *dentry; char directory_name[100]; sh_int count = 0; ch_printf( ch, "&w&W&W&CPfiles Starting With %s\n\r", capitalize(x) ); ch_printf( ch, "&B-----------------------\n\r" ); sprintf( directory_name, "%s%s", PLAYER_DIR, x ); dp = opendir( directory_name ); dentry = readdir( dp ); while ( dentry ) { if ( dentry->d_name[0] != '.' && str_suffix(".home", dentry->d_name) && str_suffix(".clone", dentry->d_name) ) { ch_printf(ch, "&O%s&w&W&W\n\r\n\r", dentry->d_name); count++; } dentry = readdir( dp ); } closedir( dp ); if ( count == 0 ) { send_to_char("&RThere are no pfiles beginning with that letter!&w&W&W\n\r", ch); } else { ch_printf(ch, "&WTotal %s Pfiles: &R%d&w&W&W\n\r", capitalize(x), count); } ch_printf( ch, "&B-----------------------" ); return; }
/* File read/write code redone using standard Smaug I/O routines - Samson 9-12-98 */ void do_finger( CHAR_DATA *ch, char *argument ) { CHAR_DATA *victim; if( IS_NPC(ch) ) { send_to_char( "Mobs can't use the finger command.\n\r", ch ); return; } if ( argument[0] == '\0' ) { send_to_char("Finger whom?\n\r", ch ); return; } victim = get_char_world(ch, argument); if ( ( victim == NULL ) || (!victim) ) { read_finger( ch, argument ); return; } if ( IS_IMMORTAL(victim) && !IS_IMMORTAL(ch) ) { send_to_char( "Cannot finger an immortal.\n\r", ch ); return; } /* if ( ( ch->top_level < victim->top_level && ch->top_level < LEVEL_INFINITE ) && IS_IMMORTAL(ch) ) { send_to_char( "Cannot finger an immortal above your own level.\n\r", ch ); return; } */ if ( IS_NPC( victim ) ) { read_finger( ch, argument ); return; } if ( !can_see( ch, victim ) ) { send_to_char("They aren't here.\n\r", ch ); return; } send_to_char("&w Finger Info\n\r", ch); send_to_char(" -----------\n\r", ch); ch_printf(ch, "&wName : &G%-20s &wAge: &G%d\n\r", victim->name, victim->pcage ); ch_printf(ch, "&wSex : &G%-20s\n\r", victim->sex == SEX_MALE ? "Male" : victim->sex == SEX_FEMALE ? "Female" : "Neutral" ); ch_printf(ch, "&wTitle: &G%s\n\r", victim->pcdata->title ); ch_printf(ch, "&wHomepage: &G%s\n\r", victim->pcdata->homepage ? victim->pcdata->homepage : "None" ); // ch_printf(ch, "&wClan: &G%s\n\r", victim->pcdata->clan ? victim->pcdata->clan->name : "Unclanned" ); ch_printf(ch, "&wLast on: &G%s\n\r", (char *) ctime( &ch->logon ) ); return; }
void do_timezone( CHAR_DATA* ch, const char* argument) { int i; if( IS_NPC( ch ) ) return; if( !argument || argument[0] == '\0' ) { ch_printf( ch, "%-6s %-30s (%s)\r\n", "Name", "City/Zone Crosses", "Time" ); send_to_char( "-------------------------------------------------------------------------\r\n", ch ); for( i = 0; i < MAX_TZONE; i++ ) { ch_printf( ch, "%-6s %-30s (%s)\r\n", tzone_table[i].name, tzone_table[i].zone, c_time( current_time, i ) ); } send_to_char( "-------------------------------------------------------------------------\r\n", ch ); return; } i = tzone_lookup( argument ); if( i == -1 ) { send_to_char( "That time zone does not exists. Make sure to use the exact name.\r\n", ch ); return; } ch->pcdata->timezone = i; ch_printf( ch, "Your time zone is now %s %s (%s)\r\n", tzone_table[i].name, tzone_table[i].zone, c_time( current_time, i ) ); }
void scan_forcers( CHAR_DATA *ch ) { DIR *dp; struct dirent *dentry; char directory_name[100]; sh_int alpha_loop; ch_printf( ch, "&w&W&W&CForcers&w&W&W\n\r"); ch_printf( ch, "&B-----------------------&w&W&W\n\r" ); for ( alpha_loop = 0; alpha_loop <= 25; alpha_loop++ ) { sprintf( directory_name, "%s%c", PLAYER_DIR, 'a' + alpha_loop ); dp = opendir( directory_name ); dentry = readdir( dp ); while ( dentry ) { if ( dentry->d_name[0] != '.' && str_suffix(".home1", dentry->d_name) && str_suffix(".home2", dentry->d_name) && str_suffix(".home3", dentry->d_name) && str_suffix(".clone", dentry->d_name) ) { read_fpfile( ch, directory_name, dentry->d_name); } dentry = readdir( dp ); } closedir( dp ); } ch_printf( ch, "&B-----------------------&w&W&W\n\r" ); return; }
/* For exit flags */ void redit_disp_exit_flag_menu( DESCRIPTOR_DATA *d ) { EXIT_DATA *pexit = d->character->spare_ptr; char buf[MSL]; int x; write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 ); for ( x = 0; x < MAX_EXIT; x++ ) { if ( (x == EXIT_RES1) || (x == EXIT_RES2) || (x == EXIT_PORTAL) ) continue; ch_printf( d->character, "&g%2d&w) %-20.20s\r\n", x+1, code_name(NULL, x, CODE_EXIT) ); } buf[0] = '\0'; for ( x = 0; x < MAX_EXIT; x++ ) { if ( HAS_BIT(pexit->flags, x) ) { strcat( buf, code_name(NULL, x, CODE_EXIT) ); strcat( buf, " " ); } } ch_printf( d->character, "\r\nExit flags: &c%s&w\r\n" "Enter room flags, 0 to quit: ", buf ); OLC_MODE(d) = REDIT_EXIT_FLAGS; }
void free_game( GAME_BOARD_DATA * board ) { if ( !board ) return; #ifdef IMC if ( board->type == TYPE_IMC ) { imc_send_chess( board->player1 ? board->player1 : NULL, board->player2, "stop" ); STRFREE( board->player2 ); } #endif if ( board->player1 ) { if ( CHAR_DATA * ch = get_char_world( supermob, board->player1 ) ) // Added for bugfix - Findecano 23/11/07 { ch_printf( ch, "The game has been stopped at %d total moves.\r\n", board->turn ); ch->pcdata->game_board = NULL; } } if ( board->player2 ) { if ( CHAR_DATA * ch = get_char_world( supermob, board->player2 ) ) // Added for bugfix - Findecano 23/11/07 { ch_printf( ch, "The game has been stopped at %d total moves.\r\n", board->turn ); ch->pcdata->game_board = NULL; } } STRFREE( board->player1 ); STRFREE( board->player2 ); DISPOSE( board ); }
void do_report( CHAR_DATA * ch, const char *argument ) { char buf[MAX_INPUT_LENGTH]; if ( IS_NPC( ch ) && ch->fighting ) return; if ( IS_AFFECTED( ch, AFF_POSSESS ) ) { send_to_char( "You can't do that in your current state of mind!\r\n", ch ); return; } if ( IS_VAMPIRE( ch ) ) ch_printf( ch, "You report: %d/%d hp %d/%d blood %d/%d mv %d xp.\r\n", ch->hit, ch->max_hit, ch->pcdata->condition[COND_BLOODTHIRST], 10 + ch->level, ch->move, ch->max_move, ch->exp ); else ch_printf( ch, "You report: %d/%d hp %d/%d mana %d/%d mv %d xp.\r\n", ch->hit, ch->max_hit, ch->mana, ch->max_mana, ch->move, ch->max_move, ch->exp ); if ( IS_VAMPIRE( ch ) ) snprintf( buf, MAX_INPUT_LENGTH, "$n reports: %d/%d hp %d/%d blood %d/%d mv %d xp.\r\n", ch->hit, ch->max_hit, ch->pcdata->condition[COND_BLOODTHIRST], 10 + ch->level, ch->move, ch->max_move, ch->exp ); else snprintf( buf, MAX_INPUT_LENGTH, "$n reports: %d/%d hp %d/%d mana %d/%d mv %d xp.", ch->hit, ch->max_hit, ch->mana, ch->max_mana, ch->move, ch->max_move, ch->exp ); act( AT_REPORT, buf, ch, NULL, NULL, TO_ROOM ); return; }
void do_time( CHAR_DATA* ch, const char* argument) { HOLIDAY_DATA *holiday; extern char str_boot_time[]; // Uncomment if you have Samson's Pfile Cleanup Snippet installed. //char buf[MSL]; const char *suf; short day; day = time_info.day + 1; if( day > 4 && day < 20 ) suf = "th"; else if( day % 10 == 1 ) suf = "st"; else if( day % 10 == 2 ) suf = "nd"; else if( day % 10 == 3 ) suf = "rd"; else suf = "th"; ch_printf( ch, "&wIt is &W%d&w o'clock &W%s&w, Day of &W%s&w,&W %d%s&w day in the Month of &W%s&w.\r\n" "&wIt is the season of %s&w, in the year &W%d&w.\r\n" "&wThe mud started up at : &W %s\r\n" "&wThe system time : &W %s\r\n", ( time_info.hour % sysdata.hournoon == 0 ) ? sysdata.hournoon : time_info.hour % sysdata.hournoon, time_info.hour >= sysdata.hournoon ? "pm" : "am", day_name[( time_info.day ) % sysdata.daysperweek], day, suf, month_name[time_info.month], season_name[time_info.season], time_info.year, str_boot_time, c_time( current_time, -1 ) ); ch_printf( ch, "&wYour local time : &W %s&D\r\n", c_time( current_time, ch->pcdata->timezone ) ); holiday = get_holiday( time_info.month, day - 1 ); if( holiday != NULL ) ch_printf( ch, "&wIt's a holiday today:&W %s\r\n", holiday->name ); if( !IS_NPC( ch ) ) { if( day == ch->pcdata->day + 1 && time_info.month == ch->pcdata->month ) send_to_char( "&WToday is your &Pb&pi&Yr&Oth&Yd&pa&Py&R!&D\r\n", ch ); } /* Uncomment if you have Samson's Pfile Cleanup Snippet installed. if( IS_IMMORTAL( ch ) && sysdata.CLEANPFILES == TRUE ) { long ptime, curtime; ptime = ( long int )( new_pfile_time_t ); curtime = ( long int )( current_time ); buf[0] = '\0'; sec_to_hms( ptime - curtime, buf ); ch_printf( ch, "&wThe next pfile cleanup is in&W %s&w.&D\r\n", buf ); } */ return; }
/* -Thoric * Display your current exp, level, and surrounding level exp requirements */ void do_level( CHAR_DATA * ch, const char *argument ) { int ability; for( ability = 0; ability < MAX_ABILITY; ability++ ) if( ability != FORCE_ABILITY || ch->skill_level[FORCE_ABILITY] > 1 ) ch_printf( ch, "%-15s Level: %-3d Max: %-3d Exp: %-10ld Next: %-10ld\r\n", ability_name[ability], ch->skill_level[ability], max_level( ch, ability ), ch->experience[ability], exp_level( ch->skill_level[ability] + 1 ) ); else ch_printf( ch, "%-15s Level: %-3d Max: ??? Exp: ??? Next: ???\r\n", ability_name[ability], ch->skill_level[ability], ch->experience[ability] ); }
/* * stampa al pg il suo stato attuale di gioco */ void show_status( CHAR_DATA *ch, CHESSBOARD_DATA *board ) { if ( !ch ) { send_log( NULL, LOG_BUG, "print_status: ch passato è NULL" ); return; } if ( !board ) { send_to_char( ch, "Non sto giocando a nessuna partita di scacchi.\r\n" ); return; } if ( !board->player1 ) send_to_char( ch, "Non ho nessun giocatore per i pezzi neri con cui gareggiare.\r\n" ); else if ( board->player1 == ch ) send_to_char( ch, "Sono io il giocatore dei pezzi neri.\r\n" ); else ch_printf( ch, "%s è il giocatore che tiene i pezzi neri.\r\n", board->player1->name ); if ( king_in_possible_checkmate(board, PIECE_KING, COLOR_BLACK) ) send_to_char( ch, "Il re nero potrebbe essere sotto scacco matto.\r\n" ); else if ( king_in_check(board, PIECE_KING, COLOR_BLACK) > 0 ) send_to_char( ch, "Il re nero è sotto scacco.\r\n" ); if ( !board->player2 ) send_to_char( ch, "Non ho nessun giocatore per i pezzi bianchi con cui gareggiare.\r\n" ); else if ( board->player2 == ch ) send_to_char( ch, "Sono io il giocatore dei pezzi bianchi.\r\n" ); else ch_printf( ch, "%s è il giocatore che tiene i pezzi bianchi.\r\n", board->player2->name ); if ( king_in_possible_checkmate(board, PIECE_KING, COLOR_WHITE) ) send_to_char( ch, "Il re bianco potrebbe essere sotto scacco matto.\r\n" ); else if ( king_in_check(board, PIECE_KING, COLOR_WHITE) > 0 ) send_to_char( ch, "Il re bianco è sotto scacco.\r\n" ); if ( !board->player2 || !board->player1 ) return; if ( board->moves < 0 ) send_to_char( ch, "Il gioco non è ancora iniziato.\r\n" ); else ch_printf( ch, "%d turni.\r\n", board->moves ); if ( board->turn == ch ) send_to_char( ch, "E' il mio turno.\r\n" ); else ch_printf( ch, "E' il turno di %s.\r\n", board->turn->name ); }
DO_RET do_calendar( CHAR_DATA *ch, char *argument ) { set_char_color( AT_PLAIN, ch ); send_to_char( ch, get_calendar_string() ); if ( IS_ADMIN(ch) ) { /* (FF) bisognerebbe farle bene rimandando un \r\n ma bisogna togliere quindi a tutti l'\n finale. */ ch_printf( ch, "\r\n%s : %21.21s\r\n", MUD_NAME, str_boot_time ); ch_printf( ch, "Ora Locale Server: %21.21s\r\n", friendly_ctime(¤t_time) ); ch_printf( ch, "Prossimo reboot previsto: %s", reboot_time ); } }
/* For exits */ void redit_disp_exit_menu( DESCRIPTOR_DATA *d ) { ROOM_DATA *room = d->character->dest_buf; EXIT_DATA *pexit; int cnt; OLC_MODE(d) = REDIT_EXIT_MENU; write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 ); for ( cnt = 0, pexit = room->first_exit; pexit; pexit = pexit->next ) { ch_printf( d->character, "&g%2d&w) %-10.10s to %-5d. Key: %d Keywords: %s Flags: %s.\r\n", ++cnt, code_name(NULL, pexit->vdir, CODE_DIR), (pexit->to_room) ? pexit->to_room->vnum : 0, pexit->key, code_bit(NULL, pexit->flags, CODE_EXIT), (VALID_STR(pexit->keyword)) ? pexit->keyword : "(none)" ); } if ( room->first_exit ) send_to_char( d->character, "\r\n" ); send_to_char( d->character, "&gA&w) Add a new exit\r\n" ); send_to_char( d->character, "&gR&w) Remove an exit\r\n" ); send_to_char( d->character, "&gQ&w) Quit\r\n" ); send_to_char( d->character, "\r\nEnter choice: " ); }
void end_tag( void ) { DESCRIPTOR_DATA *d, *d_next; tag_game.status = TAG_OFF; tag_game.timer = -1; tag_game.next = number_range( 30, 50 ); tag_game.playing = 0; for ( d = first_descriptor; d; d = d_next ) { d_next = d->next; if ( d->connected != CON_PLAYING || !d->character || !d->character->in_room ) continue; if ( d->character->in_room->vnum < FTAG_MIN_VNUM - 1 || d->character->in_room->vnum > FTAG_MAX_VNUM ) continue; xREMOVE_BIT( d->character->act, PLR_RED ); xREMOVE_BIT( d->character->act, PLR_BLUE ); xREMOVE_BIT( d->character->act, PLR_FROZEN ); xREMOVE_BIT( d->character->act, PLR_PLAYING ); xREMOVE_BIT( d->character->act, PLR_WAITING ); xREMOVE_BIT( d->character->act, PLR_PKSAFE ); char_from_room( d->character ); char_to_room( d->character, get_room_index( ROOM_VNUM_TEMPLE ) ); do_look( d->character, ( char * ) "auto" ); act( AT_TELL, "¡$n cae del cielo!\r\n", d->character, NULL, NULL, TO_ROOM ); d->character->quest_curr += 10; d->character->quest_accum += 10; ch_printf( d->character, "¡Ganas 10 puntos de gloria por participar en el evento de congelación!\r\n" ); } }
void send_timer( struct timerset *vtime, CHAR_DATA * ch ) { struct timeval ntime; int carry; if( vtime->num_uses == 0 ) return; ntime.tv_sec = vtime->total_time.tv_sec / vtime->num_uses; carry = ( vtime->total_time.tv_sec % vtime->num_uses ) * 1000000; ntime.tv_usec = ( vtime->total_time.tv_usec + carry ) / vtime->num_uses; ch_printf( ch, "Has been used %d times this boot.\r\n", vtime->num_uses ); ch_printf( ch, "Time (in secs): min %ld.%06ld; avg: %ld.%06ld; max %ld.%06ld" "\r\n", vtime->min_time.tv_sec, vtime->min_time.tv_usec, ntime.tv_sec, ntime.tv_usec, vtime->max_time.tv_sec, vtime->max_time.tv_usec ); return; }
/* * New stat and statreport command coded by Morphina * Bug fixes by Shaddai */ void do_statreport( CHAR_DATA* ch, const char* argument) { char buf[MAX_STRING_LENGTH]; if( IS_NPC( ch ) ) { send_to_char( "Huh?\r\n", ch ); return; } if( IS_VAMPIRE( ch ) ) { ch_printf( ch, "You report: %d/%d hp %d/%d blood %d/%d mv %d xp.\r\n", ch->hit, ch->max_hit, ch->pcdata->condition[COND_BLOODTHIRST], 10 + ch->level, ch->move, ch->max_move, ch->exp ); snprintf( buf, MAX_STRING_LENGTH, "$n reports: %d/%d hp %d/%d blood %d/%d mv %d xp.", ch->hit, ch->max_hit, ch->pcdata->condition[COND_BLOODTHIRST], 10 + ch->level, ch->move, ch->max_move, ch->exp ); act( AT_REPORT, buf, ch, NULL, NULL, TO_ROOM ); } else { ch_printf( ch, "You report: %d/%d hp %d/%d mana %d/%d mv %d xp.\r\n", ch->hit, ch->max_hit, ch->mana, ch->max_mana, ch->move, ch->max_move, ch->exp ); snprintf( buf, MAX_STRING_LENGTH, "$n reports: %d/%d hp %d/%d mana %d/%d mv %d xp.", ch->hit, ch->max_hit, ch->mana, ch->max_mana, ch->move, ch->max_move, ch->exp ); act( AT_REPORT, buf, ch, NULL, NULL, TO_ROOM ); } ch_printf( ch, "Your base stats: %-2d str %-2d wis %-2d int %-2d dex %-2d con %-2d cha %-2d lck.\r\n", ch->perm_str, ch->perm_wis, ch->perm_int, ch->perm_dex, ch->perm_con, ch->perm_cha, ch->perm_lck ); snprintf( buf, MAX_STRING_LENGTH, "$n's base stats: %-2d str %-2d wis %-2d int %-2d dex %-2d con %-2d cha %-2d lck.", ch->perm_str, ch->perm_wis, ch->perm_int, ch->perm_dex, ch->perm_con, ch->perm_cha, ch->perm_lck ); act( AT_REPORT, buf, ch, NULL, NULL, TO_ROOM ); ch_printf( ch, "Your current stats: %-2d str %-2d wis %-2d int %-2d dex %-2d con %-2d cha %-2d lck.\r\n", get_curr_str( ch ), get_curr_wis( ch ), get_curr_int( ch ), get_curr_dex( ch ), get_curr_con( ch ), get_curr_cha( ch ), get_curr_lck( ch ) ); snprintf( buf, MAX_STRING_LENGTH, "$n's current stats: %-2d str %-2d wis %-2d int %-2d dex %-2d con %-2d cha %-2d lck.", get_curr_str( ch ), get_curr_wis( ch ), get_curr_int( ch ), get_curr_dex( ch ), get_curr_con( ch ), get_curr_cha( ch ), get_curr_lck( ch ) ); act( AT_REPORT, buf, ch, NULL, NULL, TO_ROOM ); return; }
/* -Thoric * Display your current exp, level, and surrounding level exp requirements */ void do_level( CHAR_DATA * ch, const char *argument ) { char buf[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH]; int x, lowlvl, hilvl; if ( ch->level == 1 ) lowlvl = 1; else lowlvl = UMAX( 2, ch->level - 5 ); hilvl = URANGE( ch->level, ch->level + 5, MAX_LEVEL ); set_char_color( AT_SCORE, ch ); ch_printf( ch, "\r\nExperience required, levels %d to %d:\r\n______________________________________________\r\n\r\n", lowlvl, hilvl ); snprintf( buf, MAX_STRING_LENGTH, " exp (Current: %12s)", num_punct( ch->exp ) ); snprintf( buf2, MAX_STRING_LENGTH, " exp (Needed: %12s)", num_punct( exp_level( ch, ch->level + 1 ) - ch->exp ) ); for ( x = lowlvl; x <= hilvl; x++ ) ch_printf( ch, " (%2d) %12s%s\r\n", x, num_punct( exp_level( ch, x ) ), ( x == ch->level ) ? buf : ( x == ch->level + 1 ) ? buf2 : " exp" ); send_to_char( "______________________________________________\r\n", ch ); }
void appraise_all( CHAR_DATA * ch, CHAR_DATA * keeper, const char *fixstr ) { OBJ_DATA *obj = NULL; char buf[MAX_STRING_LENGTH], *pbuf = buf; int cost = 0, total = 0; for( obj = ch->first_carrying; obj != NULL; obj = obj->next_content ) { if( obj->wear_loc == WEAR_NONE && can_see_obj( ch, obj ) && ( obj->item_type == ITEM_ARMOR || obj->item_type == ITEM_WEAPON || obj->item_type == ITEM_DEVICE ) ) { if( !can_drop_obj( ch, obj ) ) { ch_printf( ch, "You can't let go of %s.\r\n", obj->name ); } else if( ( cost = get_repaircost( keeper, obj ) ) < 0 ) { if( cost != -2 ) { act( AT_TELL, "$n tells you, 'Sorry, I can't do anything with $p.'", keeper, obj, ch, TO_VICT ); } else { act( AT_TELL, "$n tells you, '$p looks fine to me!'", keeper, obj, ch, TO_VICT ); } } else { sprintf( buf, "$N tells you, 'It will cost %d credit%s to %s %s'", cost, cost == 1 ? "" : "s", fixstr, obj->name ); act( AT_TELL, buf, ch, NULL, keeper, TO_CHAR ); total += cost; } } } if( total > 0 ) { send_to_char( "\r\n", ch ); sprintf( buf, "$N tells you, 'It will cost %d credit%s in total.'", total, cost == 1 ? "" : "s" ); act( AT_TELL, buf, ch, NULL, keeper, TO_CHAR ); strcpy( pbuf, "$N tells you, 'Remember there is a 10% surcharge for repair all.'" ); act( AT_TELL, buf, ch, NULL, keeper, TO_CHAR ); } }
void do_prompt( CHAR_DATA * ch, const char *argument ) { char arg[MAX_INPUT_LENGTH]; set_char_color( AT_GREY, ch ); if ( IS_NPC( ch ) ) { send_to_char( "NPC's can't change their prompt..\r\n", ch ); return; } smash_tilde( argument ); one_argument( argument, arg ); if ( !*arg || !str_cmp( arg, "display" ) ) { send_to_char( "Your current prompt string:\r\n", ch ); set_char_color( AT_WHITE, ch ); ch_printf( ch, "%s\r\n", !str_cmp( ch->pcdata->prompt, "" ) ? "(default prompt)" : ch->pcdata->prompt ); set_char_color( AT_GREY, ch ); send_to_char( "Type 'help prompt' for information on changing your prompt.\r\n", ch ); return; } send_to_char( "Replacing old prompt of:\r\n", ch ); set_char_color( AT_WHITE, ch ); ch_printf( ch, "%s\r\n", !str_cmp( ch->pcdata->prompt, "" ) ? "(default prompt)" : ch->pcdata->prompt ); if ( ch->pcdata->prompt ) STRFREE( ch->pcdata->prompt ); char prompt[128]; mudstrlcpy( prompt, argument, 128 ); /* * Can add a list of pre-set prompts here if wanted.. perhaps * 'prompt 1' brings up a different, pre-set prompt */ if ( !str_cmp( arg, "default" ) ) ch->pcdata->prompt = STRALLOC( "" ); else ch->pcdata->prompt = STRALLOC( prompt ); return; }
void do_shopstat( CHAR_DATA *ch, char *argument ) { SHOP_DATA *shop; MOB_INDEX_DATA *mob; int vnum; if ( argument[0] == '\0' ) { send_to_char( "Usage: shopstat <keeper vnum>\n\r", ch ); return; } vnum = atoi( argument ); if ( (mob = get_mob_index(vnum)) == NULL ) { send_to_char( "Mobile not found.\n\r", ch ); return; } if ( !mob->pShop ) { send_to_char( "This mobile doesn't keep a shop.\n\r", ch ); return; } shop = mob->pShop; ch_printf( ch, "Keeper: %d %s\n\r", shop->keeper, mob->short_descr ); ch_printf( ch, "buy0 [%s] buy1 [%s] buy2 [%s] buy3 [%s] buy4 [%s]\n\r", o_types[shop->buy_type[0]], o_types[shop->buy_type[1]], o_types[shop->buy_type[2]], o_types[shop->buy_type[3]], o_types[shop->buy_type[4]] ); ch_printf( ch, "Profit: buy %3d%% sell %3d%%\n\r", shop->profit_buy, shop->profit_sell ); ch_printf( ch, "Hours: open %2d close %2d\n\r", shop->open_hour, shop->close_hour ); return; }
/* * Nice fancy redone Extra Description stuff :) */ void redit_disp_extradesc_prompt_menu( DESCRIPTOR_DATA *d ) { EXTRA_DESCR_DATA *ed; ROOM_DATA *room = d->character->dest_buf; int counter = 0; for ( ed = room->first_extradescr; ed; ed = ed->next ) ch_printf( d->character, "&g%2d&w) %-40.40s\r\n", counter++, ed->keyword ); send_to_char( d->character, "\r\nWhich extra description do you want to edit? " ); }
void redit_disp_exit_dirs( DESCRIPTOR_DATA *d ) { int x; write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 ); for ( x = 0; x < MAX_DIR; x++ ) ch_printf( d->character, "&g%2d&w) %s\r\n", x, code_name(NULL, x, CODE_DIR) ); send_to_char( d->character, "\r\nChoose a direction: " ); }
void do_stat( CHAR_DATA * ch, const char *argument ) { if ( IS_NPC( ch ) ) { send_to_char( "Huh?\r\n", ch ); return; } if ( IS_VAMPIRE( ch ) ) ch_printf( ch, "You report: %d/%d hp %d/%d blood %d/%d mv %d xp.\r\n", ch->hit, ch->max_hit, ch->pcdata->condition[COND_BLOODTHIRST], 10 + ch->level, ch->move, ch->max_move, ch->exp ); else ch_printf( ch, "You report: %d/%d hp %d/%d mana %d/%d mv %d xp.\r\n", ch->hit, ch->max_hit, ch->mana, ch->max_mana, ch->move, ch->max_move, ch->exp ); ch_printf( ch, "Your base stats: %-2d str %-2d wis %-2d int %-2d dex %-2d con %-2d cha %-2d lck.\r\n", ch->perm_str, ch->perm_wis, ch->perm_int, ch->perm_dex, ch->perm_con, ch->perm_cha, ch->perm_lck ); ch_printf( ch, "Your current stats: %-2d str %-2d wis %-2d int %-2d dex %-2d con %-2d cha %-2d lck.\r\n", get_curr_str( ch ), get_curr_wis( ch ), get_curr_int( ch ), get_curr_dex( ch ), get_curr_con( ch ), get_curr_cha( ch ), get_curr_lck( ch ) ); return; }
/* For room flags */ void redit_disp_flag_menu( DESCRIPTOR_DATA *d ) { ROOM_DATA *room = d->character->dest_buf; int x; int columns = 0; write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 ); for ( x = 0; x < MAX_ROOM; x++ ) { if ( x == 28 || x == 29 || x == 31 ) /* (FF) se per caso venissero convertiti i flag di room in ext cambiare questi numeri con le rispettive etichette di enumerazione */ continue; ch_printf( d->character, "&g%2d&w) %-20.20s ", x+1, code_name(NULL, x, CODE_ROOM) ); if ( !(++columns % 2) ) send_to_char( d->character, "\r\n" ); } ch_printf( d->character, "\r\nRoom flags: &c%s&w\r\nEnter room flags, 0 to quit : ", code_bit(NULL, room->flags, CODE_ROOM) ); OLC_MODE( d ) = REDIT_FLAGS; }
void redit_disp_exit_edit( DESCRIPTOR_DATA *d ) { char flags[MSL]; EXIT_DATA *pexit = d->character->spare_ptr; int x; flags[0] = '\0'; for ( x = 0; x < MAX_EXIT; x++ ) { if ( pexit->flags && HAS_BIT(pexit->flags, x) ) { strcat( flags, code_name(NULL, x, CODE_EXIT) ); strcat( flags, " " ); } } OLC_MODE(d) = REDIT_EXIT_EDIT; write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 ); ch_printf( d->character, "&g1&w) Direction : &c%s\r\n", code_name(NULL, pexit->vdir, CODE_DIR) ); ch_printf( d->character, "&g2&w) To Vnum : &c%d\r\n", (pexit->to_room) ? pexit->to_room->vnum : -1 ); ch_printf( d->character, "&g3&w) Key : &c%d\r\n", pexit->key ); ch_printf( d->character, "&g4&w) Keyword : &c%s\r\n", (VALID_STR(pexit->keyword)) ? pexit->keyword : "(none)" ); ch_printf( d->character, "&g5&w) Flags : &c%s\r\n", (VALID_STR(flags)) ? flags : "(none)" ); ch_printf( d->character, "&g6&w) Description: &c%s\r\n", (VALID_STR(pexit->description)) ? pexit->description : "(none)" ); send_to_char( d->character, "&gQ&w) Quit\r\n" ); send_to_char( d->character, "\r\nEnter choice: " ); }
void do_repairstat( CHAR_DATA *ch, char *argument ) { REPAIR_DATA *repair; MOB_INDEX_DATA *mob; int vnum; if ( argument[0] == '\0' ) { send_to_char( "Usage: repairstat <keeper vnum>\n\r", ch ); return; } vnum = atoi( argument ); if ( (mob = get_mob_index(vnum)) == NULL ) { send_to_char( "Mobile not found.\n\r", ch ); return; } if ( !mob->rShop ) { send_to_char( "This mobile doesn't keep a repair shop.\n\r", ch ); return; } repair = mob->rShop; ch_printf( ch, "Keeper: %d %s\n\r", repair->keeper, mob->short_descr ); ch_printf( ch, "fix0 [%s] fix1 [%s] fix2 [%s]\n\r", o_types[repair->fix_type[0]], o_types[repair->fix_type[1]], o_types[repair->fix_type[2]] ); ch_printf( ch, "Profit: %3d%% Type: %d\n\r", repair->profit_fix, repair->shop_type ); ch_printf( ch, "Hours: open %2d close %2d\n\r", repair->open_hour, repair->close_hour ); return; }
/* Online slay editor, show details of a slaytype - Samson 8-3-98 */ void do_showslay( CHAR_DATA * ch, char *argument ) { SLAY_DATA *slay; if( IS_NPC( ch ) ) { send_to_char( "Huh?\r\n", ch ); return; } if( argument[0] == '\0' ) { send_to_char( "Usage: showslay <slaytype>\r\n", ch ); return; } if( ( slay = get_slay( argument ) ) == NULL ) { send_to_char( "No such slaytype.\r\n", ch ); return; } ch_printf( ch, "\r\nSlaytype: %s\r\n", slay->type ); ch_printf( ch, "Owner: %s\r\n", slay->owner ); ch_printf( ch, "Color: %d\r\n", slay->color ); ch_printf( ch, "&RCmessage: \r\n%s", slay->cmsg ); ch_printf( ch, "\r\n&YVmessage: \r\n%s", slay->vmsg ); ch_printf( ch, "\r\n&GRmessage: \r\n%s", slay->rmsg ); return; }
void do_track( CHAR_DATA* ch, const char* argument) { CHAR_DATA *vict; char arg[MAX_INPUT_LENGTH]; int dir, maxdist; if( !IS_NPC( ch ) && ch->pcdata->learned[gsn_track] <= 0 ) { send_to_char( "You do not know of this skill yet.\r\n", ch ); return; } one_argument( argument, arg ); if( arg[0] == '\0' ) { send_to_char( "Whom are you trying to track?\r\n", ch ); return; } WAIT_STATE( ch, skill_table[gsn_track]->beats ); if( !( vict = get_char_world( ch, arg ) ) ) { send_to_char( "You can't find a trail of anyone like that.\r\n", ch ); return; } maxdist = 100 + ch->level * 30; if( !IS_NPC( ch ) ) maxdist = ( maxdist * LEARNED( ch, gsn_track ) ) / 100; dir = find_first_step( ch->in_room, vict->in_room, maxdist ); switch ( dir ) { case BFS_ERROR: send_to_char( "Hmm... something seems to be wrong.\r\n", ch ); break; case BFS_ALREADY_THERE: send_to_char( "You're already in the same room!\r\n", ch ); break; case BFS_NO_PATH: send_to_char( "You can't sense a trail from here.\r\n", ch ); learn_from_failure( ch, gsn_track ); break; default: ch_printf( ch, "You sense a trail %s from here...\r\n", dir_name[dir] ); learn_from_success( ch, gsn_track ); break; } }
void do_showcontracts( CHAR_DATA * ch, char *argument ) { CONTRACT_DATA *contract; send_to_char( "&R Target &W|&R Amount\n\r", ch ); send_to_char( "&W------------|----------\n\r", ch ); for( contract = ch->first_contract; contract; contract = contract->next_in_contract ) { ch_printf( ch, "&R%-12s&W|&R %d&W\n\r", contract->target, contract->amount ); } }
void do_balance( CHAR_DATA *ch, char *argument ) { BANK_DATA *bank; CHAR_DATA *banker; char buf[MAX_STRING_LENGTH]; if ( !( banker = find_banker( ch ) ) ) { send_to_char( "You're not in a bank!\r\n", ch ); return; } if ( IS_NPC( ch ) ) { snprintf( buf, MSL, "say Sorry, %s, we don't do business with mobs.", ch->name ); interpret( banker, buf ); return; } if ( ch->pcdata->bank == NULL ) { send_to_char( "You don't have any bank account open now.\r\n", ch ); return; } /* * Just to make sure that we are retrieving the latest bank info, not relying on the * stale bank info in pcdata struct */ bank = find_bank( ch->pcdata->bank->name ); if ( !bank ) { send_to_char( "There is no account by that name!\r\n", ch ); return; } ch_printf( ch, "&CFor the %s bank account the following funds are available:\r\n", bank->name ); ch_printf( ch, "&YThere is %d gold.\r\n", bank->gold ); ch_printf( ch, "&YThere is %d silver.\r\n", bank->silver ); ch_printf( ch, "&YThere is %d bronze.\r\n", bank->bronze ); ch_printf( ch, "&YThere is %d copper.\r\n", bank->copper ); }
void do_inventory( CHAR_DATA* ch, const char* argument) { CHAR_DATA *victim; if( !argument || argument[0] == '\0' || !IS_IMMORTAL( ch ) ) victim = ch; else { if( !( victim = get_char_world( ch, argument ) ) ) { ch_printf( ch, "There is nobody named %s online.\r\n", argument ); return; } } if( victim != ch ) ch_printf( ch, "&R%s is carrying:\r\n", IS_NPC( victim ) ? victim->short_descr : victim->name ); else send_to_char( "&RYou are carrying:\r\n", ch ); show_list_to_char( victim->first_carrying, ch, TRUE, TRUE ); return; }