Re: Newbie? Longterm Time format

From: Del (caminturn@EARTHLINK.NET)
Date: 08/18/98


Brett Williams wrote:
>
> I've gotten the pulse that activates the time. My problem is, the variable I
> have to keep track of the time. ch->longterm.time, is how many pulses of
> PULSE_LONGTERM, before completion. But I would like to know if it would be
> easy to change that to a time? I want it to display a msg every minute and 10
> seconds "You animate the corpse. <so much> time left." or "You enchant the
> armor. <so much> time left." etc, but this is difficult to do in the current
> form I have it. Any suggestions?
>

Under the current system, magic.c has the part to call the wearoff messages,
how about setting up something in there to send a message at each tic (along
with the wearoff).
To display a message each tic, "Your spell spell_name will wear off in %d
tics"

this way you don't have to worry about creating a time variable and creating
the messages also..??


void affect_update(void)
{
  struct affected_type *af, *next;
  struct char_data *i;
  for (i = character_list; i; i = i->next)
    for (af = i->affected; af; af = next) {
      next = af->next;
      if (af->duration >= 1)
        af->duration--;
      else if (af->duration == -1)      /* No action */
        af->duration = -1;      /* GODs only! unlimited */
      else {
        if ((af->type > 0) && (af->type <= MAX_SPELLS))
          if (!af->next || (af->next->type != af->type) ||
              (af->next->duration > 0))
            if (*spell_wear_off_msg[af->type]) {
              send_to_char(spell_wear_off_msg[af->type], i);
              send_to_char("\r\n", i);
            }
        affect_remove(i, af);
      }
    }
}

To those more experienced: This is the right section isn't it? Checking to
see if I got the right section.


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