Exemplo n.º 1
0
bool spec_guard( CHAR_DATA *ch )
{
	char buf[MSL]={'\0'};
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	CHAR_DATA *ech;
	char *crime;
	int max_evil;

	if ( !IS_AWAKE(ch) || ch->fighting != NULL )
	return FALSE;

	max_evil = 300;
	ech      = NULL;
	crime    = "";

	for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
	{
	v_next = victim->next_in_room;

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_KILLER) 
	&&   can_see(ch,victim))
		{ crime = "KILLER"; break; }

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_THIEF) 
	&&   can_see(ch,victim))
		{ crime = "THIEF"; break; }

	if ( victim->fighting != NULL
	&&   victim->fighting != ch
	&&   victim->alignment < max_evil )
	{
		max_evil = victim->alignment;
		ech      = victim;
	}
	}

	if ( victim != NULL )
	{
	sprintf( buf, "%s is a %s!  PROTECT THE INNOCENT!!  BANZAI!!", victim->name, crime );
	REMOVE_BIT(ch->comm,COMM_NOSHOUT);
	do_function(ch, &do_yell, buf );
	multi_hit( ch, victim, TYPE_UNDEFINED );
	return TRUE;
	}

	if ( ech != NULL )
	{
	act( "$n screams 'PROTECT THE INNOCENT!!  BANZAI!!", ch, NULL, NULL, TO_ROOM );
	multi_hit( ch, ech, TYPE_UNDEFINED );
	return TRUE;
	}

	return FALSE;
}
Exemplo n.º 2
0
bool spec_guardian(CHAR_DATA * ch)
{
	char buf[MAX_STRING_LENGTH];
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	CHAR_DATA *ech;
	char *crime;
	int max_evil;

	if (!IS_AWAKE(ch) || ch->fighting)
		return FALSE;

	max_evil = 300;
	ech = NULL;
	crime = "";

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;
		if (victim->fighting
		    && who_fighting(victim) != ch
		    && victim->alignment < max_evil) {
			max_evil = victim->alignment;
			ech = victim;
		}
	}

	if (victim && IS_SET(ch->in_room->room_flags, ROOM_SAFE)) {
		sprintf(buf, "%s is a %s!  As well as a COWARD!", victim->name,
			crime);
		do_yell(ch, buf);
		return TRUE;
	}

	if (victim) {
		sprintf(buf, "%s is a %s!  PROTECT THE INNOCENT!!",
			victim->name, crime);
		do_shout(ch, buf);
		multi_hit(ch, victim, TYPE_UNDEFINED);
		return TRUE;
	}

	if (ech) {
		act(AT_YELL, "$n screams 'PROTECT THE INNOCENT!!",
		    ch, NULL, NULL, TO_ROOM);
		multi_hit(ch, ech, TYPE_UNDEFINED);
		return TRUE;
	}

	return FALSE;
}
Exemplo n.º 3
0
bool spec_clan_guard(CHAR_DATA * ch)
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;

	if (!IS_AWAKE(ch) || ch->fighting)
		return FALSE;

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;
		if (!can_see(ch, victim))
			continue;
		if (get_timer(victim, TIMER_RECENTFIGHT) > 0)
			continue;
		if (!IS_NPC(victim) && victim->pcdata && victim->pcdata->clan
		    && IS_AWAKE(victim)
		    && str_cmp(ch->name, victim->pcdata->clan->name)) {
			do_yell(ch, "Hey your not allowed in here!");
			multi_hit(ch, victim, TYPE_UNDEFINED);
			return TRUE;
		}
	}

	return FALSE;
}
Exemplo n.º 4
0
bool spec_new_republic_trooper(CHAR_DATA * ch)
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;

	if (!IS_AWAKE(ch) || ch->fighting)
		return FALSE;

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;
		if (!can_see(ch, victim))
			continue;
		if (get_timer(victim, TIMER_RECENTFIGHT) > 0)
			continue;
		if ((IS_NPC(victim) && nifty_is_name("imperial", victim->name)
		     && victim->fighting && who_fighting(victim) != ch) ||
		    (!IS_NPC(victim) && victim->pcdata && victim->pcdata->clan
		     && IS_AWAKE(victim)
		     && nifty_is_name("empire", victim->pcdata->clan->name))) {
			do_yell(ch, "Long live the New Republic!");
			multi_hit(ch, victim, TYPE_UNDEFINED);
			return TRUE;
		}

	}

	return FALSE;

}
Exemplo n.º 5
0
bool spec_police_attack(CHAR_DATA * ch)
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	int vip;
	char buf[MAX_STRING_LENGTH];

	if (!IS_AWAKE(ch) || ch->fighting)
		return FALSE;

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;
		if (IS_NPC(victim))
			continue;
		if (!can_see(ch, victim))
			continue;
		if (number_bits(1) == 0)
			continue;
		for (vip = 0; vip < 32; vip++)
			if (IS_SET(ch->vip_flags, 1 << vip)
			    && IS_SET(victim->pcdata->wanted_flags, 1 << vip)) {
				sprintf(buf, "Hey you're wanted on %s!",
					planet_flags[vip]);
				do_say(ch, buf);
				REMOVE_BIT(victim->pcdata->wanted_flags,
					   1 << vip);
				multi_hit(ch, victim, TYPE_UNDEFINED);
				return TRUE;
			}

	}

	return FALSE;

}
Exemplo n.º 6
0
bool spec_clan_guard( CHAR_DATA * ch )
{
  CHAR_DATA *victim = NULL;
  CHAR_DATA *v_next = NULL;

  if( !IS_AWAKE( ch ) || ch->fighting || !ch->mob_clan )
    return FALSE;

  for( victim = ch->in_room->first_person; victim; victim = v_next )
  {
    v_next = victim->next_in_room;
    if( !can_see( ch, victim ) )
      continue;
    if( get_timer( victim, TIMER_RECENTFIGHT ) > 0 )
      continue;
    if( !IS_NPC( victim ) && victim->pcdata && victim->pcdata->clan
	&& IS_AWAKE( victim ) && victim->pcdata->clan != ch->mob_clan
	&& nifty_is_name( victim->pcdata->clan->name,
	  ch->mob_clan->atwar ) )
    {
      char buf[MAX_STRING_LENGTH];
      snprintf( buf, MAX_STRING_LENGTH, "%s",
		"Hey you're not allowed in here!" );
      do_yell( ch, buf );
      multi_hit( ch, victim, TYPE_UNDEFINED );
      return TRUE;
    }
  }

  return FALSE;
}
Exemplo n.º 7
0
void
objfun_sword_aggro(OBJ_DATA *obj, CHAR_DATA *keeper)
{
    /* Weapon 'draws' an aggro mob's attention to the player */
    /* If fighting,  make cast spells? */
    CHAR_DATA          *vch;

    if (obj->item_type != ITEM_WEAPON)
        return;
    if ((keeper == NULL) || (obj == NULL))
        return;

    if ((get_eq_char(keeper, WEAR_WIELD) != obj)
        && (get_eq_char(keeper, WEAR_WIELD_2) != obj))
        return;
    if (keeper == NULL || keeper->fighting == NULL)
        return;

    for (vch = keeper->in_room->first_person; vch != NULL; vch = vch->next_in_room) {
        if (IS_NPC(vch)
            && (vch->level > keeper->level)
            && IS_SET(vch->act, ACT_AGGRESSIVE)
            && vch->fighting == NULL && number_bits(4) == 0) {
            act("$p carried by $n glows in $s hands.", keeper, obj, NULL, TO_ROOM);
            act("$p carried by you glows in your hands.", keeper, obj, NULL, TO_CHAR);
            act("$p says 'LOOK! LOOK!  $n is here!!'", keeper, obj, NULL, TO_ROOM);
            act("$p says 'LOOK! LOOK!  $n is here!!'", keeper, obj, NULL, TO_CHAR);
            multi_hit(vch, keeper, TYPE_UNDEFINED);
            break;
        }
    }
    return;
}
Exemplo n.º 8
0
bool spec_executioner( CHAR_DATA *ch )
{
	char buf[MSL]={'\0'};
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	char *crime;

	if ( !IS_AWAKE(ch) || ch->fighting != NULL )
	return FALSE;

	crime = "";
	for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
	{
	v_next = victim->next_in_room;

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_KILLER) 
	&&   can_see(ch,victim))
		{ crime = "KILLER"; break; }

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_THIEF) 
	&&   can_see(ch,victim))
		{ crime = "THIEF"; break; }
	}

	if ( victim == NULL )
	return FALSE;

	sprintf( buf, "%s is a %s!  PROTECT THE INNOCENT!  MORE BLOOOOD!!!", victim->name, crime );
	REMOVE_BIT(ch->comm,COMM_NOSHOUT);
	do_function(ch, &do_yell, buf );
	multi_hit( ch, victim, TYPE_UNDEFINED );
	return TRUE;
}
Exemplo n.º 9
0
/*
 * Lets the mobile kill any player or mobile without murder
 *
 * Syntax: mob kill [victim]
 */
