improve skill if you get it right.. i.e. bash

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


well, I am trying to do this, and I editted the code that was posted here 
the other day for if you fail, you learn from your msitakes.. but I want 
it the opposite, so I would just run it through the check when you get 
the skill right, correct? well ehre is the code for anyone who wants it.. 
and for you guys to look at if I did something wrong..

void improve_skill(struct char_data *ch, int skill)
{
  int percent = GET_SKILL(ch, skill);
  char skillbuf[MAX_STRING_LENGTH];

  /* Fail the check if they are fully practiced, not practiced at all, */
/* or just if they aren't lucky enough to get under int+wis in the random */
  if (number(1, 200) > GET_WIS(ch) + GET_INT(ch))
    return;
  if (percent >= 100 || percent <= 0)
    return;

  percent = number(1, 5);
  SET_SKILL(ch, skill, percent);
  if (percent >= 4)
  /* Only show this is they get their skill by 4 points or better.. */
  sprintf(skillbuf, "You feel your skill in %s improving.", skill);
}

enjoy... and lemme know if there are any bugs, please.. =)


   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