Re: Mobile Special Procedures

From: Anil Mahajan (amahajan@PROXICOM.COM)
Date: 06/23/99

On Tue, 22 Jun 1999 10:23:42 -0500, Richard W. Gowen <> wrote:

>I want to make it easier to add special procedures to mobiles.  Namely, to
>be able to give a mobile an already defined special procedure just by
>flagging it in the mob file.  Instead of having to add it's vnum into the
>special proc area of the code.  For example: If I have a special proc for a
>call lightning spell and number it #1 then mob#1234 can simply choose the
>spec proc flag #1 to use this spell.
>My question is, has anyone else done this before?  And, how did you approach
>I am not looking for code, just a general plan of attack from anyone who has
>done anything similar.  Also, any pitfalls you might see in doing this.

  I've done it, as well as other Special Procedure enhancements.  The
easiest thing you can do is to give special procedures names.  Like
the fido spec proc could be called "fido".  Then, you could just add a new
E-Spec to your mobs called "special:" and just add it like that (and that makes
it easy to add specs via OLC, as well).

   To name the specs you just need to have a reference structure.  It would
hold the name and the function call.  Then you just have to map the name to
the function call when you load up the mob.

   The solution I did was similar to this, but a bit more complex.  I also
implemented a circlular linked list for my spec procs, so this way mob/obj/room
could all have multiple spec procs.  I also typed my spec procs, so that they
could trigger off of specific events (i.e. triggered by combat, or by some
specific type of event)...  Much the way MobProgs/DGScript triggers
work, but hardcoded.

- Anil
RoadKill@F.U.C.MUD 4000

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

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