[Circle] Summon Spell [code]

From: linebacker (linebacker@microlink.net)
Date: 08/07/96

I have added a simple spell that summons one of four
elementals depending upon the caster's level. I have
the bare bones of the spell, meaning I create the
elem. and place it in the game and add it as a follower
to the caster. I am having problems setting a time limit
on the charm affect. I use a SET_BIT approach. Also, I would
like to check to see how many followers the caster already
has and limit the number depending upon charisma and level.
What is the best way to do these two?

Here is my spell: (feel free to use, and if there is a more
effecient way to do this please let me know)

  struct char_data *elemental = '\0';
  *buf = '\0';

if (number(1,101) > GET_LEVEL(ch)) {     /* steep at first */
   send_to_char("Nothing answers your call.\r\n", ch);
  if (GET_LEVEL(ch) < 20)  
    elemental = read_mobile(1, VIRTUAL);
  else if (GET_LEVEL(ch) <  40)
    elemental = read_mobile(2, VIRTUAL);
  else if (GET_LEVEL(ch) < 60)
    elemental = read_mobile(3, VIRTUAL);
  elemental = read_mobile(4, VIRTUAL);

  GET_EXP(elemental) = 0;
  char_to_room(elemental, ch->in_room);
  sprintf(buf, "%sYou have summoned %s!\r\n", buf, elemental->player.short_descr);
  send_to_char(buf, ch);
  add_follower(elemental, ch);

I think that is right, I cut out some unrelate stuff for this post.

Thanks for any help,

| 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