Re: [Code] shadow/vampire SPECIAL

From: Ron Cole (rcole@EZY.NET)
Date: 08/28/97


>For what it's worth, here is my code for a shadow SPECIAL.
>Upon sunrise, if the mob isn't in a DARK room, it dies.  Setup
>requires the usual:
>
>        SPECIAL(shadow);
>
>and
>
>        ASSIGNMOB( xxxx, shadow );
>
>in spec_assign.c.
>
>spec_procs.c requires a reference to the external fn die():
>
>        void die( struct char_data * ch );
>
>I believe that I have tested this for all situations except for
>what would happen if the sun rose during a fight.  Let me know
>if you dig up any bugs I missed.  Thanks,

Mob specials are called from 3 different places I believe, in mobile_activity(),
when ever a command is typed in the same room as a mob, and perform_violence().
You need to figure out which is calling it, to decide what action to take.  You
can check for a command first, with a CMD_IS check.  I'm not sure if you can
separate the other 2, but in most specs I've seen, FIGHTING(ch) is checked
first, and if true, it's assumed to be the combat call.  If none of the above
are true, then you have a pulse_mobile call.  You would want to abort your spec
on the command call, and perhaps just have the mob take damage during the fight,
so that it seems as if he is being burned by the light.

Ron


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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