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.

set_property("spell level",int level);
This is the default level at which a spell becomes available to a player.

set_property("dev cost", int cost);
This is the amount of dev points a character must spend to gain one power
level of the spell.  Each spell has six power levels and a character gets
between 40-70 dev points times his level each time he advances (newbies will
get 40-70, etc.)  This cost should probably mnot be over
twenty to thirty even for powerful spells.  Newbie spells 3-10.
NOTE: dev cost is CUMULATIVE.  The cost to advance to level 2 is twice
level one, etc.

set_property("fast dev cost", int cost);
If the player wishes to gain more than one power level before advancing a
level in his or her guild, he or she must fast dev.  The cost of fast 
reflects the amount that character must pay to advance after once per level.
It is usually around 3 times dev cost (higher for cool spells).
NOTE: See /doc/build/dev_balance for notes on balancing out dev points.


set_property("moon", string moon);
Every spell in DarkeMUD is governed by a moon.  There are three moons in
DarkeMUD:
warzau - which governs attack and combat related spells.
ankh - which governs healing and protection.
luna - which governs just about everything else.
Set the moon to one of these.

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("fumble message", string message);
This is what a player upon whom the spell is fumbled sees.

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("can resist", 1);
Set to one if the spell can be saved against.
Set to 2 if the save will only half the effect of the spell.  This only applies
to spells with numerical results like damage etc.
Note that healing and area healing spells may be saved against!

set_property("save mod", string stat);
If you want one of the player stats: strength, dexterity, etc, to
modify the saving throw, set this property to that stat...you must spell
out the whole stat, it doesn't like dex, wis, etc.  This is not valid
if you do not set "can resist" to 1.

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("damage types", ([ "type1" : amount, "type2" : amount, etc ]));
This is only used for damage and area damage spells.  See 'help 
damage_types' for valid damage types.  "type1" etc is the damage type
and amount is a badassness of that damage type roughly on the same scale
as weapon class.  This weapon class is also multiplied by the power
level of the spell, remember.

set_property("damage multiplier", float x | int i);
This is an optional variable which may be set for damage spells.
Normally, a damage spell will not do much more damage than a hit from
a regular weapon (multiplied by the power 1-6, of course), but it is
often desirable for damage spells to be much more effective than a
single weapon hit.  The multiplier multiplies the damage done by the
spell.  Integers and floating points are supported.

set_property("heal dice",string dice);
dice is of the form "<dice>D<sides>" like "3D6", which simulates
rolling 3 6-sided dice.  Remember to put a 1 for the amount of dice
if it is only one..."D6" is BAD, "1D6" is GOOD.  Remember again, this is
the hp healed PER POWER LEVEL.

set_property("stat dice", string dice);
Works just like heal dice, except its for stat mod spells.

set_property("stats",({ "stat1", "stat2", etc. }))
Sets the different stats which are modified by the stat mod spell.

set_property("skill dice", string dice);
Works just like heal dice, except for skill mod spells.

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.
