Re: [CODE] Race Attributes

From: Edward J Glamkowski (eglamkowski@angelfire.com)
Date: 03/08/99


On Mon, 8 Mar 1999 06:10:57    Xual wrote:
>On Mon, 8 Mar 1999, Brian Heimgartner wrote:
>
>> How do you set it so that races get special skills/spells like:
>> Dwarf - Infravision, or something like that?
>> I have tried for a long time, and I'm, stumped.
>
>class.c
>do_start()
>
>if (GET_RACE(ch) == RACE_DWARF)
>  SET_BIT(AFF_FLAGS(ch), AFF_INFRAVISION);

Two pitfalls with this (though this is how I did it):
1. If you have a dispel magic spell, you'll want to
make sure it doesn't dispel any innate AFF flags.
2. The immort unaffect command - same as #1.

I just wrote a little function that I call after
a dispel or unaffect that checks all innate abilities
after a dispel or unaffect, and, if necessary, re-adds
the AFF.
I also threw in a check in do_advance to make sure
they hadn't lost their innate affects at any point,
and to log it if they had.  Not terribly helpful for
debugging, but it is just intended to be a first alert
to a problem.  No problems yet however :)



Angelfire for your free web-based e-mail. http://www.angelfire.com


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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