Exemple #1
0
void do_mpjunk(CHAR_DATA * ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    OBJ_DATA *obj;
    OBJ_DATA *obj_next;

    one_argument(argument, arg);

    if (arg[0] == '\0')
	return;

    if (str_cmp(arg, "all") && str_prefix("all.", arg)) {
	if ((obj = get_obj_wear(ch, arg)) != NULL) {
	    unequip_char(ch, obj);
	    extract_obj(obj);
	    return;
	}
	if ((obj = get_obj_carry(ch, arg, ch)) == NULL)
	    return;
	extract_obj(obj);
    } else
	for (obj = ch->carrying; obj != NULL; obj = obj_next) {
	    obj_next = obj->next_content;
	    if (arg[3] == '\0' || is_name(&arg[4], obj->name)) {
		if (obj->wear_loc != WEAR_NONE)
		    unequip_char(ch, obj);
		extract_obj(obj);
	    }
	}

    return;

}
Exemple #2
0
void do_bank_change( Character *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    OBJ_DATA *obj;
    long amount;
    int change;
    change = 0;
  
    argument = one_argument( argument, arg );

    amount = atoi(arg);
  
    obj = get_obj_carry( ch, (char*)"bank note", ch );

	
	if ( amount < 0 )
    if ( obj->value[1] < amount )
        return;

    if ( amount < 100 )
    {
        return;
    }

    change = amount/100;
    obj->value[0] += change;
    obj->value[1] -= (change * 100);
    return;
}
Exemple #3
0
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 );
}
Exemple #4
0
bool Forge::ObtainBaseObject(ForgeContext & context, std::vector<OBJ_DATA *> & baseObjects, CHAR_DATA & ch, const char *& argument)
{
    // Get the argument
    char arg[MAX_INPUT_LENGTH];
    argument = one_argument(argument, arg);
    if (arg[0] == '\0')
    {
        send_to_char("You must specify an object from which to forge the weapon.\n", &ch);
        return false;
    }

    // Get the object
    OBJ_DATA * obj(get_obj_carry(&ch, arg, &ch));
    if (obj == NULL)
    {
        // No such object
        std::ostringstream mess;
        mess << "You are carrying no " << arg << " from which to forge the " << context.weaponInfo->name << ".\n";
        send_to_char(mess.str().c_str(), &ch);
        return false;
    }

    // Check for a metal object
    if (!material_table[obj->material].metal)
    {
        act("You only know how to work metal, and thus cannot forge with $p.", &ch, obj, NULL, TO_CHAR);
        return false;
    }

    // Check for nodestroy
    if (IS_SET(obj->extra_flags[0], ITEM_NODESTROY))
    {
        act("$p is too tough to be melted down.", &ch, obj, NULL, TO_CHAR);
        return false;
    }

    // Check for specified already
    for (size_t i(0); i < baseObjects.size(); ++i)
    {
        if (obj == baseObjects[i])
        {
            act("You cannot alloy $p with itself!", &ch, obj, NULL, TO_CHAR);
            return false;
        }
    }

    // Object checks out
    baseObjects.push_back(obj);
    context.materials.push_back(obj->material);
    context.weight += obj->weight;
    return obj;
}
Exemple #5
0
void do_mpjunk( CHAR_DATA *ch, char *argument )
{
    char      arg[ MAX_INPUT_LENGTH ];
    OBJ_DATA *obj;
    OBJ_DATA *obj_next;

    if ( !IS_NPC( ch ) )
    {
        send_to_char(C_DEFAULT, "Huh?\n\r", ch );
	return;
    }

    if ( IS_AFFECTED( ch, AFF_CHARM ) )
    {
        return;
    }

    one_argument( argument, arg );

    if ( arg[0] == '\0')
    {
        bug( "Mpjunk - No argument: vnum %d.", ch->pIndexData->vnum );
	return;
    }

    if ( str_cmp( arg, "all" ) && str_prefix( "all.", arg ) )
    {
      if ( ( obj = get_obj_wear( ch, arg ) ) != NULL )
      {
	unequip_char( ch, obj );
	extract_obj( obj );
	return;
      }
      if ( ( obj = get_obj_carry( ch, arg ) ) == NULL )
	return; 
      extract_obj( obj );
    }
    else
      for ( obj = ch->carrying; obj != NULL; obj = obj_next )
      {
        obj_next = obj->next_content;
        if ( arg[3] == '\0' || is_name( &arg[4], obj->name ) )
        {
          if ( obj->wear_loc != WEAR_NONE)
	    unequip_char( ch, obj );
          extract_obj( obj );
        } 
      }

    return;

}
Exemple #6
0
void do_mpjunk( CHAR_DATA *ch, char *argument )
{
    char      arg[ MAX_INPUT_LENGTH ];
    OBJ_DATA *obj;
    OBJ_DATA *obj_next;

    if ( !IS_NPC( ch ) )
    {
	typo_message( ch );
	return;
    }

    if ( IS_SET( ch->act , ACT_PET ) || IS_AFFECTED( ch, AFF_CHARM ) )
          return;

    one_argument( argument, arg );

    if ( arg[0] == '\0')
    {
        sprintf( log_buf, "Mpjunk - No argument: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    if ( str_cmp( arg, "all" ) && str_prefix( "all.", arg ) )
    {
      if ( ( obj = get_obj_wear( ch, arg ) ) != NULL )
      {
	unequip_char( ch, obj );
	extract_obj( obj );
	return;
      }
      if ( ( obj = get_obj_carry( ch, arg ) ) == NULL )
	return; 
      extract_obj( obj );
    }
    else
      for ( obj = ch->carrying; obj != NULL; obj = obj_next )
      {
        obj_next = obj->next_content;
        if ( arg[3] == '\0' || is_name( ch, &arg[4], obj->name ) )
        {
          if ( !IS_SET( obj->wear_loc, WEAR_NONE ) )
	    unequip_char( ch, obj );
          extract_obj( obj );
        } 
      }

    return;

}
Exemple #7
0
void do_bank_balance(Character *ch, char *argument)
{
    char buf[MAX_STRING_LENGTH];
    OBJ_DATA *obj;

    if ( ( obj = get_obj_carry( ch, (char*)"bank note", ch ) ) == NULL )
    {
	send_to_char( "You do not own a bank note.\n\r", ch );
	return;
    }

    sprintf(buf,"Balance on this note is %d gold and %d silver.\n\r", obj->value[0], obj->value[1]);
    send_to_char(buf,ch);
}
Exemple #8
0
void do_bank_close(Character *ch, char *argument)
{
    OBJ_DATA *obj;

    if ( ( obj = get_obj_carry( ch, (char*)"bank note", ch ) ) == NULL )
    {
	send_to_char( "You do not own a bank note.\n\r", ch );
	return;
    }

    ch->gold += obj->value[0];
    ch->silver += obj->value[1];
    extract_obj( obj );
    send_to_char("You withdraw all the money from your bank note and return it.\n\r",ch);
    return;
}
Exemple #9
0
void do_value( CHAR_DATA * ch, char *argument )
{
  char buf[MAX_STRING_LENGTH];
  CHAR_DATA *keeper = NULL;
  OBJ_DATA *obj = NULL;
  int cost = 0;

  if( argument[0] == '\0' )
  {
    send_to_char( "Value what?\r\n", ch );
    return;
  }

  if( ( keeper = find_keeper( ch ) ) == NULL )
    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;
  }

  if( !can_drop_obj( ch, obj ) )
  {
    send_to_char( "You can't let go of it!\r\n", ch );
    return;
  }

  if( ( cost = get_cost( ch, keeper, obj, FALSE ) ) <= 0 )
  {
    act( AT_ACTION, "$n looks uninterested in $p.", keeper, obj, ch,
	TO_VICT );
    return;
  }

  sprintf( buf, "$n tells you 'I'll give you %d credits for $p.'", cost );
  act( AT_TELL, buf, keeper, obj, ch, TO_VICT );
  ch->reply = keeper;

  return;
}
Exemple #10
0
void do_bank_open(Character *ch, char *argument)
{
    OBJ_DATA *obj;
    if ( ( obj = get_obj_carry( ch, (char*)"bank note", ch ) ) != NULL )
    {
	send_to_char( "You already own a bank note.\n\r", ch );
	return;
    }

    if (ch->gold < 10)
    {
	send_to_char("It costs 10 gold to open an account.\n\r", ch);
	return;
    }

    ch->gold -= 10;
    obj_to_char(create_object(get_obj_index(OBJ_VNUM_BANK_NOTE),0),ch);
    send_to_char("Enjoy your bank note.\n\r", ch);
    return;
}
Exemple #11
0
DO_RET do_light( CHAR_DATA *ch, char *argument )
{
	OBJ_DATA *the_pipe;

	if ( !VALID_STR(argument) )
	{
		send_to_char( ch, "Devo accendere cosa?\r\n" );
		return;
	}

	if ( ms_find_obj(ch) )
		return;

	if ( (the_pipe = get_obj_carry(ch, argument, TRUE)) == NULL )
	{
		send_to_char( ch, "Non lo sto trasportando.\r\n" );
		return;
	}

	if ( the_pipe->type != OBJTYPE_PIPE )
	{
		send_to_char( ch, "Non posso accenderlo.\r\n" );
		return;
	}

	if ( !HAS_BITINT(the_pipe->pipe->flags, PIPE_LIT) )
	{
		if ( the_pipe->pipe->draws < 1 )
		{
			act( AT_ACTION, "Tento di accendere $p.", ch, the_pipe, NULL, TO_CHAR );
			act( AT_ACTION, "$n tenta di accendere $p...", ch, the_pipe, NULL, TO_ROOM );
			return;
		}
		act( AT_ACTION, "Accendo con delicatezza $p.", ch, the_pipe, NULL, TO_CHAR );
		act( AT_ACTION, "$n delicatamente accende $p.", ch, the_pipe, NULL, TO_ROOM );
		SET_BITINT( the_pipe->pipe->flags, PIPE_LIT );
		return;
	}

	send_to_char( ch, "E' gia acceso.\r\n" );
}
Exemple #12
0
/*
 * pipe commands (light, tamp, smoke)
 */
DO_RET do_tamp( CHAR_DATA *ch, char *argument )
{
	OBJ_DATA *the_pipe;

	if ( !VALID_STR(argument) )
	{
		send_to_char( ch, "Devo comprimere cosa?\r\n" );
		return;
	}

	if ( ms_find_obj(ch) )
		return;

	the_pipe = get_obj_carry( ch, argument, TRUE );
	if ( !the_pipe )
	{
		send_to_char( ch, "Non lo sto trasportando.\r\n" );
		return;
	}

	if ( the_pipe->type != OBJTYPE_PIPE )
	{
		send_to_char( ch, "Non lo posso comprimere.\r\n" );
		return;
	}

	if ( !HAS_BITINT(the_pipe->pipe->flags, PIPE_TAMPED) )
	{
		act( AT_ACTION, "Con delicatezza comprimo $p.", ch, the_pipe, NULL, TO_CHAR );
		act( AT_ACTION, "$n con delicatezza comprime $p.", ch, the_pipe, NULL, TO_ROOM );
		SET_BITINT( the_pipe->pipe->flags, PIPE_TAMPED );
		return;
	}

	send_to_char( ch, "Non neccessita una pressione.\r\n" );
}
Exemple #13
0
/*
 * Donate Command
 */
void do_donate(CHAR_DATA *ch, char *argument) {
    char Object_Name[MAX_INPUT_LENGTH];
    ROOM_INDEX_DATA *xRoom;
    OBJ_DATA *xObject;
    int DONATION_ROOM;
    argument = one_argument(argument, Object_Name);
    if(Object_Name == '\0') {
        send_to_char("Donate WHAT Object?", ch);
        return;
    }
    if((xObject = get_obj_carry(ch, Object_Name)) == NULL) {
        send_to_char("You can't donate that item! You have not got it!", ch);
        return;
    }
    switch(xObject->item_type) {
    case ITEM_WEAPON :
        DONATION_ROOM = DONATION_ROOM_WEAPON;
        break;
    case ITEM_ARMOR  :
        DONATION_ROOM = DONATION_ROOM_ARMOR;
        break;
    default :
        DONATION_ROOM = DONATION_ROOM_REST;
        break;
    }
    if((xRoom = get_room_index(DONATION_ROOM)) == NULL) {
        bug("Donate Room Does Not Exist : %d", DONATION_ROOM);
        return;
    }
    act("$p vanishes from your hands in a pink mist.", ch, xObject, NULL, TO_CHAR);
    act("$p vanishes from $n's hands in a pink mist.", ch, xObject, NULL, TO_ROOM);
    obj_from_char(xObject);
    obj_to_room(xObject, xRoom);
    act("$p appears in a pink mist in the room.", ch, xObject, NULL, TO_ROOM);
    return;
}
Exemple #14
0
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;
}
Exemple #15
0
void do_sell( CHAR_DATA *ch, char *argument )
{
    char buf[MAX_STRING_LENGTH];
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *keeper;
    OBJ_DATA *obj;
    int cost;

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
	send_to_char( "Sell what?\n\r", ch );
	return;
    }

    if ( ( keeper = find_keeper( ch ) ) == NULL )
	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;
    }
    /* Bug report and solution thanks to [email protected] */
    if ( !can_see_obj( keeper, obj) ) 
    {
        send_to_char("What are you trying to sell me? I don't buy thin air!\n\r", ch );
        return;
    }


    if ( !can_drop_obj( ch, obj ) )
    {
	send_to_char( "You can't let go of it!\n\r", ch );
	return;
    }

    if ( obj->timer > 0 )
    {
	act( AT_TELL, "$n tells you, '$p is depreciating in value too quickly...'", keeper, obj, ch, TO_VICT );
	return;
    }

    if ( ( cost = get_cost( ch, keeper, obj, FALSE ) ) <= 0 )
    {
	act( AT_ACTION, "$n looks uninterested in $p.", keeper, obj, ch, TO_VICT );
	return;
    }

    if ( cost > keeper->gold )
    {
	act( AT_TELL, "$n makes a credit transaction.", keeper, obj, ch, TO_VICT );
        lower_economy( ch->in_room->area, cost-keeper->gold );
    }
    
    separate_obj( obj );
    act( AT_ACTION, "$n sells $p.", ch, obj, NULL, TO_ROOM );
    sprintf( buf, "You sell $p for %d credit%s.",
	cost, cost == 1 ? "" : "s" );
    act( AT_ACTION, buf, ch, obj, NULL, TO_CHAR );
    ch->gold     += cost;
    keeper->gold -= cost;
    if ( keeper->gold < 0 )
	keeper->gold = 0;

    if ( obj->item_type == ITEM_TRASH )
	extract_obj( obj );
    else  if ( IS_SET( obj->extra_flags , ITEM_CONTRABAND) )
   {
       long ch_exp;
       
       ch_exp = UMIN( obj->cost*10 , ( exp_level( ch->skill_level[SMUGGLING_ABILITY]+1) - exp_level( ch->skill_level[SMUGGLING_ABILITY])  ) / 10  );
       ch_printf( ch, "You receive %ld smuggling experience for unloading your contraband.\n\r " , ch_exp );
       gain_exp( ch, ch_exp , SMUGGLING_ABILITY );
       if ( obj->item_type == ITEM_SPICE || obj->item_type == ITEM_RAWSPICE )
	 extract_obj( obj );
       else
       {
         REMOVE_BIT( obj->extra_flags , ITEM_CONTRABAND );
         obj_from_char( obj );
         obj_to_char( obj, keeper );
       }
   }
    else if ( obj->item_type == ITEM_SPICE || obj->item_type == ITEM_RAWSPICE )
	extract_obj( obj );
    else
    {
	obj_from_char( obj );
	obj_to_char( obj, keeper );
    }

    return;
}
Exemple #16
0
void do_buy( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    int maxgold;
    bool debit;
    OBJ_DATA *obj;    

    argument = one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
	send_to_char( "Buy what?\n\r", ch );
	return;
    }

    if ( IS_SET(ch->in_room->room_flags, ROOM_PET_SHOP) )
    {
	char buf[MAX_STRING_LENGTH];
	CHAR_DATA *pet;
	ROOM_INDEX_DATA *pRoomIndexNext;
	ROOM_INDEX_DATA *in_room;

   if ( argument[0] == '\0' )
      debit = FALSE;
   else if ( !str_cmp( "atm", argument ) || !str_cmp( "debit", argument ) )
   {
      bool has_card = FALSE;
      
      for ( obj = ch->last_carrying; obj; obj = obj->prev_content )        
      {
          if ( obj->item_type == ITEM_DEBIT_CARD )
            has_card = TRUE;
      }   
      
     if ( has_card == TRUE )
      debit = TRUE;
     else
     {
       send_to_char( "You don't even have your card with you!\n\r", ch );
       return;    
     }    
    }

	if ( IS_NPC(ch) )
	    return;

	pRoomIndexNext = get_room_index( ch->in_room->vnum + 1 );
	if ( !pRoomIndexNext )
	{
	    bug( "Do_buy: bad pet shop at vnum %d.", ch->in_room->vnum );
	    send_to_char( "Sorry, you can't buy that here.\n\r", ch );
	    return;
	}

	in_room     = ch->in_room;
	ch->in_room = pRoomIndexNext;
	pet         = get_char_room( ch, arg );
	ch->in_room = in_room;

	if ( pet == NULL || !IS_NPC( pet ) || !IS_SET(pet->act, ACT_PET) )
	{
	    send_to_char( "Sorry, you can't buy that here.\n\r", ch );
	    return;
	}

	if (( ch->gold < 10 * pet->top_level * pet->top_level ) && debit == FALSE)
	{
	    send_to_char( "You can't afford it.\n\r", ch );
	    return;
	}
	else if ( (ch->pcdata->bank < 10 * pet->top_level * pet->top_level) && debit == TRUE )
	{
	  send_to_char( "You dont have enough money in your bank account for it.\n\r", ch );
          return;    
        } 

	maxgold = 10 * pet->top_level * pet->top_level;
        if ( debit == FALSE )
	  ch->gold	-= maxgold; /* this was already here, btw */
	else
	  ch->pcdata->bank  -= maxgold;

	boost_economy( ch->in_room->area, maxgold );
	pet		= create_mobile( pet->pIndexData );
	SET_BIT(pet->act, ACT_PET);
	SET_BIT(pet->affected_by, AFF_CHARM);

	argument = one_argument( argument, arg );
	if ( arg[0] != '\0' )
	{
	    sprintf( buf, "%s %s", pet->name, arg );
	    STRFREE( pet->name );
	    pet->name = STRALLOC( buf );
	}

	sprintf( buf, "%sA neck tag says 'I belong to %s'.\n\r",
	    pet->description, ch->name );
	STRFREE( pet->description );
	pet->description = STRALLOC( buf );

	char_to_room( pet, ch->in_room );
	add_follower( pet, ch );
	send_to_char( "Enjoy your pet.\n\r", ch );
    	act( AT_ACTION, "$n bought $N as a pet.", ch, NULL, pet, TO_ROOM );
	return;
    }
    else
    {
	CHAR_DATA *keeper;
	int cost;
	int noi = 1;		/* Number of items */
	sh_int mnoi = 20;	/* Max number of items to be bought at once */

	if ( ( keeper = find_keeper( ch ) ) == NULL )
	    return;

	maxgold = keeper->top_level * 10;

	if ( is_number( arg ) )
	{
	    noi = atoi( arg );
	    argument = one_argument( argument, arg );
	    if ( noi > mnoi )
	    {
		act( AT_TELL, "$n tells you 'I don't sell that many items at"
		  " once.'", keeper, NULL, ch, TO_VICT );
		ch->reply = keeper;
		return;
	    }
	}

    if ( argument[0] == '\0' )
      debit = FALSE;
    else if ( !str_cmp( "atm", argument ) || !str_cmp( "debit", argument ) )
    {
      bool has_card = FALSE;
      
      for ( obj = ch->last_carrying; obj; obj = obj->prev_content )        
      {
          if ( obj->item_type == ITEM_DEBIT_CARD )
            has_card = TRUE;
      }   
      
      if ( has_card == TRUE )
       debit = TRUE;
      else
      {
        send_to_char( "You don't even have your card with you!\n\r", ch );
        return;    
      }    
     }  

	obj  = get_obj_carry( keeper, arg );
	
	if ( !obj && arg[0] == '#' )
        {     
              int onum, oref;
              bool ofound = FALSE;
              
              onum =0;
              oref = atoi(arg+1);
              for ( obj = keeper->last_carrying; obj; obj = obj->prev_content )
	      { 
	        if ( obj->wear_loc == WEAR_NONE
	        &&   can_see_obj( ch, obj ) )
	            onum++;
                if ( onum == oref ) 
                {
                    ofound = TRUE;
                    break;
                }
                else if ( onum > oref )
                   break;
	      }
	      if (!ofound)
	         obj = NULL;
        }
	if (keeper->home != NULL && obj->cost > 0)
          cost= obj->cost;
	cost = ( get_cost( ch, keeper, obj, TRUE ) * noi );

	if( !IS_NPC(ch) && ch->pcdata->learned[gsn_bargain] > 0 && ch->pcdata->learned[gsn_bargain] > number_percent())
	 {
	   ch_printf(ch,"You are able to bargain from %d credits to %d credits!\n\r", cost, (cost/3)+(cost/2));
	   cost = (cost/3) + (cost/2);
	   if(number_percent() > 50)
	    learn_from_success(ch, gsn_bargain);
	 }

	if ( cost <= 0 || !can_see_obj( ch, obj ) )
	{
	    act( AT_TELL, "$n tells you 'I don't sell that -- try 'list'.'",
		keeper, NULL, ch, TO_VICT );
	    ch->reply = keeper;
	    return;
	}

	if ( !IS_OBJ_STAT( obj, ITEM_INVENTORY ) && ( noi > 1 ) )
	{
	    interpret( keeper, "laugh" );
	    act( AT_TELL, "$n tells you 'I don't have enough of those in stock"
	     " to sell more than one at a time.'", keeper, NULL, ch, TO_VICT );
	    ch->reply = keeper;
	    return;
	}
	
	if ( ch->gold < cost && debit == FALSE)
	{
	    act( AT_TELL, "$n tells you 'You can't afford to buy $p.'",
		keeper, obj, ch, TO_VICT );
	    ch->reply = keeper;
	    return;
	}
	
        if ( ch->pcdata->bank < cost && debit == TRUE)
	{
	    send_to_char( "You are almost slide your card through, but you remember you don't have enough money!\n\r", ch );
	    return;	    
        }  

	if ( IS_SET(obj->extra_flags, ITEM_PROTOTYPE) 
             && get_trust( ch ) < LEVEL_IMMORTAL )
	{
	    act( AT_TELL, "$n tells you 'This is a only a prototype!  I can't sell you that...'", 
		keeper, NULL, ch, TO_VICT );
      	    ch->reply = keeper;
	    return;
	}

	if ( ch->carry_number + get_obj_number( obj ) > can_carry_n( ch ) )
	{
	    send_to_char( "You can't carry that many items.\n\r", ch );
	    return;
	}

	if ( ch->carry_weight + ( get_obj_weight( obj ) * noi )
		+ (noi > 1 ? 2 : 0) > can_carry_w( ch ) )
	{
	    send_to_char( "You can't carry that much weight.\n\r", ch );
	    return;
	}

	if ( noi == 1 )
	{
	    if ( !IS_OBJ_STAT( obj, ITEM_INVENTORY ) )  
	       separate_obj( obj );
	    act( AT_ACTION, "$n buys $p.", ch, obj, NULL, TO_ROOM );
    	    act( AT_ACTION, "You buy $p.", ch, obj, NULL, TO_CHAR );
	}
        else
	{
	    sprintf( arg, "$n buys %d $p%s.", noi,
		( obj->short_descr[strlen(obj->short_descr)-1] == 's'
		? "" : "s" ) );
	    act( AT_ACTION, arg, ch, obj, NULL, TO_ROOM );
	    sprintf( arg, "You buy %d $p%s.", noi,
		( obj->short_descr[strlen(obj->short_descr)-1] == 's'
		? "" : "s" ) );
	    act( AT_ACTION, arg, ch, obj, NULL, TO_CHAR );
	    act( AT_ACTION, "$N puts them into a bag and hands it to you.",
		ch, NULL, keeper, TO_CHAR );
	}

        if ( debit == FALSE )
	  ch->gold     -= cost; /* this line was already here, btw */
        else if ( debit == TRUE )
          ch->pcdata->bank     -= cost;
	keeper->gold += cost;

	if ( keeper->gold > maxgold )
	{
	    boost_economy( keeper->in_room->area, keeper->gold - maxgold/2 );
	    keeper->gold = maxgold/2;
	    act( AT_ACTION, "$n puts some credits into a large safe.", keeper, NULL, NULL, TO_ROOM );
	}

	if ( IS_OBJ_STAT( obj, ITEM_INVENTORY ) )
	{
	    OBJ_DATA *buy_obj, *bag;

	    buy_obj = create_object( obj->pIndexData, obj->level );

	    /*
	     * Due to grouped objects and carry limitations in SMAUG
	     * The shopkeeper gives you a bag with multiple-buy,
	     * and also, only one object needs be created with a count
	     * set to the number bought.		-Thoric
	     */
	    if ( noi > 1 )
	    {
		bag = create_object( get_obj_index( OBJ_VNUM_SHOPPING_BAG ), 1 );
		/* perfect size bag ;) */
		bag->value[0] = bag->weight + (buy_obj->weight * noi);
		buy_obj->count = noi;
		obj->pIndexData->count += (noi - 1);
		numobjsloaded += (noi - 1);
		obj_to_obj( buy_obj, bag );
		obj_to_char( bag, ch );
	    }
	    else
		obj_to_char( buy_obj, ch );
	}
        else
	{
	    obj_from_char( obj );
	    obj_to_char( obj, ch );
	}

	return;
    }
}
Exemple #17
0
void do_resurrect(CHAR_DATA *ch, char *argument )
{
    char buf2[MAX_STRING_LENGTH];
    char buf [MAX_INPUT_LENGTH];
    char arg [MAX_STRING_LENGTH];
    CHAR_DATA *victim;
    AFFECT_DATA af;
    OBJ_DATA *obj;
    one_argument(argument,arg);
    if (IS_NPC(ch)) return;
    if (!IS_CLASS(ch, CLASS_WIZARD))
    {
        send_to_char("Huh?\n\r",ch);
        return;
    }
    if (arg[0] == '\0')
    {
        send_to_char("Resurrect what corpse?\n\r",ch);
        return;
    }
    if ( IS_CLASS(ch, CLASS_WIZARD) && ch->pcdata->powers[WL_SKILLS] < 1 )
    {
        stc("You need level 1 in Wizard Skills\n\r",ch);
        return;
    }
    if (ch->pcdata->followers > 5)
    {
        send_to_char("Nothing happens.\n\r",ch);
        return;
    }
    if ((obj = get_obj_carry(ch,arg)) == NULL)
    {
        send_to_char("You dont have that corpse.",ch);
        return;
    }
    if (obj->item_type != ITEM_CORPSE_NPC)
    {
        send_to_char("You can only Resurrect original corpses.\n\r",ch);
        return;
    }
    ch->pcdata->followers++;

    victim=create_mobile( get_mob_index( obj->value[2] ) );
    sprintf(buf,"Resurrection of %s",victim->short_descr);
    sprintf(buf2,"Resurrection of %s is here.\n\r",victim->short_descr);
    free_string(victim->short_descr);
    victim->short_descr = str_dup(buf);
    free_string(victim->name);
    SET_BIT(victim->act, ACT_NOEXP);
    if ( IS_SET(victim->act,ACT_QUEST) ) REMOVE_BIT(victim->act,ACT_QUEST);
    victim->name = str_dup(buf);
    free_string(victim->long_descr);
    victim->long_descr= str_dup(buf2);
    victim->spec_fun = NULL;
    sprintf(buf,"I invoke the rebirth of %s!",victim->name);
    do_say( ch, buf );
    sprintf(buf, "%s clambers back up to its feet.\n\r",obj->short_descr);
    act(buf,ch,NULL,NULL,TO_ROOM);
    send_to_char(buf,ch);
    char_to_room( victim, ch->in_room );

    WAIT_STATE(ch,10);
    extract_obj(obj);

    if(victim->level > ((ch->pcdata->upgrade_level + 1) * 500))
    {
        send_to_char("You are unable to control the resurrected creature.\n\r", ch);
        return;
    }

    add_follower( victim, ch );
    af.type      = skill_lookup ("charm person");
    af.duration  = 666;
    af.location  = APPLY_NONE;
    af.modifier  = 0;
    af.bitvector = AFF_CHARM;
    affect_to_char( victim, &af );
    sprintf(buf,"%s",victim->name);
    do_group(ch,buf);
    return;
}
Exemple #18
0
/*
 * Duplicates a piece of parchment for a cost at a scribe.
 */
