Exemplo n.º 1
0
int skill_hunt( int sn, int level, CHAR_DATA *ch, void *vo )
{
  char buf[MAX_STRING_LENGTH];
  CHAR_DATA *victim;
  int direction;
  bool fArea;

  if( target_name[0] == '\0' )
    {
      send_to_char(AT_BLOOD, "Whom are you trying to hunt?\n\r", ch );
      return SKPELL_BOTCHED;
    }

  /* only imps can hunt to different areas */
  fArea = ( get_trust(ch) < MAX_LEVEL );

  if( fArea )
    victim = get_char_area( ch, target_name );
  else
    victim = get_char_world( ch, target_name );

  if( victim == NULL )
    {
      send_to_char(AT_BLOOD,"No-one around by that name.\n\r", ch );
      return SKPELL_BOTCHED;
    }

  if( ch->in_room == victim->in_room )
    {
      act(AT_BLOOD, "$N is here!", ch, NULL, victim, TO_CHAR );
      return SKPELL_NO_DAMAGE;
    }

  /*
   * Deduct some movement.
   */
  if( ch->move > 2 )
    ch->move -= 3;
  else
    {
      send_to_char(AT_BLOOD, "You're too exhausted to hunt anyone!\n\r", ch );
      return SKPELL_MISSED;
    }

  act(AT_BLOOD, "$n carefully sniffs the air.", ch, NULL, NULL, TO_ROOM );
  WAIT_STATE( ch, skill_table[sn].beats );
  direction = find_path( ch->in_room->vnum, victim->in_room->vnum,
			ch, -40000, fArea );

  if( direction == -1 )
    {
      act(AT_BLOOD, "You couldn't find a path to $N from here.",
	  ch, NULL, victim, TO_CHAR );
      return SKPELL_MISSED;
    }

  if( direction < 0 || direction > 5 )
    {
      send_to_char(AT_BLOOD, "Hmm... Something seems to be wrong.\n\r", ch );
      return SKPELL_BOTCHED;
    }

  /*
   * Give a random direction if the player misses the die roll.
   */
  if( ( IS_NPC (ch) && number_percent () > 75)        /* NPC @ 25% */
     || (!IS_NPC (ch) && number_percent () >          /* PC @ norm */
	 ( ch->pcdata->learned[sn] / 10 )  ) )
    {
      do
	{
	  direction = number_door();
	}
      while( ( ch->in_room->exit[direction] == NULL )
	    || ( ch->in_room->exit[direction]->to_room == NULL) );
    }

  /*
   * Display the results of the search.
   */
  sprintf( buf, "$N is %s from here.", dir_name[direction] );
  act(AT_BLOOD, buf, ch, NULL, victim, TO_CHAR );

  return SKPELL_NO_DAMAGE;
}
Exemplo n.º 2
0
void do_track( CHAR_DATA *ch, char *argument )
{
	char       buf [ MAX_STRING_LENGTH ];
	char       arg [ MAX_STRING_LENGTH ];
	CHAR_DATA *victim;
	int        direction, skill;
	bool       fArea=TRUE;

	skill=get_skill(ch, gsn_track);

	if (IS_NPC(ch))
	{
		return;
	}

	if ( ch->mount )
	{
		send_to_char( "Najpierw zsi±d¼ ze swojego wierzchowca.\n\r", ch );
		return;
	}

	if ( !IS_IMMORTAL( ch ) && IS_AFFECTED( ch, AFF_BLIND ) )
	{
		act("$n klêka i bezradnie potrz±sa g³ow±.",ch,NULL,NULL,TO_ROOM);
		send_to_char("Klekasz, ale przecie¿ niczego nie widzisz.\n\r",ch);
		return;
	}
	if ( room_is_dark( ch, ch->in_room ) &&  !(IS_AFFECTED( ch, AFF_DARK_VISION ) || IS_IMMORTAL( ch ) ))
	{
		send_to_char("Klekasz, ale jest tu tak ciemno, ¿e niczego nie widzisz.\n\r",ch);
		return;
	}

	// wycinamy niektóre ze sektorów
	switch ( ch->in_room->sector_type )
	{
		case  6:  //woda p³yw
		case  7:  //woda niep
		case 19:  //rzeka
		case 20:  //jezioro
		case 21:  //morze
		case 22:  //ocean
		case 23:  //lawa
		case 24:  //ruchome piaski
		case 25:  //gor±ce ¼ród³o
		case 34:  //pod wod±
		case 37:  //ciemna woda
		case 39:  //podziemne jezioro
			send_to_char( "Tutaj chyba nie da siê szukaæ ¶ladów.\n\r", ch );
			return;
	}

	// komunikaty dla tych, którzy nie umiej± szukaæ ¶ladów
	if ( skill == 0 )
	{
		switch (number_range(1,7))
		{
			case 1:
				act("$n klêka i nie wie co robiæ dalej.",ch,NULL,NULL,TO_ROOM);
				send_to_char("Klêkasz i nie za bardzo wiesz co robiæ dalej.\n\r",ch);
				break;
			case 2:
				act("$n klêka i niczego nie widzi.",ch,NULL,NULL,TO_ROOM);
				send_to_char("Klêkasz i niczego nie widzisz.\n\r",ch);
				break;
			case 3:
				act("$n mocno tupie, klêka i przygl±da siê ¶ladom.",ch,NULL,NULL,TO_ROOM);
				send_to_char("Mocno tupiesz, klêkasz i przygl±dasz siê ¶ladom.\n\r",ch);
				break;
			case 4:
				act("$n klêka i ¶ledzi tropy, ale nie ma o tym zielonego pojêcia.",ch,NULL,NULL,TO_ROOM);
				send_to_char("Klêkasz i ¶ledzisz tropy, choæ nie masz o tym zielonego pojêcia.\n\r",ch);
				break;
			case 5:
				act("$n klêka i robi nieszczê¶liw± minê.",ch,NULL,NULL,TO_ROOM);
				send_to_char("Klêkasz i robisz nieszczê¶liw± minê.\n\r",ch);
				break;
			case 6:
				act("$n rozgl±da siê dooko³a.",ch,NULL,NULL,TO_ROOM);
				send_to_char("Rozgl±dasz siê dooko³a, ale to nie pomaga.\n\r",ch);
				break;
			case 7:
				act("$n zastanawia siê nad tym, ¿e tropienie to niez³a umiejêtno¶æ.",ch,NULL,NULL,TO_ROOM);
				send_to_char("Zastanawiasz siê nad tym, ¿e tropienie to niez³a umiejêtno¶æ.\n\r",ch);
				break;
			default :
				send_to_char( "Nie masz pojêcia jak to siê robi.\n\r", ch );
				act("$n klêka i ¶ledzi tropy, ale nie ma o tym zielonego pojêcia.",ch,NULL,NULL,TO_ROOM);
				break;
		}
		return;
	}

	// bonus/kara od dobrej lokacji s± wiêksze ni¿ od z³ej
	if ( EXT_IS_SET( ch->in_room->room_flags, ROOM_CONSECRATE ))
	{
		if (IS_EVIL( ch ) ) skill -= number_range(1,5);
		if (IS_GOOD( ch ) ) skill += number_range(1,5);
	}

	if ( EXT_IS_SET( ch->in_room->room_flags, ROOM_DESECRATE ))
	{
		if (IS_EVIL( ch ) ) skill += number_range(0,4);
		if (IS_GOOD( ch ) ) skill -= number_range(0,4);
	}

	// sprawdzamy czy skill nie zrobi³ siê nam mniejszy ni¿ 1
	if (skill < 1)
	{
		skill = 1;
	}

	// no to zaczynamy w³a¶ciwe trackowanie :D
	one_argument( argument, arg );

#ifdef ENABLE_NEW_TRACK
	if(MAX_TRACK_LEN > 0)
	{
		track_new(ch, skill, argument);
		return;
	}
#endif

	if ( arg[0] == '\0' )
	{
		act("$n klêka i zaczyna z uwag± przygl±daæ siê ¶ladom.",ch,NULL,NULL,TO_ROOM);
		act("Klêkasz i z uwag± przygl±dasz siê ¶ladom.",ch,NULL,NULL,TO_CHAR);
		return;
	}

	if ( fArea )
	{
		victim = get_char_area( ch, arg );
	}
	else
	{
		victim = get_char_world( ch, arg );
	}

	if ( !victim )
	{
		act("$n klêka i zaczyna z uwag± przygl±daæ siê ¶ladom.",ch,NULL,NULL,TO_ROOM);
		act("Klêkasz, przygl±dasz siê ¶ladom, ale nie znajdujesz ¿adnego tropu.",ch,NULL,NULL,TO_CHAR);
		WAIT_STATE( ch, skill_table[gsn_track].beats );
		return;
	}

	if(victim==ch)
	{
		act("Zastanawiasz siê przez chwilê czy to ma sens, no có¿...",ch,NULL,NULL,TO_CHAR);
		return;
	}

	if ( ch->in_room == victim->in_room )
	{
		act( "Klêkasz i badasz trop, po chwili zdajesz sobie sprawê, ¿e $N stoi ko³o ciebie.", ch, NULL, victim, TO_CHAR );
		act("$n klêka i zaczyna z uwag± przygl±daæ siê ¶ladom.",ch,NULL,NULL,TO_ROOM);
		return;
	}

	if ( skill < number_range( 20, 40 ) )
	{
		act("$n klêka i zaczyna z uwag± przygl±daæ siê ¶ladom.",ch,NULL,NULL,TO_ROOM);
		act("Klêkasz, przygl±dasz siê ¶ladom, ale nie znajdujesz ¿adnego tropu.",ch,NULL,NULL,TO_CHAR);
		WAIT_STATE( ch, skill_table[gsn_track].beats );
		check_improve(ch, NULL, gsn_track, FALSE, 12);
		return;
	}

	if ( IS_AFFECTED ( victim, AFF_SPIRIT_WALK ) )
	{
		act("$n klêka i zaczyna z uwag± przygl±daæ siê ¶ladom.",ch,NULL,NULL,TO_ROOM);
		act("Klêkasz, przygl±dasz siê ¶ladom, ale nie znajdujesz ¿adnego tropu.",ch,NULL,NULL,TO_CHAR);
		WAIT_STATE( ch, skill_table[gsn_track].beats );
		return;
	}
	else
	{
		act("$n klêka i zaczyna z uwag± przygl±daæ siê ¶ladom.",ch,NULL,NULL,TO_ROOM);
		act("Klêkasz i przygladasz siê ¶ladom, chyba widzisz jaki¶ trop.",ch,NULL,NULL,TO_CHAR);
	}

	WAIT_STATE( ch, skill_table[gsn_track].beats );


	direction = find_path( ch->in_room->vnum, victim->in_room->vnum, ch, -40000, fArea );

	if ( direction == -1 )
	{
		act( "Niestety, nie mo¿esz nic wiêcej odczytaæ ze ¶ladów.", ch, NULL, victim, TO_CHAR );
		return;
	}

	if ( direction < 0 || direction >= MAX_DIR )
	{
		send_to_char( "Hmm... co¶ jest nie tak.\n\r", ch );
		return;
	}

/*
 * Give a random direction if the player misses the die roll.
 */
	if ( number_percent() > skill )
	{
		do
		{
			direction = number_door( );
		}
		while (   !( ch->in_room->exit[direction] ) || !( ch->in_room->exit[direction]->u1.to_room ) );
	}

	check_improve(ch, NULL, gsn_track, TRUE, 9);

/*
 * Display the results of the search.
 */


	sprintf( buf, "Znajdujesz ¶lady $Z prowadz±ce na %s.", direction == 4 ? "górê" : dir_name[direction] );
	act( buf, ch, NULL, victim, TO_CHAR );
	return;
}
Exemplo n.º 3
0
void do_track( CHAR_DATA *ch, char *argument )
{
    char       buf [ MAX_STRING_LENGTH ];
    char       arg [ MAX_STRING_LENGTH ];
    CHAR_DATA *victim;
    int        dir;
    bool       fArea;

    if ( !can_use( ch, gsn_track ) )
    {
        send_to_char( "You do not know of this skill yet.\n\r", ch );
        return;
    }

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
        send_to_char( "Whom are you trying to track?\n\r", ch );
        return;
    }

    if ( ch->riding )
    {
        send_to_char( "You can't sniff a trail mounted.\n\r", ch );
        return;
    }

    /* only imps can hunt to different areas */
    fArea = ( get_trust( ch ) < L_DIR );

    if ( fArea )
        victim = get_char_area( ch, arg );
    else
        victim = get_char_world( ch, arg );

    if ( !victim )
    {
        send_to_char( "You can't find a trail of anyone like that.\n\r", ch );
        return;
    }

    if ( ch->in_room == victim->in_room )
    {
        act( "You're already in $N's room!", ch, NULL, victim, TO_CHAR );
        return;
    }

    /*
     * Deduct some movement.
     */
    if ( ch->move > 2 )
        ch->move -= 3;
    else
    {
        send_to_char( "You're too exhausted to hunt anyone!\n\r", ch );
        return;
    }

    act( "$n carefully sniffs the air.", ch, NULL, NULL, TO_ROOM );
    WAIT_STATE( ch, skill_table[gsn_track].beats );

    /*
     * Give a random direction if the player misses the die roll.
     */
    if (   (  IS_NPC( ch ) && number_percent( ) > 75 )	/* NPC @ 25% */
            || ( !IS_NPC( ch ) && number_percent( ) >	/* PC @ norm */
                 ch->pcdata->learned[gsn_track] ) )
    {
        do
        {
            dir = number_door( );
        }
        while (   !( ch->in_room->exit[dir] )
                  || !( ch->in_room->exit[dir]->to_room ) );

        learn( ch, gsn_track, FALSE );
    }
    else
    {
        dir = find_path( ch->in_room, victim->in_room, 100 + ch->level * 30 );

        if ( dir < 0 )
        {
            act( "You can't sense $N's trail from here.",
                 ch, NULL, victim, TO_CHAR );
            return;
        }

        learn( ch, gsn_track, TRUE );
    }

    /*
     * Display the results of the search.
     */
    sprintf( buf, "You sense $N's trail %s from here...", dir_name[dir] );
    act( buf, ch, NULL, victim, TO_CHAR );
    return;
}
Exemplo n.º 4
0
Arquivo: hunt.c Projeto: Lamieur/Lac
void do_hunt( CHAR_DATA *ch, char *argument )
{
    char buf[ MAX_STRING_LENGTH ];
    char arg[ MAX_STRING_LENGTH ];
    CHAR_DATA *victim;
    int direction;
    bool fArea;
    bool uzycie;

    one_argument( argument, arg );

    if ( ch->hunting )
    {
	wywal_zwod( &ch->hunting->zwod_hunting, ch );
	ch->hunting = NULL;
    }
    if ( arg[ 0 ] == '\0' )
    {
	send_to_char( "Na kogo chcesz zapolowa`c?\n\r", ch );
	return;
    }

    if ( ch->in_room->area == area_czysciec )
    {
	send_to_char( "No co`s ty, w niecielesnym `swiecie?\n\r", ch );
	return;
    }

    if ( IS_SET( ch->in_room->room_flags, ROOM_NO_HUNT ) )
    {
	send_to_char( "Nie mo`zesz tu znale`x`c niczyich `slad`ow.\n\r", ch );
	return;
    }

    /* only imps can hunt to different areas */
    fArea = ( get_trust( ch ) < L_SEN );

    if ( fArea )
	victim = get_char_area( ch, arg );
    else
	victim = get_char_world( ch, arg );

    if ( !victim )
    {
	send_to_char( "Nikogo takiego nie ma w pobli`zu.\n\r", ch );
	return;
    }

    if ( ch == victim )
    {
	send_to_char( "Znajdujesz siebie!\n\r", ch );
	return;
    }

    if ( ch->in_room == victim->in_room )
    {
	act( ZM_ZAWSZE, "$N jest tutaj!", ch, NULL, victim, TO_CHAR );
	return;
    }

    if ( IS_NPC( victim ) && IS_SET( victim->act, ACT_NO_HUNT ) )
    {
	act( ZM_ZAWSZE, "Nie mo`zesz znale`x`c drogi do $!.", ch, NULL, victim, TO_CHAR );
	return;
    }

    /*
     * Deduct some movement.
     */
    if ( ch->move > 2 )
	ch->move -= 3;
    else
    {
	ASTC( "Jeste`s zbyt wyczerpan$y, aby szuka`c `slad`ow!", ch );
	return;
    }

    act( ZM_WZROK | ZM_WID_CHAR, "$n szuka `slad`ow na ziemi.", ch, NULL, NULL, TO_ROOM );
    WAIT_STATE( ch, skill_table[ gsn_hunt ].beats );
    direction = find_path( ch->in_room, victim->in_room,
			40000, fArea, TRUE );

    if ( direction == -1 )
    {
	/* Vigud 26.7.2010: jesli nie moglem widziec celu, $! bylo zamieniane na
	   "kogos", a to wygladalo dosc glupio, skoro wiem, na kogo poluje */
	/* act( ZM_ZAWSZE, "Nie mo`zesz st`ad znale`x`c drogi do $!.", ch, NULL, victim, TO_CHAR ); */
	sprintf( buf, "Nie mo`zesz st`ad znale`x`c drogi do %s.\n\r", victim->dopelniacz );
	STC( buf, ch );
	return;
    }

    if ( direction < 0 || direction > 9 )
    {
	send_to_char( "Wiesz, co`s tu jest nie tak.\n\r", ch );
	return;
    }

    /*
     * Give a random direction if the player misses the die roll.
     */
    uzycie = TRUE;
    if ( ( IS_NPC( ch ) && number_percent( ) < 25 )        /* NPC @ 25% */
      || ( !IS_NPC( ch ) && number_percent( ) >          /* PC @ norm */
		ch->pcdata->learned[ gsn_hunt ] ) )
    {
	do
	{
	    direction = number_door( );
	}
	while ( ch->in_room->exit[ direction ] == NULL
	     || ch->in_room->exit[ direction ]->to_room == NULL );
	uzycie = FALSE;
    }

    /*
     * Display the results of the search.
     */
    sprintf( buf, "Droga do $! prowadzi na %s.", kierunki[ direction ].biernik );
    act( ZM_ZAWSZE, buf, ch, NULL, victim, TO_CHAR );

    /* bez wywal_zwod, jest to robione wczesniej */
    ch->hunting = victim;
    dod_zwod( &victim->zwod_hunting, ch );
    if ( uzycie )
	uzyj( ch, gsn_hunt, "poszukiwaniu dr`og" );

    return;
}
Exemplo n.º 5
0
void do_track( CHAR_DATA *ch, char *argument )
{
  char buf[MAX_STRING_LENGTH];
  char arg[MAX_STRING_LENGTH];
  CHAR_DATA *victim;
  int direction;
  bool fArea;

  one_argument( argument, arg );

    if ( !IS_NPC(ch)
    &&   !can_use_skpell( ch, gsn_track) )          
      {
        send_to_char( "\n\r{WYou find some tracks that look remarkably like your own...{x\n\r",ch);                                           
        return;   
      }


  if( arg[0] == '\0' )
    {
      send_to_char( "\n\r{CWhom are you trying to track?{x\n\r", ch );
      return;
    }

  /* only imps can hunt to different areas */

  fArea = ( ch->level < MAX_LEVEL );

/*
  if (IS_NPC(ch))
    victim = get_char_world( ch, arg );
  else 
*/

  if (fArea)
    victim = get_char_area( ch, arg );
  else
    victim = get_char_area( ch, arg );

  if (IS_SET(ch->in_room->room_flags, ROOM_DRAGONPIT))
    {
      send_to_char("\n\r{CThat would be cheating..{x\n\r", ch );
      return;
    }

  if( victim == NULL )
    {
      send_to_char("\n\r{RNo-one around by that name.{x\n\r", ch );
      return;
    }

  if( ch->in_room == victim->in_room )
    {
      act( "\n\r{G$N is here!{x\n\r", ch, NULL, victim, TO_CHAR );
      return;
    }

  /*
   * Deduct some movement.
   */
  if( ch->move > 3 )
    ch->move -= 3;
  else
    {
      send_to_char( "\n\r{RYou're too exhausted to track anyone!{x\n\r", ch );
      return;
    }

  act( "\n\r{c$n carefully sniffs the air.{x\n\r", ch, NULL, NULL, TO_ROOM );
  WAIT_STATE( ch, skill_table[gsn_track].beats );
  direction = find_path( ch->in_room->vnum, victim->in_room->vnum,
			ch, -40000, fArea );

  if( direction == -1 )
    {
      act( "\n\r{GYou couldn't find a path to $N from here.{x\n\r",
	  ch, NULL, victim, TO_CHAR );
      return;
    }

  if( direction < 0 || direction > 9 )
    {
      send_to_char( "\n\r{CHmm... Something seems to be wrong.{x\n\r", ch );
      return;
    }

  /*
   * Give a random direction if the player misses the die roll.
   */
#if 0
  if( ( IS_NPC (ch) && number_percent () > 75)        /* NPC @ 25% */
     || (!IS_NPC (ch) && number_percent () >          /* PC @ norm */
	 ch->pcdata->learned[gsn_track] ) )
#endif

  if (!IS_NPC(ch) && number_percent() > ch->pcdata->learned[gsn_track])
    {
      do
	{
	  direction = number_door();
	}
      while( ( ch->in_room->exit[direction] == NULL )
	    || ( ch->in_room->exit[direction]->u1.to_room == NULL) );
    }

  /*
   * Display the results of the search.
   */
  sprintf( buf, "\n\r{C$N is %s from here.{x\n\r", dir_name[direction] );
  act( buf, ch, NULL, victim, TO_CHAR );
  check_improve(ch,gsn_track,TRUE,1);
  return;
}