[Circle] summon water

From: Angus A. Mezick (dodger@WPI.EDU)
Date: 08/09/96


have you looked at the code for mag_summons() in magic.c?????

If the animate_dead spell is mine, please tell me and I will forward my
mag_summons.   
oh bloody hell, here ya go:
void mag_summons(int level, struct char_data * ch, struct obj_data * obj,
                      int spellnum, int savetype)
{
  struct char_data *mob;
  struct obj_data *tobj, *next_obj;
  int pfail = 0;
  int msg = 0, fmsg = 0;
  int num = 1;
  int i;
  int mob_num = 0;
  int handle_corpse = 0;

  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;
    msg = 12;
    mob_num = MOB_SKELETON;
    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) = 1000;
    IS_CARRYING_N(mob) = 100;
    GET_EXP(mob) = 0;
    REMOVE_BIT(MOB_FLAGS(mob), MOB_AGGRESSIVE);
    REMOVE_BIT(MOB_FLAGS(mob), MOB_SPEC);
    SET_BIT(mob->specials.affected_by, AFF_CHARM);
    add_follower(mob, ch);
    act(mag_summon_msgs[fmsg], FALSE, ch, 0, mob, TO_ROOM);
    if (spellnum == SPELL_CLONE) {
      strcpy(GET_NAME(mob), GET_NAME(ch));
      strcpy(mob->player.short_descr, GET_NAME(ch));
    }
  }
  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);
  }
}

hmmm... just reminds me, I had better check the extract_obj() mem leak
(corpse name strings) 

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