Re: Requesting help for multi-class code bpl21

From: Shane P. Lee (
Date: 08/10/02

--- Thomas Larcombe <raucous@DIM.COM> wrote:
> Hi all.
>    I am requesting some help with multi class code I am attempting
> to develop on my own. I have checked the archives and the ftp site
> and they are sadly lacking in multi class code for the later patch
> levels. I am using circlemud3.0 bpl21, major code additions are
> OasisOLC, 128 bit patch, DG_scripts. Other minor code additions that
> are pertinent (or may be) are additions of 5 classes and 24 races.
>    My problem is in one section only. I am using a GET_CLASS2,
> chclass2
> route towards the multiclassing. I have differing xp tables for
> classes
> which I want to keep. I can get the values into GET_CLASS2 and all
> the
> other pertinent variables, however when I try to set the initial
> skills
> (and I would assume skills gained with levels later on) I cannot get
> the mud to accept the skills from the second class. I think that they
> are assigned via init_spell_levels in class.c and spell_level in
> spell_parser.c. If this is correct can anyone give me a bit of help
> in
> how I can get the skills from the second class to actually be given
> to
> the character?

Okay, here's what you have to do. Never tried this myself, but I'm
very positive this will work:


in spell_parser.c change
void spell_level(int spell, int chclass, int level)
void spell_level(int spell, int chclass, int chclass2, int level)

Further down, you'll see:

  if (chclass < 0 || chclass >= NUM_CLASSES) {
    log("SYSERR: assigning '%s' to illegal class %d/%d.",
                chclass, NUM_CLASSES - 1);
    bad = 1;

Add another case like so:

  if (chclass2 < 0 || chclass2 >= NUM_CLASSES) {
    log("SYSERR: assigning '%s' to illegal second class %d/%d.",
                chclass2, NUM_CLASSES - 1);
    bad = 1;

Now then, in class.c, simply add the extra class to
 void init_spell_levels(void)
Like this:


You'll have to make a check in the guild spec proc that searches
for the player's class, maybe something like this;

Search for:

    if (GET_LEVEL(ch) >= spell_info[i].min_level[(int) GET_CLASS(ch)])
 and change it to:
/* This is messy code, but it should give you an idea of what I mean */
    if (GET_LEVEL(ch) >= spell_info[i].min_level[(int) GET_CLASS(ch)]
|| GET_LEVEL(ch) >= spell_info[i].min_level[(int) GET_CLASS2(ch)]) {


You are going to run into problems like this, of course, but it should
give you an idea of how to proceed. I myself completely re-wrote the
init_spells() function to read from a file, so that I could add new
skills/spells to the game as it was running.
If you're interested in that, email me off-list and I'll send you my


 * "Mommy! Make the bad man go away!" *

Do You Yahoo!?
HotJobs - Search Thousands of New Jobs

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT