Re: [BPL14][Newbie] Extract Char

From: Stephen Wolfe (siv@CYBERENET.NET)
Date: 09/09/98


> was wondering........why dont these spells end? Ok this is what i mean as
> far as AD&D goes these spells and others such as aerial servant only last a
> certain amount off time then the mob is extracted.  But when the aff flag
> CHARM is turned on for these spells it doesnt ever go off.  To test that i
> left them there overnight and still charmed in the morning.  However i dont

i did something similar with my "caller" class (based on the final fantasy
games)..the first time i implemented calling, i just added a variable to
the mob struct for the number of tics that the mob would be around based
on the level of the caster..

LIFETIME(mob) = MAX(MIN(GET_LEVEL(caster)/4, 12), 3);

where lifetime would be defined as the variable that you added to the
character struct (i'd put it in the same place as hit points, etc)

then in point_update (limits.c) add in a check like:

  /* characters */
  for (i = character_list; i; i = next_char) {
    next_char = i->next;

    if (LIFETIME(i) && --LIFETIME(i) == 0)
      remove_summoned_char(i);
    if (IS_NPC(i)) continue;

remove_summoned_char would be the func that sends the disappearing
messages and extracts the char..

you could also do this whole thing using an event system..it would be much
more efficient since there would be no variable to add to the structs and
decrement every tic..make an event that sends messages and extracts
characters, then just create one when the mob is initially summoned..

if anyone is interested in the aforementioned caller code, i think i
posted something to the list a while ago that should show up in the
archives..

siv


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