Request for help. Regarding CAN_CAST

Posted by Sokol on Tue 10 Aug 2004 12:47 AM — 5 posts, 20,406 views.

#0
I have made a Dual Class / Tripple Class code for smaug FUSS. That is to say I have the dual/trip class code in and have run into afew glitches. the one I'd like to address right now is CAN_CAST here is what my mud.h has

Code will follow below:
---------------------------------------------
#define CAN_CAST(ch) (((ch)->class != 2 && (ch)->class != 3) \
&& ((ch)->dual_class != 2 && (ch)->dual_class != 3) \
&& ((ch)->trip_class != 2 && (ch)->trip_class != 3))
---------------------------------------------

Now obviously I have a problem here :) Can some one give
me a solution that will allow one to cast if the
class is a caster, if the dual_class is a caster, or if the
trip_class is a caster. For instance If I start as a
warrior and dual at a set level to mage I want to have that char be able to cast from that point on.

thanks,
sokol
sokol@eqinterface.com
Amended on Tue 10 Aug 2004 02:56 AM by Sokol
Canada #1
What exactly is the error? Are you getting a compile error, it it not working correctly, allowing anyone to cast, or is it not letting anyone cast, etc.
#2
It's not letting them cast.
"You can't do that."
Any non immortal can't cast.

The way it is now is it's looking for the player to be anything but class 2 or 3, dual_class 2 or 3, or trip_class 2 or 3.
I'm looking for a better CAN_CAST solution.


-Sokol
Amended on Tue 10 Aug 2004 02:55 AM by Sokol
#3
Hmm..I'm reading:
#define CAN_CAST(ch) (((ch)->class != 2 && (ch)->class != 3) \
&& ((ch)->dual_class != 2 && (ch)->dual_class != 3) \
&& ((ch)->trip_class != 2 && (ch)->trip_class != 3))
as:
"If class is not 2 and 3, AND dual is not 2 and 3, AND trip is not 2 and 3".

so if any of your 3 classes are 2 or 3, then you can't cast...i think changing the &&'s on the outside to ||'s would fix it up.

that way if any of the 3 classes are magic using classes, then they can cast. but i suck at coding, so i could be wrong (;


#4
Nope, I initialy had it set to || which is OR and that also had a problem. I solved the problem, been away from muds for awhile, but it seems in smaug you have to have 1 or above in the spell to cast period. Unless it's my code causing this.

-sokol