Code for Rom2.4b4: critical backstab skill v1.0 by Kracus Thanks to the people below for the making muds possible! :) Based on ROM Version 2.4 beta (c)1993-96 Russ Taylor Based on Merc 2.1 code by Hatchet, Furey, and Kahn Original DikiMud by: Hans Staerfeldt, Katja Nyboe, Tom Madsen, Micheal Seifert, Sebastian Hammer This skill "critical backstab" allows the person To have a 1 percent chance of killing a mob or pc, in one hit, no matter the mob or pc's hitpoints. If they fail to crit they just do a regular backstab. This is not the best code, and it is possible to fail And have the victims hp only at 1hp and then miss, But it doesn't require a new raw_kill version. The reason for this is I was to lazy to make a new raw_kill That gives exp, since raw_kill won't give exp. So in this version the player gets exp even if their crit is successful. Well, this does help and give you a workable code for crit. ;) Please keep the header on do_critical_backstab below intact. Thanks Kracus /* Kracus- in command procedures in fight.c add this */ DECLARE_DO_FUN(do_critical_backstab ); /* Kracus in void multi-hit in fight.c add this below backstab*/ if ( ch->fighting != victim || dt == gsn_critical_backstab ) return; /* Kracus- in void mob_hit in fight.c add this below backstab*/ if (ch->fighting != victim || dt == gsn_critical_backstab) return; /* Kracus- in one_hit in fight.c add this below backstab */ if (dt == gsn_critical_backstab) thac0 -= 10 * (100 - get_skill(ch,gsn_critical_backstab)); /*Kracus farther down in one_hit in fight.c add this below backstab */ if ( dt == gsn_critical_backstab && wield != NULL) if ( wield->value[0] != 2 ) dam *= 2 + (ch->level / 10); else dam *= 2 + (ch->level / 8); /*Kracus- in fight.c add this below do_backstab */ /* Critical Backstab- code by Kracus 1997 */ void do_critical_backstab( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; CHAR_DATA *victim; OBJ_DATA *obj; one_argument( argument, arg ); if (arg[0] == '\0') { send_to_char("Critical Backstab whom?\n\r",ch); return; } if (ch->fighting != NULL) { send_to_char("You're facing the wrong end.\n\r",ch); return; } else if ((victim = get_char_room(ch,arg)) == NULL) { send_to_char("They aren't here.\n\r",ch); return; } if ( victim == ch ) { send_to_char( "You cannot critically backstab yourself?\n\r", ch ); return; } if ( is_safe( ch, victim ) ) return; if (IS_NPC(victim) && victim->fighting != NULL && !is_same_group(ch,victim->fighting)) { send_to_char("Kill stealing is not permitted.\n\r",ch); return; } if ( ( obj = get_eq_char( ch, WEAR_WIELD ) ) == NULL) { send_to_char( "You need to wield a weapon to critical backstab.\n\r", ch ); return; } if ( victim->hit < victim->max_hit / 3) { act( "$N is too hurt to critically backstab.", ch, NULL, victim, TO_CHAR ); return; } check_killer( ch, victim ); WAIT_STATE( ch, skill_table[gsn_critical_backstab].beats ); if ( number_percent( ) < get_skill(ch,gsn_critical_backstab) || ( get_skill(ch,gsn_critical_backstab) >= 2 && !IS_AWAKE(victim) ) ) { if(number_percent() > 99) { victim->hit= UMIN(victim->hit = (victim->max_hit/victim->max_hit), victim->max_hit); update_pos(victim); check_improve(ch,gsn_critical_backstab, TRUE, 1); multi_hit(ch,victim, gsn_critical_backstab); send_to_char("Your {rcritical backstab{x has succeeded causing {rdeath{x!\n\r",ch); return; } } else /*Kracus put the check killer above the 99percent*/ if ( number_percent( ) < get_skill(ch,gsn_critical_backstab) || ( get_skill(ch,gsn_critical_backstab) >= 2 && !IS_AWAKE(victim) ) ) { check_improve(ch,gsn_critical_backstab,TRUE,1); multi_hit( ch, victim, gsn_critical_backstab ); } else { check_improve(ch,gsn_critical_backstab,FALSE,1); damage( ch, victim, 0, gsn_critical_backstab,DAM_NONE,TRUE); } return; } /*Kracus- add this now to interp.c in the part with backstab */ { "critical backstab", do_critical_backstab, POS_FIGHTING, 0, LOG_NORMAL, 1 }, /* Kracus add this to db.c */ sh_int gsn_critical_backstab; /*Kracus- add this to interp.h */ DECLARE_DO_FUN( do_critical_backstab ); /* Kracus- add this to merc.h */ extern sh_int gsn_critical_backstab; /*Kracus- add this to const.c */ { "critical backstab", { 53, 53, 24, 53 }, /* level 24 for thieves in stock rom */ { 0, 0, 5, 0}, /* costs 5 to gain for thieves in stockrom */ spell_null, TAR_IGNORE, POS_STANDING, &gsn_critical_backstab, SLOT( 0), 0, 24, /* is lagged around after attacking with crit */ "critical backstab", "!Critical Backstab!", "" }, /*Kracus- LAST- increase MAX_SKILL in merc.h by 1 cause you added in a new skill */