void do_kill( CHAR_DATA * ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
CHAR_DATA *rch;
argument = one_argument( argument, arg );
// one_argument( argument, arg );
if( arg[0] == '\0' )
{
send_to_char( "Kill whom?\n\r", ch );
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
if( ( victim = get_char_room( ch, arg ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
if( !IS_NPC( victim ) && !victim->desc )
{
send_to_char( "They are link dead, it wouldn't be right.", ch );
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
if( IS_NPC( victim ) && victim->morph )
{
send_to_char( "This creature appears strange to you. Look upon it more closely before attempting to kill it.", ch );
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
if( IS_NPC( victim ) && is_splitformed( victim ) && victim->master && victim->master == ch )
{
send_to_char( "You can't kill your own Split Form.\n\r", ch );
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
if( IS_NPC( ch ) && is_splitformed( ch ) )
{
send_to_char( "You can't do that.", ch );
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
if( !IS_NPC( ch ) && IS_NPC( victim ) && is_splitformed( victim ) )
{
pager_printf_color( ch, "Why don't you try attacking the real %s.", victim->short_descr );
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
if( IS_NPC( victim ) && victim->master != NULL && IS_IMMORTAL( victim->master ) && !IS_IMMORTAL( ch ) )
{
send_to_char( "Cheatz.\n\r", ch );
return;
}
/*
*
else
{
if ( IS_AFFECTED(victim, AFF_CHARM) && victim->master != NULL )
{
send_to_char( "You must MURDER a charmed creature.\n\r", ch );
return;
}
}
*
*/
if( victim == ch )
{
send_to_char( "You hit yourself. Ouch!\n\r", ch );
/* Removed to avoid abuse and "self-inflicted SSJ*/
/* multi_hit( ch, ch, TYPE_UNDEFINED );*/
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
/* Karn - 05.17..06
if( is_safe( ch, victim, TRUE ) )
{
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
*/
if( !IS_IMMORTAL( ch ) && !IS_NPC( ch ) && !IS_NPC( victim ) )
{
if( !xIS_SET( ch->act, PLR_QUESTING ) && xIS_SET( victim->act, PLR_QUESTING ) )
{
send_to_char( "You can't attack a player involved in a role playing event.\n\r", ch );
return;
}
if( xIS_SET( ch->act, PLR_QUESTING ) && !xIS_SET( victim->act, PLR_QUESTING ) )
{
send_to_char( "You can't attack a player not involved in a role playing event.\n\r", ch );
return;
}
}
if( xIS_SET( ch->in_room->room_flags, ROOM_ARENA ) )
{
send_to_char( "You can only spar while in an arena.\n\r", ch );
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
if( xIS_SET( ch->act, PLR_SPAR ) )
{
xREMOVE_BIT( ch->act, PLR_SPAR );
}
if( xIS_SET( victim->act, PLR_SPAR ) )
{
xREMOVE_BIT( victim->act, PLR_SPAR );
}
if( IS_AFFECTED( ch, AFF_CHARM ) && ch->master == victim )
{
act( AT_PLAIN, "$N is your beloved master.", ch, NULL, victim, TO_CHAR );
WAIT_STATE( ch, 1 * PULSE_VIOLENCE / 2 );
return;
}
if( ch->position == POS_RESTING || ch->position == POS_SLEEPING )
{
send_to_char( "How do you propose to do that in your current state?\n\r", ch );
return;
}
if( ch->position == POS_FIGHTING
|| ch->position == POS_EVASIVE
|| ch->position == POS_DEFENSIVE || ch->position == POS_AGGRESSIVE || ch->position == POS_BERSERK )
{
send_to_char( "You do the best you can!\n\r", ch );
return;
}
if( who_fighting( victim ) != NULL )
{
send_to_char( "It would not be honorable to interfere with some one else's battle.\n\r", ch );
return;
}
if( !IS_NPC( ch ) && !IS_NPC( victim ) && strcmp( argument, "now" ) )
{
send_to_char( "You must type 'kill <person> now' if you want to kill a player.\n\r", ch );
return;
}
if( !IS_NPC( ch ) && !IS_NPC( victim ) )
if( !pkill_ok( ch, victim ) )
return;
if( !IS_NPC( victim ) )
// {
// send_to_char("PKing is currently disabled.\n\r",ch);
// return;
// }
{
sprintf( log_buf, "PLAYER COMBAT: %s[%s] vs. %s[%s].",
ch->name, !xIS_SET( ch->act, PLR_SPAR ) ? "DEADLY" : "SPARING",
victim->name, !xIS_SET( victim->act, PLR_SPAR ) ? "DEADLY" : "SPARING" );
log_string_plus( log_buf, LOG_NORMAL, ch->level );
WAIT_STATE( ch, 1 * PULSE_VIOLENCE );
if( !xIS_SET( ch->act, PLR_SPAR ) )
{
sprintf( buf, "Help! I am being attacked by %s!", IS_NPC( ch ) ? ch->short_descr : ch->name );
if( IS_PKILL( victim ) )
{
do_wartalk( victim, buf );
}
else
{
do_yell( victim, buf );
}
ch->focus = 0;
victim->focus = 0;
}
check_illegal_pk( ch, victim );
}
else
WAIT_STATE( ch, 1 * PULSE_VIOLENCE );
if( !IS_NPC( ch ) && ch->race == 6 )
{
find_absorb_data( ch, victim );
ch->pcdata->absorb_pl = 0;
}
if( !IS_NPC( victim ) && victim->race == 6 )
{
find_absorb_data( victim, ch );
victim->pcdata->absorb_pl = 0;
}
if( IS_DEMON( ch ) && IS_DEMON( victim ) && ( ch->rank > 1 || victim->rank > 1 ) )
{
for( rch = ch->in_room->first_person; rch; rch = rch->next_in_room )
{
if( !IS_NPC( rch ) )
continue;
if( rch->master )
{
if( rch->master == ch )
{
ch_printf( ch, "Your minion returns to the void, leaving you to duel alone.\n\r" );
act( AT_DGREY, "$n's minion returns to the void.", ch, NULL, victim, TO_ROOM );
extract_char( rch, TRUE );
if( xIS_SET( ch->affected_by, AFF_TRI_FORM ) )
xREMOVE_BIT( ch->affected_by, AFF_TRI_FORM );
continue;
}
else if( rch->master == victim )
{
ch_printf( victim, "Your minion returns to the void, leaving you to duel alone.\n\r" );
act( AT_DGREY, "$n's minion returns to the void.", victim, NULL, ch, TO_ROOM );
extract_char( rch, TRUE );
if( xIS_SET( victim->affected_by, AFF_TRI_FORM ) )
xREMOVE_BIT( victim->affected_by, AFF_TRI_FORM );
continue;
}
}
}
}
ch->delay = 0;
check_attacker( ch, victim );
multi_hit( ch, victim, TYPE_UNDEFINED );
return;
}