Re: Mob Summon spell

From: Fili (cybom@NETROPOLIS.NET)
Date: 09/06/98


Joe Tremblay wrote:
>
> Hey, I added in your monster summoning snippet, and it works great,
> except for one thing, it summons two mobs instead of one... I fiddled
> with the code for a few minutes and couldn't figure out why it summoned
> two and not one... If you know what I should change to get just one mob
> I'd be greatful if you'd mail me the solution.
>
> Thanks!

OOps. Here is the updated version :)


Fili

--Begin Snippet--

From: Fili <cybom@netropolis.net>
Subject: Mob Summoning Spell

 This code allows you to create a spell that will summon a zombie when
cast. It can easily be changed to suit your needs, and should work fine
with whatever setting you want to put it in. If it doesn't work, mail
cybom@netropolis.net.  Good Luck.

9/6/98 - Over a year after the last update, someone finally tells me my
mistake. *Grin* Thanks to Joe Tremblay for the bug report. This should
fix the code.

7/19/97 - There was a problem with the fact that I had it summoning the
wrong kind of mob :) Oh well. I also saw a parse error or two so I
dedided now would be a good time to fix it. Sorry!


Begin Code:
---------------------

in magic.c:

around line 875 (May be different on yours.)
BEFORE void mag_summons

#define MOB_UNDEAD  1000 /* The number is the vnum of the mob to be
                            summoned */

in void mag_summons()
add after switch (spellnum) {

  case SPELL_SUMMON_UNDEAD: /* Tells what spell we're using */

    handle_corpse = 0; /* Tells that we do not need a corpse to work the
                          spell on */

    msg = 12; /* In an array above, you see the message numbers. This
                 tells what message number to use */

    mob_num = MOB_UNDEAD; /* This is what the #define was for. This
tells
                             which mob you want to summon */

    send_to_char("The Zombies you summoned appear before you.\r\n", ch);
              /* send a message to the caster saying that he succeeded
*/

    break; /* the end */


in spell_parser.c:

around line 94:

 Change the first "!unused!" to "summon undead" REMEMBER THE NUMBER THAT
IS HERE. The numbers are stated in the comments. Line 94 is 2 lines
after
the /* 50 */, so the number is 52.

around line 1011:

     spello(SPELL_SUMMON_UNDEAD, 100, 75, 3, POS_SITTING,
        TAR_IGNORE, FALSE, MAG_SUMMONS); /* read one of the spell.doc
                                            files on the snippets site
                                            for explanation here */

in magic.h:

around line 91:

Add in #define SPELL_SUMMON_UNDEAD  ?? /* The ?? is the number from
                                          spell_parser.c */

Then, all you have to do is add in the spell in class.c, and you're
pretty much done! Have fun! Hope it works....

Fili


     +------------------------------------------------------------+
     | 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