casting, do_cast, classless casting

Posted by Frobozz on Sat 01 Jan 2005 03:35 PM — 6 posts, 22,903 views.

#0
Hi again,

Right now I have a "tree based" skill system. But I've encountered a hang up and Im not sure how to get around it (surprise)!

I want everyone, when taught, to have the ability to cast a spell. As it stands right now, only immortals can do this. I took a look at do_cast and it does not seem to specify a class that can or cannot cast.

I've removed all classes except for warrior from the class.lst in system, everyone is a warrior... They just dont see it.

I tried making a class called adventurer, set its mana, and nothing! I got this message when my test character tried to cast heal:

c
Cast which what where?
>
c heal
You can't do that.
>

What do you guys think?
Canada #1
The thing to check, then, is what conditions is being met(or not met) to dislpay that message? It's likely in magic.c, just do a search on that phrase, and check why its being displayed, and work backwards from there.
USA #2
I remember there being some kind of flag somewhere that determines if a class has mana or not - it's a flag on the class itself, IIRC. That could be the culprit, but I agree with Greven: the best way to know for sure is to find that sentence and backtrack from there.
#3
Found it:



        /* Regular mortal spell casting */
        if ( get_trust(ch) < LEVEL_GOD )
        {
            if ( ( sn = find_spell( ch, arg1, TRUE ) ) < 0
            || ( !IS_NPC(ch) && ch->level < skill_table[sn]->skill_level[ch->class] ) )
            {
                send_to_char( "You can't do that.\n\r", ch );
                return;



So if Im reading this right.... casting is dependent on skill_level[ch->class]?

So if I removed ch->level < skill_table[sn]->skill_level[ch->class] it should work fine, since Im not really using "classes" to determine what skills one has?

USA #4
Each skill has a minimum level per class associated with it; this is the stuff in the slist players see. In order to cast a spell, a player must be of the sufficient level for his/her class.

What to do depends on what you're trying to do. If you're trying to remove skill levels in addition to classes, then yes, remove the line. Otherwise, if you're trying to remove classes but keep skill levels, then you need to do something else, such as setting the levels for the "warrior class" (since you said everybody is a "warrior") for each skill to what you want them to be.
#5
Yep,

Removed that line AND changed true to FALSE. Works perfectly.

Thanks