Redoing Advance...

From: Ramsey Stone (ramseystone@hotmail.com)
Date: 11/09/01


Hi Again ^ ^,

   Ive been redoing my advance command. Thanks for all your
help on the who MOTD! Sorry to bug you again. Anyways, brace
yourself, its gonna be a long one. And id appreciate it if you
didnt comment on my skills in c, its not very nice :)

Ok, Ive been converting CircleMUD into a leveless. Soooo....
I remade the advance command so It dosnt use numbers, it
uses names. Only problem is, I get TONS of errors. Ive
been a bad boy :(. Anyway, heres my remade advance command:
/***************************************************************
* Command: advance                              Author: Andra *
*                                                             *
* USAGE: advance <person> <position>                          *
*                                                             *
* This command was rewritten because of the usage of levels.  *
* it has now been revamped so it WORKS and it has NOTHING to  *
* do with levels.                                             *
***************************************************************/

ACMD(do_advance) {
  struct char_data *victim;
  char *name = NULL, position[MAX_STRING_LENGTH] = NULL,
logger[MAX_STRING_LENGTH];

  two_arguments(argument, name, position);

  /* -- Beginning of Checks -- */

  if (*name) {
      if (!(victim = get_char_vis(ch, name, NULL, FIND_CHAR_WORLD))) {
          send_to_char("You cant seem to find them.\r\n", ch);
          return;
      }
  } else {
          send_to_char("Advance Who?\r\n", ch);
          return;
         }

  if (GET_LEVEL(ch) <= GET_LEVEL(victim)) {
    send_to_char("Maybe that's not such a great idea.\r\n", ch);
    return;
    }

  if (!*position) {
    send_to_char("Advance them to WHAT!?\r\n", ch);
    return;
  }

  /* -- End of Checks -- */

  switch (position) {
    case 'immortal':
    case 'Immortal':
         GET_LEVEL(victim) = LVL_IMMORT;
         break;
    case 'novice':
    case 'Novice':
         GET_LEVEL(victim) = LVL_JRBUILD;
         break;
    case 'builder':
    case 'Builder':
         GET_LEVEL(victim) = LVL_GOD;
         break;
    case 'advanced':
    case 'Advanced':
         GET_LEVEL(victim) = LVL_ADVBUILD;
         break;
    case 'editor':
    case 'Editor':
         GET_LEVEL(victim) = LVL_EDITOR;
         break;
    case 'assistant':
    case 'Assistant':
         GET_LEVEL(victim) = LVL_ASSIST;
         break;
    case 'supervisor':
    case 'Supervisor':
         GET_LEVEL(victim) = LVL_IMMORT;
         break;
    case 'ruler':
    case 'Ruler':
         GET_LEVEL(victim) = LVL_JRBUILD;
         break;
    default:
         send_to_char("Thats NOT a position!!!\r\n", ch);
         return;
         break;
    }

sprintf(buf, "Your head floods with thoughts
of power and glory, and white
doves take flight into the pure
blue sky. The ringing of bells
can be heard in the distance,
making you rejoice. Your body
is taken to another dimension,
then snapped back to reality
with a sudden ring in your ears.

You have become a %s!", position);
sprintf(logger, "(GC) %s advanced %s to %s", GET_NAME(ch), GET_NAME(victim),
position);
send_to_char(buf, victim);
mudlog(logger, NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE);
}

Sorry if its over 75 chars long. Anyways, I compile, and it
gives me the following errors:
make ../bin/circle
make[1]: Entering directory `/usr/users/mud/apocmud/EG/src'
gcc -g -O2 -Wall    -c -o act.wizard.o act.wizard.c
act.wizard.c: In function `do_advance':
act.wizard.c:1435: invalid initializer
act.wizard.c:1463: switch quantity not an integer
act.wizard.c:1464: character constant too long
act.wizard.c:1465: character constant too long
act.wizard.c:1468: character constant too long
act.wizard.c:1469: character constant too long
act.wizard.c:1472: character constant too long
act.wizard.c:1473: character constant too long
act.wizard.c:1476: character constant too long
act.wizard.c:1477: character constant too long
act.wizard.c:1480: character constant too long
act.wizard.c:1481: character constant too long
act.wizard.c:1484: character constant too long
act.wizard.c:1485: character constant too long
act.wizard.c:1488: character constant too long
act.wizard.c:1489: character constant too long
act.wizard.c:1492: character constant too long
act.wizard.c:1493: character constant too long
act.wizard.c:1466: warning: unreachable code at beginning of switch
statement
act.wizard.c:1503: parse error before `void'
act.wizard.c:1511: `vict' undeclared (first use in this function)
act.wizard.c:1511: (Each undeclared identifier is reported only once
act.wizard.c:1511: for each function it appears in.)
act.wizard.c:1519: `i' undeclared (first use in this function)
act.wizard.c:1435: warning: unused variable `logger'
make[1]: *** [act.wizard.o] Error 1
make[1]: Leaving directory `/usr/users/mud/apocmud/EG/src'
make: *** [all] Error 2

Does anyone see anythihng wrong with my code? If you
do, could you kindly point it out?

             Thanks in Advance,
                       Ramsey Stone(Andra)

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST