Coder Class FactSheet By Kracus This is a fact sheet to provide basic information on how to code Classes for Rom2.4b4 source code, copyright 1993-96 Russ Taylor To add in a new class you will need to deal with these files: Const.c... Merc.h... STEP 1. You will need to look for this section of code and add your class below it { "warrior", "War", STAT_STR, OBJ_VNUM_SCHOOL_SWORD, { 3022, 9633 }, 75, 20, -10, 11, 15, FALSE, "warrior basics", "warrior default" }, { "your class' name", "how it appears on the wholist", STAT_STR, OBJ_VNUM_SCHOOL_SWORD, { 3022, 9633 }, 75, 20, -10, 11, 15, FALSE, "your class' basics", "your class' default" }, .... The above section of code means this: { "class' name", "must be 3letters to appear in wholist", STAT_STR(primary stat), OBJ_etc..(your class'weapon), { 3022,9633 (vnums of the guild rooms for the class)}, 75(max percentage class can train skill-spells) 20, -10, 20(starting armorclass), -10(max armorclass)11(hitpoints minimum class gains), 15(hitpoints maximum class gains), FALSE(is a non-mana class), "warrior basics(class gains this skill group automactically)", "warrior default(class gets this default group if they choose to not customize)" }, STEP 2. This is optional if you don't want the word "null" not to show up in titles, add this code into this section of code: { "Master Warrior", "Master Warrior" }, { "Knight Hero", "Knight Heroine" }, { "Avatar of War", "Avatar of War" }, { "Angel of War", "Angel of War" }, { "Demigod of War", "Demigoddess of War" }, { "Immortal Warlord", "Immortal Warlord" }, { "God of War", "God of War" }, { "Deity of War", "Deity of War" }, { "Supreme Master of War", "Supreme Mistress of War" }, { "Creator", "Creator" }, { "Implementor", "Implementress" } }, { { "Man", "Woman" }, { "your class' male title", "your class' female title" }, { "your class' male title", "your class' female title" }, { "your class' male title", "your class' female title" }, { "your class' male title", "your class' female title" }, { "your class' male title", "your class' female title" }, Special note: for every level you have on your mud you should include one of these lines ...above to give each level for your new class a title. STEP 3. You will need to look for the spell-skill section of the code and add this to ALL SKILLS and SPELLS { "bless", { 2, 7, 50, 50}, { 1, 1, 2, 2 }, spell_bless, TAR_OBJ_CHAR_DEF, POS_STANDING, NULL, SLOT( 3), 5, 12, "", "You feel less righteous.", "$p's holy aura fades." }, ....make the Spell Bless look like this instead of how it was originally coded above: { "bless", { 2, 7, 50, 5, 10}, { 1, 1, 2, 2, 1 }, spell_bless, TAR_OBJ_CHAR_DEF, POS_STANDING, NULL, SLOT( 3), 5, 12, "", "You feel less righteous.", "$p's holy aura fades." }, ....... In the above code you added a 10 into one group, and added a 1 into another group { "bless", { 2, 7, 50, 5, 10( you added this 10 in) }, { 1, 1, 2, 2, 1(you added this 1 in) }, spell_bless, TAR_OBJ_CHAR_DEF, POS_STANDING, NULL, SLOT( 3), 5, 12, "", "You feel less righteous.", "$p's holy aura fades." }, ... the 10 means your new class gains the Spell Bless at level 10 ... the 1 means how well your new class learns the spell when it is practiced YOU MUST add each of these two numbers to all skills and spells in const.c which are available to be gained. If you do not add these two numbers to all skills and spells your mud will be bugged... ...SLOT( 3) this is a number that distinguishes one spell from another slots for all spells should be different numbers. ... 5 is the amount of mana it takes to cast the spell ... 12 is the number of pulses it waits till you may cast the spell again STEP 4. You will need to find this code section and add in your class' basics below it: { "warrior basics",{ -1, -1, -1, 0 }, { "sword", "second attack" } }, { "your class name basics",{ -1, -1, -1, -1, 0 }, { "sword", "second attack" } }, ..this above code means { "class basics", { -1(mage class may not gain this group, -1(noncleric), -1(nonthief), 0(warriors get this group)}, { "sword", "second attack"(these are the skills found in this skill-group)} }, ...you will notice you added in a 0 to your class' basic group { "your class name basics",{ -1(mage class can never gain this group), -1, -1, -1, 0(added this 0 in) }, { "sword", "second attack" } }, ...this was because all basic, skill, and spell groups must have an extra value added in since you added in a class. ...so the -1 means this class cannot ever gain this group ...and the 0 means this class receives this group at level 0 ...so for all BASIC, SPELL, and SKILL groups you need to add in an extra number into that slot. See below for more info on this concept.... STEP 5. You will need to make a default group for your class and ADD in values for the other remaining defaults. Look for this code: { "warrior default", { -1, -1, -1, 40 }, { "weaponsmaster", "shield block", "bash", "disarm", "enhanced damage",$ "parry", "rescue", "third attack" } }, add this below it..... { "your class default", { -1, -1, -1, -1, 40 }, { "weaponsmaster", "shield block", "bash", "disarm", "enhanced damage",$ "parry", "rescue", "third attack" } }, ....the above means this: { "class default", { -1(mage class cannot gain this group), -1(clerics can't gain), -1(thieves can't gain, 40(warriors gain at the cost of 40 creation points) }, { "weaponsmaster", "shield block", "bash", "disarm", "enhanced damage",$ "parry", "rescue", "third attack"(these are all the spells and skills found in this group) } }, .....REMEMBER you need to add an extra number to all groups basic , spell, and skill when you make a new class. For example in the warrior default you need to add this in: { "warrior default", { -1, -1, -1, 40, -1(added -1 in cause of new class and make it so new class can't gain it }, { "weaponsmaster", "shield block", "bash", "disarm", "enhanced damage",$ "parry", "rescue", "third attack" } }, ....IMPORTANT, REMEMBER for all the spells and skill groups such as WEATHER, CURATIVE, COMBAT you also have to have as many numbers in the { -1, -1, -1, 40, -1} slot as there are classes. FILE Merc.h STEP 6. You will need to increase MAX_CLASS by 1 since you added in your new class You will need to increase MAX_GROUP by 2 since you added in your class' basicgroup and defaultgroup If there are more spells and skills in a group than the number listed in MAX_IN_GROUP, you have to Increase the MAX_IN_GROUP number to how many you increased to. #define MAX_SOCIALS 256 #define MAX_SKILL 185 #define MAX_GROUP 51(raise by 2) #define MAX_IN_GROUP 15(raise only if you have exceeded this amount in any group you make or adjust) #define MAX_ALIAS 5 #define MAX_CLASS 9(raise by 1) #define MAX_PC_RACE 16 #define MAX_CLAN 18 #define MAX_DAMAGE_MESSAGE 42 STEP 7. This is an optional choice, but in file ACT_COMM.C, you may choose to add in class poses STEP 8. Remove all the o files in src directory by typing "rm *.o" be very careful when you rm, NEVER type "rm *.*" NEVER type "rm *" STEP 9. Do a makefile and startup your mud with the startup command STEP 10. Play your new class.... it is hard work to make a new class, but well worth it...!