Re: autoassist

From: Greg Alexander Irvine (s9211947@arcadia.cs.rmit.edu.au)
Date: 08/21/95


hehehe. well, that little bit of autoassist code i included at the bottom
of that extra attack stuff was basically not too far off the mark.

except it has to go inside the second last bracer ( } ).

and should look like this (WITHIN the for loop in perform_violence in fight.c)
need a ACMD(do_assist); proto at the top of the function too. :)

if (IS_PC(ch) && FIGHTING(ch) && IS_GROUPED(ch))  {
  if (!(leader = ch->master))
    leader = ch;
	/* should the leader join? */
  if ( (ch != leader) && (IN_ROOM(ch) == IN_ROOM(leader)) &&
	(!FIGHTING(leader)) && PLR_FLAGGED(leader, PLR_AUTOASS))
    do_assist(leader, GET_NAME(ch), 0, 0);

	/* what about the rest of the group? */
  for (f=leader->followers; f; f=f->next)
    if (IS_GROUPED(f->follower) && (IN_ROOM(ch) == IN_ROOM(f->follower)) &&
	!FIGHTING(f->followwer) && PLR_FLAGGED(f->follower))
      do_assist(f->follower, GET_NAME(ch), 0, 0);
}


OK, that looks a little better :)


I just noticed a small bug in the memory of mobs too.
If you attack a mob and flee, it remembers you (if its flagged to).
if  you then die to another mob, that mob doesnt remember you agaon, but
the one that you attacked earlier still does.  I guess basically the only
way to fix this is each time a player dies is to go through ALL the mobs
and make them forget the player  ( a bit of a time consumer cpu wise :( )


Greg.



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