Add menu options for mob's stats in medit.

By Richard Glover

 

Here's a snippet of code for those of you that want to add the menu options
to edit a mob's stats in medit.  This will not affect your .mob files in any
way.  This part of the code was just not produced.

Adding stats (physical/mental ability scores) to Oasis OLC's medit:

olc.h (with other MEDIT_x stuff):
#define MEDIT_ABIL_STR                   35
#define MEDIT_ABIL_ADD                   36
#define MEDIT_ABIL_INT                   37
#define MEDIT_ABIL_WIS                   38
#define MEDIT_ABIL_DEX                   39
#define MEDIT_ABIL_CON                   40
#define MEDIT_ABIL_CHR                   41


medit.c (medit_disp_menu):
After your last menu item, but before Quit:
      "%sS%s) Stats     : Str/Add Int Wis Dex Con Chr\r\n"
      "                %s%3d%s/%s%3d %3d %3d %3d %3d %3d%s\r\n"

...and appropriately with the other args:
      grn, nrm, cyn, GET_STR(mob), nrm, cyn, GET_ADD(mob), GET_INT(mob),
      GET_WIS(mob), GET_DEX(mob), GET_CON(mob), GET_CHA(mob), nrm,


medit.c (medit_parse):
Right before default of the second switch:
    case 's':
    case 'S':
      OLC_MODE(d) = MEDIT_ABIL_STR;
      send_to_char("\r\nEnter Strength (not %) : ", d->character);
      return;

After case MEDIT_ALIGNMENT's break:
  case MEDIT_ABIL_STR:
    i = atoi(arg);
    GET_STR(OLC_MOB(d)) = MAX(3, MIN(25, i ? i : 11));
    send_to_char("\r\nEnter Percentile for Strength : ", d->character);
    OLC_MODE(d) = MEDIT_ABIL_ADD;
    return;

  case MEDIT_ABIL_ADD:
    GET_ADD(OLC_MOB(d)) = (GET_STR(OLC_MOB(d)) == 18) ? MAX(0, MIN(100,
atoi(arg
))) : 0;
    send_to_char("\r\nEnter Intelligence : ", d->character);
    OLC_MODE(d) = MEDIT_ABIL_INT;
    return;

  case MEDIT_ABIL_INT:
    i = atoi(arg);
    GET_INT(OLC_MOB(d)) = MAX(3, MIN(25, i ? i : 11));
    send_to_char("\r\nEnter Wisdom : ", d->character);
    OLC_MODE(d) = MEDIT_ABIL_WIS;
    return;

  case MEDIT_ABIL_WIS:
    i = atoi(arg);
    GET_WIS(OLC_MOB(d)) = MAX(3, MIN(25, i ? i : 11));
    send_to_char("\r\nEnter Dexterity : ", d->character);
    OLC_MODE(d) = MEDIT_ABIL_DEX;
    return;

  case MEDIT_ABIL_DEX:
    i = atoi(arg);
    GET_DEX(OLC_MOB(d)) = MAX(3, MIN(25, i ? i : 11));
    send_to_char("\r\nEnter Constitution : ", d->character);
    OLC_MODE(d) = MEDIT_ABIL_CON;
    return;

  case MEDIT_ABIL_CON:
    i = atoi(arg);
    GET_CON(OLC_MOB(d)) = MAX(3, MIN(25, i ? i : 11));
    send_to_char("\r\nEnter Charisma : ", d->character);
    OLC_MODE(d) = MEDIT_ABIL_CHR;
    return;

  case MEDIT_ABIL_CHR:
    i = atoi(arg);
    GET_CHA(OLC_MOB(d)) = MAX(3, MIN(25, i ? i : 11));
    break;

If you enter a zero at these prompts, the stat will be set to 11 to save
disk space (since 11 is default).  The exception is StrAdd of course, which
can go from 0 to 100, but I restricted it just to the 18 strength (out of
the book).

Rick