Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ 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 page
Posted by
| Frobozz
(75 posts) 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?
| Top |
|
Posted by
| Greven
Canada (835 posts) 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 | Top |
|
Posted by
| David Haley
USA (3,881 posts) 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 | Top |
|
Posted by
| Frobozz
(75 posts) 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?
| Top |
|
Posted by
| David Haley
USA (3,881 posts) 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 | Top |
|
Posted by
| Frobozz
(75 posts) 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 | 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.
17,201 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top