Re: Wizcommands

From: Thomas Larsson (aarcerak@rocketmail.com)
Date: 09/15/02


This is the zap code, first of all it works, no
errors.
But it lowers the hitpoint, mana and move, so people
just have to heal themself up. Shouldnt it lower the
maxhitpoint etc ?
Also i thought it would lower the level of the char
for like demoting people. Any ideas on how to do that
?

ACMD(do_zap)
{

  /* Zapping mobiles was fun at first.. */

  struct char_data *vict;
  int WASHIT,   WASMANA,        WASMOVE;
  int ISHIT,    ISMANA,         ISMOVE;
  int NHIT,     NMANA,          NMOVE;
  float ZAPMULT; /* Yeah, I know this produces a
warning.. *
                  * If that bugs ya, fix it..
    */



/* This is just a reminder for me *
 * because I'm pretty fogetful    *
 *                                *
 * LVL_IMPL     66  Primo Deo     *
 * LVL_DEO      65  Lesser Deo    *
 * LVL_GRGOD    64  Greater God   *
 * LVL_GOD      63  God           *
 * LVL_LEGOD    62  Lesser God    *
 * LVL_IMMORT   61  Immortal      */

  one_argument(argument, buf);
  if (!*buf)
    send_to_char("Who you zappin'?\r\n", ch);

  else if (!(vict = get_char_vis(ch, buf,
FIND_CHAR_WORLD)))
    send_to_char(NOPERSON, ch);

  else if (IS_NPC(ch))   /* Zapping mobiles was fun at
first.. */
    send_to_char("Oh no you don't! No zapping
mobiles!\r\n", ch);

  else if ((vict) == (ch))
    send_to_char("Now that's just plain
foolishness!\r\n", ch);

  else if (GET_IDNUM(vict) == 1)
    send_to_char("Dont work on the owner!", ch);

  /* I tried to make this part as adaptable(word?) as
possible, *
   * which is why it's so screwy.. that and the guy
that taught *
   * me C was a crankhead.. *twitch*                            */

  else {
        if(GET_LEVEL(ch) == LVL_IMPL)
          ZAPMULT = .2;
        if(GET_LEVEL(ch) == LVL_LOVIMP)
          ZAPMULT = .3;
        if(GET_LEVEL(ch) == LVL_OVERS)
          ZAPMULT = .4;
        if(GET_LEVEL(ch) == LVL_GRGOD)
          ZAPMULT = .5;
        if(GET_LEVEL(ch) == LVL_GOD)
          ZAPMULT = .6;
        if(GET_LEVEL(ch) == LVL_DEMI)
          ZAPMULT = .7;
        if(GET_LEVEL(ch) == LVL_SAINT)
          ZAPMULT = .8;
        if(GET_LEVEL(ch) == LVL_ANGEL)
          ZAPMULT = .9;
        if(GET_LEVEL(ch) == LVL_RIMM)
          ZAPMULT = .10;
        if(GET_LEVEL(ch) == LVL_IMMORT)
          ZAPMULT = .11;
        if(GET_LEVEL(vict) > GET_LEVEL(ch)){
          send_to_char("Whoopsidoodle..\r\n", ch);

          /* Originally, I wrote it so anybody could
just go ahead and zap
           * anyone else but it was kind of easy to
abuse.. so if you try
           * to zap a higher-up, it's reflected back
at you.. sort of the
           * rubber and glue thing...
           */
          send_to_char("You laugh as you reflect the
lightning bolt coming toward you.\r\n", vict);
          vict = ch;}


   /* This most assuredly isn't the best way to set
all this up but for
    * the sake of simplicity and further adaptation,
it runs like this..
    */
    WASHIT = GET_HIT(vict);    /* Get the current
stats of the victim, put */
    WASMANA = GET_MANA(vict);  /* them into holding..
*/
    WASMOVE = GET_MOVE(vict);

    GET_HIT(vict) = (GET_HIT(vict) * ZAPMULT); /* Put
their stats against the zap multiplier.. */
    GET_MANA(vict) = (GET_MANA(vict) * ZAPMULT);
    GET_MOVE(vict) = (GET_MOVE(vict) * ZAPMULT);

    ISHIT = GET_HIT(vict); /* Get the victim's new
stats, hold 'em.. */
    ISMANA = GET_MANA(vict);
    ISMOVE = GET_MOVE(vict);

    NHIT = (WASHIT - ISHIT);  /* Subtract their new
stats from the old. */
    NMANA = (WASMANA - ISMANA);
    NMOVE = (WASMOVE - ISMOVE);

    /* Then display and syslog it */
    sprintf(buf, "(GC) %s zapped %s for %dH, %dM, %dV
(stats * %d)",
    GET_NAME(ch), GET_NAME(vict), NHIT, NMANA, NMOVE,
ZAPMULT);
    mudlog(buf, BRF, MAX(LVL_IMMORT,
GET_INVIS_LEV(ch)), TRUE);

    update_pos(vict); /* Change this to whatever you
want */
    send_to_outdoor("The sky begins to darken, and
clouds loom ominously overhead.\r\n");
    send_to_outdoor("Suddenly the clouds part and a
bolt of lightning jumps from\r\n");
    send_to_outdoor("the opening left in the sky,
striking HARD!\r\n");
    send_to_char(OK, ch); /* Same here.. yeah */
    act("&RAhh shit! You got zapped! Better get
yourself in line!&n", FALSE, vict, 0, ch, TO_CHAR);
  }
}

__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT