|
Summon Mob Spell [by Fili] |
|
|
|
Posted Wednesday, August 12th @ 11:37:43 PM, by George Greer in the Skills dept.
Updated Jul 20, 1997. Click the link below to read it or download it.
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.
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 (I have heavily modified code)
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 */
mob = read_mobile(mob_num, VIRTUAL); /* This sets the variable 'mob' to
the vnum of the mob to summon
(correct me if I'm wrong here...) */
char_to_room(mob, ch->in_room); /* This actually loads the mob */
IS_CARRYING_W(mob) = 0; /* Makes sure the mob isn't carrying anything */
IS_CARRYING_N(mob) = 0; /* Makes sure the mob can't carry anything */
SET_BIT(AFF_FLAGS(mob), AFF_CHARM); /* Makes the mob take the caster's
orders */
add_follower(mob, ch); /* Actually make the mob follow the caster */
act(mag_summon_msgs[fmsg], FALSE, ch, 0, mob, TO_ROOM);
/* send a message to the room */
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
<< Stun Skill [by Ryan Stapleton] | Reply | View as text | Flattened | Summon Spell (w/answer) [by Mark Gerritsen] >> |
|
Related Links |
|
|
|
CircleMUD Snippets |
|
|
Note: Not all of these snippets will work perfectly with
your version of code, so be prepared to fix one
or two bugs that may arise, and please let me know
what you needed to do to fix it. Sending a corrected
version is always welcome.
|
Finally, if you wish to use any of the snippets from this
page, you are more than welcome, just mention the
authors in your credits. If you wish to release any
of these snippets to the public on another site,
contact me FIRST.
|
|
|
|
|
|
|