/* ok, got this idea from a friend of mine....thanks Chuck * basically, when you disarm, its not logical that you go after * the primary weapon all the time, its somewhat logical to * go after either weapon....so...i made it so that the * PC can specify either one of the following * disarm primary -does what it says * disarm secondary -also does what it says * disarm -this one you have a 50% chance of trying * to disarm either slot :) * well ive rambled on long enough...heres the code. * NOTE: ONLY use if you have dual wield :P */ /* - means remove * + means add */ /* top of fight.c, global declarations */ - void disarm args( ( CHAR_DATA *ch, CHAR_DATA *victim ) ); + void disarm args( ( CHAR_DATA *ch, CHAR_DATA *victim, const int bitname ) ); /* to disarm */ - void disarm( CHAR_DATA *ch, CHAR_DATA *victim ) + void disarm( CHAR_DATA *ch, CHAR_DATA *victim, const int bitname ) - if ( ( obj = get_eq_char( victim, WEAR_WIELD ) ) == NULL ) + if ( ( obj = get_eq_char( victim, bitname ) ) == NULL ) /* if you want to make it so that when your primary gets disarmed, * your secondary becomes your primary (*more realistic*) * then add this right before the return at the end of the function. */ /* Make secondary weapon your primary!!!, remove if you dont want */ if ( ( obj = get_eq_char( victim, WEAR_SECONDARY ) ) != NULL ) { send_to_char("{RYour secondary weapon becomes your primary!\n\r{x", victim); act("{R$N quickly moves his secondary weapon to his primary!{x\n\r", ch, NULL, victim, TO_NOTVICT ); obj->wear_loc = WEAR_WIELD; } / * to do_disarm */ int bitname; /* after the check for whether or not you are fighting * add this: */ /* if they specify primary, disarm primary, * if they specify secondary, disarm secondary * if they dont sepcify, just give a random possibility :) */ one_argument( argument, arg ); if (!str_prefix( arg, "primary")) bitname = WEAR_WIELD; else if (!str_prefix( arg, "secondary")) bitname = WEAR_SECONDARY; else {bitname = number_range( 0, 1 ) ? WEAR_SECONDARY : WEAR_WIELD;} - if ( ( obj = get_eq_char( victim, WEAR_WIELD ) ) == NULL ) + if ( ( obj = get_eq_char( victim, bitname ) ) == NULL ) - disarm( ch, victim ); + disarm( ch, victim, bitname );