I decided to answer the first post. More below:
From: "Thomas Larcombe" <raucous@DIM.COM>
> 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.
24 races.. I assume you let the race decide stats, then.
One problem gone :P
> My problem is in one section only. I am using a GET_CLASS2, chclass2
> route towards the multiclassing.
I would have suggested a more generic approach of changing the GET_CLASS
to a bitvector of classes, combined with a level[NUM_CLASSES] array.
You would avoid the double checking[1] throughout the code, but it would
mean more changes to the rest of the code[2].
> 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?
As it is, init_spell_levels() only makes sure a certain class can use
a certain skill/spell from a certain level. In order to use it, you must
find the place where it check if you can use it;
mag_manacost(), list_skills(), SPECIAL(guild) all assume that
GET_CLASS(ch) is the class using the skill.
I suggest you look into at least these three places, and make sure they
check for the other class. Also, you must have a way of storing the
second classes level in the pfile.
> Concept only is fine and hopefully I can translate it into
> code. If my assumption there is wrong could someone please tell me exactly
> where the skills are assigned on character creation and on level gains?
Skills are assigned on creation in do_start - make sure to check for CLASS2
there, too.
Welcor
[1] if (GET_CLASS(ch) == CLASS_MAGIC_USER)
spell_level = GET_LEVEL(ch);
else if (GET_CLASS2(ch) == CLASS_MAGIC_USER)
spell_level = GET_LEVEL2(ch);, or
switch GET_CLASS(ch) {
...
}
switch GET_CLASS2(ch) {
...
}
[2] Do you realize how many arrays are indexed by GET_CLASS ?
..
..
..
..
..
..
..
..
spell_info, guild_info and prac_params :P
--
+---------------------------------------------------------------+
| FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
| Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
| Newbie List: http://groups.yahoo.com/group/circle-newbies/ |
+---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 06/25/03 PDT