Esempio n. 1
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" );
}
Esempio n. 2
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" );
}
Esempio n. 3
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;

}
Esempio n. 4
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." );
}