Attachment multiclass.zip not found
Cool, I skimmed over those old patches but they are clunky.
I didn't look through the src directory one because that is .. well.. a whole src directory
So here is a simple implementation that you can use as a
basis to work from, it is a .diff file compared to a fresh download of 3.66
Please note that this is a draft and hasn't been tested more than a few minutes, but hopefully the concepts will help you flesh it out further!
What it does:
Allows PC characters to have levels in each class, each adding up to give their total 'real' level.
Overview:
I've change the 'level' variable in the player structure to be an array which will now hold the level of each class in the MUD.
Eg: int level[NUM_CLASSES];
Expanding the array out would look something like this:
level [0, 1, 2, 3]
Magic User, Cleric, Thief, Warrior
This just uses the natural values of CLASS_xxx
This means the GET_LEVEL(ch) definition has to change, it becomes GET_LEVEL(ch, i) - where 'i' is the class eg: CLASS_MAGIC_USER
(Gaining XP no longer automatically levels you up - this has just been commented out.)
But we want a way to find out the characters total level. For this I re-used the GET_REAL_LEVEL(ch) definition.
Now, this may or may not be a good idea - but you can always rewrite your own definition and leave the original alone if you prefer
Basically it will add up a characters levels for each class and return that value. The original one checked if the character was switched but I could not for the life of me get that to work..
For simplicity I just made mobs use CLASS_WARRIOR, this can be expanded on but requires reworking medit.c and db.c and then updating all existing mob files. A bit long winded for a proof of concept, but certainly do-able.
So, the bulk of the .diff file is just finding all those instances of GET_LEVEL(ch) and changing them to GET_REAL_LEVEL(ch)
The pfile is saved and loaded differently, it adds the four class levels into the Levl: line. This will not break existing pfiles and will simply update when they are next saved.
I added a quick update to do_score which will show you each of your levels, broken down by class.
Other things to do would include altering the 'do_who' list if you wanted to show all of a players class levels, updating the advance or set wizcommands. And adding in a way to level up!
Hopefully that covers everything and is clear enough to work with, or at least gets your creative juices flowing!