void do_duplicate(CHAR_DATA *ch, char *argument)
{
    CHAR_DATA *mob;
    OBJ_DATA *obj;
    OBJ_DATA *clone_obj;
    int cost = 1000; // 10 gold

    if ((mob = find_mob_by_act(ch, ACT_SCRIBE)) == NULL)
    {
        send_to_char("You must find a scribe in order to duplicate pieces of parchment.\r\n", ch);
        return;
    }

    // Not with people that can't be seen.. this will depend on the mob.. if the mob has detect hidden
    // or detect invis they will see most people unless they are in another for of non-detect, etc.
    if (!can_see(mob, ch))
    {
        act("{x$N says '{gI don't trade with folks I can't see, please make yourself 'visible'.'{x", ch, NULL, mob, TO_CHAR);
        return;
    }

    // No argument was sent, tell them how much it costs
    if (IS_NULLSTR(argument))
    {
        act("{x$N says '{gI will duplicate a parchment for 10 gold pieces.{x'", ch, NULL, mob, TO_CHAR);
        act("{x$N says '{gYou may ask me to 'duplicate' a specific parchment in your possession.{x'", ch, NULL, mob, TO_CHAR);
        return;
    }

    if (cost > (ch->gold * 100 + ch->silver))
    {
        act("{x$N says '{gI apologize, but you do not appear to have enough wealth for my services.'{x", ch, NULL, mob, TO_CHAR);
        return;
    }

    if ((obj = get_obj_carry(ch, argument, ch)) == NULL)
    {
        act("{x$N says '{gI do not see that you have that item.'{x", ch, NULL, mob, TO_CHAR);
        return;
    }

    // Make sure the item is a piece of parchment.
    if (obj->item_type != ITEM_PARCHMENT)
    {
        act("{x$N says '{gThat is not a piece of parchment.'{x", ch, NULL, mob, TO_CHAR);
        return;
    }

    // Only copy the parchment if it has been written to.
    if (obj->value[1] == FALSE)
    {
        act("{x$N says '{gThat parchment has not been written to yet, please provide one that has.'{x", ch, NULL, mob, TO_CHAR);
        return;
    }

    // Deduct the cost and then clone the parchment.
    deduct_cost(ch, cost);
    mob->gold += cost / 100;
    mob->silver += cost % 100;

    clone_obj = create_object(obj->pIndexData);
    clone_object(obj, clone_obj);
    obj_to_char(clone_obj, ch);

    act("$N dips his quill in ink and begins writing on a piece of parchment.", ch, NULL, mob, TO_ROOM);
    act("$N hands you parchment with the identical text of your original.", ch, NULL, mob, TO_CHAR);

    // A little lag
    WAIT_STATE(ch, PULSE_VIOLENCE);
}
Exemple #19
0
void do_pipe ( CHAR_DATA *ch, char *argument )
{
	OBJ_DATA * pObj;
	OBJ_DATA * qObj;
	char *pipe_name;
	char pipe_name_2[MAX_INPUT_LENGTH];
	int amount, range, weed_amount, weed_type, dex, wis, con;
	AFFECT_DATA *old_smoke, *old_poison;
	AFFECT_DATA new_smoke, poison;
	int dur = 1, old_dur = 0, old_level = 0, level = 1;

	char buf[ MAX_INPUT_LENGTH ];

	char arg1[ MAX_INPUT_LENGTH ];
	char arg2[ MAX_INPUT_LENGTH ];
	char arg3[ MAX_INPUT_LENGTH ];
	char arg4[ MAX_INPUT_LENGTH ];

	// mobom dziêkujemy bez komunikatu
	if ( IS_NPC( ch ) )
	{
		return ;
	}

    // w czasie walki dziêkujemy z komunikatem
    if ( ch->position == POS_FIGHTING || ch->fighting != NULL )
	{
		send_to_char( "Lepiej skup siê na walce.\n\r", ch );
		return;
    }

	argument = one_argument( argument, arg1 );
	argument = one_argument( argument, arg2 );
	argument = one_argument( argument, arg3 );
	argument = one_argument( argument, arg4 );

	pObj = get_obj_carry( ch, arg2, ch );

	if ( arg1[ 0 ] == '\0' )
	{
		send_to_char( "Co takiego chcesz zrobiæ z fajk±?\n\r", ch );
		send_to_char( "{R[PORADA]:{y 'Je¿eli nie wiesz, co mo¿esz, wpisz {Rhelp pipe{x / {Cpomoc fajka{x.{Y'{x\n\r", ch );
		return;
	}

	if ( !str_prefix( arg1, "smoke" ) || !str_prefix( arg1, "pal" ))
	{
		if ( arg2[ 0 ] == '\0' )
		{
			send_to_char( "Paliæ co?\n\r", ch );
			return ;
		}

		// je¿eli obiekt nieistnieje w inventory, to mo¿e kto¶ co¶ takiego trzyma

		if ( pObj == NULL ) pObj = get_eq_char( ch, WEAR_HOLD );

		if ( pObj == NULL )
		{
			send_to_char( "Potrzebujesz fajki ¿eby paliæ ziele fajkowe.\n\r", ch );
			return ;
		}

		/*if ( ( pObj = get_obj_carry( ch, arg2, ch ) ) == NULL )
		{
			send_to_char( "Potrzebujesz fajki ¿eby paliæ ziele fajkowe.\n\r", ch );
			return ;
		}*/

		if ( pObj->item_type != ITEM_PIPE )
		{
			send_to_char( "Potrzebujesz fajki ¿eby paliæ ziele fajkowe.\n\r", ch );
			return ;
		}

		/* Gdy fajka jest pusta... */
		if ( pObj->value[ 1 ] <= 0 )
		{
			act( "W $j nie ma niczego, co móg³by¶ paliæ! Jest pusta.", ch, pObj, NULL, TO_CHAR );
			act( "$n spogl±da z dziwnym smutkiem na $h.", ch, pObj, NULL, TO_ROOM );
			return ;
		}

		/* Gdy fajka jest zgaszona*/
		if ( pObj->value[ 0 ] == 0 )
		{
			act( "Przecie¿ $p jest zgaszona!", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		/* Flaga informujaca o tym, ze gracz sobie pociagnal dymka... */
		if ( !EXT_IS_SET( ch->act, PLR_SMOKED ) )
			EXT_SET_BIT( ch->act, PLR_SMOKED );

		if ( is_affected( ch, gsn_on_smoke ) )
		{
			old_smoke = affect_find( ch->affected, gsn_on_smoke );
			old_dur = old_smoke->duration;
			old_level = old_smoke->level;
			affect_strip( ch, gsn_on_smoke );
		}

		level = weed_table[ pObj->value[2] ].weed_affect[0];

		dur += old_dur;
		level += old_level;

		new_smoke.where = TO_AFFECTS;
		new_smoke.type = gsn_on_smoke;
		new_smoke.level = level;
		new_smoke.duration = UMIN( dur, number_range( 5, 7 ) );
		new_smoke.rt_duration = 0;
		new_smoke.location = APPLY_NONE;
		new_smoke.modifier = 0;
		new_smoke.bitvector = &AFF_NONE;

		if ( level > number_range( 5, 7 ) && weed_table[ pObj->value[2] ].weed_affect[0] && number_percent() < weed_table[ pObj->value[2] ].weed_affect[1] )
		{
			send_to_char( "\n\rZaczynasz czuæ siê jako¶ dziwnie. Przed oczyma zaczynaj± lataæ ci kolorowe plamki.\n\r", ch );
			act( "\n\r$n zaczyna wygl±dajaæ jako¶ dziwnie blado.", ch, pObj, NULL, TO_ROOM );
			if ( dice( 1, 2 ) == 1 )
				new_smoke.bitvector = &AFF_HALLUCINATIONS_NEGATIVE;
			else
				new_smoke.bitvector = &AFF_HALLUCINATIONS_POSITIVE;
		}
		new_smoke.visible = FALSE;
		affect_to_char( ch, &new_smoke, NULL, FALSE );

		if ( number_percent() < weed_table[ pObj->value[2] ].weed_affect[2] )
		{
			if( is_affected(ch,gsn_poison ))
			{
				old_poison = affect_find( ch->affected, gsn_poison );
				old_poison->duration += stat_throw(ch,STAT_CON) ? number_range(2,4) : number_range(4,8);
				if( old_poison->level < UMIN( weed_table[ pObj->value[2] ].weed_affect[0], 3) )
					old_poison->level = UMIN( weed_table[ pObj->value[2] ].weed_affect[0], 3);
				act( "$n jeszcze bardziej zielenieje na twarzy.", ch, pObj, NULL, TO_ROOM );
				send_to_char( "Czujesz siê jeszcze gorzej.\n\r", ch );
			}
			else
			{
				poison.where = TO_AFFECTS;
				poison.type = gsn_poison;
				poison.level = UMIN( weed_table[ pObj->value[2] ].weed_affect[0], 3);
				poison.duration = stat_throw(ch,STAT_CON) ? number_range(2,4) : number_range(4,8);
				poison.rt_duration = 0;
				poison.location = APPLY_NONE;
				poison.modifier = 0;
				poison.bitvector = &AFF_NONE;
				poison.visible = FALSE;
				affect_to_char( ch, &poison, NULL, FALSE );
				send_to_char( "Momentalnie zaczynasz czuæ siê jako¶ niedobrze. Bardzo niedobrze.\n\r", ch );
				act( "$n widocznie zielenieje na twarzy.", ch, pObj, NULL, TO_ROOM );
			}
		}

		/* Troche losowosci */
		range = number_range( 1, 9 );
		switch ( range )
		{
			case 1:
				act( "$n zaci±ga siê g³êboko $j.", ch, pObj, NULL, TO_ROOM );
				act( "Zaci±gasz siê g³êboko $j.", ch, pObj, NULL, TO_CHAR );
				break;
			case 2:
				act( "$n pyka sobie $h przez chwilê.", ch, pObj, NULL, TO_ROOM );
				act( "Pykasz sobie $h przez chwilê.", ch, pObj, NULL, TO_CHAR );
				break;
			case 3:
				act( "$n wci±ga gwa³townie dym z $f.", ch, pObj, NULL, TO_ROOM );
				act( "Wci±gasz gwa³townie dym z $f.", ch, pObj, NULL, TO_CHAR );
				break;
			case 4:
				act( "$n zaci±ga siê delikatnie $j.", ch, pObj, NULL, TO_ROOM );
				act( "Zaci±gasz siê delikatnie $j.", ch, pObj, NULL, TO_CHAR );
				break;
			case 5:
				act( "Widzisz jak $n zaci±ga siê lekko $j.", ch, pObj, NULL, TO_ROOM );
				act( "Zaci±gasz siê lekko $j.", ch, pObj, NULL, TO_CHAR );
				break;
			case 6:
				act( "Dostrzegasz, jak $n z wpraw± zaci±ga siê dymkiem z $f.", ch, pObj, NULL, TO_ROOM );
				act( "Z wielk± wpraw± zaci±gasz siê dymkiem z $f.", ch, pObj, NULL, TO_CHAR );
				break;
			case 7:
				act( "$n jakby od niechcenia pali przez chwilê swoj± $h.", ch, pObj, NULL, TO_ROOM );
				act( "Przez chwilkê machinalnie palisz sobie swoj± $h.", ch, pObj, NULL, TO_CHAR );
				break;
			case 8:
				act( "$n z u¶miechem kurzy sobie $h.", ch, pObj, NULL, TO_ROOM );
				act( "Kurzysz sobiê $h, u¶miechaj±c siê przy tym b³ogo.", ch, pObj, NULL, TO_CHAR );
				break;
			default:
				act( "$n pali sobie przez chwilkê $h.", ch, pObj, NULL, TO_ROOM );
				act( "Palisz sobie przez chwilkê $h.", ch, pObj, NULL, TO_CHAR );
				break;
		}

		amount = number_range( 1, 3 ); // moze sie palic szybciej, lub wolniej (o 1, 2 lub o 3)
		if ( pObj->value[ 0 ] == 1 )     // sprawdzamy czy fajeczka jest zapalona
		{
			pObj->value[ 1 ] -= amount; // wypalamy zawartosc fajeczki
			//pObj->short_descr = capitalize(pObj->short_descr );
			amount = number_range( 1, 7 );
			switch ( amount )
			{
				case 1:
					act( "Nad $j trzyman± przez $z unosi siê w±ska stru¿ka dymu.", ch, pObj, NULL, TO_ROOM );
					act( "Nad $j unosi siê w±ska stru¿ka dymu.", ch, pObj, NULL, TO_CHAR );
					break;
				case 2:
					act( "Nad $j $z unosz± siê ma³e, ciemne chmurki dymu.", ch, pObj, NULL, TO_ROOM );
					act( "Nad $j unosz± siê ma³e, ciemne chmurki dymu.", ch, pObj, NULL, TO_CHAR );
					break;
				case 3:
					act( "Widzisz jak w $f $z tl± siê ma³e, jasne iskierki.", ch, pObj, NULL, TO_ROOM );
					act( "Widzisz kilka ma³ych, jasnych iskierek tl±cych siê w $k.", ch, pObj, NULL, TO_CHAR );
					break;
				case 4:
					act( "Dostrzegasz, ¿e nad $f trzyman± przez $z unosi siê gêsta smuga dymu.", ch, pObj, NULL, TO_ROOM );
					act( "Dosrzegasz unosz±c± siê nad $f gêst± smugê dymu.", ch, pObj, NULL, TO_CHAR );
					break;
				case 5:
					act( "S³yszysz jak zawarto¶æ $f $z lekko syczy tl±c siê.", ch, pObj, NULL, TO_ROOM );
					act( "S³yszysz jak zawarto¶æ $f lekko syczy tl±c siê.", ch, pObj, NULL, TO_CHAR );
					break;
				case 6:
					act( "Czujesz delikatny aromat jakoby zio³owego dymu, bij±cy od $z i jego $f.", ch, pObj, NULL, TO_ROOM );
					act( "Czujesz bij±cy od $f lekki, jakby zio³owy aromat.", ch, pObj, NULL, TO_CHAR );
					break;
				default:
					act( "Zawarto¶æ $f nale¿±cej do $z tli siê lekko.", ch, pObj, NULL, TO_ROOM );
					act( "Zawarto¶æ $f tli siê lekko.", ch, pObj, NULL, TO_CHAR );
					break;
			}

			if ( pObj->value[ 1 ] <= 0 )
			{
				act( "Ostatnie, tl±ce siê iskierki gasn±, kiedy wypali³a siê ca³a zawarto¶æ $f.", ch, pObj, NULL, TO_CHAR );
				act( "Widzisz jak $p $z ga¶nie z lekkim sykiem.", ch, pObj, NULL, TO_ROOM );
				pObj->value[ 0 ] = 0;
				pObj->value[ 1 ] = 0;
				pObj->value [ 2 ] = 0;
			}
		}
		return ;
	}


	if ( !str_prefix( arg1, "exhale" ) || !str_prefix( arg1, "wydech" ))
	{
		// Potrzebne staty do testow na 'triki'...
		dex = get_curr_stat_deprecated(ch,STAT_DEX);
		con = get_curr_stat_deprecated(ch,STAT_CON);
		wis = get_curr_stat_deprecated(ch,STAT_WIS);

		/* Zeby "wydychac" flaga palenia musi byc nalozona na gracza - sprawdzanie */
		if ( !EXT_IS_SET( ch->act, PLR_SMOKED ) )
		{
			send_to_char( "Jak chcesz to zrobiæ? Najpierw musisz zaci±gn±æ siê dymem!\n\r", ch );
			return ;
		}

		/* Pomocy!
		if ( !str_prefix( arg2, "help" ) || !str_prefix( arg2, "pomoc" ))
		{
			act( "{R[PORADA]:{x\n\r", ch, NULL, NULL, TO_CHAR );
			act( "{YZanim bêdziesz <&móg³/mog³a/mog³o> wydychaæ dym musisz paliæ fajkê.{x", ch, NULL, NULL, TO_CHAR );
			act( "{YPo tym jak skoñczysz rozkoszowaæ siê bogatym smakiem ziela fajkowego...{x", ch, NULL, NULL, TO_CHAR );
			act( "{YMo¿esz wydychaæ tytoniowy dym na ró¿ne sposoby, ¿eby uatrakcyjniæ palenie.{x", ch, NULL, NULL, TO_CHAR );
			act( "{YSpróbuj tych oto typów wydechu, aby zadziwiæ znajomych:{x \n\r", ch, NULL, NULL, TO_CHAR );
			act( "Angielskie komendy: RINGS, LINES, SPHERE, WEB, PHOENIX, HORNS, NAME", ch, NULL, NULL, TO_CHAR );
			act( "Polskie komendy: KO£A, LINIE, KULA, SIEÆ, FENIKS, ROGI, IMIÊ\n\r", ch, NULL, NULL, TO_CHAR );
			act( "\n\r{YSk³adnia angielska: {Gpipe exhale <nazwa figury>{x.", ch, NULL, NULL, TO_CHAR );
			act( "{YSk³adnia polska: {Gfajka wydech <nazwa figury>{x.\n\r", ch, NULL, NULL, TO_CHAR );
			return ;
		}*/

		if ( arg2[ 0 ] == '\0' )
		{
			switch ( number_range ( 1, 5 ) )
			{
				case 1:
					act( "$n wydycha ustami ob³ok bladego, szarego dymu.", ch, NULL, NULL, TO_ROOM );
					act( "Wydychasz ustami ob³ok szarego, bladego dymu.", ch, NULL, NULL, TO_CHAR );
					EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
					return ;
				case 2:
					act( "$n wydycha nosem ob³ok bladego, szarego dymu.", ch, NULL, NULL, TO_ROOM );
					act( "Wydychasz nosem ob³ok szarego, bladego dymu.", ch, NULL, NULL, TO_CHAR );
					EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
					return ;
				case 3:
					act( "$n spokojnie wydycha ustami ob³ok bladego, szarego dymu.", ch, NULL, NULL, TO_ROOM );
					act( "Spokojnie wydychasz ustami ob³ok szarego, bladego dymu.", ch, NULL, NULL, TO_CHAR );
					EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
					return ;
				case 4:
					act( "$n spokojnie wydycha nosem ob³ok bladego, szarego dymu.", ch, NULL, NULL, TO_ROOM );
					act( "Spokojnie wydychasz nosem ob³ok szarego, bladego dymu.", ch, NULL, NULL, TO_CHAR );
					EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
					return ;
				default:
					act( "$n wydycha ob³ok bladego, szarego dymu.", ch, NULL, NULL, TO_ROOM );
					act( "Wydychasz ob³ok szarego, bladego dymu.", ch, NULL, NULL, TO_CHAR );
					EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
					return ;
			}
		}
		else if ( !str_prefix( arg2, "ko³a" ) || !str_prefix( arg2, "rings" ) )
		{
			if ( dice( 2, dex - 10 ) >= 4 && dice( 2, con - 6 ) > 6 )
			{
				act( "$n niespodziewanie wypuszcza z ust kilka du¿ych, zadziwiaj±co okr±g³ych kó³ z dymu, które uk³adaj± siê w ¶mieszny tunel zawieszony w powietrzu!", ch, NULL, NULL, TO_ROOM );
				act( "Wypuszczasz z ust kilka du¿ych, zadziwiaj±co okr±g³ych kó³ z dymu, które uk³adaj± siê w ¶mieszny tunel zawieszony w powietrzu!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 4 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie ko³a, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust kilka kszta³tnych kó³, jednak nie udaje ci siê, a dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "linie" ) || !str_prefix( arg2, "lines" ))
		{
			if ( dice( 2, dex - 10 ) > 5 && dice( 2, con - 8 ) >= 5 )
			{
				act( "$n wydycha d³ug± smugê dymu w kszta³cie piêknej, prostej linii, zdaj±c± siê pi±æ w kierunku nieba!", ch, NULL, NULL, TO_ROOM );
				act( "Wydychasz d³ug± smugê dymu w kszta³cie piêknej, prostej linii, zdaj±c± siê pi±æ w kierunku nieba!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 5 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie linii, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 4:
						act( "$n z gracj± zaczyna wypuszczaæ z ust kilka chmurek dymu, które niespodziewanie szybko rozp³ywaj± siê w powietrzu.", ch, pObj, NULL, TO_ROOM );
						act( "W skupieniu wypuszczasz z ust kilka chmurek dymu, te jednak rozp³ywaj± siê szybko w powietrzu zanim zd±zy³y siê uformowaæ w jaki¶ kszta³t.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust prost± liniê dymu, jednak nie udaje ci siê, a dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "kula" ) || !str_prefix( arg2, "sphere" ))
		{
			if ( dice( 2, dex - 5 ) >= 7 && dice( 3, con - 2 ) > 15 )
			{
				act( "$n wypuszcza z ust jedn±, niesamowicie okr±g³a, chmurê dymu w kszta³cie idealnej kuli!", ch, NULL, NULL, TO_ROOM );
				act( "Wypuszczasz z ust du¿±, niesamowicie okr±g³±, chmurê dymu w kszta³cie idealnej kuli!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 5 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie kuli, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 4:
						act( "$n nagle zaczyna kaszlaæ dymem, a dym który ulatuje z jego ust tworzy dziwn± chmurkê.", ch, pObj, NULL, TO_ROOM );
						act( "Niespodziewanie co¶ ci nie wychodzi, krztusisz siê i kaszlaj±c panicznie wypuszczasz z ust resztki dymu.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust kulê dymu, jednak nie udaje ci siê, a dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "sieæ" ) || !str_prefix( arg2, "web" ))
		{
			if ( dice( 2, dex - 5 ) >= 15 && dice( 2, con - 8 ) > 6 )
			{
				act( "$n wydycha kilkana¶cie cieniutkich, zwiewnych pasemek dymu, które niespodziewanie ³±cz± siê tworz±c delikatn±, prawie pajêcz±, sieæ w powietrzu!", ch, NULL, NULL, TO_ROOM );
				act( "Wydychasz kilkana¶cie cieniutkich, zwiewnych pasemek dymu, które niespodziewanie ³±cz± siê tworz±c delikatn±, prawie pajêcz±, sieæ w powietrzu!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 5 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie kuli, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 4:
						act( "$n wydycha szybk± seriê w±skich dymków, które wydaj± siê pe³zaæ w powietrzu jak niepos³usze robaczki, szybko rozp³ywaj±ce siê w powietrzu.", ch, pObj, NULL, TO_ROOM );
						act( "Szybko wydychasz seriê w±skich dymków chc±c z nich uformowaæ pajêczynê, te jednak szybko rozp³ywaj± siê w powietrzu.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust seriê dymków, jednak nie udaje ci siê, a sam dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "feniks" ) || !str_prefix( arg2, "phoenix" ) || !str_prefix( arg2, "fenix" ) )
		{
			if ( dice( 2, dex - 10 ) >= 8 && dice( 2, con - 10 ) >= 8 && dice( 2, wis - 10 ) >= 5 )
			{
				act( "$n wydycha serie ma³ych chmurek dymu, które na chwilê uk³adaj± siê w wizerunek feniksa, tylko po to, aby chwilê pó¼niej rozp³ynê³y siê, niczym proch.", ch, NULL, NULL, TO_ROOM );
				act( "Wydychasz serie ma³ych chmurek dymu, które na chwilê uk³adaj± siê w wizerunek feniksa, tylko po to, aby chwilê pó¼niej rozp³ynê³y siê, niczym proch.", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 7 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie linii, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 4:
						act( "$n w wielkim skupieniu wydycha kilkana¶cie dymków, które zaczynaj± uk³adaæ siê w powietrzu w co¶ przypominaj±cego hybrydê szczura z ludzkimi nogami... Czy to by³o zamierzone?", ch, pObj, NULL, TO_ROOM );
						act( "W wielkim skupieniu wydychasz kilkana¶cie dymków, które niespodziewanie zamiast feniksa uk³adaj± siê w co¶ przypominaj±cego po³±czenie szczura z ludzkimi nogami! Okropne.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 5:
						act( "$n, z grymasem na twarzy, wypuszcza z ust kilkana¶cie dymków, które uk³adaj± siê w powietrzu w jaki¶ dziwny ptakopodobny twór, wygl±daj±cy dosyæ ohydnie.", ch, pObj, NULL, TO_ROOM );
						act( "Czuj±c, ¿e co¶ pójdzie ¼le wypuszczasz z ust kilkana¶cie dymków, które uk³adaj± siê w powietrzu w jaki¶ bezkszta³tny, ptakopodobny twór.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 6:
						act( "$n, z wyrazem pewno¶ci siebie na twarzy, wydycha seriê ma³ych dymków, które nagle ³±cz± siê w powietrzu tworz±c pewien du¿y, oble¶ny kszta³t... Hmm, to ciekawe. K±tem oka widzisz, ¿e $n siê rumieni na widok swojego dzie³a.", ch, pObj, NULL, TO_ROOM );
						act( "Wypuszczasz z ust kilkana¶cie ma³ych dymków, które nagle ³±cz± siê w powietrzu, tworz±c naprawdê du¿y, oble¶ny kszta³t. Chyba siê zaraz spalisz ze wstydu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust kilkana¶cie dymków, jednak nie udaje ci siê, a sam dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "rogi" ) || !str_prefix( arg2, "horns" ))
		{
			if ( dice( 2, dex - 10 ) >= 9 && dice( 2, con - 6 ) >= 10 )
			{
				act( "$n wydycha dwie grube smugi dymu, które uk³adaj± siê nad $m niczym para wielkich rogów!", ch, NULL, NULL, TO_ROOM );
				act( "Wydychasz dwie grube smugi dymu, które uk³adaj± sie nad tob± niczym para wielkich rogów!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 4 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie linii, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust prost± liniê dymu, jednak nie udaje ci siê, a dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else if ( !str_prefix( arg2, "imiê" ) || !str_prefix( arg2, "name" ))
		{
			if ( dice( 2, dex - 10 ) >= 8 && dice( 2, con - 8 ) >= 9 && dice( 2, wis - 10 ) > 6 )
			{
				act( "$n wypuszcza z ust kilkana¶cie ma³ych dymków, które niespodziewanie tworz± w powietrzu napis '$n'! Niesamowite!", ch, NULL, NULL, TO_ROOM );
				act( "Wypuszczasz z ust kilkana¶cie ma³ych dymków, które niespodziewanie tworz± w powietrzu napis '$n'! ¦wietnie!", ch, NULL, NULL, TO_CHAR );
				EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
				return ;
			}
			else
			{
				switch ( number_range ( 1, 6 ) )
				{
					case 1:
						act( "$n nagle robi dziwn± minê, po czym momentalnie dostaje ataku kaszlu.", ch, pObj, NULL, TO_ROOM );
						act( "Próbujesz zrobiæ sztuczkê, jednak w ostatniej chwili dym zacz±³ gry¼æ ciê w gar³o i <&dosta³e¶/dosta³a¶/dosta³o¶> ataku kaszlu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 2:
						act( "Widzisz jak $n koncentruje siê przez chwilkê, aby po chwili wypu¶ciæ z ust niekszta³tn± chmurê dymu.", ch, pObj, NULL, TO_ROOM );
						act( "Koncentrujesz siê przez chwilkê, chc±c wypu¶ciæ z ust chmurê dymu w kszta³cie linii, jednak nie udaje ci siê to.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 3:
						act( "$n nagle zielenieje na twarzy, a z jego nosa zaczynaj± wylatywaæ szare stru¿ki dymu.", ch, pObj, NULL, TO_ROOM );
						act( "W ostatniej chwili przygotowañ do zrobienia sztuczki krztusisz siê i bezwiednie wypuszczasz dym nosem.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 4:
						act( "$n, z wyrazem pewno¶ci siebie na twarzy, wydycha seriê ma³ych dymków, które nagle ³±cz± siê w powietrzu tworz±c pewien du¿y, oble¶ny kszta³t... Hmm, to ciekawe. K±tem oka widzisz, ¿e $n siê rumieni na widok swojego dzie³a.", ch, pObj, NULL, TO_ROOM );
						act( "Wypuszczasz z ust kilkana¶cie ma³ych dymków, które nagle ³±cz± siê w powietrzu, tworz±c naprawdê du¿y, oble¶ny kszta³t. Chyba siê zaraz spalisz ze wstydu!", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					case 5:
						print_char( ch, "Wydychasz w wielkim skupieniu kilkana¶cie szarych dymków, które niespodziewanie tworz± w powietrzu bezsensowny napis '%s'!", gen_random_str( 4, 8 ) );
						sprintf( buf, "$n wydycha w wielkim skupieniu kilkana¶cie szarych dymków, które niespodziewanie tworz± w powietrzu bezsensowny napis '%s'!\n\r", gen_random_str( 4, 8 ) );
						act( buf, ch, NULL, NULL, TO_ROOM );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
					default:
						act( "$n próbuje zrobiæ jak±¶ sztuczkê z wypuszczeniem z ust dymu, jednak udaje mu siê jedynie uformowaæ dym w bezkszta³tn± chmurê.", ch, pObj, NULL, TO_ROOM );
						act( "Starasz siê wypu¶ciæ z ust kilka dziwnych chmurek dymu, jednak nie udaje ci siê, a dym przybiera kszta³t nieforemnej chmury.", ch, pObj, NULL, TO_CHAR );
						EXT_REMOVE_BIT( ch->act, PLR_SMOKED );
						break;
				}
			}
		}
		else
		{
			send_to_char( "Huh?! Nie znasz takiej sztuczki!\n\r", ch );
			return;
		}
	}


	// Nabijanie fajki
	if ( !str_prefix( arg1, "tamp" ) || !str_prefix( arg1, "nabij" ))
	{
		// Seria zabezpieczen...
		if ( pObj == NULL ) pObj = get_eq_char( ch, WEAR_HOLD );

		if ( pObj == NULL )
		{
			act( "Co chcesz nabiæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		if ( pObj->item_type != ITEM_PIPE )
		{
			send_to_char( "Mo¿esz nabijaæ jedynie fajki!\n\r", ch );
			return ;
		}

		if ( ( qObj = get_obj_carry( ch, arg3, ch ) ) == NULL )
		{
			act( "Czym chcesz nabiæ $h?", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		if ( qObj->item_type != ITEM_WEED )
		{
			pipe_name = capitalize( pObj->name4 );
			sprintf( pipe_name_2, "%s mo¿esz nabiæ jedynie jakim¶ rodzajem ziela.", pipe_name );
			act( pipe_name_2, ch, pObj, NULL, TO_CHAR );
		}
		else if ( pObj->value[ 0 ] == 1 )
		{
			pipe_name = capitalize( pObj->short_descr );
			sprintf( pipe_name_2, "%s jest zapalona, nie mo¿esz jej teraz nabijaæ!", pipe_name );
			act( pipe_name_2, ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else if ( pObj->value[ 1 ] > 0 )
		{
			pipe_name = capitalize( pObj->short_descr );
			sprintf( pipe_name_2, "%s jest ju¿ czym¶ nabita. Przed ponownym nabiciem opró¿nij j±.", pipe_name );
			act( pipe_name_2, ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else
		{
			// Nabijanie fajki, przepisywanie wartosci ziela do fajeczki.
			weed_amount = qObj->value [ 0 ];
			weed_type = qObj->value [ 1 ];
			pObj->value [ 1 ] = weed_amount;
			pObj->value [ 2 ] = weed_type;
			print_char( ch, "Nabijasz %s %s.\n\r", pObj->name4, qObj->name5 );
			sprintf( buf, "$n nabija %s %s.\n\r", pObj->name4, qObj->name5 );
			act( buf, ch, NULL, NULL, TO_ROOM );
			extract_obj( qObj );
			return ;
		}


	}

	// zapalanie
	if ( !str_prefix( arg1, "light" ) || !str_prefix( arg1, "zapal" ))
	{
		pObj = get_obj_carry( ch, arg2, ch );

		if ( pObj == NULL ) pObj = get_eq_char( ch, WEAR_HOLD );

		if ( pObj == NULL )
		{
			act( "Co chcesz zapaliæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		if ( pObj->item_type != ITEM_PIPE )
		{
			send_to_char( "Mo¿esz zapalaæ jedynie fajki!\n\r", ch );
			return ;
		}
		else if ( pObj->value[ 0 ] == 1 )
		{
			pipe_name = capitalize( pObj->short_descr );
			sprintf( pipe_name_2, "%s jest ju¿ zapalona.", pipe_name );
			act( pipe_name_2, ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else if ( pObj->value[ 2 ] == 4 )
		{
			act( "Zawarto¶æ $f jest mokra! Nie dasz rady tego zapaliæ.", ch, pObj, NULL, TO_CHAR );
			act( "Lepiej wyczy¶æ $h i nape³nij j± czym¶ suchym, najlepiej zielem fajkowym.", ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else
		{
			pObj->value [ 0 ] = 1;
			act( "Zapalaj±c $h zaczynasz czuæ przyjemny, delikatny zapach palonego ziela.", ch, pObj, NULL, TO_CHAR );
			act( "$n zapala $h. Czujesz jak w powietrzu zaczyna unosiæ siê lekki zapach palonego ziela.", ch, pObj, NULL, TO_ROOM );
			return ;
		}
	}

	// gaszenie
	if ( !str_prefix( arg1, "extinguish" ) || !str_prefix( arg1, "zga¶" ))
	{

		/*if ( ( pObj = get_obj_carry( ch, arg2, ch ) ) == NULL )
		{
			act( "Co chcesz zgasiæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}*/

		if ( pObj == NULL ) pObj = get_eq_char( ch, WEAR_HOLD );

		if ( pObj == NULL )
		{
			act( "Co chcesz zgasiæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		if ( pObj->item_type != ITEM_PIPE )
		{
			send_to_char( "Mo¿esz gasiæ jedynie fajki!\n\r", ch );
			return ;
		}
		else if ( pObj->value[ 0 ] == 0 )
		{
			pipe_name = capitalize( pObj->short_descr );
			sprintf( pipe_name_2, "%s jest ju¿ zgaszona.", pipe_name );
			act( pipe_name_2, ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else
		{
			pObj->value [ 0 ] = 0;
			act( "Gasz±c $h widzisz jak ostatnie iskierki ognia bledn± i znikaj±.", ch, pObj, NULL, TO_CHAR );
			act( "$n gasi $h.", ch, pObj, NULL, TO_ROOM );
			return ;
		}
	}

	// czyszczenie / opró¿nianie
	if ( !str_prefix( arg1, "clean" ) || !str_prefix( arg1, "wyczy¶æ" ))
	{

		/*if ( ( pObj = get_obj_carry( ch, arg2, ch ) ) == NULL )
		{
			act( "Co chcesz wyczy¶ciæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}*/

		if ( pObj == NULL ) pObj = get_eq_char( ch, WEAR_HOLD );

		if ( pObj == NULL )
		{
			act( "Co chcesz wyczy¶ciæ?", ch, pObj, NULL, TO_CHAR );
			return ;
		}

		if ( pObj->item_type != ITEM_PIPE )
		{
			send_to_char( "Mo¿esz czy¶ciæ jedynie fajki!\n\r", ch );
			return ;
		}
		else if ( pObj->value[ 0 ] == 1 )
		{
			act( "Mo¿e lepiej najpierw zga¶ $h?", ch, pObj, NULL, TO_CHAR );
			return ;
		}
		else if ( pObj->value[ 1 ] == 0 )
		{
			act( "Ogl±dasz z dum± $h, po czym pucujesz j± dok³adnie rêkawem. Teraz jest naprawdê czysta!", ch, pObj, NULL, TO_CHAR );
			act( "$n z dum± pucuje $h, u¶miechaj±c siê przy tym tajemniczo.", ch, pObj, NULL, TO_ROOM );
			return ;
		}
		else
		{
			pObj->value [ 1 ] = 0;
			pObj->value [ 2 ] = 0;
			act( "Wysypujesz zawarto¶æ $f. Teraz jest pusta.", ch, pObj, NULL, TO_CHAR );
			act( "$n wysypuje zawarto¶æ $f.", ch, pObj, NULL, TO_ROOM );
			return ;
		}
	}

	send_to_char( "Huh?\n\r", ch );
	return;
}
Exemple #20
0
void do_cdonate( CHAR_DATA *ch, char *arg )
{
    OBJ_DATA *container;
    OBJ_DATA *obj;
    OBJ_DATA *obj_next;
    char      arg1 [ MAX_INPUT_LENGTH ];

    if ( !is_clan( ch ) )
    {
	send_to_char( "You aren't a clansman!\n\r", ch );
	return;
    }

    arg = one_argument( arg, arg1 );

    if ( arg1[0] == '\0' )
    {
	send_to_char( "Donate to your clan what?\n\r", ch );
	return;
    }

    for ( container = object_list; container; container = container->next )
    {
        if ( can_see_obj( ch, container )
	    && container->pIndexData->vnum == ch->pcdata->clan->donation )
	    break;
    }

    if ( !container )
    {
	send_to_char( "The donation pit is missing from the world.\n\r", ch );
	return;
    }

    if ( str_cmp( arg1, "all" ) && str_prefix( "all.", arg1 ) )
    {
	if ( !( obj = get_obj_carry( ch, arg1 ) ) )
	{
	    send_to_char( "You do not have that item.\n\r", ch );
	    return;
	}

	if ( !can_drop_obj( ch, obj ) )
	{
	    send_to_char( "You can't let go of it.\n\r", ch );
	    return;
	}
	
	if ( get_obj_weight( obj ) + get_obj_weight( container ) 
	  > container->value[0] )
	{
	    send_to_char( "It won't fit.\n\r", ch );
	    return;
	}

	if ( obj->item_type == ITEM_TRASH
	    || obj->item_type == ITEM_FOOD
	    || obj->item_type == ITEM_KEY
	    || obj->item_type == ITEM_PILL )
	{
	    act( "You send $p flying to the $P.", ch, obj, container,
		TO_CHAR );
	    extract_obj( obj );
	    return;
	}

	obj_from_char( obj );
	obj_to_obj( obj, container );
	act( "$n sends $p flying to the $P.", ch, obj, container, TO_ROOM );
	act( "You send $p flying to the $P.", ch, obj, container, TO_CHAR );
	send_to_room( "A loud clank is heard from the pit!",
		     container->in_room );
    }
    else
    {
	for ( obj = ch->carrying; obj; obj = obj_next )
	{
	    obj_next = obj->next_content;

	    if ( obj->deleted )
		continue;

	    if ( ( arg1[3] == '\0' || is_name( &arg1[4], obj->name ) )
		&& can_see_obj( ch, obj )
		&& obj->wear_loc == WEAR_NONE
		&& obj != container
		&& can_drop_obj( ch, obj )
		&& get_obj_weight( obj ) + get_obj_weight( container )
		<= container->value[0] )
	    {

	        if ( obj->item_type == ITEM_TRASH
		    || obj->item_type == ITEM_FOOD
		    || obj->item_type == ITEM_KEY
		    || obj->item_type == ITEM_PILL )
		{
		    act( "You send $p flying to the $P.", ch, obj, container,
			TO_CHAR );
		    extract_obj( obj );
		    continue;
		}

		obj_from_char( obj );
		obj_to_obj( obj, container );
		act( "$n sends $p flying to the $P.", ch, obj, container,
		    TO_ROOM );
		act( "You send $p flying to the $P.", ch, obj, container,
		    TO_CHAR );
		send_to_room( "A loud clank is heard from the pit!\n\r",
		     container->in_room );

		ch->pcdata->clan->score += 1;
	    }
	}
    }

    return;

}
Exemple #21
0
void do_sell( CHAR_DATA * ch, char *argument )
{
  char buf[MAX_STRING_LENGTH];
  char arg[MAX_INPUT_LENGTH];
  CHAR_DATA *keeper = NULL;
  OBJ_DATA *obj = NULL;
  int cost = 0;

  one_argument( argument, arg );

  if( arg[0] == '\0' )
  {
    send_to_char( "Sell what?\r\n", ch );
    return;
  }

  if( ( keeper = find_keeper( ch ) ) == NULL )
    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!\r\n", ch );
    return;
  }

  if( obj->timer > 0 )
  {
    act( AT_TELL,
	"$n tells you, '$p is depreciating in value too quickly...'",
	keeper, obj, ch, TO_VICT );
    return;
  }

  if( ( cost = get_cost( ch, keeper, obj, FALSE ) ) <= 0 )
  {
    act( AT_ACTION, "$n looks uninterested in $p.", keeper, obj, ch,
	TO_VICT );
    return;
  }

  if( cost > keeper->gold )
  {
    act( AT_TELL, "$n makes a credit transaction.", keeper, obj, ch,
	TO_VICT );
  }

  separate_obj( obj );
  act( AT_ACTION, "$n sells $p.", ch, obj, NULL, TO_ROOM );
  sprintf( buf, "You sell $p for %d credit%s.", cost, cost == 1 ? "" : "s" );
  act( AT_ACTION, buf, ch, obj, NULL, TO_CHAR );
  ch->gold += cost;
  keeper->gold -= cost;
  if( keeper->gold < 0 )
    keeper->gold = 0;

  if( obj->item_type == ITEM_TRASH )
    extract_obj( obj );
  else
  {
    obj_from_char( obj );
    obj_to_char( obj, keeper );
  }

  return;
}
Exemple #22
0
void do_bank_withdraw( Character *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    char buf[MAX_INPUT_LENGTH];
    int amount;
    OBJ_DATA *obj;


    argument = one_argument( argument, arg );


    if ( IS_NPC(ch) )
    {
        send_to_char( "Mobs don't have bank accounts!\n\r", ch );
        return;
    }

    if ( ( obj = get_obj_carry( ch, (char*)"bank note", ch ) ) == NULL )
    {
        send_to_char( "You do not own a bank note.\n\r", ch );
        return;
    }

    if ( arg[0] == '\0' )
    {
        send_to_char( "Withdraw how much?\n\r", ch );
        return;
    }

    if(!str_cmp(argument, "silver"))
    {
   if ( !is_number( arg ) )
    {
        send_to_char( "Withdraw how much?\n\r", ch );
            return;
        }


        amount = atoi(arg);
        if ( obj->value[1] < amount ) /* is balance - than amount */
        {
            send_to_char( "Your account does not have that much silver in it!\n\r", ch );
            return;
        }    /* else withdraw silver */


        ch->silver += amount;  
        obj->value[1] -= amount;
        act("$n withdraws some silver.", ch, NULL, NULL, TO_ROOM);
    return;
    }


    if(!str_cmp(argument, "gold"))
    {
        if ( !is_number( arg ) )
        {
            send_to_char( "Withdraw how much?\n\r", ch );
            return;
        }
                         
        amount = atoi(arg);
        if ( obj->value[0] < amount ) /* is balance - than amount */
        {
            send_to_char( "Your account does not have that much gold in it!\n\r", ch );
            return;
        }    /* else withdraw gold */


        ch->gold += amount;  
        obj->value[0] -= amount;
        sprintf(buf,"You withdraw %d gold.\n\r", amount);
	send_to_char(buf,ch);
        act("$n withdraws some gold.", ch, NULL, NULL, TO_ROOM );
    return;
    }

       send_to_char("You want to withdraw what?\n\r", ch );
       return;
}   
Exemple #23
0
void do_dip(CHAR_DATA * ch, char * argument)
{
    char                arg1[MAX_INPUT_LENGTH];
    char                arg2[MAX_INPUT_LENGTH];
    OBJ_DATA *			dipped;
    OBJ_DATA *			dipping;
    OBJ_DATA *			parchment;
	EXTRA_DESCR_DATA *	ed;
	EXTRA_DESCR_DATA *	dipEd;
	bool				fountain=FALSE;
    
    argument = one_argument(argument, arg1);
    argument = one_argument(argument, arg2);

	if(arg1[0]=='\0')
	{
		send_to_char("Usage: dip <object to dip> <object to dip into>\n\r", ch);
		return;
	}
	
	// Lets make sure they have their object
	dipped = get_obj_carry(ch, arg1, ch);
	if(dipped==NULL)
	{
		send_to_char("You do not have the item you want to dip.\n\r", ch);
		return;
	}

	// If they don't type anything, check to see if there is a fountain in the room
	if(arg2[0]=='\0') 
	{
		for(dipping=ch->in_room->contents;dipping!=NULL;dipping=dipping->next_content)
        {
            if(dipping->item_type==ITEM_FOUNTAIN)
                break;
        }

        if(dipping==NULL)
        {
            send_to_char("Dip into what?\n\r", ch );
            return;
        }
        
        fountain=TRUE;
    }
    else
    {
    	dipping = get_obj_here(ch, arg2);
    	if(dipping==NULL)
    	{
    		send_to_char("You do not have the item you want to dip into.\n\r", ch);
            return;
        }
        
        if(dipping->item_type!=ITEM_POTION && dipping->item_type!=ITEM_DRINK_CON)
        {
        	send_to_char("You can only dip things into liquids! Like a potion!", ch);
        	return;
        }
    }
    
    // Ok now we have an item to dip and an item to dip into, lets see if its a special item
    ed = GetED(dipping, "*dip");
    if(ed==NULL)
    {
    	// That means the object being dipped into is not special, only thing this can do is
    	// erase scrolls and make them blank parchments, wet parchments for 2 ticks
    	if(dipped->item_type==ITEM_SCROLL)
    	{
			dipEd = GetED(dipped, "*fade");
			if(dipEd==NULL)
			{
    			act("You dip $p into $P. The writing on $p fades slightly.", ch, dipped, dipping, TO_CHAR);
    			act("$n dips $p into $P. The writing on $p fades slightly.", ch, dipped, dipping, TO_ROOM);
			
				dipEd = AddED(dipped, "*fade", "1");

    			if(fountain==FALSE)
    			{
    				// If its not a fountain, it uses the entire potion to erase the text
    				act("$p dries up!", ch, dipped, dipping, TO_CHAR);
    				act("$p dries up!", ch, dipped, dipping, TO_ROOM);
    			
    				extract_obj(dipping);
    			}
			}
			else
			{
    			act("You dip $p into $P. The writing completely fades away.", ch, dipped, dipping, TO_CHAR);
    			act("$n dips $p into $P. The writing completely fades away.", ch, dipped, dipping, TO_ROOM);
    			
    			if(fountain==FALSE)
    			{
    				// If its not a fountain, it uses the entire potion to erase the text
    				act("$P dries up!", ch, dipped, dipping, TO_CHAR);
    				act("$P dries up!", ch, dipped, dipping, TO_ROOM);
    			
    				extract_obj(dipping);
    			}
    			
    			extract_obj(dipped);
    			parchment = create_object(get_obj_index(26), ch->level);
    			obj_to_char(parchment, ch);
			}
    	}
    	else
    	{
    		act("You dip $p into $P. Nothing happens.", ch, dipped, dipping, TO_CHAR);
    		act("$n dips $p into $P. Nothing happens.", ch, dipped, dipping, TO_ROOM);
    	}
    }
    else
    {
    	// Add in flags for this stuff later
    	act("You dip $p into $P. Nothing happens.", ch, dipped, dipping, TO_CHAR);
    	act("$n dips $p into $P. Nothing happens.", ch, dipped, dipping, TO_ROOM);
    }
}
Exemple #24
0
void do_deforge( CHAR_DATA *ch, char *argument)
{
    OBJ_DATA *obj;
    char sCommand[100];
    int nValues[8] = { -3, -6, -9, -12, -24, -36, -48, -96 };
    int temp;

    if ( IS_NPC(ch) ) return;
    one_argument(argument, sCommand);
    if ( sCommand[0] == '\0' ) return stcf(ch,"Syntax: deforge <item>\n\r");
    if ( ( obj = get_obj_carry( ch, sCommand ) ) == NULL )
    {
        return stcf( ch,"You do not have that item.\n\r");
    }
    if( !IS_FORGED(obj))
    {
        return stcf(ch,"That item doesn't have any forging on it.\n\r");
    }
    if ( IS_SET(obj->spectype, SITEM_COPPER) )
    {
        REMOVE_BIT(obj->spectype, SITEM_COPPER);
        if(!remove_forge_affect(obj))
        {
            forge_affect(obj, nValues[0]);
        }
        temp = ch->pcdata->security;
        ch->pcdata->security = 6;
        do_oload(ch,"30049");
        do_claim(ch,"slab");
        ch->pcdata->security = temp;
        return stcf(ch,"With pain-staking labor, you remove the copper off your item.\n\r",ch);
    }
    else if ( IS_SET(obj->spectype, SITEM_IRON) )
    {
        REMOVE_BIT(obj->spectype, SITEM_IRON);
        if(!remove_forge_affect(obj))
        {
            forge_affect(obj, nValues[1]);
        }
        temp = ch->pcdata->security;
        ch->pcdata->security = 6;
        do_oload(ch,"30050");
        do_claim(ch,"slab");
        ch->pcdata->security = temp;
        return stcf(ch,"With pain-staking labor, you remove the iron off your item.\n\r",ch);
    }
    else if ( IS_SET(obj->spectype, SITEM_STEEL) )
    {
        REMOVE_BIT(obj->spectype, SITEM_STEEL);
        if(!remove_forge_affect(obj))
        {
            forge_affect(obj, nValues[2]);
        }
        temp = ch->pcdata->security;
        ch->pcdata->security = 6;
        do_oload(ch,"30051");
        do_claim(ch,"slab");
        ch->pcdata->security = temp;
        return stcf(ch,"With pain-staking labor, you remove the steel off your item.\n\r",ch);
    }
    else if ( IS_SET(obj->spectype, SITEM_ADAMANTITE) )
    {
        REMOVE_BIT(obj->spectype, SITEM_ADAMANTITE);
        if(!remove_forge_affect(obj))
        {
            forge_affect(obj, nValues[3]);
        }
        temp = ch->pcdata->security;
        ch->pcdata->security = 6;
        do_oload(ch,"30052");
        do_claim(ch,"slab");
        ch->pcdata->security = temp;
        return stcf(ch,"With pain-staking labor, you remove the adamantite off your item.\n\r",ch);
    }
    else if ( IS_SET(obj->spectype, SITEM_TITANIUM) )
    {
        REMOVE_BIT(obj->spectype, SITEM_TITANIUM);
        if(!remove_forge_affect(obj))
        {
            forge_affect(obj, nValues[4]);
        }
        temp = ch->pcdata->security;
        ch->pcdata->security = 6;
        do_oload(ch,"101017");
        do_claim(ch,"slab");
        ch->pcdata->security = temp;
        return stcf(ch,"With pain-staking labor, you remove the titanium off your item.\n\r",ch);
    }
    else if ( IS_SET(obj->spectype, SITEM_DIAMOND) )
    {
        REMOVE_BIT(obj->spectype, SITEM_DIAMOND);
        if(!remove_forge_affect(obj))
        {
            forge_affect(obj, nValues[5]);
        }
        temp = ch->pcdata->security;
        ch->pcdata->security = 6;
        do_oload(ch,"101018");
        do_claim(ch,"slab");
        ch->pcdata->security = temp;
        return stcf(ch,"With pain-staking labor, you remove the zirconium off your item.\n\r",ch);

    }
    else if ( IS_SET(obj->spectype, SITEM_EXCAVIER) )
    {
        REMOVE_BIT(obj->spectype, SITEM_EXCAVIER);
        if(!remove_forge_affect(obj))
        {
            forge_affect(obj, nValues[6]);
        }
        temp = ch->pcdata->security;
        ch->pcdata->security = 6;
        do_oload(ch,"101019");
        do_claim(ch,"slab");
        ch->pcdata->security = temp;
        return stcf(ch,"With pain-staking labor, you remove the excavier off your item.\n\r",ch);
    }
    else if ( IS_SET(obj->spectype, SITEM_LIQUID_SHADOW) )
    {
        REMOVE_BIT(obj->spectype, SITEM_LIQUID_SHADOW);
        if(!remove_forge_affect(obj))
        {
            forge_affect(obj, nValues[7]);
        }
        temp = ch->pcdata->security;
        ch->pcdata->security = 6;
        do_oload(ch,"101024");
        do_claim(ch,"slab");
        ch->pcdata->security = temp;
        return stcf(ch,"With pain-staking labor, you remove the mithril off your item.\n\r",ch);
    }

    else
        return stcf(ch,"Something went very wrong.\n\r");
}
Exemple #25
0
void do_buy( CHAR_DATA * ch, char *argument )
{
  char arg[MAX_INPUT_LENGTH];
  int maxgold = 0;

  argument = one_argument( argument, arg );

  if( arg[0] == '\0' )
  {
    send_to_char( "Buy what?\r\n", ch );
    return;
  }

  /* in case of different shop types */
  {
    CHAR_DATA *keeper = NULL;
    OBJ_DATA *obj = NULL;
    int cost = 0;
    int noi = 1;		/* Number of items */
    short mnoi = 20;		/* Max number of items to be bought at once */

    if( ( keeper = find_keeper( ch ) ) == NULL )
      return;

    maxgold = keeper->top_level * 10;

    if( is_number( arg ) )
    {
      noi = atoi( arg );
      argument = one_argument( argument, arg );

      if( noi > mnoi )
      {
	act( AT_TELL, "$n tells you 'I don't sell that many items at"
	    " once.'", keeper, NULL, ch, TO_VICT );
	ch->reply = keeper;
	return;
      }
    }

    obj = get_obj_carry( keeper, arg );

    if( !obj && arg[0] == '#' )
    {
      int onum = 0, oref = atoi( arg + 1 );
      bool ofound = FALSE;

      for( obj = keeper->last_carrying; obj; obj = obj->prev_content )
      {
	if( obj->wear_loc == WEAR_NONE && can_see_obj( ch, obj ) )
	  onum++;

	if( onum == oref )
	{
	  ofound = TRUE;
	  break;
	}
	else if( onum > oref )
	  break;
      }
      if( !ofound )
	obj = NULL;
    }

    cost = ( get_cost( ch, keeper, obj, TRUE ) * noi );
    if( cost <= 0 || !can_see_obj( ch, obj ) )
    {
      act( AT_TELL, "$n tells you 'I don't sell that -- try 'list'.'",
	  keeper, NULL, ch, TO_VICT );
      ch->reply = keeper;
      return;
    }

    if( !IS_OBJ_STAT( obj, ITEM_INVENTORY ) && ( noi > 1 ) )
    {
      char buf[MAX_STRING_LENGTH];
      snprintf( buf, MAX_STRING_LENGTH, "%s", "laugh" );
      interpret( keeper, buf );
      act( AT_TELL, "$n tells you 'I don't have enough of those in stock"
	  " to sell more than one at a time.'", keeper, NULL, ch,
	  TO_VICT );
      ch->reply = keeper;
      return;
    }

    if( ch->gold < cost )
    {
      act( AT_TELL, "$n tells you 'You can't afford to buy $p.'",
	  keeper, obj, ch, TO_VICT );
      ch->reply = keeper;
      return;
    }

    if( IS_SET( obj->extra_flags, ITEM_PROTOTYPE ) && IS_IMMORTAL( ch ) )
    {
      act( AT_TELL,
	  "$n tells you 'This is a only a prototype!  I can't sell you that...'",
	  keeper, NULL, ch, TO_VICT );
      ch->reply = keeper;
      return;
    }

    if( ch->carry_number + get_obj_number( obj ) > can_carry_n( ch ) )
    {
      send_to_char( "You can't carry that many items.\r\n", ch );
      return;
    }

    if( ch->carry_weight + ( get_obj_weight( obj ) * noi )
	+ ( noi > 1 ? 2 : 0 ) > can_carry_w( ch ) )
    {
      send_to_char( "You can't carry that much weight.\r\n", ch );
      return;
    }

    if( noi == 1 )
    {
      if( !IS_OBJ_STAT( obj, ITEM_INVENTORY ) )
	separate_obj( obj );
      act( AT_ACTION, "$n buys $p.", ch, obj, NULL, TO_ROOM );
      act( AT_ACTION, "You buy $p.", ch, obj, NULL, TO_CHAR );
    }
    else
    {
      sprintf( arg, "$n buys %d $p%s.", noi,
	  ( obj->short_descr[strlen( obj->short_descr ) - 1] == 's'
	    ? "" : "s" ) );
      act( AT_ACTION, arg, ch, obj, NULL, TO_ROOM );
      sprintf( arg, "You buy %d $p%s.", noi,
	  ( obj->short_descr[strlen( obj->short_descr ) - 1] == 's'
	    ? "" : "s" ) );
      act( AT_ACTION, arg, ch, obj, NULL, TO_CHAR );
      act( AT_ACTION, "$N puts them into a bag and hands it to you.",
	  ch, NULL, keeper, TO_CHAR );
    }

    ch->gold -= cost;
    keeper->gold += cost;

    if( keeper->gold > maxgold )
    {
      keeper->gold = maxgold / 2;
      act( AT_ACTION, "$n puts some credits into a large safe.", keeper,
	  NULL, NULL, TO_ROOM );
    }

    if( IS_OBJ_STAT( obj, ITEM_INVENTORY ) )
    {
      OBJ_DATA *buy_obj = create_object( obj->pIndexData );
      OBJ_DATA *bag = NULL;

      /*
       * Due to grouped objects and carry limitations in SMAUG
       * The shopkeeper gives you a bag with multiple-buy,
       * and also, only one object needs be created with a count
       * set to the number bought.                -Thoric
       */
      if( noi > 1 )
      {
	bag = create_object( get_obj_index( OBJ_VNUM_SHOPPING_BAG ) );
	/* perfect size bag ;) */
	bag->value[0] = bag->weight + ( buy_obj->weight * noi );
	buy_obj->count = noi;
	obj->pIndexData->count += ( noi - 1 );
	numobjsloaded += ( noi - 1 );
	obj_to_obj( buy_obj, bag );
	obj_to_char( bag, ch );
      }
      else
	obj_to_char( buy_obj, ch );
    }
    else
    {
      obj_from_char( obj );
      obj_to_char( obj, ch );
    }

    return;
  }
}
Exemple #26
0
void do_glamour(CHAR_DATA *ch, char *argument)
{

	char arg1[MAX_STRING_LENGTH];
	char arg2[MAX_STRING_LENGTH];
	char arg3[MAX_STRING_LENGTH];
	OBJ_DATA *obj;

	argument=one_argument(argument,arg1);
	argument=one_argument(argument,arg2);
	strcpy(arg3,argument);

	if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_DROW))
  {
    send_to_char("Huh?\n\r",ch);
    return;
  }
	if (IS_CLASS(ch,CLASS_DROW) && !IS_SET(ch->pcdata->powers[1],DPOWER_GLAMOUR)) {
	send_to_char("Huh?\n\r", ch );
	return;}


	if ((obj=get_obj_carry(ch,arg1)) == NULL)
	{send_to_char("You dont have that item.\n\r",ch);
	return;}

	if (!(!str_cmp(arg2,"short") || !str_cmp(arg2,"name")))
        {send_to_char("syntax : glamour <item> <short/name> <newname>.\n\r",ch);
        return;}

	if (strlen(arg3) > 60 || strlen(arg3) < 3)
	{send_to_char("From 3 to 60 characters please.\n\r",ch);
	return;}

  if (has_bad_chars(ch, arg3))
  {
    send_to_char("Illegal chars, please retry.\n\r",ch);
    return;
  }

  if (IS_SET(obj->quest, QUEST_ARTIFACT) || IS_SET(obj->quest, QUEST_PRIZE))
  {
    send_to_char("Not on artifacts and prizes.\n\r",ch);
    return;
  }

	if (!str_cmp(arg2,"name"))
        {free_string(obj->name);
	obj->name = str_dup(arg3);
	obj->questmaker = str_dup(ch->name);
	}
	if (!str_cmp(arg2,"short"))
	{free_string(obj->short_descr);
	obj->short_descr=str_dup(arg3);
	obj->questmaker = str_dup(ch->name);
	}
	send_to_char("Ok.\n\r",ch);

	return;
}
Exemple #27
0
void do_sharpen( CHAR_DATA * ch, char *argument )
{
   OBJ_DATA *obj;
   OBJ_DATA *pobj;
   char arg[MAX_INPUT_LENGTH];
   AFFECT_DATA *paf;
   int percent;
   int level;

   one_argument( argument, arg );

   if( arg[0] == '\0' )
   {
      send_to_char( "What do you wish to sharpen?\r\n", ch );
      return;
   }

   if( ms_find_obj( ch ) )
      return;

   if( !( obj = get_obj_carry( ch, arg ) ) )
   {
      send_to_char( "You do not have that weapon.\r\n", ch );
      return;
   }

   if( obj->item_type != ITEM_WEAPON )
   {
      send_to_char( "You can't sharpen something that's not a weapon.\r\n", ch );
      return;
   }

   /*
    * Let's not allow people to sharpen bludgeons and the like ;) 
    */
   /*
    * small mods to make it more generic.. --Cronel 
    */
   if( obj->value[3] != DAM_HIT
       && obj->value[3] != DAM_SLICE
       && obj->value[3] != DAM_STAB
       && obj->value[3] != DAM_SLASH
       && obj->value[3] != DAM_CLAW && obj->value[3] != DAM_BITE && obj->value[3] != DAM_PIERCE )
   {
      send_to_char( "You can't sharpen that type of weapon!\r\n", ch );
      return;
   }

   if( obj->value[5] == 1 )   /* see reason below when setting */
   {
      send_to_char( "It is already as sharp as it's going to get.\r\n", ch );
      return;
   }

   for( pobj = ch->first_carrying; pobj; pobj = pobj->next_content )
   {
      if( pobj->pIndexData->vnum == OBJ_VNUM_SHARPEN )
         break;
   }

   if( !pobj )
   {
      send_to_char( "You do not have a sharpening stone.\r\n", ch );
      return;
   }

   WAIT_STATE( ch, skill_table[gsn_sharpen]->beats );
   /*
    * Character must have the dexterity to sharpen the weapon nicely, 
    * * if not, damage weapon 
    */
   if( !IS_NPC( ch ) && get_curr_dex( ch ) < 17 )
   {
      separate_obj( obj );
      if( obj->value[0] <= 1 )
      {
         act( AT_OBJECT, "$p breaks apart and falls to the ground in pieces!.", ch, obj, NULL, TO_CHAR );
         extract_obj( obj );
         learn_from_failure( ch, gsn_sharpen );
         return;
      }
      else
      {
         obj->value[0]--;
         act( AT_GREEN, "You clumsily slip and damage $p!", ch, obj, NULL, TO_CHAR );
         return;
      }
   }

   percent = ( number_percent(  ) - get_curr_lck( ch ) - 15 ); /* too low a chance to damage? */

   separate_obj( pobj );
   if( !IS_NPC( ch ) && percent > ch->pcdata->learned[gsn_sharpen] )
   {
      act( AT_OBJECT, "You fail to sharpen $p correctly, damaging the stone.", ch, obj, NULL, TO_CHAR );
      if( pobj->value[0] <= 1 )
      {
         act( AT_OBJECT, "The sharpening stone crumbles apart from misuse.", ch, pobj, NULL, TO_CHAR );
         extract_obj( pobj );
         learn_from_failure( ch, gsn_sharpen );
         return;
      }
      pobj->value[0]--;
      learn_from_failure( ch, gsn_sharpen );
      return;
   }
   level = ch->level;
   separate_obj( obj );
   act( AT_SKILL, "With skill and precision, you sharpen $p to a fine edge.", ch, obj, NULL, TO_CHAR );
   act( AT_SKILL, "With skill and precision, $n sharpens $p.", ch, obj, NULL, TO_ROOM );
   CREATE( paf, AFFECT_DATA, 1 );
   paf->type = -1;
   paf->duration = -1;
   paf->location = APPLY_DAMROLL;
   paf->modifier = level / 10;
   xCLEAR_BITS( paf->bitvector );   /* changed to ext BVs in upgrade --Cronel */
   LINK( paf, obj->first_affect, obj->last_affect, next, prev );

   obj->value[5] = 1;
   /*
    * originaly a sharpened object flag was used, but took up a BV, 
    * * so I switched to giving it a value5, which is not used in weapons 
    * * besides to check for this 
    */
   learn_from_success( ch, gsn_sharpen );
   return;

}
Exemple #28
0
/* ---------------------------------------------------------------------
 * CMD_EVAL
 * This monster evaluates an if/or/and statement
 * There are five kinds of statement:
 * 1) keyword and value (no $-code)	    if random 30
 * 2) keyword, comparison and value	    if people > 2
 * 3) keyword and actor		    	    if isnpc $n
 * 4) keyword, actor and value		    if carries $n sword
 * 5) keyword, actor, comparison and value  if level $n >= 10
 *
 *----------------------------------------------------------------------
 */
int cmd_eval( sh_int vnum, char *line, int check,
	CHAR_DATA *mob, CHAR_DATA *ch, 
	const void *arg1, const void *arg2, CHAR_DATA *rch )
{
    CHAR_DATA *lval_char = mob;
    CHAR_DATA *vch = (CHAR_DATA *) arg2;
    OBJ_DATA *obj1 = (OBJ_DATA  *) arg1;
    OBJ_DATA *obj2 = (OBJ_DATA  *) arg2;
    OBJ_DATA  *lval_obj = NULL;

    char *original, buf[MAX_INPUT_LENGTH], code;
    int lval = 0, oper = 0, rval = -1;

    original = line;
    line = one_argument( line, buf );
    if ( buf[0] == '\0' || mob == NULL )
	return FALSE;

    /*
     * If this mobile has no target, let's assume our victim is the one
     */
    if ( mob->mprog_target == NULL )
	mob->mprog_target = ch;

    switch ( check )
    {
	/*
	 * Case 1: keyword and value
	 */
	case CHK_RAND:
	    return( atoi( buf ) < number_percent() );
	case CHK_MOBHERE:
	    if ( is_number( buf ) )
		return( get_mob_vnum_room( mob, atoi(buf) ) );
	    else
		return( (bool) (get_char_room( mob, buf) != NULL) );
	case CHK_OBJHERE:
	    if ( is_number( buf ) )
		return( get_obj_vnum_room( mob, atoi(buf) ) );
	    else
		return( (bool) (get_obj_here( mob, buf) != NULL) );
        case CHK_MOBEXISTS:
	    return( (bool) (get_char_world( mob, buf) != NULL) );
	case CHK_OBJEXISTS:
	    return( (bool) (get_obj_world( mob, buf) != NULL) );
	/*
	 * Case 2 begins here: We sneakily use rval to indicate need
	 * 		       for numeric eval...
	 */
	case CHK_PEOPLE:
	    rval = count_people_room( mob, 0 ); break;
	case CHK_PLAYERS:
	    rval = count_people_room( mob, 1 ); break;
	case CHK_MOBS:
	    rval = count_people_room( mob, 2 ); break;
	case CHK_CLONES:
	    rval = count_people_room( mob, 3 ); break;
	case CHK_ORDER:
	    rval = get_order( mob ); break;
	case CHK_HOUR:
	    rval = time_info.hour; break;
	default:;
    }

    /*
     * Case 2 continued: evaluate expression
     */
    if ( rval >= 0 )
    {
	if ( (oper = keyword_lookup( fn_evals, buf )) < 0 )
	{
	    sprintf( buf, "Cmd_eval: prog %d syntax error(2) '%s'",
		vnum, original );
	    bug( buf, 0 );
	    return FALSE;
	}
	one_argument( line, buf );
	lval = rval;
	rval = atoi( buf );
	return( num_eval( lval, oper, rval ) );
    }

    /*
     * Case 3,4,5: Grab actors from $* codes
     */
    if ( buf[0] != '$' || buf[1] == '\0' )
    {
	sprintf( buf, "Cmd_eval: prog %d syntax error(3) '%s'",
		vnum, original );
	bug( buf, 0 );
        return FALSE;
    }
    else
        code = buf[1];
    switch( code )
    {
    	case 'i':
            lval_char = mob; break;
        case 'n':
            lval_char = ch; break;
        case 't':
            lval_char = vch; break;
        case 'r':
            lval_char = rch == NULL ? get_random_char( mob ) : rch ; break;
        case 'o':
            lval_obj = obj1; break;
        case 'p':
            lval_obj = obj2; break;
	case 'q':
	    lval_char = mob->mprog_target; break;
	default:
	    sprintf( buf, "Cmd_eval: prog %d syntax error(4) '%s'",
		vnum, original );
	    bug( buf, 0 );
	    return FALSE;
    }
    /*
     * From now on, we need an actor, so if none was found, bail out
     */
    if ( lval_char == NULL && lval_obj == NULL )
    	return FALSE;

    /*
     * Case 3: Keyword, comparison and value
     */
    switch( check )
    {
	case CHK_ISPC:
            return( lval_char != NULL && !IS_NPC( lval_char ) );
        case CHK_ISNPC:
            return( lval_char != NULL && IS_NPC( lval_char ) );
        case CHK_ISGOOD:
            return( lval_char != NULL && IS_GOOD( lval_char ) );
        case CHK_ISEVIL:
            return( lval_char != NULL && IS_EVIL( lval_char ) );
        case CHK_ISNEUTRAL:
            return( lval_char != NULL && IS_NEUTRAL( lval_char ) );
	case CHK_ISIMMORT:
            return( lval_char != NULL && IS_IMMORTAL( lval_char ) );
        case CHK_ISCHARM: /* A relic from MERC 2.2 MOBprograms */
            return( lval_char != NULL && IS_AFFECTED( lval_char, AFF_CHARM ) );
        case CHK_ISFOLLOW:
            return( lval_char != NULL && lval_char->master != NULL 
		 && lval_char->master->in_room == lval_char->in_room );
	case CHK_ISACTIVE:
	    return( lval_char != NULL && lval_char->position > POS_SLEEPING );
	case CHK_ISDELAY:
	    return( lval_char != NULL && lval_char->mprog_delay > 0 );
	case CHK_ISVISIBLE:
            switch( code )
            {
                default :
                case 'i':
                case 'n':
                case 't':
                case 'r':
		case 'q':
	    	    return( lval_char != NULL && can_see( mob, lval_char ) );
		case 'o':
		case 'p':
	    	    return( lval_obj != NULL && can_see_obj( mob, lval_obj ) );
	    }
	case CHK_HASTARGET:
	    return( lval_char != NULL && lval_char->mprog_target != NULL
		&&  lval_char->in_room == lval_char->mprog_target->in_room );
	case CHK_ISTARGET:
	    return( lval_char != NULL && mob->mprog_target == lval_char );
	default:;
     }

     /* 
      * Case 4: Keyword, actor and value
      */
     line = one_argument( line, buf );
     switch( check )
     {
	case CHK_AFFECTED:
	    return( lval_char != NULL 
		&&  IS_SET(lval_char->affected_by, flag_lookup(buf, affect_flags)) );
	case CHK_ACT:
	    return( lval_char != NULL 
		&&  IS_SET(lval_char->act, flag_lookup(buf, act_flags)) );
	case CHK_IMM:
	    return( lval_char != NULL 
		&&  IS_SET(lval_char->imm_flags, flag_lookup(buf, imm_flags)) );
	case CHK_OFF:
	    return( lval_char != NULL 
		&&  IS_SET(lval_char->off_flags, flag_lookup(buf, off_flags)) );
	case CHK_CARRIES:
	    if ( is_number( buf ) )
		return( lval_char != NULL && has_item( lval_char, atoi(buf), -1, FALSE ) );
	    else
		return( lval_char != NULL && (get_obj_carry( lval_char, buf ) != NULL) );
	case CHK_WEARS:
	    if ( is_number( buf ) )
		return( lval_char != NULL && has_item( lval_char, atoi(buf), -1, TRUE ) );
	    else
		return( lval_char != NULL && (get_obj_wear( lval_char, buf ) != NULL) );
	case CHK_HAS:
	    return( lval_char != NULL && has_item( lval_char, -1, item_lookup(buf), FALSE ) );
	case CHK_USES:
	    return( lval_char != NULL && has_item( lval_char, -1, item_lookup(buf), TRUE ) );
	case CHK_NAME:
            switch( code )
            {
                default :
                case 'i':
                case 'n':
                case 't':
                case 'r':
		case 'q':
		    return( lval_char != NULL && is_name( buf, lval_char->name ) );
		case 'o':
		case 'p':
		    return( lval_obj != NULL && is_name( buf, lval_obj->name ) );
	    }
	case CHK_POS:
	    return( lval_char != NULL && lval_char->position == position_lookup( buf ) );
	case CHK_CLAN:
	    return( lval_char != NULL && lval_char->clan == clan_lookup( buf ) );
	case CHK_RACE:
	    return( lval_char != NULL && lval_char->race == race_lookup( buf ) );
	case CHK_OBJTYPE:
	    return( lval_obj != NULL && lval_obj->item_type == item_lookup( buf ) );
	default:;
    }

    /*
     * Case 5: Keyword, actor, comparison and value
     */
    if ( (oper = keyword_lookup( fn_evals, buf )) < 0 )
    {
	sprintf( buf, "Cmd_eval: prog %d syntax error(5): '%s'",
		vnum, original );
	bug( buf, 0 );
	return FALSE;
    }
    one_argument( line, buf );
    rval = atoi( buf );

    switch( check )
    {
	case CHK_VNUM:
	    switch( code )
            {
                default :
                case 'i':
                case 'n':
                case 't':
                case 'r':
		case 'q':
                    if( lval_char != NULL && IS_NPC( lval_char ) )
                        lval = lval_char->pIndexData->vnum;
                    break;
                case 'o':
                case 'p':
                     if ( lval_obj != NULL )
                        lval = lval_obj->pIndexData->vnum;
            }
            break;
	case CHK_HPCNT:
	    if ( lval_char != NULL ) lval = (lval_char->hit * 100)/(UMAX(1,lval_char->max_hit)); break;
	case CHK_ROOM:
	    if ( lval_char != NULL && lval_char->in_room != NULL )
		lval = lval_char->in_room->vnum; break;
        case CHK_SEX:
	    if ( lval_char != NULL ) lval = lval_char->sex; break;
        case CHK_LEVEL:
            if ( lval_char != NULL ) lval = lval_char->level; break;
	case CHK_ALIGN:
            if ( lval_char != NULL ) lval = lval_char->alignment; break;
	case CHK_MONEY:  /* Money is converted to silver... */
	    if ( lval_char != NULL ) 
		lval = lval_char->gold + (lval_char->silver * 100); break;
	case CHK_OBJVAL0:
            if ( lval_obj != NULL ) lval = lval_obj->value[0]; break;
        case CHK_OBJVAL1:
            if ( lval_obj != NULL ) lval = lval_obj->value[1]; break;
        case CHK_OBJVAL2: 
            if ( lval_obj != NULL ) lval = lval_obj->value[2]; break;
        case CHK_OBJVAL3:
            if ( lval_obj != NULL ) lval = lval_obj->value[3]; break;
	case CHK_OBJVAL4:
	    if ( lval_obj != NULL ) lval = lval_obj->value[4]; break;
	case CHK_GRPSIZE:
	    if( lval_char != NULL ) lval = count_people_room( lval_char, 4 ); break;
	default:
            return FALSE;
    }
    return( num_eval( lval, oper, rval ) );
}
Exemple #29
0
void do_bank_deposit( Character *ch, char *argument )
{
    char arg1[MAX_INPUT_LENGTH];
    char buf[MAX_INPUT_LENGTH];
    int amount;
    OBJ_DATA *obj;


    argument = one_argument( argument, arg1 );

    if ( IS_NPC(ch) )
    {
        send_to_char( "Mobs don't have bank accounts!\n\r", ch );
        return;
    }

    if ( ( obj = get_obj_carry( ch, (char*)"bank note", ch ) ) == NULL )
    {
        send_to_char( "You do not own a bank note.\n\r", ch );
        return;
    }

    if (!str_cmp( arg1, "all"))
    {
	if (ch->gold <= 0 && ch->silver <= 0)
	{
	    send_to_char("You have no money to deposit!\n\r",ch);
	    return;
	}

	/* Lets convert our silver first */
	obj->value[1] += ch->silver;
        sprintf( buf, "%d", obj->value[1] );
        do_bank_change(ch, buf );
	sprintf(buf,"You deposit %ld silver and %ld gold into your bank note.\n\r", ch->silver, ch->gold );
	send_to_char(buf,ch);
	obj->value[0] += ch->gold;
	ch->gold = 0;
	ch->silver = 0;
	return;
    }

    if(!str_cmp(argument, "silver"))
    {

    if ( !is_number( arg1 ) )
    {
        send_to_char( "Deposit how much?\n\r", ch );
            return;
        }

        amount = atoi(arg1);
	if (ch->silver < amount || amount <= 0)
	{
	    send_to_char("You don't have that ammount of silver.\n\r",ch);
	    return;
	}

        ch->silver -= amount;  
        obj->value[1] += amount;
	sprintf(buf,"You deposit %d silver.\n\r", amount);
	send_to_char(buf,ch);
	sprintf( buf, "%d", obj->value[1] );
        do_bank_change(ch, buf );
        act("$n deposits some silver.", ch, NULL, NULL, TO_ROOM);
    return;
    }


    if(!str_cmp(argument, "gold"))
    {
        if ((amount = atoi(arg1)) <= 0)
	{
	    send_to_char("You must deposit at least one gold.\n\r",ch);
	    return;
        }

	if (ch->gold < amount || amount <= 0 )
	{
	    send_to_char("You can't put that much gold in the bank.\n\r",ch);
	    return;
	}

        ch->gold -= amount;  
        obj->value[0] += amount;
	sprintf(buf, "You deposit %d gold.\n\r", amount);
	send_to_char(buf,ch);
        act("$n deposits some gold.", ch, NULL, NULL, TO_ROOM );
    return;
    }

       send_to_char("Syntax: bank deposit <ammount> <gold/silver>\n\r", ch );
	send_to_char("Or:     bank deposit all\n\r",ch);
       return;
}   
Exemple #30
0
/*
 * (FF) Da rivedere:
 * 	1) materiali vegetali bruciabili
 *	2) elenco erbe per slot con effetti oppure utilizzo lista di affect uhm... da pensare.
 */
DO_RET do_smoke( CHAR_DATA *ch, char *argument )
{
	OBJ_DATA *the_pipe;

	if ( !VALID_STR(argument) )
	{
		send_to_char( ch, "Che cosa devo fumare?\r\n" );
		return;
	}

	if ( ms_find_obj(ch) )
		return;

	if ( (the_pipe = get_obj_carry(ch, argument, TRUE)) == NULL )
	{
		send_to_char( ch, "Non lo sto trasportando.\r\n" );
		return;
	}

	if ( the_pipe->type != OBJTYPE_PIPE )
	{
		act( AT_ACTION, "Tento di fumare $p.. ma non si accende.", ch, the_pipe, NULL, TO_CHAR );
		act( AT_ACTION, "$n tenta di fumare $p...", ch, the_pipe, NULL, TO_ROOM );
		return;
	}

	if ( !HAS_BITINT(the_pipe->pipe->flags, PIPE_LIT) )
	{
		act( AT_ACTION, "Tento di fumare $p, ma non arde.", ch, the_pipe, NULL, TO_CHAR );
		act( AT_ACTION, "$n tenta di fumare $p, con scarso successo.", ch, the_pipe, NULL, TO_ROOM );
		return;
	}

	if ( the_pipe->pipe->draws > 0 )
	{
		if ( !oprog_use_trigger( ch, the_pipe, NULL, NULL, NULL ) )
		{
			act( AT_ACTION, "Tiro profondamente da $p.", ch, the_pipe, NULL, TO_CHAR );
			act( AT_ACTION, "$n tira profondamente da $p.", ch, the_pipe, NULL, TO_ROOM );
		}

		if ( is_valid_herb(the_pipe->pipe->herb) && the_pipe->pipe->herb <= MAX_HERB )
		{
			int			sn		= the_pipe->pipe->herb + TYPE_HERB;
			SKILL_DATA *skill	= get_skilltype( sn );

			WAIT_STATE( ch, skill->beats * 3 );	/* (WT) */
			if ( skill->spell_fun )
				obj_cast_spell( sn, UMIN(the_pipe->level/2, get_level(ch)/2), ch, ch, NULL );
			if ( obj_extracted(the_pipe) )
				return;
		}
		else
		{
			send_log( NULL, LOG_BUG, "do_smoke: tipo di erba errata %d", the_pipe->pipe->herb );
		}

		SET_BITINT( the_pipe->pipe->flags, PIPE_HOT );
		if ( --the_pipe->pipe->draws < 1 )
		{
			REMOVE_BITINT( the_pipe->pipe->flags, PIPE_LIT );
			SET_BITINT( the_pipe->pipe->flags, PIPE_DIRTY );
			SET_BITINT( the_pipe->pipe->flags, PIPE_FULLOFASH );
		}
	} /* chiude l'if */
	send_log( NULL, LOG_BUG, "do_smoke: in attesa di nuova implementazione." );
}