I'm currently installing a code for player installed cybernetics...when it was a command it worked fine.. now it is crashing when i turned it into a skill and added a the timer. I marked where it is crashing in the code with a ---->
chance = IS_NPC(ch) ? ch->top_level : (int) (ch->pcdata->learned[gsn_surgery]);
if ( number_percent( ) < chance )
{
send_to_char( "&GYou begin the long process of installing a cybernetic part.\n\r", ch);
act( AT_PLAIN, "$n takes $s scalpel and begins to preform the surgery.", ch, NULL, argument , TO_ROOM );
add_timer ( ch , TIMER_DO_FUN , 1 , do_installcybernetic , 1 );
ch->dest_buf = str_dup(arg1);
return;
}
send_to_char("&RYou can't figure out how to preform surgery.\n\r",ch);
learn_from_failure( ch, gsn_surgery );
return;
case 1:
if ( !ch->dest_buf )
return;
strcpy(arg1, ch->dest_buf);
DISPOSE( ch->dest_buf);
break;
case SUB_TIMER_DO_ABORT:
DISPOSE( ch->dest_buf );
ch->substate = SUB_NONE;
send_to_char("&RYou are interupted and fail to finish your work.\n\r", ch);
return;
}
ch->substate = SUB_NONE;
if ( ms_find_obj(ch) )
return;
obj = get_obj_carry( ch, arg1 );
chance = IS_NPC(ch) ? ch->top_level : (int) (ch->pcdata->learned[gsn_surgery]) ;
if ( number_percent( ) < chance )
{
send_to_char( "You realize that you installed the cybernetic part upside down and crossed some wires.", ch);
learn_from_failure( ch, gsn_surgery );
separate_obj( obj );
obj_from_char( obj );
extract_obj( obj );
return;
}
if (obj->item_type == ITEM_COMMCYBER)
{
----> if (!IS_SET(victim->pcdata->cyber, CYBER_COMM))
{
send_to_char( "&RThey seem to already have that cybernetic part installed.\n\r", ch);
return;
}
checkcyber = TRUE;
separate_obj( obj );
obj_from_char( obj );
extract_obj( obj );
SET_BIT (victim->pcdata->cyber, CYBER_COMM );
}