Re: Spells affecting mobs or objects...

From: Chris Proctor (cjp@YOYO.CC.MONASH.EDU.AU)
Date: 07/16/97

>         I'm somewhat confused as to how to make a manual spell affect
> either an object OR a character/mob.  I mean, in the actual code for the
> spell, is there any convenient way to check and see if the argument
> passed is an object or a spell?
>         I don't want you folks to think I'm slacking, I looked around for
> such a device already in the code, but I just couldn't find one.  Did I
> just miss something, or is this trickier than I anticipate?

Ok, the other two replies suggested:
A: Copy the bless code.
This won't work if you want a manual spell. Cos bless isn't one :P
B: use generic_find.
This won't work because you no longer have the original argument to
do_cast (unless you want to write code to save it, as I have, but that's a
different story).

The answer's easier yet. In the declaration of ASPELL there are two
variables of note: victim and obj.

Just do a:

if (victim != NULL) {
else if (obj != NULL) {
else {
  send_to_char("Eh?\r\n", ch);

The cast code already automatically locates the character/object
(searching through lists in the appropriate places).

Now you just go into spell_parser.c and do a spello entry, and use:
for the target and voila!

or whatever (yes, you can just about copy the bless entry for the spello
don't forget the heaps of entries in various files that you need for
manual spells.


  _           />>
  \\         / \
  [*********<()>--- - ---=== Chris Proctor, a.k.a Deathblade ===---   -->
  //         \ /
  ~           \>>

        Dominia Mud: 3333

        My homepage:

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/08/00 PST