Handy trigger

From: Fafhrd (fafhrd@ROTD.COM)
Date: 09/19/98


This is a simplistic one, yet my builders are finding numerous uses for it.
Its called upon loading a mob, and can be used to have them follow
the leader mob, or mount a horse previously loaded, or whatever.

Add MTRIG_LOAD to dg_scripts,h
Up NUM_TRIG_TYPES in same file
Add "Load" and "UNUSED" to trig_types[], wtrig_types[] etc in dg_triggers.c
Prototype this function wherever
Add load_mtrigger(mob) to do_load in act.wizard.c and in zone_reset in db.c
Be sure this is called _after_ the mob is actually placed in the room.
Add the following function to dg_triggers.c.....
int load_mtrigger(char_data * ch)
{
  trig_data *t;

  if (!SCRIPT_CHECK(ch, MTRIG_LOAD) || AFF_FLAGGED(ch, AFF_CHARM))
    return 1;

  for (t = TRIGGERS(SCRIPT(ch)); t; t = t->next) {
    if (TRIGGER_CHECK(t, MTRIG_LOAD)) {
      return script_driver(ch, t, MOB_TRIGGER, TRIG_NEW);
    }
  }

  return 1;
}

Erik Madison
ICQ #13940294
fafhrd@rotd.com


     +------------------------------------------------------------+
     | 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