Ok i'm working on a little bit of code here to set an "offensive strength" relative to weapon type being
wielded. I intend to add more variables before it's all said and done but this is the basic prototype. However
when i compile i have no problems, but when i execute the code it returns 0. The only way this is possible is if get_curr_str(ch) could be returning 0. or the initial test is invalid hence it does not execute at all. Any insights?
thanks.
wielded. I intend to add more variables before it's all said and done but this is the basic prototype. However
when i compile i have no problems, but when i execute the code it returns 0. The only way this is possible is if get_curr_str(ch) could be returning 0. or the initial test is invalid hence it does not execute at all. Any insights?
void do_os( CHAR_DATA * ch, char *argument)
{
OBJ_DATA *wield;
int os = 0;
wield = get_eq_char( ch, WEAR_WIELD );
if ( !IS_NPC(ch) && wield )
{
if ( wield->value[3] == WEAPON_AXE )
os = ((get_curr_str(ch) * 2) + get_curr_dex(ch) + get_curr_con(ch));
else if ( wield->value[3] == WEAPON_DAGGER )
os = ((get_curr_dex(ch) * 2) + get_curr_str(ch) + get_curr_ref(ch));
else if ( wield->value[3] == WEAPON_SWORD )
os = ((get_curr_str(ch) * 2) + get_curr_dex(ch) + get_curr_ref(ch));
else
os = ((get_curr_str(ch) * 10));
ch->os = os;
}
ch_printf( ch, "Ok this is here to test: OS = %d\n\r", os );
}
thanks.