[Code] Animate dead problem

From: J.T. (roi@CONAN.IDS.NET)
Date: 07/14/97


Ok, I added animate dead to my mud, and the spell itself works... It
extracts the corpse, and creates the mob, BUT, even though the mob is
charmed, he still tries to move around... To the players it displays
"The zombie bursts into tears" and to the mob itself it displays "The
thought of leaving your master makes you weep" or something like that...
I have tried everything I could think of to fix this, but nothing
works... I have included my entire mag_summons for magic.c:

void mag_summons(int level, struct char_data * ch, struct obj_data *obj,
                      int spellnum, int savetype)
{
  struct char_data *mob = NULL;
  struct obj_data *tobj, *next_obj;
  int pfail = 0;
  int msg = 0, fmsg = 0;
  int mob_num = 0;
  int change_mob = 0;
  int handle_corpse = 0;
  int i;
  int num = 1;

  if (ch == NULL)
    return;

  switch (spellnum) {
  case SPELL_ANIMATE_DEAD:
    if ((obj == NULL) || (GET_OBJ_TYPE(obj) != ITEM_CONTAINER) ||
        (!GET_OBJ_VAL(obj, 3))) {
      act(mag_summon_fail_msgs[7], FALSE, ch, 0, 0, TO_CHAR);
      return;
    }
    handle_corpse = 1;
    change_mob = 1;
    msg = 15;
    mob_num = MOB_ZOMBIE;
    pfail = 8;
    break;
  default:
    return;
  }

  if (IS_AFFECTED(ch, AFF_CHARM)) {
    send_to_char("You are too giddy to have any followers!\r\n", ch);
    return;
  }
  if (number(0, 101) < pfail) {
    send_to_char(mag_summon_fail_msgs[fmsg], ch);
    return;
  }
  for (i = 0; i < num; i++) {
    mob = read_mobile(mob_num, VIRTUAL);
    char_to_room(mob, ch->in_room);
    IS_CARRYING_W(mob) = 0;
    IS_CARRYING_N(mob) = 0;
    SET_BIT(AFF_FLAGS(mob), AFF_CHARM);
    add_follower(mob, ch);
    act(mag_summon_msgs[fmsg], FALSE, ch, 0, mob, TO_ROOM);
  }
  if (handle_corpse) {
    for (tobj = obj->contains; tobj; tobj = next_obj) {
      next_obj = tobj->next_content;
      obj_from_obj(tobj);
      obj_to_char(tobj, mob);
    }
    extract_obj(obj);
  }
}

I have not edited charm in any way, so that has nothing to do with it,
and when I use my old mag_summons, charmed mobs don't do that... But
with this code, ALL charmed mobs are messed up. Any help will be
appreciated.


      +-----------------------------------------------------------+
      | 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/08/00 PST