src/fight.c
/*
 * Disarm a creature.
 * Caller must check for successful attack.
 */
Disarm a creature.
Caller must check for successful attack.
Disarm a creature . Caller must check for successful attack .
void disarm( CHAR_DATA *ch, CHAR_DATA *victim )
{
    OBJ_DATA *obj;
    if ( ( obj = get_eq_char( victim, WEAR_WIELD ) ) == NULL )
	return;
    if ( IS_OBJ_STAT(obj,ITEM_NOREMOVE))
    {
	act("$S weapon won't budge!",ch,NULL,victim,TO_CHAR);
	act("$n tries to disarm you, but your weapon won't budge!",
	    ch,NULL,victim,TO_VICT);
	act("$n tries to disarm $N, but fails.",ch,NULL,victim,TO_NOTVICT);
	return;
    }
    act( "$n DISARMS you and sends your weapon flying!", 
	 ch, NULL, victim, TO_VICT    );
    act( "You disarm $N!",  ch, NULL, victim, TO_CHAR    );
    act( "$n disarms $N!",  ch, NULL, victim, TO_NOTVICT );
    obj_from_char( obj );
    if ( IS_OBJ_STAT(obj,ITEM_NODROP) || IS_OBJ_STAT(obj,ITEM_INVENTORY) )
	obj_to_char( obj, victim );
    else
    {
	obj_to_room( obj, victim->in_room );
	if (IS_NPC(victim) && victim->wait == 0 && can_see_obj(victim,obj))
	    get_obj(victim,obj,NULL);
    }
    return;
}
void disarm ( CHAR_DATA * ch , CHAR_DATA * victim ) { OBJ_DATA * obj ; if ( ( obj = get_eq_char ( victim , WEAR_WIELD ) ) == NULL ) return ; if ( IS_OBJ_STAT ( obj , ITEM_NOREMOVE ) ) { act ( " " , ch , NULL , victim , TO_CHAR ) ; act ( " " , ch , NULL , victim , TO_VICT ) ; act ( " " , ch , NULL , victim , TO_NOTVICT ) ; return ; } act ( " " , ch , NULL , victim , TO_VICT ) ; act ( " " , ch , NULL , victim , TO_CHAR ) ; act ( " " , ch , NULL , victim , TO_NOTVICT ) ; obj_from_char ( obj ) ; if ( IS_OBJ_STAT ( obj , ITEM_NODROP ) || IS_OBJ_STAT ( obj , ITEM_INVENTORY ) ) obj_to_char ( obj , victim ) ; else { obj_to_room ( obj , victim -> in_room ) ; if ( IS_NPC ( victim ) && victim -> wait == 0 && can_see_obj ( victim , obj ) ) get_obj ( victim , obj , NULL ) ; } return ; }
Disarm a creature.
Disarm a creature .