[HELP] Clone Spell

From: Croll, Neil (Neil.Croll@BAESEMA.CO.UK)
Date: 07/24/97


Are there any tools, or code updates, which will allow an Imp to delete
players from the player file (up to and including IMP level)?
(I'm using the standard binary player file, not an ASCII one)

I'm currently developing a MUD and have created two Imps, unfortunately
the player information for one of them has become corrupted and crashes
the MUD everytime I use it, and Imps don't seem to be able to delete
themselves.

On a different vein, I`m having trouble implementing the CLONE spell.

The spell is supposed to do the following:
  Make caster invisible
  create an exact duplicate of the player
  charm the clone
  make the clone follow the player.


I`m currently using the mob 10 (a boring clone) to be based upon the
player, but whenever this spell is cast the clone appears, and is named
`Boring Clone`  but to order the clone to do something, you must use the
"Order <playername>  <action>"

How can i make the clone appear the same as the player (with the same
name, etc)?

This is my code (can you see where I`m going wrong?):

ASPELL (spell_clone)
{
  struct char_data *clone_ch;
  struct affected_type af, clone_af;


  int i; /* Loop Variable */

  send_to_char ("You slowly fade out of existence.\r\n", ch);
  act ("$n slowly fades out of existence.", FALSE, ch, 0, 0, TO_ROOM);
  act ("$n slowly fades into existence.", FALSE, ch, 0, 0, TO_ROOM);


  send_to_char ("Your clone appears.\r\n", ch);

  af.duration = 10 + (GET_LEVEL (ch) << 2);
  af.location = APPLY_AC;
  af.bitvector = AFF_INVISIBLE;
  affect_to_char (ch, &af);


  clone_ch = read_mobile (10, VIRTUAL);
  clone_af.type = SPELL_CHARM;
  clone_af.duration = 99;
  clone_af.modifier = 0;
  clone_af.location = 0;
  clone_af.bitvector = AFF_CHARM;

  affect_to_char (clone_ch, &clone_af);

  clone_ch->carrying = ch->carrying;
  clone_ch->real_abils = ch->real_abils;
  clone_ch->aff_abils = ch->aff_abils;
  clone_ch->player.name = ch->player.name;
  //clone_ch->player.short_descr = ch->player.short_descr;<== This
crashes the game
  clone_ch->player.long_descr = ch->player.long_descr;
  clone_ch->player.title = ch->player.title;
  clone_ch->player.level = ch->player.level;
  clone_ch->player.sex = ch->player.sex;
  clone_ch->player.class = ch->player.class;
  clone_ch->player.description = ch->player.description;
  clone_ch->points = ch->points;
  clone_ch->points.gold = 0;
  clone_ch->points.bank_gold = 0;
  //clone_ch->char_specials = ch->char_specials;


  // Load up clone with same equip as master.
  for (i = 0; i < NUM_WEARS; i++)
    clone_ch->equipment[i] = ch->equipment[i];


  char_to_room (clone_ch, ch->in_room);
  add_follower(clone_ch, ch);

}



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