Tutorial on building spells:
----------------------------
This is kind of a chore and requires coding knowledge a little above and
beyond area building.  You need a fair knowledge of how combat works,
and whow user.c, living.c, body.c, etc. are set up.  If you do not,
peruse or download those files and look them over until you understand them.
Then, Daniel-san, you are ready.

First of all you wanna put this line at the top of your spell file.

inherit "/std/spells/spell";

Now, make a function called create that will be called just befor the
spell is cast.  This is much like create in a wepon or armour.  Do it like
this:

void create() {
    ::create();

    whatever
    whatever
}

Now, as far as what you put in there, this will set all the properties of
the spell.  The REQUIRED ones are as follows:

set_property("name", string spell-name);
The name of the spell.

set_property("target type", string target-type);
where string target-type may be "player" if the target must be a player,
"living" if the target must be a player or monster, or "any" for any
object.

set_property("must be present",int flag);
set the flag to one if the target needs to be in the same room as the caster,
otherwise to 0.

set_property("skill", string skill);
This is the casting skill for the spell.  Look for /doc/build/spells/spell_skill
for skill types and descriptions.

set_property("casting time", int time);
This is how long (in heartbeats, which are 2 sec) that it takes to cast the
spell.

set_property("base mp cost", int cost);
This is the magic points cost of the spell.  It may be modified by certain
things.



NOTE: for the following messages, these variables may be used:
$C - caster's name inserted (not for caster message)
$T - target's name inserted (not for target message)
set_property("caster message",string message);
The caster sees this when he casts the spell.

set_property("target message", string message);
The target(s) of the spell see this.  For damage spells, this is also the
fumble message, so you need not supply a separate one for spells which do only
damage (see below)

set_property("observer message", string message);
This is what observers in the same room as the caster see.

set_property("target observer message", string message);
If the spell can be cast on someone outside the room of the caster, this is
what observers in the target's room see.

set_property("duration", "permanent" | int duration);
"permanent" makes the spell permanent, a number makes the spell last for
that many seconds.  Damage and healing spells do not need durations.
------------------------------------------------------------------
OPTIONAL SETS:

set_property("combat spell", 1);
This will cause whoever the spell is cast at to enter combat with the
caster.

set_property("no target", int flag);
Set flag to 1 if the spell is not cast at anything.
NOTE: if this is set to one, and the player puts something in for a target,
it is sent to spell_func as args.  See below.

set_property("spell type", ({ "type1", "type2", etc. }));
This is an array of generic spell types supported by the spell.c to save coding
time on common spells.  At present the following are supported:
damage - single target attack spell
area damage - multiple target attack
healing - single target heal
area healing - heals all in room except attackers to the caster
stat mod - modifies permantly or temporarily a player or monster stat
skill mod - same for skills.
More are on the way, like protection for instance.

set_property("skills",({ "skill1", "skill2", etc. }));
Sets which skills are modified by the spell.
----------------------------------------------------------
Also make an info function which gives help on the spell like:

void info() {
write("This spell does this and this and this");
}

-------------------------------------------------------------
Okay, if you wanna make a nonstandard spell, you need to define a
function in your spell file called spell_func like this:

void spell_func(object caster, object at, int power, string args, int flag) {
    stuff;
    stuff;
    etc.;
}

caster is who is casting the spell
at is who the spell was cast at (if any)
args are optional extra arguements supplied with the spell if it needs them.
    NOTE: The character casts a spell like :
	cast <spell> at <target> <optional-args>
flag is normally zero, but will be one if the spell was fumbled.  Do something
nasty.

This is where you define your spell function.  If you want to know in your
function what any of the above set things are, use:
query_property("whatever")
that will return what is set in "whatever."
For instance, query_property("duration") gives duration.
NOTE:  In case the spell fails for some reason other than skill failure,
and you want to return the mp spent to the player, say:
caster->add_mp(props["mp cost"]);

Also, the global variable:
skill
Contains the modified spell casting skill, in case you want that.

Also, the global variable:
resist_flag
Will be nonzero if the following conditions are met:
1. The "can resist" property is set to 2.
2. The spell was saved against
This is so you may handle the half effects caused by this save.  If
"can resist" is set to one and the spell is resisted, spell_func is never
called.
If you have any questions mail me.
If you code good spells I will like you a lot.
If you have ideas for generic spell types, also mail me.
