yet another fix for improve_skill

From: Brian Williams - Nashak (bmw@efn.org)
Date: 07/17/96


well, if you put in my little improve_skill thing.. you might notice that 
it never sends the message to the ch.. and always sprintfs the thing? 
well.. it's cuz' I forgot 2 things.. well here is the fixed one.. <I hope 
no errors are in it.. :P> you put in in like fight.c.. then in 
act.offensive.c put a void improve_skill(blah, blah).. and then where the 
skills are successful.. do a little improve_skill(ch, SKILL_<skill>)
ok here the code:
void improve_skill(struct char_data *ch, int skill)
{
  int percent = GET_SKILL(ch, skill);
  int newpercent;
  char skillbuf[MAX_STRING_LENGTH];


  if (number(1, 200) > GET_WIS(ch) + GET_INT(ch))
    return;
  if (percent >= 100 || percent <= 0)
    return;

  newpercent = number(1, 5);
  percent += newpercent;
  SET_SKILL(ch, skill, percent);
  if (newpercent >= 4)
  sprintf(skillbuf, "You feel your skill in %s improving.", skill);
  send_to_char(skillbuf, ch);
}
enjoy!




   Nashak			Brian Williams		The Realms of Luminari
   nashak@darkstr.com		bmw@efn.org		darkstr.com 6969



This archive was generated by hypermail 2b30 : 12/07/00 PST