ok, i'm lookin and i think i need a default but i don't know what to put default or if i even need one. here's the whole function.
[code]
void do_fire( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim = NULL;
OBJ_DATA *arrow;
OBJ_DATA *bow;
sh_int max_dist;
int PROJ_STONE;
int PROJ_BOLT;
int PROJ_ARROW;
int PROJ_DART;
if( ( bow = get_eq_char( ch, WEAR_MISSILE_WIELD ) ) == NULL )
{
send_to_char( "But you are not wielding a missile weapon!!\n\r", ch );
return;
}
one_argument( argument, arg );
if ( arg[0] == '\0' && ch->fighting == NULL )
{
send_to_char( "Fire at whom or what?\n\r", ch );
return;
}
if( !str_cmp( arg, "none" ) || !str_cmp( arg, "self" ) || victim == ch )
{
send_to_char( "How exactly did you plan on firing at yourself?\n\r", ch );
return;
}
if( ( arrow = get_eq_char( ch, WEAR_HOLD ) ) == NULL )
{
send_to_char( "You are not holding a projectile!\n\r", ch );
return;
}
if( arrow->item_type != ITEM_PROJECTILE )
{
send_to_char( "You are not holding a projectile!\n\r", ch );
return;
}
/* modify maximum distance based on bow-type and ch's class/str/etc */
max_dist = URANGE( 1, bow->value[4], 10 );
if( bow->value[5] != arrow->value[4] )
{
char *msg = "You have nothing to fire...\n\r";
switch( bow->value[5] )
{
case PROJ_BOLT: msg = "You have no bolts...\n\r"; break;
case PROJ_ARROW: msg = "You have no arrows...\n\r"; break;
case PROJ_DART: msg = "You have no darts...\n\r"; break;
case PROJ_STONE: msg = "You have no slingstones...\n\r"; break;
}
send_to_char( msg, ch );
return;
}
/* Add wait state to fire for pkill, etc... */
WAIT_STATE( ch, 6 );
/* handle the ranged attack */
ranged_attack( ch, argument, bow, arrow, TYPE_HIT + arrow->value[3], max_dist );
return;
}
[/code]
thanks for any help on this. i'm goin to bed. heh, i've been workin too long on this. |