void roll_real_abils

From: Bo Young (Jeepster11@email.msn.com)
Date: 01/06/99


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?....

case CON_QROLLSTATS:
    switch (arg) {
      case '1':
    return 1;
        break;
   case '2':
    return 2;
        break;
      case '3':
    return 3;
        break;
   case '4':
    return 4;
        break;
      default:
        roll_real_abils(d->character);
  SEND_TO_Q("\r\n  Choose from any of the following groups of abilities...",
d);
        SEND_TO_Q("\r\nGroup: 1     2     3     4", d);
        sprintf(buf, "\r\nStr:[%2d/%3d] [%2d/%3d] [%2d/%3d] [%2d/%3d]",
           GET_TEMP_STR1(d->character), GET_TEMP_ADD1(d->character),
     GET_TEMP_STR2(d->character), GET_TEMP_ADD2(d->character),
           GET_TEMP_STR3(d->character), GET_TEMP_ADD3(d->character),
     GET_TEMP_STR4(d->character), GET_TEMP_ADD4(d->character));
  SEND_TO_Q(buf, d);
  sprintf(buf, "\r\nInt:[%2d] [%2d] [%2d] [%2d]",
           GET_TEMP_INT1(d->character), GET_TEMP_INT2(d->character),
           GET_TEMP_INT3(d->character), GET_TEMP_INT4(d->character));
  SEND_TO_Q(buf, d);
  sprintf(buf, "\r\nWis:[%2d] [%2d] [%2d] [%2d]",
           GET_TEMP_WIS1(d->character), GET_TEMP_WIS2(d->character),
           GET_TEMP_WIS3(d->character), GET_TEMP_WIS4(d->character));
  SEND_TO_Q(buf, d);
  sprintf(buf, "\r\nDex:[%2d] [%2d] [%2d] [%2d]",
           GET_TEMP_DEX1(d->character), GET_TEMP_DEX2(d->character),
           GET_TEMP_DEX3(d->character), GET_TEMP_DEX4(d->character));
  SEND_TO_Q(buf, d);
  sprintf(buf, "\r\nCon:[%2d] [%2d] [%2d] [%2d]",
           GET_TEMP_CON1(d->character), GET_TEMP_CON2(d->character),
           GET_TEMP_CON3(d->character), GET_TEMP_CON4(d->character));
  SEND_TO_Q(buf, d);
        SEND_TO_Q("\r\n\r\nChoose a group <1-4>, or press return to
reroll -->", d);
       return;
  }

 what it SHOULD look like:

  Choose from any of the following groups of abilities...
Group: 1     2     3     4
Str:   13    14    13    17
Int:   14    15    13    15
Wis:   13    13    12    14
Dex:   13    11    14    15
Con:   15    16    10    12
Choose a group <1-4>, or press return to reroll -->


This is the stock roll_real_abils in bpl14:
/*
 * Roll the 6 stats for a character... each stat is made of the sum of
 * the best 3 out of 4 rolls of a 6-sided die.  Each class then decides
 * which priority will be given for the best to worst stats.
 */
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];
      }
  }

Any hints?....
>>-----Bo----->Young


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



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