Пример #1
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;
}
Пример #2
0
void force_cast(CHAR_DATA *ch, CHAR_DATA *victim, sh_int sn)
{
static char buf[MAX_INPUT_LENGTH];
char * target;

    if(ch == victim)
    {
	sprintf(buf,"'%s' self",skill_table[sn].name);
	do_function(ch,&do_cast, buf );
        return;
    }

    if( (target = get_target_by_name(ch,victim)) == NULL)
    {
	sprintf(buf,"'%s' %s",skill_table[sn].name, victim ? victim->name : "");
	do_function(ch,&do_cast, buf );
    }
    else
    {
	sprintf(buf,"'%s' %s",skill_table[sn].name, target);
	do_function(ch,&do_cast, buf );
    }
    return;
}