Spectral wizard spell & special procedure.

From: Justin Potter (JTP94@aol.com)
Date: 11/28/98

I was amazed one day whenI ran into my code for Interposing hand on someones
web site and it wasn't even the full code only a partial setup,so I decided to
put up another mailer code I worked on some time ago for creating a spectral
wizard henchmen. Here goes:

Note that I use the spells mana transfer and life transfer in this code. They
are not included in this code and if you want them email me. Just replace them
with code to transfer life force and mana from the spectral wizard to its
master whenever the master is weakened.

Also to note BOY I made alot more changes for this code than I thought :>
You need to put something like this in the animate dead spell:
  if (ch->master && IS_NPC(ch))
     add_follower(mob, ch->master);
     add_follower(mob, ch);

I believe there was a bug in that not all corpses were being animated but I
corrected it in a newer version which unfortunately is on another computer in
another house in another city right now. I hope someone can have some fun with
this and if I get some responses in the good then I will post more in the
future,like corpse host, watch ghost,etc.

This is the code so the spectral wizards animated corpses are led by the
spectral wizards master. In a newer form of the spectral wizard I am making a
new animate corpse spell to do this instead of altering magic.c
And as with all mob summoning spells you need to make the spectral wizard
What this spell does in roleplay terms:
 IN a duel between the archmage Fistandantilus and his student Harlequin the
mighty Fistandantilus decided to end his students foolish attack by turning
his human student into a spectral wizard the most useful and subservient thing
that fistandantilus could think of at the time. A creature that would use all
the magic it had known in life to aid its master and when all of its life or
power had been used up it would dispose of itself so nice & neat.

  struct obj_data *obj, *next_obj;
  struct char_data *vict = ch->master;


  if (cmd)
    return (0);

  if (GET_HIT(ch) < 11 || GET_MOVE(ch) < 11 || GET_MANA(ch) < 11)
  switch (number(0, 10)) {
  case 0:
    do_say(ch, "My master I am here to serve thee!", 0, 0);
    return (1);
  case 1:
    do_say(ch, "My magic is finite as is my existence.", 0, 0);
    return (1);
  case 2:
    do_say(ch, "I am here to serve at my masters whim.", 0, 0);
    return (1);
  case 3:
    do_say(ch, "In serving my master I am completing myself.", 0, 0);
    return (1);
  case 4:
    if (GET_SKILL(ch, SPELL_LIFE_TRANSFER) && (GET_HIT(vict) <
GET_MAX_HIT(vict) / 2))
      cast_spell(ch, vict, NULL, SPELL_LIFE_TRANSFER);
      do_say(ch, "My life is my masters!!!.", 0, 0);
    else do_say(ch, "Your lifeforce inspires me!!", 0, 0);
  case 5:
GET_MAX_MANA(vict) / 2))
    do_say(ch, "My magic is my masters!!!", 0, 0);
    cast_spell(ch, vict, NULL, SPELL_MANA_TRANSFER);
     else do_say(ch, "Your magic keeps me in awe my master!", 0, 0);
  case 6:
    for (obj = world[ch->in_room].contents; obj; obj = next_obj) {
      next_obj = obj->next_content;
      if (GET_OBJ_VAL(obj, 3) && GET_OBJ_TYPE(obj) == ITEM_CONTAINER)
         cast_spell(ch, NULL, obj, SPELL_ANIMATE_DEAD);
  case 7:

    return (0);
  } /* end switch */

And finally the spell itself which is a very restricted casting requirements.

   int i;
   struct char_data *mob = NULL;
   extern char *spells[];
   extern struct spell_info_type spell_info[];

   if (mag_savingthrow(victim, SAVING_SPELL))
     send_to_char("Your spell is resisted.", ch);
      act("$N glows blue and thrashes wildly in torment!", FALSE, ch, 0, 0,
      act("You feel a wild surge of necromantic energy attempt\r\nto twist
your form but you resist.\r\n", FALSE, ch, 0, victim, TO_VICT);
    if (GET_HIT(victim) < 20 && (!GET_MAX_HIT(victim) > GET_HIT(victim)))
     send_to_char("This life force is too strong, destroy it a little", ch);
     if (!GET_CLASS(victim) == CLASS_MAGIC_USER)
       send_to_char("Your victim is not a magic-user, go find one and try
again!", ch);
      if (GET_RACE(victim) == RACE_HUMAN || GET_RACE(victim) == RACE_ELF)
         mob = read_mobile(MOB_SPECTRAL_WIZARD, VIRTUAL);
         char_to_room(mob, ch->in_room);
         IS_CARRYING_W(mob) = 0;
         IS_CARRYING_N(mob) = 0;
         GET_LEVEL(mob) = GET_LEVEL(ch);
         GET_MAX_HIT(mob) = GET_MAX_HIT(ch);
         GET_HIT(mob) = GET_HIT(ch) - 10;
         GET_MAX_MANA(mob) = GET_MAX_MANA(ch) + 10;
         GET_MANA(mob) = GET_MAX_MANA(mob);
         SET_BIT(AFF_FLAGS(mob), AFF_CHARM);
         add_follower(mob, ch);
        /* give all spells of magic user to mob */
         for (i = 1; i < MAX_SPELLS+1; i++)
             if (GET_LEVEL(ch) >= spell_info[i].min_level[(int)
                if (GET_SKILL(ch, i) > 0)
                 SET_SKILL(mob, i, GET_SKILL(ch, i));

} /* End function */

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |

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