[CODE] list_skills

From: The Mookow (micron@NET.BLUEMOON.NET)
Date: 08/27/98


 In my MUD, I have eliminated classes and added mulitiple level systems and
races.
I have thus changed the spell/skill system accordingly, or so I think. I am
now
having problems with the list_skills functions. I've added Weapons and
Languages
to the skill/spell system, but list_skills didn't work before then. I've
attached
my list_skills below after countless trying of fixing it myself. I had it
working
before one of our coders(?) accidently RMed the wrong directory, so I know
it's
possible. Please Help. Thank you.

     -Ryan Brown

ObCircle:

>---
>"One hundred years from now, none of this will matter because you and I
>will be dead -- unless the Grim Reaper has switched his record-keeping to
>a Windows 95-based system, in which case we all might live forever. "
>-- Associated Press


I like that :)



void list_skills(struct char_data *ch)
{
  extern char *spells[];
  extern struct spell_info_type spell_info[];
  int i, j = 0;

  sprintf(buf,
"\r\n\r\n------------------------SKILLS------------------------\r\n");

  for (i = MAX_SPELLS + 1; i <= NUM_SKILLS; i++) {
    if ((spell_info[i].type == 1) && (GET_BTHLEV(ch) >=
spell_info[i].min_level)) {
      sprintf(buf, "%s%-20s (%3d%%)    ", buf,
              spells[i], GET_SKILL(ch, i));
      if (!(++j % 3))
        strcat(buf, "\r\n");
    }
    else if ((spell_info[i].type == 2) && (GET_CMDLEV(ch) >=
spell_info[i].min_level)) {
        sprintf(buf, "%s%-20s (%3d%%)    ", buf,
                spells[i], GET_SKILL(ch, i));
        if (!(++j % 3))
          strcat(buf, "\r\n");
    }
    else if ((spell_info[i].type == 3) && (GET_COMLEV(ch) >=
spell_info[i].min_level)) {
      sprintf(buf, "%s%-20s (%3d%%)    ", buf,
              spells[i], GET_SKILL(ch, i));
      if (!(++j % 3))
        strcat(buf, "\r\n");
    }
    else if ((spell_info[i].type == 4) && (GET_ENGLEV(ch) >=
spell_info[i].min_level)) {
      sprintf(buf, "%s%-20s (%3d%%)    ", buf,
              spells[i], GET_SKILL(ch, i));
      if (!(++j % 3))
        strcat(buf, "\r\n");
    }
    else if ((spell_info[i].type == 5) && (GET_ESPLEV(ch) >=
spell_info[i].min_level)) {
      sprintf(buf, "%s%-20s (%3d%%)    ", buf,
              spells[i], GET_SKILL(ch, i));
      if (!(++j % 3))
        strcat(buf, "\r\n");
    }
    else if ((spell_info[i].type == 6) && (GET_FRCLEV(ch) >=
spell_info[i].min_level)) {
      sprintf(buf, "%s%-20s (%3d%%)    ", buf,
              spells[i], GET_SKILL(ch, i));
      if (!(++j % 3))
        strcat(buf, "\r\n");
    }
    else if ((spell_info[i].type == 7) && (GET_PILLEV(ch) >=
spell_info[i].min_level)) {
      sprintf(buf, "%s%-20s (%3d%%)    ", buf,
              spells[i], GET_SKILL(ch, i));
      if (!(++j % 3))
        strcat(buf, "\r\n");
    }
    else if ((spell_info[i].type == 8) && (GET_SMGLEV(ch) >=
spell_info[i].min_level)) {
      sprintf(buf, "%s%-20s (%3d%%)    ", buf,
              spells[i], GET_SKILL(ch, i));
      if (!(++j % 3))
        strcat(buf, "\r\n");
    }
  }
  send_to_char(buf, ch);
  sprintf(buf,
"\r\n\r\n------------------------SPELLS------------------------\r\n");

  for (i = 1; i <= NUM_SPELLS; i++) {
    if ((spell_info[i].type == 6) && (GET_FRCLEV(ch) >=
spell_info[i].min_level)) {
      sprintf(buf, "%s%-20s (%3d%%)    ", buf,
              spells[i], GET_SKILL(ch, i));
      if (!(++j % 3))
        strcat(buf, "\r\n");
    }
  }
  send_to_char(buf, ch);

  sprintf(buf,
"\r\n\r\n------------------------WEAPONS-----------------------\r\n");

  for (i = MAX_SKILLS; i <= NUM_WEAPS; i++) {
    if (GET_COMLEV(ch) >= spell_info[i].min_level) {
      sprintf(buf, "%s%-20s (%3d%%)    ", buf,
              spells[i], GET_SKILL(ch, i));
      if (!(++j % 3))
        strcat(buf, "\r\n");
    }
  }
  send_to_char(buf, ch);

  sprintf(buf,
"\r\n\r\n-----------------------LANGUAGES----------------------\r\n");


  for (i = MAX_WEAPS; i <= NUM_LANGS; i++) {
    sprintf(buf, "%s%-20s (%3d%%)    ", buf,
            spells[i], GET_SKILL(ch, i));
    if (!(++j % 3))
      strcat(buf, "\r\n");
  }
  send_to_char(buf, ch);
}


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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