void do_mpkill( CHAR_DATA *ch, char *argument )
{
    char      arg[ MAX_INPUT_LENGTH ];
    CHAR_DATA *victim;

    one_argument( argument, arg );

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

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
	return;

    if ( victim == ch || IS_NPC(victim) || ch->position == POS_FIGHTING )
	return;

    if ( IS_AFFECTED( ch, AFF_CHARM ) && ch->master == victim )
    {
	bug( "MpKill - Charmed mob attacking master from vnum %d.",
	    IS_NPC(ch) ? ch->pIndexData->vnum : 0 );
	return;
    }

    multi_hit( ch, victim, TYPE_UNDEFINED );
    return;
}
Exemplo n.º 10
0
bool spec_executioner( CHAR_DATA *ch )
{
    char buf[MAX_STRING_LENGTH];
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    char *crime;

    if ( !IS_AWAKE(ch) || ch->fighting != NULL )
	return FALSE;

    crime = "";
    for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
    {
	v_next = victim->next_in_room;

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_KILLER) )
	    { crime = "KILLER"; break; }

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_THIEF) )
	    { crime = "THIEF"; break; }
    }

    if ( victim == NULL )
	return FALSE;

    sprintf( buf, "%s is a %s!  PROTECT THE INNOCENT!  MORE BLOOOOD!!!",
	victim->name, crime );
    do_shout( ch, buf );
    multi_hit( ch, victim, TYPE_UNDEFINED );
    char_to_room( create_mobile( get_mob_index(MOB_VNUM_CITYGUARD) ),
	ch->in_room );
    char_to_room( create_mobile( get_mob_index(MOB_VNUM_CITYGUARD) ),
	ch->in_room );
    return TRUE;
}
Exemplo n.º 11
0
SPEC_RET spec_executioner( CHAR_DATA *ch )
{
	MOB_PROTO_DATA *cityguard;
	CHAR_DATA	   *victim;
	CHAR_DATA	   *v_next;
	char		   *crime;
	char			buf[MSL];

	if ( !is_awake(ch) )	return FALSE;
	if ( ch->fighting )		return FALSE;

	crime = "";
	for ( victim = ch->in_room->first_person;  victim;  victim = v_next )
	{
		v_next = victim->next_in_room;

		if ( IS_PG(victim) && HAS_BIT_PLR(victim, PLAYER_KILLER) )
		{
			crime = "assassino";
			break;
		}

		if ( IS_PG(victim) && HAS_BIT_PLR(victim, PLAYER_THIEF) )
		{
			crime = "ladro";
			break;
		}
	}

	if ( !victim )
		return FALSE;

	if ( HAS_BIT(ch->in_room->flags, ROOM_SAFE) )
	{
		sprintf( buf, "yell codardo di un %s!", crime );	/* (GR) articolo */
		send_command( ch, buf, CO );
		return TRUE;
	}

	sprintf( buf, "yell Proteggiamo l'innocente dal %s!!", crime );	/* (GR) articolo dal dall' */
	send_command( ch, buf, CO );
	multi_hit( ch, victim, TYPE_UNDEFINED );

	if ( char_died(ch) )
		return TRUE;

	/* Aggiunto il log nel caso che venga a mancare la guardia cittadina */
	cityguard = get_mob_index( NULL, VNUM_MOB_CITYGUARD );

	if ( !cityguard )
	{
		send_log( NULL, LOG_BUG, "spec_executioner: Guardia cittadina mancante - Vnum:[%d]", VNUM_MOB_CITYGUARD );
		return TRUE;
	}

	char_to_room( make_mobile(cityguard), ch->in_room );
	char_to_room( make_mobile(cityguard), ch->in_room );
	return TRUE;
}
Exemplo n.º 12
0
void soul_sword (CHAR_DATA *ch)
{
	//Soul Sword can rarely kill victims outright, and does 1 dmg, and is VERY unlikely to hit. UNGODLY Expensive
	CHAR_DATA *victim;
	OBJ_DATA *katana;
	char buf[MAX_STRING_LENGTH];
	int thebonus = 0;
	
	if (IS_NPC(ch))		return;

	katana = get_eq_char(ch, WEAR_WIELD);
	
	if ((victim = ch->fighting) == NULL)
	{
		send_to_char("You find no need for this now.\n\r",ch);
		return;
	}
	
	if (IS_NPC(victim))		thebonus = 45;
		else				thebonus = 7;
	if (ch->mana < 30000)
	{
		send_to_char("You have not the 30000 mana power to use this.\n\r",ch);
		return;
	}
	
	if ((katana == NULL) || (katana->pIndexData->vnum != 33176))
	{
		send_to_char("Without a proper katana the energy will destroy your weapon.\n\r",ch);
		return;
	}
	ch->mana -= 30000;
	send_to_char("You channel mystical energy into your katana.\n\r",ch);
	do_say(ch,"#0SOUL #nSWORD!");
	
	act("A bolt of light shoots out of your katana and into $N",ch, NULL, victim, TO_CHAR);
	act("A bolt of light shoots out of $n's katana and into you!", ch, NULL, victim, TO_VICT);
	act("A bolt of light shoots out of $n's katana and into $N!", ch, NULL, victim, TO_NOTVICT);

	if (number_range(0,250) > (4 + thebonus))  // Was .5% now it's 5%/20%
	{
		act("Your attack was ineffective.", ch, NULL, victim, TO_CHAR);
		act("$n looks confused as nothing happens.", ch, NULL, NULL, TO_ROOM);
		multi_hit( ch, victim, TYPE_UNDEFINED );
		WAIT_STATE(ch, (PULSE_VIOLENCE * 5));
		return;
	}
	
	xprintf(buf,"$N screams as $E is ripped apart by the dark energy. #R[#y#b MORTAL #n#R]#n");
	act(buf, ch, NULL, victim, TO_CHAR);
	xprintf(buf,"$n looks on as you start screaming while dark energy rips you apart from the inside out. #R[#y#b MORTAL #n#R]#n");
	act(buf, ch, NULL, victim, TO_VICT);
	send_to_char("You crumple to the ground.\n\r", victim);
	act("$n looks on as $N starts screaming.  Weakened $N crumples to the ground.", ch, NULL, victim, TO_NOTVICT);
	WAIT_STATE(ch, (PULSE_VIOLENCE * 5));
	victim->hit = -10;
	hurt_person(ch, victim, 1);
	return;
}
Exemplo n.º 13
0
/* ciut przerobione */
void found_prey( CHAR_DATA *ch, CHAR_DATA *victim )
{
	OBJ_DATA *weapon;
	char * target;

	if ( !victim )
	{
	bug( "Found_prey: null victim", 0 );
	return;
	}

	if ( !victim->in_room )
	{
		bug( "Found_prey: null victim->in_room", 0 );
		return;
	}

	if ( !can_see( ch, victim ) )
	return;

	if ( is_safe( ch, victim ) )
	return;

	stop_hunting( ch );

	if( (weapon = get_eq_char(ch, WEAR_WIELD)) != NULL )
	{
		if( (target = get_target_by_name(ch,victim)) == NULL)
		target = victim->name;

	if(weapon->value[0] == WEAPON_DAGGER && get_skill(ch, gsn_backstab) > 0)
	{
		do_function(ch, &do_backstab, target );
	}
		else if ( get_skill(ch, gsn_charge) > 0 && IS_WEAPON_STAT( weapon, WEAPON_TWO_HANDS ) && weapon->value[0] != WEAPON_WHIP && weapon->value[0] != WEAPON_SHORTSWORD && weapon->value[0] != WEAPON_DAGGER )
	{
		do_function(ch, &do_charge, target );
	}
	else
		multi_hit( ch, victim, TYPE_UNDEFINED );
	return;
	}

	multi_hit( ch, victim, TYPE_UNDEFINED );
	return;
}
Exemplo n.º 14
0
/* lets the mobile kill any player or mobile without murder*/
void do_mpkill( CHAR_DATA *ch, char *argument )
{
    char      arg[ MAX_INPUT_LENGTH ];
    CHAR_DATA *victim;

    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, "MpKill - no argument: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
    }

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
    {
        sprintf( log_buf, "MpKill - Victim not in room: vnum %d name %s short %s .",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    if ( victim == ch )
    {
        sprintf( log_buf, "MpKill - Bad victim to attack: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    if ( IS_AFFECTED( ch, AFF_CHARM ) && ch->master == victim )
    {
        sprintf( log_buf, "MpKill - Charmed mob attacking master: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    if ( ch->position == POS_FIGHTING )
    {	
        sprintf( log_buf, "MpKill - Already fighting: vnum %d name %s short %s.",
                 ch->pIndexData->vnum, ch->name, ch->short_descr );
        bug( log_buf, -1 );
	return;
    }

    multi_hit( ch, victim, TYPE_UNDEFINED );
    return;
}
Exemplo n.º 15
0
bool spec_executioner( CHAR_DATA *ch )
{
    char buf[MAX_STRING_LENGTH];
    MOB_INDEX_DATA *cityguard;
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    char *crime;

    if ( !IS_AWAKE(ch) || ch->fighting )
	return FALSE;

    crime = "";
    for ( victim = ch->in_room->first_person; victim; victim = v_next )
    {
	v_next = victim->next_in_room;

	if ( !IS_NPC(victim) && xIS_SET(victim->act, PLR_KILLER) )
	    { crime = "KILLER"; break; }

	if ( !IS_NPC(victim) && xIS_SET(victim->act, PLR_THIEF) )
	    { crime = "THIEF"; break; }
    }

    if ( !victim )
	return FALSE;

    if ( xIS_SET( ch->in_room->room_flags, ROOM_SAFE ) )
    {
	sprintf( buf, "%s is a %s!  As well as a COWARD!",
		victim->name, crime );
	do_yell( ch, buf );
	return TRUE;
    }

    sprintf( buf, "%s is a %s!  PROTECT THE INNOCENT!  MORE BLOOOOD!!!",
	victim->name, crime );
    do_yell( ch, buf );
    multi_hit( ch, victim, TYPE_UNDEFINED );
    if ( char_died(ch) )
      return TRUE;

    /* Added log in case of missing cityguard -- Tri */

    cityguard = get_mob_index( MOB_VNUM_CITYGUARD );

    if ( !cityguard )
    {
      sprintf( buf, "Missing Cityguard - Vnum:[%d]", MOB_VNUM_CITYGUARD );
      bug( buf, 0 );
      return TRUE;
    }

    char_to_room( create_mobile( cityguard ), ch->in_room );
    char_to_room( create_mobile( cityguard ), ch->in_room );
    return TRUE;
}
Exemplo n.º 16
0
void do_mpkill( CHAR_DATA *ch, char *argument )
{
    char      arg[ MAX_INPUT_LENGTH ];
    CHAR_DATA *victim;

    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( "MpKill - no argument: vnum %d.",
		ch->pIndexData->vnum );
	return;
    }

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
    {
	bug( "MpKill - Victim not in room: vnum %d.",
	    ch->pIndexData->vnum );
	return;
    }

    if ( victim == ch )
    {
	bug( "MpKill - Bad victim to attack: vnum %d.",
	    ch->pIndexData->vnum );
	return;
    }

    if ( IS_AFFECTED( ch, AFF_CHARM ) && ch->master == victim )
    {
	bug( "MpKill - Charmed mob attacking master: vnum %d.",
	    ch->pIndexData->vnum );
	return;
    }

    if ( ch->position == POS_FIGHTING )
    {	
	bug( "MpKill - Already fighting: vnum %d",
	    ch->pIndexData->vnum );
	return;
    }

    multi_hit( ch, victim, TYPE_UNDEFINED );
    return;
}
Exemplo n.º 17
0
bool spec_ogre_member( CHAR_DATA *ch )
{
    CHAR_DATA * vch, *victim = NULL;
    int count = 0;
    char *message;

    if ( !IS_AWAKE( ch ) || IS_AFFECTED( ch, AFF_CALM ) || ch->in_room == NULL
         || IS_AFFECTED( ch, AFF_CHARM ) || ch->fighting != NULL )
        return FALSE;

    /* find an troll to beat up */
    for ( vch = ch->in_room->people; vch != NULL; vch = vch->next_in_room )
    {
        if ( !IS_NPC( vch ) || ch == vch )
            continue;

        if ( !str_cmp( race_table[ GET_RACE(vch) ].name, "troll" )
             && ch->level > vch->level - 2 && !is_safe( ch, vch, TRUE ) )
        {
            if ( number_range( 0, count ) == 0 )
                victim = vch;

            count++;
        }
    }

    if ( victim == NULL )
        return FALSE;

    /* say something, then raise hell */
    switch ( number_range( 0, 6 ) )
    {
        default: message = NULL;	break;
        case 0: message = "$n wrzeszczy 'Szuka³em ciê, ¶mieciu!'";
            break;
        case 1: message = "$n atakuje $C z szaleñczym wrzaskiem.";
            break;
        case 2: message =
                "$n mówi 'Co taki ¶mierdz±cy, trollowaty pomiot jak ty tu w ogóle robi?'";
            break;
        case 3: message = "$n wy³amuje palce a¿ trzeszcz± i mówi 'My¶lisz, ¿e masz szczê¶cie?'";
            break;
        case 4: message = "$n mówi 'Nie widzê tu stra¿ników którzy mogliby ciê ochroniæ tym razem!'";
            break;
        case 5: message = "$n mówi 'Czas do³±czyæ do swoich durnych braci w za¶wiatach.'";
            break;
        case 6: message = "$n mówi 'I niech gra muzyka...'";
            break;
    }

    if ( message != NULL )
        act( message, ch, NULL, victim, TO_ALL );
    multi_hit( ch, victim, TYPE_UNDEFINED );
    return TRUE;
}
Exemplo n.º 18
0
void do_backstab( CHAR_DATA *ch, char *argument )
{
	char arg[MIL]={'\0'};
	CHAR_DATA *victim;
	/*OBJ_DATA *obj;*/

	one_argument( argument, arg );

	if (IS_NULLSTR(arg))
	{
		send_to_char("Backstab whom?\n\r",ch);
		return;
	}

	if (ch->fighting != NULL)
	{
		send_to_char("You're facing the wrong end.\n\r",ch);
		return;
	}

	else if ((victim = get_char_room(ch,arg)) == NULL)
	{
		send_to_char("They aren't here.\n\r",ch);
		return;
	}

	if ( victim == ch )
	{
		send_to_char( "How can you sneak up on yourself?\n\r", ch );
		return;
	}

	WAIT_STATE( ch, skill_table[gsn_backstab].beats );
	if ( number_percent( ) < get_skill(ch,gsn_backstab)
			|| ( get_skill(ch,gsn_backstab) >= 2 && !IS_AWAKE(victim) ) )
	{
		multi_hit( ch, victim, gsn_backstab );
	}
	else
	{
		damage( ch, victim, 0, gsn_backstab,DAM_NONE,TRUE,0,-1);
	}

	return;
}
Exemplo n.º 19
0
/*
 * Lets the mobile assist another mob or player
 *
 * Syntax: mob assist [character]
 */
void do_mpassist(CHAR_DATA * ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;

    one_argument(argument, arg);

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

    if ((victim = get_char_room(ch, arg)) == NULL)
	return;

    if (victim == ch || ch->fighting != NULL || victim->fighting == NULL)
	return;

    multi_hit(ch, victim->fighting, TYPE_UNDEFINED);
    return;
}
Exemplo n.º 20
0
void do_surrender( CHAR_DATA *ch, char *argument )
{
	CHAR_DATA *mob;
	if ( (mob = ch->fighting) == NULL )
	{
		send_to_char( "But you're not fighting!\n\r", ch );
		return;
	}
	act( "You surrender to $N!", ch, NULL, mob, TO_CHAR, 1 );
	act( "$n surrenders to you!", ch, NULL, mob, TO_VICT, 1 );
	act( "$n tries to surrender to $N!", ch, NULL, mob, TO_NOTVICT, 0 );
	stop_fighting( ch, TRUE );

	if ( !IS_NPC( ch ) && IS_NPC( mob )
			&&   ( !HAS_TRIGGER( mob, TRIG_SURR )
					|| !mp_percent_trigger( mob, ch, NULL, NULL, TRIG_SURR ) ) )
	{
		act( "$N seems to ignore your cowardly act!", ch, NULL, mob,TO_CHAR,1);
		multi_hit( mob, ch, TYPE_UNDEFINED );
	}
}
Exemplo n.º 21
0
bool spec_guard( CHAR_DATA *ch )
{
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    CHAR_DATA *ech;
    char *crime;
    int max_evil;

    if ( !IS_AWAKE( ch ) || ch->fighting != NULL )
        return FALSE;

    max_evil = 300;
    ech = NULL;
    crime = "";

    for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
    {
        v_next = victim->next_in_room;

        if ( victim->fighting != NULL
        &&   victim->fighting != ch
        &&   victim->fighting != victim
        &&   victim->spec_fun != spec_guard
        &&	!IS_NPC( victim )
        &&   victim->alignment < max_evil )
        {
            max_evil = victim->alignment;
            ech = victim;
        }
    }

    if ( ech != NULL )
    {
        act( "$n krzyczy 'Chroniæ niewinnych!!  Broñ siê $N!!", ch, NULL, ech, TO_ROOM );
        multi_hit( ch, ech, TYPE_UNDEFINED );
        return TRUE;
    }

    return FALSE;
}
Exemplo n.º 22
0
bool spec_executioner( CHAR_DATA *ch )
{
    char buf[ MAX_STRING_LENGTH ];
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    char *crime;

    if ( !IS_AWAKE( ch ) || ch->fighting != NULL )
        return FALSE;

    crime = "";
    for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
    {
        v_next = victim->next_in_room;

        if ( !IS_NPC( victim ) && EXT_IS_SET( victim->act, PLR_KILLER )
             && can_see( ch, victim ) )
        {
            crime = "KILLER"; break;
        }

        if ( !IS_NPC( victim ) && EXT_IS_SET( victim->act, PLR_THIEF )
             && can_see( ch, victim ) )
        {
            crime = "THIEF"; break;
        }
    }

    if ( victim == NULL )
        return FALSE;

    sprintf( buf, "%s is a %s!  BRONIÆ NIEWINNYCH!  KRRRRWII!!!",
             victim->name, crime );
    REMOVE_BIT( ch->comm, COMM_NOSHOUT );
    do_function( ch, &do_yell, buf );
    multi_hit( ch, victim, TYPE_UNDEFINED );
    return TRUE;
}
Exemplo n.º 23
0
bool check_social( CHAR_DATA * ch, const char *command, const char *argument )
{
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim, *victim_next;
   SOCIALTYPE *social;
   CHAR_DATA *removed[128];   /* What are the chances of more than 128? */
   ROOM_INDEX_DATA *room;
   int i = 0, k = 0;

   if( ( social = find_social( command ) ) == NULL )
      return FALSE;

   if( !IS_NPC( ch ) && xIS_SET( ch->act, PLR_NO_EMOTE ) )
   {
      send_to_char( "You are anti-social!\r\n", ch );
      return TRUE;
   }

   switch ( ch->position )
   {
      case POS_DEAD:
         send_to_char( "Lie still; you are DEAD.\r\n", ch );
         return TRUE;

      case POS_INCAP:
      case POS_MORTAL:
         send_to_char( "You are hurt far too bad for that.\r\n", ch );
         return TRUE;

      case POS_STUNNED:
         send_to_char( "You are too stunned to do that.\r\n", ch );
         return TRUE;

      case POS_SLEEPING:
         /*
          * I just know this is the path to a 12" 'if' statement.  :(
          * But two players asked for it already!  -- Furey
          */
         if( !str_cmp( social->name, "snore" ) )
            break;
         send_to_char( "In your dreams, or what?\r\n", ch );
         return TRUE;
   }

   /*
    * Search room for chars ignoring social sender and 
    * remove them from the room until social has been  
    * completed              
    */
   room = ch->in_room;
   for( victim = ch->in_room->first_person; victim; victim = victim_next )
   {
      if( i == 127 )
         break;
      victim_next = victim->next_in_room;
      if( is_ignoring( victim, ch ) )
      {
         if( !IS_IMMORTAL( ch ) || get_trust( victim ) > get_trust( ch ) )
         {
            removed[i] = victim;
            i++;
            UNLINK( victim, room->first_person, room->last_person, next_in_room, prev_in_room );
         }
         else
         {
            set_char_color( AT_IGNORE, victim );
            ch_printf( victim, "You attempt to ignore %s," " but are unable to do so.\r\n", ch->name );
         }
      }
   }

   one_argument( argument, arg );
   victim = NULL;
   if( arg[0] == '\0' )
   {
      act( AT_SOCIAL, social->others_no_arg, ch, NULL, victim, TO_ROOM );
      act( AT_SOCIAL, social->char_no_arg, ch, NULL, victim, TO_CHAR );
   }
   else if( ( victim = get_char_room( ch, arg ) ) == NULL )
   {
      /*
       * If they aren't in the room, they may be in the list of 
       * people ignoring...                 
       */
      if( i != 0 )
      {
         for( k = 0, victim = removed[0]; k < i; k++, victim = removed[k] )
         {
            if( nifty_is_name( victim->name, arg ) || nifty_is_name_prefix( arg, victim->name ) )
            {
               set_char_color( AT_IGNORE, ch );
               ch_printf( ch, "%s is ignoring you.\r\n", victim->name );
               break;
            }
         }
      }

      if( !victim )
         send_to_char( "They aren't here.\r\n", ch );
   }
   else if( victim == ch )
   {
      act( AT_SOCIAL, social->others_auto, ch, NULL, victim, TO_ROOM );
      act( AT_SOCIAL, social->char_auto, ch, NULL, victim, TO_CHAR );
   }
   else
   {
      act( AT_SOCIAL, social->others_found, ch, NULL, victim, TO_NOTVICT );
      act( AT_SOCIAL, social->char_found, ch, NULL, victim, TO_CHAR );
      act( AT_SOCIAL, social->vict_found, ch, NULL, victim, TO_VICT );

      if( !IS_NPC( ch ) && IS_NPC( victim )
          && !IS_AFFECTED( victim, AFF_CHARM ) && IS_AWAKE( victim ) && !HAS_PROG( victim->pIndexData, ACT_PROG ) )
      {
         switch ( number_bits( 4 ) )
         {
            case 0:
               if( IS_EVIL( ch ) && !is_safe( victim, ch, TRUE ) )   /* was IS_EVIL(ch) ||.... didn't make sense to me - FB */
                     multi_hit( victim, ch, TYPE_UNDEFINED );
               else if( IS_NEUTRAL( ch ) )
               {
                  act( AT_ACTION, "$n slaps $N.", victim, NULL, ch, TO_NOTVICT );
                  act( AT_ACTION, "You slap $N.", victim, NULL, ch, TO_CHAR );
                  act( AT_ACTION, "$n slaps you.", victim, NULL, ch, TO_VICT );
               }
               else
               {
                  act( AT_ACTION, "$n acts like $N doesn't even exist.", victim, NULL, ch, TO_NOTVICT );
                  act( AT_ACTION, "You just ignore $N.", victim, NULL, ch, TO_CHAR );
                  act( AT_ACTION, "$n appears to be ignoring you.", victim, NULL, ch, TO_VICT );
               }
               break;

            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
               act( AT_SOCIAL, social->others_found, victim, NULL, ch, TO_NOTVICT );
               act( AT_SOCIAL, social->char_found, victim, NULL, ch, TO_CHAR );
               act( AT_SOCIAL, social->vict_found, victim, NULL, ch, TO_VICT );
               break;

            case 9:
            case 10:
            case 11:
            case 12:
               act( AT_ACTION, "$n slaps $N.", victim, NULL, ch, TO_NOTVICT );
               act( AT_ACTION, "You slap $N.", victim, NULL, ch, TO_CHAR );
               act( AT_ACTION, "$n slaps you.", victim, NULL, ch, TO_VICT );
               break;
         }
      }
   }

   /*
    * Replace the chars in the ignoring list to the room 
    * note that the ordering of the players in the room  
    * might change                
    */
   if( i != 0 )
   {
      for( k = 0, victim = removed[0]; k < i; k++, victim = removed[k] )
      {
         LINK( victim, room->first_person, room->last_person, next_in_room, prev_in_room );
      }
   }

   return TRUE;
}
Exemplo n.º 24
0
void do_divestrike ( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;

    argument = one_argument (argument, arg);
        if (IS_NPC(ch)) return;

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

        if (ch->pcdata->powers[SKYBLADE_SKILLS] < 10)
        {
        send_to_char("You have not mastered the ability yet.\n\r",ch);
        return;
        }

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

    if ( ( victim = get_char_room( ch, NULL, arg ) ) == NULL )
    {
        send_to_char( "They aren't here.\n\r", ch ); return;
    }

    if ( victim == ch )
    {
        send_to_char( "#CWhatever#n\n\r", ch );
        return;
    }
    if (ch->move < 10000)
    {
        send_to_char( "#CYou need 10000 move to use this!#n\n\r", ch );
        return;
    }

    if (IS_NPC(victim))
        {

    send_to_char("#LYou jump down from the #Wclouds#L and strike down upon your opponent.#n\n\r",ch);
        act("#C$n #Ljumps down from the #Wclouds #Land strikes $s opponent with $s rapier.#n\n\r",ch,NULL,victim,TO_ROOM);
        WAIT_STATE( ch, 3 * PULSE_VIOLENCE );
        multi_hit( ch, victim, TYPE_UNDEFINED );
        multi_hit( ch, victim, TYPE_UNDEFINED );
        multi_hit( ch, victim, TYPE_UNDEFINED );
        }
    send_to_char("#LYou jump from the heavens down upon your opponent.#n\n\r",ch);
    act("#C$n #Ljumps down from the heavens and strikes upon you with $s rapier.#n\n\r",ch,NULL,victim,TO_VICT);
    ch->move -= 10000;
    ch->hitroll += 5000;
    WAIT_STATE( ch, 3 * PULSE_VIOLENCE);
    multi_hit( ch, victim, TYPE_UNDEFINED );
    multi_hit( ch, victim, TYPE_UNDEFINED );
    multi_hit( ch, victim, TYPE_UNDEFINED );
    ch->hitroll -= 5000;
    return;
}
Exemplo n.º 25
0
void found_prey( CHAR_DATA * ch, CHAR_DATA * victim )
{
    char buf[MAX_STRING_LENGTH];
    char victname[MAX_STRING_LENGTH];

    if( victim == NULL )
    {
        bug( "%s", "Found_prey: null victim" );
        return;
    }

    if( victim->in_room == NULL )
    {
        bug( "%s", "Found_prey: null victim->in_room" );
        return;
    }

    mudstrlcpy( victname, IS_NPC( victim ) ? victim->short_descr : victim->name, MAX_STRING_LENGTH );

    if( !can_see( ch, victim ) )
    {
        if( number_percent(  ) < 90 )
            return;
        switch ( number_bits( 2 ) )
        {
        case 0:
            snprintf( buf, MAX_STRING_LENGTH, "Don't make me find you, %s!", victname );
            do_say( ch, buf );
            break;
        case 1:
            act( AT_ACTION, "$n sniffs around the room for $N.", ch, NULL, victim, TO_NOTVICT );
            act( AT_ACTION, "You sniff around the room for $N.", ch, NULL, victim, TO_CHAR );
            act( AT_ACTION, "$n sniffs around the room for you.", ch, NULL, victim, TO_VICT );
            do_say( ch, "I can smell your blood!" );
            break;
        case 2:
            snprintf( buf, MAX_STRING_LENGTH, "I'm going to tear %s apart!", victname );
            do_yell( ch, buf );
            break;
        case 3:
            do_say( ch, "Just wait until I find you..." );
            break;
        }
        return;
    }

    if( xIS_SET( ch->in_room->room_flags, ROOM_SAFE ) )
    {
        if( number_percent(  ) < 90 )
            return;
        switch ( number_bits( 2 ) )
        {
        case 0:
            do_say( ch, "C'mon out, you coward!" );
            snprintf( buf, MAX_STRING_LENGTH, "%s is a bloody coward!", victname );
            do_yell( ch, buf );
            break;
        case 1:
            snprintf( buf, MAX_STRING_LENGTH, "Let's take this outside, %s", victname );
            do_say( ch, buf );
            break;
        case 2:
            snprintf( buf, MAX_STRING_LENGTH, "%s is a yellow-bellied wimp!", victname );
            do_yell( ch, buf );
            break;
        case 3:
            act( AT_ACTION, "$n takes a few swipes at $N.", ch, NULL, victim, TO_NOTVICT );
            act( AT_ACTION, "You try to take a few swipes $N.", ch, NULL, victim, TO_CHAR );
            act( AT_ACTION, "$n takes a few swipes at you.", ch, NULL, victim, TO_VICT );
            break;
        }
        return;
    }

    switch ( number_bits( 2 ) )
    {
    case 0:
        snprintf( buf, MAX_STRING_LENGTH, "Your blood is mine, %s!", victname );
        do_yell( ch, buf );
        break;
    case 1:
        snprintf( buf, MAX_STRING_LENGTH, "Alas, we meet again, %s!", victname );
        do_say( ch, buf );
        break;
    case 2:
        snprintf( buf, MAX_STRING_LENGTH, "What do you want on your tombstone, %s?", victname );
        do_say( ch, buf );
        break;
    case 3:
        act( AT_ACTION, "$n lunges at $N from out of nowhere!", ch, NULL, victim, TO_NOTVICT );
        act( AT_ACTION, "You lunge at $N catching $M off guard!", ch, NULL, victim, TO_CHAR );
        act( AT_ACTION, "$n lunges at you from out of nowhere!", ch, NULL, victim, TO_VICT );
    }
    stop_hunting( ch );
    set_fighting( ch, victim );
    multi_hit( ch, victim, TYPE_UNDEFINED );
    return;
}
Exemplo n.º 26
0
void hunt_victim( CHAR_DATA *ch )
{
  int		dir;
  bool		found;
  CHAR_DATA	*tmp;

  if( ch == NULL || ch->hunting == NULL || !IS_NPC(ch) )
    return;

  /*
   * Make sure the victim still exists.
   */
  for( found = 0, tmp = char_list; tmp && !found; tmp = tmp->next )
    if( ch->hunting == tmp )
      found = 1;

  if( !found || !can_see( ch, ch->hunting ) )
    {
      do_say( ch, "Damn!  My prey is gone!!" );
      ch->hunting = NULL;
      return;
    }

  if( ch->in_room == ch->hunting->in_room )
    {
      act(AT_BLOOD, "$n glares at $N with vengeance filled eyes.",
	  ch, NULL, ch->hunting, TO_NOTVICT );
      act(AT_BLOOD, "$n glares at you with vengeance filled eyes.",
	  ch, NULL, ch->hunting, TO_VICT );
      act(AT_BLOOD, "You glare at $N with vengeance filled eyes.",
	  ch, NULL, ch->hunting, TO_CHAR);
      multi_hit( ch, ch->hunting, TYPE_UNDEFINED );
      ch->hunting = NULL;
      return;
    }

  WAIT_STATE( ch, skill_table[skill_lookup("hunt")].beats );
  dir = find_path( ch->in_room->vnum, ch->hunting->in_room->vnum,
		  ch, -40000, TRUE );

  if( dir < 0 || dir > 5 )
    {
      act(AT_BLOOD, "$n says 'Damn!  Lost $M!'", ch, NULL, ch->hunting, TO_ROOM );
      ch->hunting = NULL;
      return;
    }

  /*
   * Give a random direction if the mob misses the die roll.
   */
  if( number_percent () > 75 )        /* @ 25% */
    {
      do
        {
	  dir = number_door();
        }
      while( ( ch->in_room->exit[dir] == NULL )
	    || ( ch->in_room->exit[dir]->to_room == NULL ) );
    }


  if( IS_SET( ch->in_room->exit[dir]->exit_info, EX_CLOSED ) )
    {
      do_open( ch, (char *) dir_name[dir] );
      return;
    }

  move_char( ch, dir );
  return;
}
Exemplo n.º 27
0
SPEC_RET spec_guard( CHAR_DATA *ch )
{
	CHAR_DATA	*victim;
	CHAR_DATA	*v_next;
	CHAR_DATA	*ech;
	char		*crime;
	char		 buf[MSL];
	int			 max_evil;

	if ( !is_awake(ch) )	return FALSE;
	if ( ch->fighting )		return FALSE;

	max_evil = 300;
	ech		 = NULL;
	crime	 = "";

	for ( victim = ch->in_room->first_person;  victim;  victim = v_next )
	{
		v_next = victim->next_in_room;

		if ( !victim->fighting )			continue;
		if ( who_fighting(victim) == ch )	continue;

		if ( IS_PG(victim) && HAS_BIT_PLR(victim, PLAYER_KILLER) )
		{
			crime = "assassino";
			break;
		}

		if ( IS_PG(victim) && HAS_BIT_PLR(victim, PLAYER_THIEF) )
		{
			crime = "ladro";
			break;
		}

		if ( victim->alignment < max_evil )
		{
			max_evil = victim->alignment;
			ech	  = victim;
		}
	}

	if ( victim && HAS_BIT(ch->in_room->flags, ROOM_SAFE) )
	{
		sprintf( buf, "yell codardo di un %s!", crime );	/* (GR) articolo */
		send_command( ch, buf, CO );
		return TRUE;
	}

	if ( victim )
	{
		sprintf( buf, "yell Proteggiamo l'innocente dal %s!!", crime );	/* (GR) articolo dal dall' */
		send_command( ch, buf, CO );
		multi_hit( ch, victim, TYPE_UNDEFINED );
		return TRUE;
	}

	if ( ech )
	{
		act( AT_YELL, "$n urla 'Proteggiamo l'innocente!'", ch, NULL, NULL, TO_ROOM );
		multi_hit( ch, ech, TYPE_UNDEFINED );
		return TRUE;
	}

	return FALSE;
}
Exemplo n.º 28
0
Arquivo: track.c Projeto: onjin/astral
void found_prey( CHAR_DATA *ch, CHAR_DATA *victim )
{
    char buf[MAX_STRING_LENGTH];
    char victname[MAX_STRING_LENGTH];

    if (victim == NULL)
    {
	bug("Found_prey: null victim", 0);
	return;
    }

    if ( victim->in_room == NULL )
    {
        bug( "Found_prey: null victim->in_room", 0 );
        return;
    }

    sprintf( victname, IS_NPC( victim ) ? victim->short_descr : victim->nwol );

    if ( !can_see(ch, victim) )
    {
	if ( number_percent( ) < 90 )
	    return;
	switch( number_bits( 2 ) )
	{
	case 0: sprintf( buf, "Nie kaz mi Cie szukac, %s!", victname );
		do_say( ch, buf );
	        break;
	case 1: act( AT_ACTION, "$n sniffs around the room for $N.", ch, NULL, victim, TO_NOTVICT );
		act( AT_ACTION, "You sniff around the room for $N.", ch, NULL, victim, TO_CHAR );
		act( AT_ACTION, "$n sniffs around the room for you.", ch, NULL, victim, TO_VICT );
		sprintf( buf, "I can smell your blood!" );
		do_say( ch, buf );
		break;
	case 2: sprintf( buf, "I'm going to tear %s apart!", victname );
		do_yell( ch, buf );
		break;
	case 3: do_say( ch, "Just wait until I find you...");
		break;
	}
	return;
    }

    if ( IS_SET( ch->in_room->room_flags, ROOM_SAFE ) )
    {
	if ( number_percent( ) < 90 )
	    return;
	switch( number_bits( 2 ) )
	{
	case 0:	do_say( ch, "C'mon out, you coward!" );
		sprintf( buf, "%s is a bloody coward!", victname );
		do_yell( ch, buf );
		break;
	case 1: sprintf( buf, "Let's take this outside, %s", victname );
		do_say( ch, buf );
		break;
	case 2: sprintf( buf, "%s is a yellow-bellied wimp!", victname );
		do_yell( ch, buf );
		break;
	case 3: act( AT_ACTION, "$n takes a few swipes at $N.", ch, NULL, victim, TO_NOTVICT );
		act( AT_ACTION, "You try to take a few swipes $N.", ch, NULL, victim, TO_CHAR );
		act( AT_ACTION, "$n takes a few swipes at you.", ch, NULL, victim, TO_VICT );
		break;
	}
	return;
    }

    switch( number_bits( 2 ) )
    {
     case 0: sprintf( buf, "Twoja krew jest moja, %s!", victname );
	     do_yell( ch, buf);
	     break;
     case 1: sprintf( buf, "Ha, znow sie spotykamy, %s!", victname );
     	     do_say( ch, buf );
     	     break;
     case 2: sprintf( buf, "Co sobie zyczysz wypisac na nagrobku, %s?", victname );
     	     do_say( ch, buf );
     	     break;
     case 3: act( AT_ACTION, "$n lunges at $N from out of nowhere!", ch, NULL, victim, TO_NOTVICT );
	     act( AT_ACTION, "You lunge at $N catching $M off guard!", ch, NULL, victim, TO_CHAR );
	     act( AT_ACTION, "$n lunges at you from out of nowhere!", ch, NULL, victim, TO_VICT );
    }
    stop_hunting( ch );
    set_fighting( ch, victim );
    multi_hit(ch, victim, TYPE_UNDEFINED);
    return;
} 
Exemplo n.º 29
0
void do_ambush( CHAR_DATA * ch, char *argument )
{
   CHAR_DATA *victim;
   int percent;

   if( argument[0] == '\0' )
   {
      send_to_char( "Syntax: Ambush <victim>\n\r", ch );
      return;
   }

   if( IS_NPC( ch ) )
   {
      send_to_char( "Only players may use this ability.\n\r", ch );
      return;
   }

   if( ( victim = get_char_room( ch, argument ) ) == NULL )
   {
      send_to_char( "How can you ambush someone who's not even here.\n\r", ch );
      return;
   }

   if( ch == victim )
   {
      send_to_char( "How can you possibly ambush yourself?\n\r", ch );
      return;
   }

   if( ch->position == POS_FIGHTING )
   {
      send_to_char( "You are already fighting someone!\n\r", ch );
      return;
   }

   if( victim->position == POS_FIGHTING )
   {
      send_to_char( "They are already fighting someone!\n\r", ch );
      return;
   }

   if( victim->position <= POS_STUNNED )
   {
      send_to_char( "Come now, there's no honor in that!\n\r", ch );
      return;
   }

   if( !IS_SET( ch->affected_by, AFF_SNEAK ) )
   {
      send_to_char( "You are moving far too loudly to ambush someone!\n\r", ch );
      return;
   }
   percent = number_percent(  ) - ( get_curr_lck( ch ) - 14 ) + ( get_curr_lck( victim ) - 13 );

   affect_strip( ch, gsn_sneak );
   affect_strip( ch, gsn_silent );
   REMOVE_BIT( ch->affected_by, AFF_HIDE );
   if( ch->race != RACE_DEFEL )  /* Defel has perm invis */
      REMOVE_BIT( ch->affected_by, AFF_INVISIBLE );
   if( ch->race != RACE_NOGHRI ) /* Noghri has perm sneak */
      REMOVE_BIT( ch->affected_by, AFF_SNEAK );


   act( AT_RED, "You jump out from behind $N and attack $M!", ch, NULL, victim, TO_CHAR );
   act( AT_RED, "$n jumps out from behind you and attacks you!", ch, NULL, victim, TO_VICT );
   act( AT_RED, "$n jumps out from behind $N and attacks $M!", ch, NULL, victim, TO_NOTVICT );
   if( !IS_AWAKE( victim ) || percent < ch->pcdata->learned[gsn_ambush] )
   {
      multi_hit( ch, victim, gsn_ambush );
      learn_from_success( ch, gsn_ambush );
   }
   else
   {
      learn_from_failure( ch, gsn_ambush );
      global_retcode = damage( ch, victim, 0, gsn_ambush );
   }
}
Exemplo n.º 30
0
void do_swordtech(CHAR_DATA * ch, char *argument)
{
	char buf[MAX_STRING_LENGTH];
	CHAR_DATA *victim = 0;
	OBJ_DATA *obj;
	AFFECT_DATA af;
	long chance;

	if(!ch || IS_NPC(ch))
		return;

	if(!IS_CLASS(ch, CLASS_HIGHLANDER))
	{
		send_to_char("You are not one of the chosen.\n\r", ch);
		return;
	}

	if(!argument || argument[0] == '\0')
	{
		send_to_char("What type of swordtech manuever do you want to attempt?\n\r", ch);
		send_to_char("Types are: fury, disarm, berserk, stun, decapitate, concentrate\n\r", ch);
		return;
	}

	if((obj = get_eq_char(ch, WEAR_WIELD)) == 0 || obj->pIndexData->vnum != 29695)
	{
		send_to_char("You must be wielding your Katana to do a swordtech manuever.\n\r", ch);
		return;
	}

	if(is_affected(ch, gsn_swordtech))
	{
		send_to_char("You are not ready for another swordtech manuever yet!\n\r", ch);
		return;
	}

	if(ch->move < 850)
	{
		send_to_char("You need 850 movement points to do a swordtech manuever!\n\r", ch);
		return;
	}

	ch->move -= 600;

	if(ch->pcdata->stats[UNI_GEN] == 1)
		chance = 55;
	else if(ch->pcdata->stats[UNI_GEN] == 2)
		chance = 35;
	else
		chance = 0;

	chance += 35;

	act("{G$n holds $p in front of $m and a spiral of silver energy swirls around $s body.{x", ch, obj, 0, TO_ROOM);
	act("{GYou holds $p in front of you and a spiral of silver energy swirls around your body.{x",
	    ch, obj, 0, TO_CHAR);

	if(chance < number_percent())
	{
		af.type = gsn_swordtech;
		af.duration = 3 + ch->pcdata->stats[UNI_GEN];
		af.modifier = 0;
		af.location = 0;
		af.bitvector = 0;
		affect_to_char(ch, &af);

		act("{gYou fail the manuever and the energy leaves you.{x", ch, 0, 0, TO_CHAR);
		act("{g$n fails the manuever and the energy leaves $m.{x", ch, 0, 0, TO_ROOM);
		return;
	}

	if(!str_prefix(argument, "berserk")
	   || !str_prefix(argument, "bezerk") || !str_prefix(argument, "beserk") || !str_prefix(argument, "berzerk"))
	{
		af.type = gsn_swordtech;
		af.duration = 5 + ((3 - ch->pcdata->stats[UNI_GEN]) * 2);
		af.modifier = 0;
		af.location = 0;
		af.bitvector = STECH_BERSERK;
		affect_to_char(ch, &af);
		act("You go berserk!", ch, 0, 0, TO_CHAR);
		act("$n goes berserk!", ch, 0, 0, TO_ROOM);
		return;
	}

	if(!str_prefix(argument, "concentrate"))
	{
		af.type = gsn_swordtech;
		af.duration = 5 + ((3 - ch->pcdata->stats[UNI_GEN]) * 2);
		af.modifier = 0;
		af.location = 0;
		af.bitvector = STECH_CONCENTRATE;
		affect_to_char(ch, &af);
		act("A deep calm overcomes you and you begin examining your opponent very carefully.", ch, 0, 0,
		    TO_CHAR);
		act("$n appears to get very calm and more alertive.", ch, 0, 0, TO_ROOM);
		return;
	}

	if(!str_prefix(argument, "decapitate"))
	{
		if((victim = ch->fighting) == 0)
		{
			send_to_char("You have to be fighting to do this manuever.\n\r", ch);
			return;
		}
		if(IS_NPC(victim) || number_percent() < 50)
		{
			act("You bring your sword up for a masterful swing and......miss horribly.", ch, 0, victim,
			    TO_CHAR);
			act("$n brings $s sword up for a masterful swing and......misses $N's head by a mile.", ch, 0,
			    victim, TO_NOTVICT);
			act("$n brings $s sword up for a masterful swing and......misses your head by a mile.", ch, 0,
			    victim, TO_VICT);
			act("You drop your weapons!", ch, 0, 0, TO_CHAR);
			act("$n drops $s weapons!", ch, 0, 0, TO_ROOM);
			obj_from_char(obj);
			obj_to_room(obj, ch->in_room);
			if((obj = get_eq_char(ch, WEAR_HOLD)) != 0)
			{
				obj_from_char(obj);
				obj_to_room(obj, ch->in_room);
			}
			return;
		}
		act("You bring your sword up for a masterful swing and whack $N's head clean off!", ch, 0, victim,
		    TO_CHAR);
		act("$n brings $s sword up for a masterful swing and whacks $N's head clean off!", ch, 0, victim,
		    TO_NOTVICT);
		act("$n brings $s sword up for a masterful swing and......you are now missing a head?!", ch, 0, victim,
		    TO_VICT);
		sprintf(buf, "{B%s swordtech decapitates %s!  Ooooh that's gotta hurt!{X", ch->name, victim->name);
		do_info(ch, buf);
		behead(victim);
		return;
	}

	if(!str_prefix(argument, "stun"))
	{
		if((victim = ch->fighting) == 0)
		{
			send_to_char("You have to be fighting to do this manuever.\n\r", ch);
			return;
		}
		act("You knock the hell out of $N's head with the side of your sword!", ch, 0, victim, TO_CHAR);
		act("$n knocks the hell out of $N's head with the side of $s sword!", ch, 0, victim, TO_NOTVICT);
		act("$n knocks the hell out of your head with the side of $s sword!", ch, 0, victim, TO_VICT);
		WAIT_STATE(victim, number_range(24, 60));
		return;
	}

	if(!str_prefix(argument, "fury"))
	{
		if((victim = ch->fighting) == 0)
		{
			send_to_char("You have to be fighting to do this manuever.\n\r", ch);
			return;
		}
		af.type = gsn_swordtech;
		af.duration = 3 + (ch->pcdata->stats[UNI_GEN] * 2);
		af.modifier = APPLY_STR;
		af.location = 0;
		af.bitvector = STECH_FURY;
		affect_to_char(ch, &af);
		act("You attack in a wild fury!", ch, 0, 0, TO_CHAR);
		act("$n attacks in a wild fury!", ch, 0, 0, TO_ROOM);
		multi_hit(ch, ch->fighting, TYPE_UNDEFINED);
		multi_hit(ch, ch->fighting, TYPE_UNDEFINED);
		multi_hit(ch, ch->fighting, TYPE_UNDEFINED);
		return;
	}

	if(!str_prefix(argument, "disarm"))
	{
		if((victim = ch->fighting) == 0 && !ch->in_room)
		{
			send_to_char("You have to be fighting to do this manuever.\n\r", ch);
			return;
		}
		if(IS_NPC(victim))
		{
			send_to_char("Not on NPC's.\n\r", ch);
			return;
		}
		if((obj = get_eq_char(victim, WEAR_WIELD)) == 0)
		{
			send_to_char("They aren't wielding a weapon!\n\r", ch);
			return;
		}
		obj_from_char(obj);
		obj_to_room(obj, ch->in_room);
		af.type = gsn_swordtech;
		af.duration = 5 + (ch->pcdata->stats[UNI_GEN] * 2);
		af.modifier = 0;
		af.location = 0;
		af.bitvector = STECH_DISARM;
		affect_to_char(ch, &af);
		act("$n disarms YOU!", ch, 0, victim, TO_VICT);
		act("$n disarms $N!", ch, 0, victim, TO_NOTVICT);
		act("You disarm $N!", ch, 0, victim, TO_CHAR);
		return;
	}

	send_to_char("Nothing happens.\n\r", ch);
}