[Circle] A rare contribution

From: Yoink! (xombi@accessus.net)
Date: 11/08/96


OK, I know I've been a curmudgeon recently, after lurking for so long.
Before I switch lurk mode back on, lemme give a suggestion for a code
change to stock circle muds.

Changing just the BEGINNING of a stock circle30bpl11 circle mud to the
do_cast in spell_parser.c.

It will allow players to type "cast 4 mob" instead of "cast 'blindness'
mob".  I *hope* and *think* that anybody who hasn't modified heavily
their magic system can use this, for even their extended spells.  The
players will have to be clued in as to what your muds spell number are
if they don't have access to them now.

I believe the only requirement is that any number passed into
spell_parser.c relate to one specific spell, namely the numbers defined
in spells.h, such as #define SPELL_BLINDNESS 4, as on all stock muds.

Lemme know what you guys think.
-----------------------------------------------------------------------
ACMD(do_cast)
{
  struct char_data *tch = NULL;
  struct obj_data *tobj = NULL;
  char *s, *t, name[MAX_STRING_LENGTH];
  int mana, spellnum= -3, i, target = 0;

  if (IS_NPC(ch))
    return;

  one_argument(argument, name);

  if (*name >= '0' && *name <= '9') {
    spellnum = atoi(name);
    argument += strlen(name) +1;
    skip_spaces(&argument);
    if (!*argument)
    send_to_char("EMPTY", ch);
    t=argument;
   }
  else {
  /* get: blank, spell name, target name */
  s = strtok(argument, "'");

  if (s == NULL) {
    send_to_char("Cast what where?\r\n", ch);
    return;
  }
  s = strtok(NULL, "'");
  if (s == NULL) {
    send_to_char("Spell names must be enclosed in the Holy Magic Symbols: '\r\n", ch);
    return;
  }
  t = strtok(NULL, "\0");

  /* spellnum = search_block(s, spells, 0); */
  spellnum = find_skill_num(s);

  if ((spellnum < 1) || (spellnum > MAX_SPELLS)) {
    send_to_char("Cast what?!?!?\r\n", ch);
    return;
  }

  if (GET_LEVEL(ch) < SINFO.min_level[(int) GET_CLASS(ch)]) {
    send_to_char("You do not know that spell!\r\n", ch);
    return;
  }
  if (GET_SKILL(ch, spellnum) == 0) {
    send_to_char("You are unfamiliar with that spell.\r\n", ch);
    return;
  }
  /* Find the target */
  if (t != NULL) {
    one_argument(strcpy(arg, t), t);
    skip_spaces(&t);
  }
 } /* end your new else statement here, and code continues on next
      line as before */

  if (IS_SET(SINFO.targets, TAR_IGNORE)) {
    target = TRUE;
 __      __ 
 \ \\   / //                "If I were a dinosaur, I'd be a licalottapus!"
  \ \\ / //  _____  __       __ ______  ___       -Jonathan "Jax" Armsterd
   \ \/ //  //   \\ |\\     /|| ||   \\ | ||   
    >  <<  ||     ||||\\   //|| |----<< | ||         Hard to believe,
   / /\ \\ ||     |||| \\ // || ||    \\| ||        Harder to killfile!
  / // \ \\ \\___//_||  \//  ||_||____//|_||
 /_//   \_\\       In God We Trust. All others pay cash.

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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