[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  casting, do_cast, classless casting

casting, do_cast, classless casting

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Frobozz   (75 posts)  [Biography] bio
Date Sat 01 Jan 2005 03:35 PM (UTC)
Message
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?
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #1 on Sat 01 Jan 2005 03:59 PM (UTC)
Message
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.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #2 on Sat 01 Jan 2005 04:04 PM (UTC)
Message
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.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Frobozz   (75 posts)  [Biography] bio
Date Reply #3 on Sat 01 Jan 2005 04:22 PM (UTC)
Message
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?

[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #4 on Sun 02 Jan 2005 12:56 AM (UTC)
Message
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.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Frobozz   (75 posts)  [Biography] bio
Date Reply #5 on Sun 02 Jan 2005 02:18 AM (UTC)
Message
Yep,

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

Thanks
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,198 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]