void roll_real_abils Reroll stats and give multiple choices @ startup

From: Bo Young (Jeepster11@EMAIL.MSN.COM)
Date: 11/03/98


This is the stock roll_real_abils in bpl14:   What I want to do is give the
new char the option of selecting from 4 different sets of stats to pick
from....   I think i kinda know what I'm need..  Correct me if wrong what I
need is to instead of averaging these rolls as below I want to retain them
in temp tables and then display those four rolls in the startup screen and
allow them to reroll their stats kinda like Buck Floyd's reroll.txt.....
Any hints?....                  >>-----Bo----->Young

void roll_real_abils(struct char_data * ch)
{
  int i, j, k, temp;
  ubyte table[6];
  ubyte rolls[4];

  for (i = 0; i < 6; i++)
    table[i] = 0;

  for (i = 0; i < 6; i++) {

    for (j = 0; j < 4; j++)
      rolls[j] = number(1, 6);

    temp = rolls[0] + rolls[1] + rolls[2] + rolls[3] -
      MIN(rolls[0], MIN(rolls[1], MIN(rolls[2], rolls[3])));

    for (k = 0; k < 6; k++)
      if (table[k] < temp) {
 temp ^= table[k];
 table[k] ^= temp;
 temp ^= table[k];
      }
  }



I'm figuring that you would use something similar to this in interpreter.c

case CON_QROLLSTATS:
    switch (*arg) {
      case 'y':
      case 'Y':
        break;
      case 'n':
      case 'N':
      default:
        roll_real_abils(d->character);
        sprintf(buf, "\r\nStr: [%d/%d] Int: [%d] Wis: [%d] Dex: [%d] Con:
[%d] Cha: [%d]",
           GET_STR(d->character), GET_ADD(d->character),
           GET_INT(d->character), GET_WIS(d->character),
           GET_DEX(d->character), GET_CON(d->character),
           GET_CHA(d->character));
        SEND_TO_Q(buf, d);
        SEND_TO_Q("\r\n\r\nKeep these stats? (y/N)", d);
       return;
  }

But pulling the info from those temp thingies yes?  Any hints?....
>>-----Bo----->Young


     +------------------------------------------------------------+
     | 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