multi.patch - can't use skills/spells at same time??

From: Brian (brian@IMI-BOTTLING.COM)
Date: 02/21/98


I recently put in the multi.patch, but I'll be darned if I can get it to
work...

The only problem I seem to have is the fact that a mortal can't have both
skills and spells at the same time (I'm assuming this is the reason).

Here's the scenario:

I start a new character as a Mage.  I practice magic missile.  I try to
cast it, and I get "Insufficient level to cast that spell".

I printf'd all the variables of the following code from the patch file to
see what numbers it was using to solve the expression.  It turned out on
all cases, SINFO.min_level[class] was 31.

Here's the snippet out of the multi.patch file dealing with do_cast.  If I
comment this out, the MUD functions normally again.  Just to note, in case
I don't make it clear... There are other functions in other parts of the
code.  Most seem to be nothing important.  This code segment seems to be
the problem (but I'm not very experienced at 'C' so I might be in error).
Again, this is from the multi.patch on the
ftp.circlemud.org/pub/CircleMUD/contrib/code directory.

Anyways.. here's the segment in patch form (this obviously isn't how it
appears verbatim in the code):

------------------------
@@ -650,6 +651,15 @@ ACMD(do_cast)
     send_to_char("You are unfamiliar with that spell.\r\n", ch);
return;
   }+  if (GET_SKILL(ch, spellnum)) {
+    for (class = 0; class < NUM_CLASSES; class++) {
+      if (GET_LEVEL(ch) < SINFO.min_level[class]) {
+   send_to_char("Your level is not sufficient right now to cast
that!\r\n", ch);
+        return;+      }+    }+  }+   /* Find the target */   if (t !=
NULL) {
     one_argument(strcpy(arg, t), t);
---------------------------

It should be mentioned that I'm using races & classes, so
SINFO.min_level[class]to be changed to SINFO.class_min_level[class]

Now...  An Immortal or greater has no problem casting spells and using
skills at the same time....


I was fiddling with the code in all sorts of imaginable ways...

I tried shifting some of the functions of do_cast around and found that is
I start a mage, practice all spells, get to level 30, multi into a warrior,
I won't have my spells anymore, and won't be able to cast any...  It'll
tell me I don't know that spell.  If I get warrior to multi (and practice
all skills) and multi into a cleric, I'll have access to my mage spells as
I increase levels, but I won't have access to any warrior skills, no matter
what level I am.  Now.. (whew), if I get to level 30 and multi into a
thief, I'll have my warrior skills come back as I get thief levels, but I
will no longer be able to cast any cleric or mage spells.


It got to the point where I was wondering what on earth was filling those
variables in the expression, so I did a printf to the shell and found that
SINFO.class_min_level[class] was always 31, class would be the class number
of the class the spell/skill came from, GET_LEVEL would be my level, and
NUM_CLASSES would be 4 (which is the correct number of classes I have).  I
stuck this in under the sprintf line that send the "Insufficient level"
text...  So I could see what the variables were when it failed.

Does anyone have any idea why it's doing this?  Am I missing something
really easy here?

This has been driving me nuts for days!  I didn't want to bother anyone
with this, but I think I need help! :)  Also, I tried contacting the
author, but the e-mail bounced.

If someone sees something or wants more info, I'll be glad to give more
info/code whatever.  If you've got suggestions for things to look for or
things to try, I'll do it..

Thanks

 - Brian


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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