Re: [CODE] Invasion!

From: Chris Jacobson (fear@ATHENET.NET)
Date: 03/05/98


On 3/5/98 6:37 PM, Patrick J. Dughi (dughi@IMAXX.NET) stated:

>        Pirate thing, yeah..I believe Eric Green has the FL code off his
>web site.. this is a guess..but.. http://www.imaxx.net/~egreen/fl
>
>        He stated something to that affect about a week ago, plus or minus
>a month if I'm not mistaken.

That is close:

http://www.imaxx.net/~thrytis/fl/

I've been working with the FL code for a few weeks now, it is quite nice,
altho it appears to be somewhat mixed Circle/Envy code.

From what I gather, the actual "pirate" system uses regular aggy mobs,
and a special function, "aggro_scan", which I will post here.  The
function basically scans all the directions, looking for someone to
attack that is within sight, then moving towards that person. Note: this
isn't cut/pate code.  I'm simply pasting it here to give you people an
idea, without having to download the whole thing.

struct char_data *aggro_scan(struct char_data *mob, int range, int cnd,
int *tdr)
{
   int i, r, rm = mob->in_room;
   struct char_data *spud;
   char buf[MAX_STRING_LENGTH];

   for (i=0;i<6;i++) {
      r = 0;
      rm = mob->in_room;
      while (r<range) {
         if (clearpath(mob, rm,i)) {
            rm = real_roomp(rm)->dir_option[i]->to_room;
            r++;
            for
(spud=real_roomp(rm)->people;spud;spud=spud->next_in_room) {
               if
((CAN_SEE(mob,spud))&&(!IS_MOB(spud))&&(GetMaxLevel(spud)<61)) {
                  if(!IS_SET(mob->specials.mob_act,ACT_STAY_ZONE) ||
                     (real_roomp(rm)->zone==real_roomp(mob->in_room)->zone))
                  {
                     *tdr = i;
                     if (cnd==0) return spud;
/*
                     if ((cnd==1)&&(is_pissed(mob,spud))) return spud;
*/
                  }
               }
            }
         } else {
            r = range + 1;
         }
      }
   }
   return NULL;
}



- Chris Jacobson


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