|
How To Add Spells [by goamkows] |
|
|
|
Posted Wednesday, August 12th @ 11:28:39 PM, by George Greer in the Skills dept.
Added Dec 3, 1996. Click the link below to read it or download it.
From: goamkows@kirk.geog.scarolina.edu
Subject: Adding Spells
to add a spell:
in spells.h, add a #define for the spell (where all the others are),
giving it a unique number less than MAX_SPELLS (defined at the bottom
of the spell list, before the skill list).
if it is a manual spell, search for ASPELL and add one for the new
spell you are putting in.
furthermore, for manual spells, put the code itself for the spell at
the bottom of spells.c.
if it is not a manual spell, in magic.c, if it is a spell that does
damage, search for man_damage and put in a case for your spell. if it
affects a character in any way (e.g. strength, armor, blindness,
etc.), put in a case in mag_affects. etc. for the other spell types.
read the comments for each type - they are there for a reason :)
when all this is done, go over to spell_parser.c.
put the spell into char *spells[] in a slot marked UNUSED (it should
have an index number equal to the value you defined the spell to be in
spells.h, so if SPELL_KILL_BARNEY is defined as 101 in spells.h, it
better be in slot 101 in spells[] - the slots are marked every 5 for
convenience.
if the spell is a manual spell, in the call_magic function, add a case
for it where the other manual spells are.
finally, add a spello - there are detailed notes on what each value
should be, so it should not be difficult. if necessary, just copy
another spell of the same type and modify it to suit your needs.
finally, in constants.c, search for spell_wear_off_msg[] and add a
message at the end that will be displayed when the spell wears off.
even if that doesn't make sense (spells with instantaneous effect),
you need to put in the spell name (e.g. "!Kill Barney!",) anyway, so
the index number in the array correspond with the correct spell.
i think that's everything.
<< Hometowns [by Daniel Burke] | Reply | View as text | Flattened | How To Add Wear Bits [by WhiteDemon] >> |
|
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.
|
|
|
|
|
|
|