void do_repair( CHAR_DATA * ch, char *argument ) { CHAR_DATA *keeper = NULL; OBJ_DATA *obj = NULL; char fixstr[MAX_STRING_LENGTH]; char fixstr2[MAX_STRING_LENGTH]; int maxgold = 0; if( argument[0] == '\0' ) { send_to_char( "Repair what?\r\n", ch ); return; } if( ( keeper = find_fixer( ch ) ) == NULL ) return; maxgold = keeper->top_level * 10; switch ( keeper->pIndexData->rShop->shop_type ) { default: case SHOP_FIX: sprintf( fixstr, "%s", "repair" ); sprintf( fixstr2, "%s", "repairs" ); break; case SHOP_RECHARGE: sprintf( fixstr, "%s", "recharge" ); sprintf( fixstr2, "%s", "recharges" ); break; } if( !strcmp( argument, "all" ) ) { for( obj = ch->first_carrying; obj; 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 ) ) repair_one_obj( ch, keeper, obj, argument, maxgold, fixstr, fixstr2 ); } return; } if( ( obj = get_obj_carry( ch, argument ) ) == NULL ) { act( AT_TELL, "$n tells you 'You don't have that item.'", keeper, NULL, ch, TO_VICT ); ch->reply = keeper; return; } repair_one_obj( ch, keeper, obj, argument, maxgold, fixstr, fixstr2 ); }
void do_appraise( CHAR_DATA *ch, char *argument ) { char buf[MAX_STRING_LENGTH]; char arg[MAX_INPUT_LENGTH]; CHAR_DATA *keeper; OBJ_DATA *obj; int cost; char *fixstr; one_argument( argument, arg ); if ( arg[0] == '\0' ) { send_to_char( "Appraise what?\n\r", ch ); return; } if ( ( keeper = find_fixer( ch ) ) == NULL ) return; switch( keeper->pIndexData->rShop->shop_type ) { default: case SHOP_FIX: fixstr = "repair"; break; case SHOP_RECHARGE: fixstr = "recharge"; break; } if ( !strcmp( arg, "all") ) { appraise_all( ch, keeper, fixstr ); return; } if ( ( obj = get_obj_carry( ch, arg ) ) == NULL ) { act( AT_TELL, "$n tells you 'You don't have that item.'", keeper, NULL, ch, TO_VICT ); ch->reply = keeper; return; } if ( !can_drop_obj( ch, obj ) ) { send_to_char( "You can't let go of it.\n\r", ch ); return; } 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 ); return; } sprintf( buf, "$N tells you, 'It will cost %d credit%s to %s that...'", cost, cost == 1 ? "" : "s", fixstr ); act( AT_TELL, buf, ch, NULL, keeper, TO_CHAR ); if ( cost > ch->gold ) act( AT_TELL, "$N tells you, 'Which I see you can't afford.'", ch, NULL, keeper, TO_CHAR ); return; }