Spec_proc (level)

From: Demond LaZaro (demond@TOLKIEN.REALMS.ORG)
Date: 11/05/97


Heres the spec_proc I'm trying to use :)
extern struct title_type titles[NUM_CLASSES][LVL_IMPL + 1];

SPECIAL(level)
{
  extern void advance_level(struct char_data * ch);
  if (IS_NPC(ch) || !CMD_IS("gain"))
    return 0;

  skip_spaces(&argument);

  if (!*argument) {
    send_to_char("In what class do you want to gain??\r\nFirst Second or Third\r\n", ch);
    return 1;
  }

  if (argument == ("First") || argument == ("first")) {
      while (GET_LEVEL(ch) < LVL_HERO &&
                GET_EXP(ch) >= titles[(int) GET_CLASS(ch)][GET_LEVEL(ch) + 1].exp) {
        GET_LEVEL(ch) += 1;
        GET_EXP(ch) -= titles[(int) GET_CLASS(ch)][GET_LEVEL(ch) + 1].exp;
        advance_level(ch);
        send_to_char("Congratulations you leveled in your first class!", ch);
      }
      return 1;
  }
  else if (argument == ("Second") || argument == ("second")) {
      while (GET_DUAL_LEVEL(ch) < LVL_HERO &&
                GET_EXP(ch) >= titles[(int) GET_DUAL(ch)][GET_DUAL_LEVEL(ch) + 1].exp) {
        GET_DUAL_LEVEL(ch) += 1;
        GET_EXP(ch) -= titles[(int) GET_DUAL(ch)][GET_DUAL_LEVEL(ch) + 1].exp;
        advance_level(ch);
        send_to_char("Congratulations you leveled in your second class!", ch);
      }
      return 1;
  }
  else if (argument == ("Third") || argument == ("third")) {
      while (GET_TRI_LEVEL(ch) < LVL_HERO &&
                GET_EXP(ch) >= titles[(int) GET_TRI(ch)][GET_TRI_LEVEL(ch) + 1].exp) {
        GET_TRI_LEVEL(ch) += 1;
        GET_EXP(ch) -= titles[(int) GET_TRI(ch)][GET_TRI_LEVEL(ch) + 1].exp;
        advance_level(ch);
        send_to_char("Congratulations you leveled in your third class!", ch);
      }
      return 1;
  }
  return 1;
}

Thanx,
Demond

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Name: Demond LaZaro the Implementor     Phone: 1-505-776-8866
Mud: Master's Realm Mud                 Code Base: CircleMud
Addy: realms.org 6969                   Addy2: 206.185.32.8 6969
Fax: None (yet :\)                      E-mail: demond@realms.org

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


     +------------------------------------------------------------+
     | 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/08/00 PST