Code for Rom2.4b4: mend 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 Please keep all headers below intact. Thanks Kracus ...put in help.are -1 MEND~ Syntax: mend This is a skill called "mend". It allows the player to mend his wounds if he is below max hp. The cost to mend is 25movement and it mends about half the charater's level in hp. -Code by Kracus ~ /* Kracus-In fight.c add this at the top of the file */ DECLARE_DO_FUN(do_mend ); /* Kracus-In fight.c below do_trip */ /* Mend code by Kracus 1997 */ void do_mend( CHAR_DATA *ch, char *argument) { int chance, hp_percent; if ((chance = get_skill(ch,gsn_mend)) == 0 && ch->level < skill_table[gsn_mend].skill_level[ch->class]) { send_to_char("You do not have enough skill to mend your wounds.\n\r",ch); return; } if (ch->hit < 100) /*cant mend with low hp*/ { send_to_char("Your wounds are too severe to mend.\n\r",ch); return; } if (ch->move < 25) /*Kracus- cant mend with low movement*/ { send_to_char("You are too exhausted to try and mend your wounds.\n\r",ch); return; } if (ch->position == POS_FIGHTING) /* if char is fighting better chance */ chance += 10; /* more char is hurt has better chance of mending wounds */ hp_percent = 100 * ch->hit/ch->max_hit; chance += 25 - hp_percent/3; if (number_percent() < chance) { WAIT_STATE(ch,PULSE_VIOLENCE); ch->move -= 25; /* takes 25 movement away from char to mend */ ch->hit += (ch->level/2); ch->hit = UMIN(ch->hit,ch->max_hit); send_to_char("You quickly mend your wounds.\n\r",ch); act("$n quickly puts some salve on $s his wounds.",ch,NULL,NULL,TO_ROOM); check_improve(ch,gsn_mend,TRUE,2); } else { WAIT_STATE(ch,3 * PULSE_VIOLENCE); send_to_char("You mend your wounds, but it seems to have no effect.\n\r",ch); check_improve(ch,gsn_mend,FALSE,2); } } /* Kracus- add to db.c */ sh_int gsn_mend; /* Kracus- add this in the interp.c into the code under kick */ { "kick", do_kick, POS_FIGHTING, 0, LOG_NORMAL, 1 }, { "mend", do_mend, POS_FIGHTING, 0, LOG_NORMAL, 1 }, /* Kracus- add this to interp.h */ DECLARE_DO_FUN( do_mend ); /* Kracus - add this to merc.h around line 1900 */ extern sh_int gsn_mend; /* Kracus add this to const.c and adjust the class levels and how much it costs to gain */ { "mend", { 53, 53, 53, 21}, /* for stock rom level 23 for warriors */ { 0, 0, 0, 5 }, /* for stockrom costs warriors 5 to gain, or creation 5cps */ spell_null, TAR_IGNORE, POS_STANDING, &gsn_mend, SLOT( 0), 0, 12, "", "!MEND!", "" }, /* Kracus- Lastly, in merc.h increase MAX_SKILL by one since */ have fun ;)