Re: [CODE] Object OLC apply limits (Oasis 2.0)

From: Del (caminturn@earthlink.net)
Date: 01/23/00


copied straight from my working mud. Not the text file I made the
snippet from: (note: I have a COIMP level, change it to IMPL)

case OEDIT_APPLYMOD:
  mod = atoi(arg);
  if (GET_LEVEL(d->character) < LVL_COIMP) {
    check = OLC_OBJ(d)->affected[OLC_VAL(d)].location;
    switch (check) {
      case APPLY_NONE:
          break;
      case APPLY_STR:
        mod = MAX(MIN_APPLY_STR, MIN(MAX_APPLY_STR, mod));
        break;
      case APPLY_DEX:
        mod = MAX(MIN_APPLY_DEX, MIN(MAX_APPLY_DEX, mod));
        break;
      case APPLY_INT:
        mod = MAX(MIN_APPLY_INT, MIN(MAX_APPLY_INT, mod));
        break;
      case APPLY_WIS:
        mod = MAX(MIN_APPLY_WIS, MIN(MAX_APPLY_WIS, mod));
        break;
      case APPLY_CON:
        mod = MAX(MIN_APPLY_CON, MIN(MAX_APPLY_CON, mod));
         case APPLY_CHA:
        mod = MAX(MIN_APPLY_CHA, MIN(MAX_APPLY_CHA, mod));
        break;
      case APPLY_CLASS:
        mod = 0;
        break;
      case APPLY_LEVEL:
        mod = 0;
        break;
      case APPLY_AGE:
        mod = MAX(MIN_APPLY_AGE, MIN(MAX_APPLY_AGE, mod));
        break;
      case APPLY_CHAR_WEIGHT:
        mod = 0;
        break;
      case APPLY_CHAR_HEIGHT:
        mod = 0;
        break;
      case APPLY_MANA:
        mod = MAX(MIN_APPLY_MANA, MIN(MAX_APPLY_MANA, mod));
        break;
      case APPLY_HIT:
        mod = MAX(MIN_APPLY_HIT, MIN(MAX_APPLY_HIT, mod));
        break;
      case APPLY_MOVE:
        mod = MAX(MIN_APPLY_MOVE, MIN(MAX_APPLY_MOVE, mod));
        break;
      case APPLY_GOLD:
        mod = 0;
        break;
      case APPLY_EXP:
        mod = 0;
        break;
      case APPLY_AC:
        mod = MAX(MIN_APPLY_AC, MIN(MAX_APPLY_AC, mod));
        break;
      case APPLY_HITROLL:
        mod = MAX(MIN_APPLY_HITROLL, MIN(MAX_APPLY_HITROLL, mod));
        break;
      case APPLY_DAMROLL:
        mod = MAX(MIN_APPLY_DAMROLL, MIN(MAX_APPLY_DAMROLL, mod));
        break;
      case APPLY_SAVING_PARA:
      case APPLY_SAVING_ROD:
      case APPLY_SAVING_PETRI:
      case APPLY_SAVING_BREATH:
      case APPLY_SAVING_SPELL:
        mod = MAX(MIN_APPLY_SPELL, MIN(MAX_APPLY_SPELL, mod));
        break;
      /*
       * ADD MORE APPLY'S HERE THAT CORRESPONDS TO structs.h
       */
      default:
        mod = 0;
        log("SYSERR: Default in OLC Max check.\r\n");
        /* should not get here */
        break;
      }
  }
    OLC_OBJ(d)->affected[OLC_VAL(d)].modifier = mod;
    oedit_disp_prompt_apply_menu(d);
    return;


     +------------------------------------------------------------+
     | 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 : 04/10/01 PDT