Re: Time specific spells

From: Patrick Dughi (
Date: 05/01/03

> I was wondering how you can make a spell work only during specific hours
> or in rooms with specific roomflags. I was hoping to make an
> invisibility spell that only works at night and in dark rooms.
> ------O------
> Hi
> Try to take a look at this variable
> Declare this in the top of the file.
> extern struct time_info_data time_info;
> and use this to return the hour of the day.
> time_info.hours
> it And for the dark room
>         // Do your magic here :)
> }
> This should do what your are asking for.

        That will help you determine when to cast the spell, but you can
also use it to determine the duration of the spell as well.  It wouldn't
make sense to have a spell that is only supposed to work at night last
until noon the next day.

        If you're looking for specific effects, like the tough one;
lycanthropy, you'll have to perform more global coding routines, if
they're not attached to spells directly.


   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/26/03 PDT