Pre-requisite Skills Snippet Version 2 ====================================== What does it do? ================ Ever wanted to make players practice certain spells/skills before they could practice another, EG: "Second Attack" before "Third Attack". Well this makes it so you cannot raise a skill percent over its prerequisite skills whilst practicing. Also included is a command to display the prerequistes of a skill/spell. Changes from Version 1 ====================== The do_prereq command was heavily bugged which I didnt realise till I started messing with skills/spells so heres the fix. - Only big change is do the do_prereq command and two little typo's. - You can get a classes prerequisite skills by using a letter as an argument M for Mage, T for Thief, etc. This is dependant on your own version of parse_class() which is used in character creation. (I use mag,war,etc in my own mud) also made an error message. - Now checks the argument is a valid skill/spell name before trying to find it and display it. - No argument displays current prereqs for the players class - Got rid of the NULL pointer being strcat'd which was making it die for Daemon How to install. =============== Backup your current mud, and hand patch it in. Credits. ======== Standard disclaimers. No need too but you can if you want. Drop me a email to saethu@hotmail.com if you want as well. Thanks to Daemon for giving me a bit of feedback/bug report for MSVC++5. diff -uNrp stockcircle/src/act.informative.c tempcircle/src/act.informative.c --- stockcircle/src/act.informative.c Wed Aug 15 01:56:28 2001 +++ tempcircle/src/act.informative.c Tue Dec 18 20:05:30 2001 @@ -37,6 +37,7 @@ extern char *immlist; extern char *policies; extern char *handbook; extern char *class_abbrevs[]; +extern struct spell_info_type spell_info[]; /* extern functions */ ACMD(do_action); @@ -1720,3 +1721,66 @@ ACMD(do_commands) strcat(buf, "\r\n"); send_to_char(buf, ch); } +ACMD(do_prereq) +{ + int chclass, level, i, columns, found, skill_num; + + + /* The folowing buffer has to be able to hold all the skills with prereqs for each class + * Increase/decrease as you want I personally use georges buffer patch + */ + + char display_buf[8192]; + + + + skip_spaces(&argument); + + if (!*argument) + chclass = GET_CLASS(ch); + else + chclass = parse_class(argument); + + + + if (chclass!=CLASS_UNDEFINED){ + + sprintf(display_buf, "Pre-requisite list for %ss:\r\n", pc_class_types[chclass]); + for (level = 1; level < LVL_IMMORT; level++) + { + found=FALSE; + sprintf(buf,"Level %3d: \r\n",level); + for (i = 1, columns=0; i < MAX_SKILLS+1; i++) + { + if (spell_info[i].min_level[chclass]==level) + { + + if (spell_info[i].first_prereq[chclass]!= TYPE_UNDEFINED){ + found=TRUE; + sprintf(buf+strlen(buf), " %-20s: ", + spell_info[i].name); + sprintf(buf+strlen(buf), " %-20s", + spell_info[spell_info[i].first_prereq[chclass]].name); + if (spell_info[i].second_prereq[chclass]!= TYPE_UNDEFINED){ + sprintf(buf+strlen(buf), " %-20s", + spell_info[spell_info[i].second_prereq[chclass]].name); + } + strcat(buf,"\r\n"); + } + } + } + if (found){ + strcat(display_buf, buf); + } + } + page_string(ch->desc, display_buf, 1,""); + }else if ((skill_num = find_skill_num(argument))!=TYPE_UNDEFINED){ + chclass = GET_CLASS(ch); + sprintf(buf, "Pre-requisites for %s :-\r\n", + spell_info[skill_num].name); + send_to_char(buf, ch); + + if (spell_info[skill_num].first_prereq[chclass]!= TYPE_UNDEFINED){ + sprintf(buf, " %s", + spell_info[spell_info[skill_num].first_prereq[chclass]].name); + if (spell_info[skill_num].second_prereq[chclass]!= TYPE_UNDEFINED){ + sprintf(buf+strlen(buf), " %s", + spell_info[spell_info[skill_num].second_prereq[chclass]].name); + } + send_to_char(buf,ch); + }else{ + send_to_char(" None.",ch); + } + send_to_char("\r\n",ch); + }else{ + /* if they get here not a skill or a class*/ + send_to_char("Syntax: prereq , where classletter is (M)age, (C)leric, (W)arrior or (T)hief\r\n",ch); + } +} + + + + diff -uNrp stockcircle/src/class.c tempcircle/src/class.c --- stockcircle/src/class.c Thu Jun 28 16:03:52 2001 +++ tempcircle/src/class.c Tue Dec 18 20:16:52 2001 @@ -1632,75 +1632,86 @@ int invalid_class(struct char_data *ch, */ void init_spell_levels(void) { + +/* spell_level(TYPE_UNDEFINED, TYPE_UNDEFINED, SPELL_MAGIC_MISSILE, CLASS_MAGIC_USER, 1); + ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^ + (first prereq) (second prereq) (actual skill/spell) (Class) (level) + + The code assumes if there is not a first prereq, there wont be a second prereq. + + ( A possible cosmetic change is to put the prereqs after the actual skill) +*/ + + /* MAGES */ - spell_level(SPELL_MAGIC_MISSILE, CLASS_MAGIC_USER, 1); - spell_level(SPELL_DETECT_INVIS, CLASS_MAGIC_USER, 2); - spell_level(SPELL_DETECT_MAGIC, CLASS_MAGIC_USER, 2); - spell_level(SPELL_CHILL_TOUCH, CLASS_MAGIC_USER, 3); - spell_level(SPELL_INFRAVISION, CLASS_MAGIC_USER, 3); - spell_level(SPELL_INVISIBLE, CLASS_MAGIC_USER, 4); - spell_level(SPELL_ARMOR, CLASS_MAGIC_USER, 4); - spell_level(SPELL_BURNING_HANDS, CLASS_MAGIC_USER, 5); - spell_level(SPELL_LOCATE_OBJECT, CLASS_MAGIC_USER, 6); - spell_level(SPELL_STRENGTH, CLASS_MAGIC_USER, 6); - spell_level(SPELL_SHOCKING_GRASP, CLASS_MAGIC_USER, 7); - spell_level(SPELL_SLEEP, CLASS_MAGIC_USER, 8); - spell_level(SPELL_LIGHTNING_BOLT, CLASS_MAGIC_USER, 9); - spell_level(SPELL_BLINDNESS, CLASS_MAGIC_USER, 9); - spell_level(SPELL_DETECT_POISON, CLASS_MAGIC_USER, 10); - spell_level(SPELL_COLOR_SPRAY, CLASS_MAGIC_USER, 11); - spell_level(SPELL_ENERGY_DRAIN, CLASS_MAGIC_USER, 13); - spell_level(SPELL_CURSE, CLASS_MAGIC_USER, 14); - spell_level(SPELL_POISON, CLASS_MAGIC_USER, 14); - spell_level(SPELL_FIREBALL, CLASS_MAGIC_USER, 15); - spell_level(SPELL_CHARM, CLASS_MAGIC_USER, 16); - spell_level(SPELL_ENCHANT_WEAPON, CLASS_MAGIC_USER, 26); - spell_level(SPELL_CLONE, CLASS_MAGIC_USER, 30); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_MAGIC_MISSILE, CLASS_MAGIC_USER, 1); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_DETECT_INVIS, CLASS_MAGIC_USER, 2); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_DETECT_MAGIC, CLASS_MAGIC_USER, 2); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CHILL_TOUCH, CLASS_MAGIC_USER, 3); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_INFRAVISION, CLASS_MAGIC_USER, 3); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_INVISIBLE, CLASS_MAGIC_USER, 4); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_ARMOR, CLASS_MAGIC_USER, 4); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_BURNING_HANDS, CLASS_MAGIC_USER, 5); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_LOCATE_OBJECT, CLASS_MAGIC_USER, 6); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_STRENGTH, CLASS_MAGIC_USER, 6); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_SHOCKING_GRASP, CLASS_MAGIC_USER, 7); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_SLEEP, CLASS_MAGIC_USER, 8); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_LIGHTNING_BOLT, CLASS_MAGIC_USER, 9); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_BLINDNESS, CLASS_MAGIC_USER, 9); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_DETECT_POISON, CLASS_MAGIC_USER, 10); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_COLOR_SPRAY, CLASS_MAGIC_USER, 11); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_ENERGY_DRAIN, CLASS_MAGIC_USER, 13); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CURSE, CLASS_MAGIC_USER, 14); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_POISON, CLASS_MAGIC_USER, 14); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_FIREBALL, CLASS_MAGIC_USER, 15); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CHARM, CLASS_MAGIC_USER, 16); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_ENCHANT_WEAPON, CLASS_MAGIC_USER, 26); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CLONE, CLASS_MAGIC_USER, 30); /* CLERICS */ - spell_level(SPELL_CURE_LIGHT, CLASS_CLERIC, 1); - spell_level(SPELL_ARMOR, CLASS_CLERIC, 1); - spell_level(SPELL_CREATE_FOOD, CLASS_CLERIC, 2); - spell_level(SPELL_CREATE_WATER, CLASS_CLERIC, 2); - spell_level(SPELL_DETECT_POISON, CLASS_CLERIC, 3); - spell_level(SPELL_DETECT_ALIGN, CLASS_CLERIC, 4); - spell_level(SPELL_CURE_BLIND, CLASS_CLERIC, 4); - spell_level(SPELL_BLESS, CLASS_CLERIC, 5); - spell_level(SPELL_DETECT_INVIS, CLASS_CLERIC, 6); - spell_level(SPELL_BLINDNESS, CLASS_CLERIC, 6); - spell_level(SPELL_INFRAVISION, CLASS_CLERIC, 7); - spell_level(SPELL_PROT_FROM_EVIL, CLASS_CLERIC, 8); - spell_level(SPELL_POISON, CLASS_CLERIC, 8); - spell_level(SPELL_GROUP_ARMOR, CLASS_CLERIC, 9); - spell_level(SPELL_CURE_CRITIC, CLASS_CLERIC, 9); - spell_level(SPELL_SUMMON, CLASS_CLERIC, 10); - spell_level(SPELL_REMOVE_POISON, CLASS_CLERIC, 10); - spell_level(SPELL_WORD_OF_RECALL, CLASS_CLERIC, 12); - spell_level(SPELL_EARTHQUAKE, CLASS_CLERIC, 12); - spell_level(SPELL_DISPEL_EVIL, CLASS_CLERIC, 14); - spell_level(SPELL_DISPEL_GOOD, CLASS_CLERIC, 14); - spell_level(SPELL_SANCTUARY, CLASS_CLERIC, 15); - spell_level(SPELL_CALL_LIGHTNING, CLASS_CLERIC, 15); - spell_level(SPELL_HEAL, CLASS_CLERIC, 16); - spell_level(SPELL_CONTROL_WEATHER, CLASS_CLERIC, 17); - spell_level(SPELL_SENSE_LIFE, CLASS_CLERIC, 18); - spell_level(SPELL_HARM, CLASS_CLERIC, 19); - spell_level(SPELL_GROUP_HEAL, CLASS_CLERIC, 22); - spell_level(SPELL_REMOVE_CURSE, CLASS_CLERIC, 26); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CURE_LIGHT, CLASS_CLERIC, 1); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_ARMOR, CLASS_CLERIC, 1); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CREATE_FOOD, CLASS_CLERIC, 2); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CREATE_WATER, CLASS_CLERIC, 2); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_DETECT_POISON, CLASS_CLERIC, 3); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_DETECT_ALIGN, CLASS_CLERIC, 4); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CURE_BLIND, CLASS_CLERIC, 4); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_BLESS, CLASS_CLERIC, 5); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_DETECT_INVIS, CLASS_CLERIC, 6); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_BLINDNESS, CLASS_CLERIC, 6); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_INFRAVISION, CLASS_CLERIC, 7); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_PROT_FROM_EVIL, CLASS_CLERIC, 8); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_POISON, CLASS_CLERIC, 8); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_GROUP_ARMOR, CLASS_CLERIC, 9); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CURE_CRITIC, CLASS_CLERIC, 9); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_SUMMON, CLASS_CLERIC, 10); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_REMOVE_POISON, CLASS_CLERIC, 10); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_WORD_OF_RECALL, CLASS_CLERIC, 12); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_EARTHQUAKE, CLASS_CLERIC, 12); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_DISPEL_EVIL, CLASS_CLERIC, 14); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_DISPEL_GOOD, CLASS_CLERIC, 14); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_SANCTUARY, CLASS_CLERIC, 15); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CALL_LIGHTNING, CLASS_CLERIC, 15); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_HEAL, CLASS_CLERIC, 16); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_CONTROL_WEATHER, CLASS_CLERIC, 17); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_SENSE_LIFE, CLASS_CLERIC, 18); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_HARM, CLASS_CLERIC, 19); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_GROUP_HEAL, CLASS_CLERIC, 22); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SPELL_REMOVE_CURSE, CLASS_CLERIC, 26); /* THIEVES */ - spell_level(SKILL_SNEAK, CLASS_THIEF, 1); - spell_level(SKILL_PICK_LOCK, CLASS_THIEF, 2); - spell_level(SKILL_BACKSTAB, CLASS_THIEF, 3); - spell_level(SKILL_STEAL, CLASS_THIEF, 4); - spell_level(SKILL_HIDE, CLASS_THIEF, 5); - spell_level(SKILL_TRACK, CLASS_THIEF, 6); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SKILL_SNEAK, CLASS_THIEF, 1); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SKILL_PICK_LOCK, CLASS_THIEF, 2); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SKILL_BACKSTAB, CLASS_THIEF, 3); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SKILL_STEAL, CLASS_THIEF, 4); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SKILL_HIDE, CLASS_THIEF, 5); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SKILL_TRACK, CLASS_THIEF, 6); /* WARRIORS */ - spell_level(SKILL_KICK, CLASS_WARRIOR, 1); - spell_level(SKILL_RESCUE, CLASS_WARRIOR, 3); - spell_level(SKILL_TRACK, CLASS_WARRIOR, 9); - spell_level(SKILL_BASH, CLASS_WARRIOR, 12); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SKILL_KICK, CLASS_WARRIOR, 1); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SKILL_RESCUE, CLASS_WARRIOR, 3); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SKILL_TRACK, CLASS_WARRIOR, 9); + spell_level(TYPE_UNDEFINED,TYPE_UNDEFINED, SKILL_BASH, CLASS_WARRIOR, 12); } diff -uNrp stockcircle/src/interpreter.c tempcircle/src/interpreter.c --- stockcircle/src/interpreter.c Fri May 18 17:23:42 2001 +++ tempcircle/src/interpreter.c Tue Dec 18 20:11:07 2001 @@ -185,6 +185,8 @@ ACMD(do_wizutil); ACMD(do_write); ACMD(do_zreset); +ACMD(do_prereq); + /* This is the Master Command List(tm). @@ -313,7 +315,7 @@ cpp_extern const struct command_info cmd { "growl" , POS_RESTING , do_action , 0, 0 }, { "gsay" , POS_SLEEPING, do_gsay , 0, 0 }, { "gtell" , POS_SLEEPING, do_gsay , 0, 0 }, - + { "prereq" , POS_SLEEPING, do_prereq , 0, 0 }, { "help" , POS_DEAD , do_help , 0, 0 }, { "handbook" , POS_DEAD , do_gen_ps , LVL_IMMORT, SCMD_HANDBOOK }, { "hcontrol" , POS_DEAD , do_hcontrol , LVL_GRGOD, 0 }, diff -uNrp stockcircle/src/spec_procs.c tempcircle/src/spec_procs.c --- stockcircle/src/spec_procs.c Thu Jun 28 16:03:54 2001 +++ tempcircle/src/spec_procs.c Mon Dec 17 18:26:36 2001 @@ -179,11 +179,37 @@ SPECIAL(guild) send_to_char("You are already learned in that area.\r\n", ch); return (1); } - send_to_char("You practice for a while...\r\n", ch); - GET_PRACTICES(ch)--; - percent = GET_SKILL(ch, skill_num); percent += MIN(MAXGAIN(ch), MAX(MINGAIN(ch), int_app[GET_INT(ch)].learn)); + +/**** Does the Player have the Prerequisites? ****/ + if (spell_info[skill_num].first_prereq[(int) GET_CLASS(ch)]!= TYPE_UNDEFINED) + { + /* is there a first prereq? if so check they have practiced it */ + if (percent >= GET_SKILL(ch,spell_info[skill_num].first_prereq[(int) GET_CLASS(ch)])) + { + sprintf(buf, "But your skill in %s is only %d%%\r\n", + spell_info[spell_info[skill_num].first_prereq[(int) GET_CLASS(ch)]].name, + GET_SKILL(ch,spell_info[skill_num].first_prereq[(int) GET_CLASS(ch)])); + send_to_char(buf, ch); + return 1; + } + if (spell_info[skill_num].second_prereq[(int) GET_CLASS(ch)]!= TYPE_UNDEFINED) + { + /* is there a second prereq? if so check they have practiced it */ + if (percent >= GET_SKILL(ch,spell_info[skill_num].second_prereq[(int) GET_CLASS(ch)])) + { + sprintf(buf, "But your skill in %s is only %d%%\r\n", + spell_info[spell_info[skill_num].second_prereq[(int) GET_CLASS(ch)]].name, + GET_SKILL(ch,spell_info[skill_num].second_prereq[(int) GET_CLASS(ch)])); + send_to_char(buf, ch); + return 1; + } + } + } + + send_to_char("You practice for a while...\r\n", ch); + GET_PRACTICES(ch)--; SET_SKILL(ch, skill_num, MIN(LEARNED(ch), percent)); diff -uNrp stockcircle/src/spell_parser.c tempcircle/src/spell_parser.c --- stockcircle/src/spell_parser.c Thu Jun 28 16:03:54 2001 +++ tempcircle/src/spell_parser.c Tue Dec 18 19:58:13 2001 @@ -642,7 +642,7 @@ ACMD(do_cast) -void spell_level(int spell, int chclass, int level) +void spell_level(int first_prereq, int second_prereq, int spell, int chclass, int level) { int bad = 0; @@ -662,9 +662,22 @@ void spell_level(int spell, int chclass, level, LVL_IMPL); bad = 1; } + + if (first_prereq < 0 || first_prereq > TOP_SPELL_DEFINE) { + log("SYSERR: attempting to assign illegal first pre-requisite spellnum of %d to spellnum %d/%d", first_prereq, spell, TOP_SPELL_DEFINE); + bad =1; + } + + if (second_prereq < 0 || second_prereq > TOP_SPELL_DEFINE) { + log("SYSERR: attempting to assign illegal second pre-requiste spellnum of %d to spellnum %d/%d", second_prereq, spell, TOP_SPELL_DEFINE); + bad =1; + } - if (!bad) + if (!bad){ spell_info[spell].min_level[chclass] = level; + spell_info[spell].first_prereq[chclass] = first_prereq; + spell_info[spell].second_prereq[chclass] = second_prereq; + } } @@ -685,6 +698,10 @@ void spello(int spl, const char *name, i spell_info[spl].routines = routines; spell_info[spl].name = name; spell_info[spl].wear_off_msg = wearoff; + for (i = 0; i < NUM_CLASSES; i++) + spell_info[spl].first_prereq[i] = TYPE_UNDEFINED; + for (i = 0; i < NUM_CLASSES; i++) + spell_info[spl].second_prereq[i] = TYPE_UNDEFINED; } @@ -702,6 +719,10 @@ void unused_spell(int spl) spell_info[spl].violent = 0; spell_info[spl].routines = 0; spell_info[spl].name = unused_spellname; + for (i = 0; i < NUM_CLASSES; i++) + spell_info[spl].first_prereq[i] = TYPE_UNDEFINED; + for (i = 0; i < NUM_CLASSES; i++) + spell_info[spl].second_prereq[i] = TYPE_UNDEFINED; } #define skillo(skill, name) spello(skill, name, 0, 0, 0, 0, 0, 0, 0, NULL); diff -uNrp stockcircle/src/spells.h tempcircle/src/spells.h --- stockcircle/src/spells.h Thu May 10 13:11:56 2001 +++ tempcircle/src/spells.h Mon Dec 17 18:16:08 2001 @@ -177,6 +177,8 @@ struct spell_info_type { int targets; /* See below for use with TAR_XXX */ const char *name; const char *wear_off_msg; + int first_prereq[NUM_CLASSES]; /* prerequisite skill/spell one */ + int second_prereq[NUM_CLASSES]; /* prerequisite skill/spell two */ }; /* Possible Targets: @@ -267,6 +269,6 @@ int cast_spell(struct char_data *ch, str /* other prototypes */ -void spell_level(int spell, int chclass, int level); +void spell_level(int first_prereq,int second_prereq, int spell, int chclass, int level); void init_spell_levels(void); const char *skill_name(int num);