[DG Scripts] More fields to evaluate...

From: Tony Robbins (tonyr@NWPACLINK.COM)
Date: 01/10/98


I love DG Scripts!  (!!!)

Anyway, what I'd like to contribute here is some simple code (you advanced
coders will prolly just junk this cause it's not very difficult code).

What this does is add the %actor.align%, %actor.hp%, and %actor.maxhp%
fields for evaluation.  If you're wondering why I even bothered with this,
it's that I used this to create a trigger script for praying in churches
for hitpoints.  :)

All of this is in dg_scripts.c

Where you find

     else if (!str_cmp(field, "level"))
        sprintf(str, "%d", GET_LEVEL(c));

Add:

     else if (!str_cmp(field, "align"))
        sprintf(str, "%d", GET_ALIGNMENT(c));

     else if (!str_cmp(field, "hp"))
        sprintf(str, "%d", GET_HIT(c));

     else if (!str_cmp(field, "maxhp"))
        sprintf(str, "%d", GET_MAX_HIT(c));

that's all!  after looking at this code, you should be able to recognize
how much this can be expanded, and how easy it is to add these fields.  If
you have any ideas or questions, e-mail me.

(Again, I _MUST_ thank Mark Heilpern for DG Scripts--I'd just be
mobproggin' without them!)
-B.


     +------------------------------------------------------------+
     | 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/15/00 PST