Re: [Circle] race dependant spells

From: Stefan Jakobsson (
Date: 11/11/96

On Sun, 10 Nov 1996, Mathieu Fenniak wrote:
> Nic Suzor wrote:
> > 
> > Hey,
> > 
> > i have recently added races to my mud, and i am toying with an idea:
> > 
> > currently spells are given to pcs based on class. what would be ideal, is
> > to also have spells given to races. so, a HUMAN MAGE and a OGRE MAGE would
> > have the same MAGE class spells, but the ogre might have a couple of extra
> > spells given only to ogres... the way im thinking of doing it would be to
> > duplicate the whole do_cast function, but that might be a little big... i
> > am wondering if i can just add another pointer in do_cast to a new array
> > like the one in class.c that defines spell levels. if i just make a new
> > array, SPELL_RACE_LEVEL or something like that, is it possible? this would
> > also be easier as i wouldnt need to add a new command instead of cast etc.
> > just a thought.
> > 
> I'm not sure if this would be an easier or a better wa y to do this, but
> it might work. Just add the spell normally, as if it were for all races.
> Then put something like this:
> if (GET_RACE(ch) == RACE_HUMAN) {
>    send_to_char(ch, "Only ogres can cast this spell!");
>    break;
>  }
> It would work (I think), and it would be relativly problem free.

In that case it would prolly be better to do:

 if (GET_RACE(ch) != RACE_OGRE) {
    send_to_char(ch, "Only Ogres can cast this spell!");

That way you won't have to add a check for every race...

(Hope i didn't mess this up, i'm still new at this) :)

Reg, Stefan (aka Slite)
PhoneyMUD Imp

| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   |

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