Sorry if this is a little long, sometimes it takes me a bit to get to the point.
I'm running a slightly modified version of QuickMUD and I'm trying to make a
'delayed blast fireball' type spell and at the same time, modify the code in
such a way as to allow me to easily create other spells in the same vein, such
as a delayed blast curse or a delayed blast heal.

I have coded a spell that functions correctly to a point.  In order to have the
object cast the spell, obj_cast_spell needs to have a ch thats operating the
object passed to it.  If the item is just sitting in a room somewhere, there is
no char_data connected with it so it will go off but not cast any spells.  To
remedy this, I added a new field to OBJ_DATA that stores the ch of whoever
created the item.  This is passed to the function when the item goes off so
that spells will be passed correctly.  The problem with this is that, when the
item goes off and the creator of the item is in another room, they will see all
the damage messages from the spell and will be entered in one round of combat
with the chars in a completely different room.  Or, if the spells kill things
in a different room, the char will recieve exp from fights in a different room.
 This is what I do not want to happen.  Since the spell will hit its' caster as
soon as it will hit anything else, I don't see the need to have the gem
actually initiate combat.

I have thought of a few scenarios for fixing this but all are fairly complex and
I wanted to get some other, more experienced opinions on which route I should
take.
 The first thing I thought of was to create a new function patterend on
the function damage that accepted an obj instead of a ch as the attacker, but
then I could not utilize current spells, attack information would have to be
stored on the item itself.
The second thing I thought of would be to, since I plan on rewriting most of the
spells anyways, was to change all the spells to accept a void pointer as the
caster, so the caster could be an object and to modify damage() in the same way.
 This way is the most work intensive, but also offers me the flexibility I am
seeking.
If anyone could tell me what they think, or offer some suggestions, I would
appreciate it.

Brian


Reply via email to