09 Feb, 2011, Vfx23 wrote in the 1st comment:
Votes: 0
Hey all. Well, the bugs are fixed enough to keep the mud stable, hasn't crashed in a good week now. I need to finish up 2 more classes before they are "playable". I have 8 classes, cleric, monk, druid, mage, ranger, thief, paladin, and fighter. Now, I have to finish adding skills and spells (and spell groups, current ones, not new ones) to paladin and druid before they can be played. Im having trouble though finding out which number belongs to each class. I looked on class_table, doesnt say anything there that is any help. I saw this in const.c, for all the skills and spells.

For example, this is a druid only skill:

{
"entrapment", { 170, 170, 170, 170, 170, 50, 170, 170 }, { 0, 0, 0, 0, 0, 1, 0, 0},
spell_entrapment, TAR_CHAR_OFFENSIVE, POS_FIGHTING,
NULL, SLOT(85), 50, 16,
"", "{gThe vines around you wither away.{x", "",
{666, 666, 666, 666}, FALSE },


Now this is one that a few classes get:

"word of recall",       { 100, 100, 170, 170, 130, 110, 120, 125 },     { 1,  1,  0,  0, 2, 2, 2, 2},
spell_word_of_recall, TAR_CHAR_SELF, POS_RESTING,
NULL, SLOT(42), 100, 12,
"", "!Word of Recall!", "",
{666, 666, 666, 666}, FALSE },


Im guessing the: { 1, 1, 0, 0, 2, 2, 2, 2}, are the classes that can get it? Where do I go to find out what number each class has? Oh, almost forgot, this is a somewhat modified rom2.4 codebase. All help is greatly appreciated.

Edit by Kiasyn: added code tags
09 Feb, 2011, Runter wrote in the 2nd comment:
Votes: 0
It's more likely that { 1, 1, 0, 0, 2, 2, 2, 2} represents an array of the 8 classes. I'm guessing 0 means "off" and anything else means on (but slightly different.) I'm not sure what the number themselves actually mean, but I don't think the number represents the class. It just represents an option. The position in the array is probably the class.
09 Feb, 2011, plamzi wrote in the 3rd comment:
Votes: 0
Runter is right - it's the position in the array that would determine which class gets this value.

If you can't find where in the code this mapping is being evaluated, one way to do it is to change one spell into 1, 2, 3, 4, 5, etc. then start changing the class and level of a test char until you find out when that spell becomes available to them.

When you do find that, put it in a comment line inside the code - there should have been a comment there to begin with.
09 Feb, 2011, ATT_Turan wrote in the 4th comment:
Votes: 0
A good way to figure out things like this is to work your way backwards. If you look up at the top of that list where your skills start, you should see that it is of a structure called skill_type. Looking into merc.h (which is where all of your structures are defined), and searching for skill_type, we can see that the list of numbers you're looking at is an array of length MAX_CLASS.

If that's referencing MAX_CLASS, some other list of classes must also use it, right? So let's search for other instances of MAX_CLASS inside of merc.h, where all of these things would be listed. I do this and come across a class_table variable of size MAX_CLASS - this should be it! So I search all of my *.c files for class_table and see it is defined in const.c, back where we started. And there I see the list of all the classes in my code, in the order they are referenced by that list of numbers in each spell. All I would have to do is decide what level a class gets this skill at and change the number from 0 accordingly.

Now I don't know precisely what codebase you're using, so your results may vary slightly, but even if that's not the exact same answer for you, it's a sound methodology to find your way around.
09 Feb, 2011, Vfx23 wrote in the 5th comment:
Votes: 0
Ok, gotcha, thanks guys, what you said ATT helped me figure it out. :biggrin:
0.0/5