<< ROMANCE MODULE v.0.93 >> Code/Installfile By Yoru-Hikage (E-mail: yoru@mindspring.com) N.B.: If you have installed Romance Module v0.9, you probably have noticed it was VERY VERY BUGGY. I cannot begin to express how sorry I am for releasing that code before adding the load/save routines.. This code has been FULLY TESTED, and should have NO PROBLEMS. Well, as far as I know, anyway.. ** IMPORTANT ** Note that, if you do not know how to add/remove values to your playerfiles manually, you may require a PWIPE to make this work correctly. Just a word of warning. Also, installing v0.93 will again add values to the playerfiles above what was added in 0.90.2. ** IMPORTANT ** Note that this was written and tested on a STOCK CIRCLE 3.0 test MUD. If you have ASCII playerfiles or some other significant modification of Circle 3.0, you will need to adapt the load/save routines and playerfile additions to suit your MUD. This specific modification was written on Stock Circle 3.0 Build 13. ** IMPORTANT - C compiler users, please read! ** In some of the code, I used, out of habit, the C++ line-comment command "//". Your compiler may or may not support this, meaning that it may produce unsavory errors. To fix this, you can change "//" to "/*" and put a "*/" at the end of the comment. In case you've already installed a previous version of Romance Module, just overwrite the previous code with the new code. This ensures that all the bugs I crunched out are fixed. Note that, when asked to find something or add something, ignore the ">" marks before the text/code. This is to help you distinguish between installfile text and the stuff you want to put into/find in the code files. ^_^ Along with this installfile, you should have received 9 more files, called: act_informative_c act_other_c db_c interpreter_c limits_c structs_h utils_h act_movement_c act_wizard_c These correspond the Circle SRC files of the same names as when you replace the underscores with dots. (act_informative_c --> act.informative.c) To install: OPEN act_informative_c in a plain text editor. Go down to < Section 1 >. Copy everything between the beginning and ending tags of Section 1, then open act.informative.c in the MUD source code. Go down to the END of void look_at_char, before the line of send_to_char(buf, ch). It should look like this: > } > send_to_char(buf, ch); > } Paste it JUST ABOVE the send_to_char() command. Next, go back to act_informative_c, and copy the contents of Section 2. Go back to act.informative.c, and scroll down until you're at the end of ACMD(do_score). It should look like this: > if (PRF_FLAGGED(ch, PRF_SUMMONABLE)) > strcat(buf, "You are summonable by other players.\r\n"); > send_to_char(buf, ch); > } Paste it JUST ABOVE the send_to_char() command. ^_^ Go back to act_informative_c and copy the contents of Section 3. Scroll back up to the top of act.informative.c until you're at the end of the extern function declarations. It probably looks like this: >char *title_female(int chclass, int level); >struct time_info_data real_time_passed(time_t t2, time_t t1); > >void show_obj_to_char(struct obj_data * object, struct char_data * ch, Paste between that final struct and the first function. Save/Close act.informative.c and act_informative_c. OPEN act_other_c, copy the entire chunk of Section 1 code, and paste it at the end of act.other.c. You can actually put it between anything in act.other.c, but it's most convenient to put it at the bottom. Head back to act_other_c and copy the block of section 2 code in. NOW, go back up to the top of the act.other.c file, and find the following: > /* extern procedures */ > void list_skills(struct char_data * ch); > void appear(struct char_data * ch); > void perform_immort_vis(struct char_data *ch); > SPECIAL(shop_keeper); > ACMD(do_gen_comm); > void die(struct char_data * ch); > void Crash_rentsave(struct char_data * ch, int cost); At the end of this list, paste the section 2 code in. There's a lot of toggles there. Most are self-explanitory, but I'll go over them. If you'd like to allow same-sex relationships, change SAME_SEX_ALLOWED to TRUE. Note that I'm assuming that in your MUD's universe, it is a biological impossibility for same-sex characters to impregnate each other. If you'd like to enable this, feel free to try. If you'd like to ban out-of-wedlock conception, just change OUT_OF_WEDLOCK to FALSE. If you don't feel that the mother should get a stat reward after giving birth, change REWARD_ALLOWED to FALSE. You can then ignore (but not remove!) all the (stat)_REWARD defines. If you would like to give a stat reward, just modify the (stat)_REWARD defines until they fit what you like. Note that you don't have to worry about maximum limits. The birthing routine that will add the rewards (if enabled) also calls the normalization function which will keep stats at or below the maximum. If you would like to ban abortions, just change ABORT_ALLOWED to FALSE. Don't mess with the MONTH defines or you could get some nasty results. Save and close act.other.c and act_other_c. Now OPEN db_c and db.c. Scroll down in db.c until you get to the end of store_to_char(). It should look like this: > } > } /* store_to_char */ Copy section 1 from db_c and paste it above that last bracket. It'll look this this now: > } > /* RomanceMod additions */ > ROMANCE(ch) = st->romance; > PARTNER(ch) = str_dup(st->partner); > PREG(ch) = st->ticks_left; // MatingMod additions > } /* store_to_char */ Now go down to the bottom of char_to_store(), where it looks like this: > /* affect_total(ch); unnecessary, I think !?! */ > } /* Char to store */ Copy the code from Section 2 of db_c and paste it above that last bracket, so it looks like this: > /* affect_total(ch); unnecessary, I think !?! */ > /* RomanceMod additions! */ > st->romance = ROMANCE(ch); > if(PARTNER(ch)) > strcpy(st->partner, PARTNER(ch)); > else > *st->partner = '\0'; > st->ticks_left = PREG(ch); /* MatingMod Additions */ > } /* Char to store */ Next, scroll down to the middle of void init_char(), where it looks like this: > set_title(ch, NULL); > > ch->player.short_descr = NULL; > ch->player.long_descr = NULL; > ch->player.description = NULL; > > ch->player.hometown = 1; Copy Section 3 from db_c and paste it between the description and hometown initialization, so it now looks like this: > set_title(ch, NULL); > > ch->player.short_descr = NULL; > ch->player.long_descr = NULL; > ch->player.description = NULL; > /* Romance Initialization, initialize to no partner, and single */ > ch->player.romance = 0; > ch->player.partner = NULL; > > ch->player.hometown = 1; Next, copy section 4 from db_c and go down until you find the code snippet where height and weight are defined. It should look something like this: > /* make favors for sex */ > if (ch->player.sex == SEX_MALE) { > ch->player.weight = number(120, 180); > ch->player.height = number(160, 200); > } else { > ch->player.weight = number(100, 160); > ch->player.height = number(150, 180); > } OVERWRITE this old code with the new snippet, and it'll look like this: > /* make favors for sex */ /* Includes MatingMod additions */ > if (ch->player.sex == SEX_MALE) { > ch->player.weight = number(120, 180); > ch->player.height = number(160, 200); > PREG(ch) = MALE; > } else { > ch->player.weight = number(100, 160); > ch->player.height = number(150, 180); > PREG(ch) = NOT_PREG; /* End MatingMod Additions */ > } Save and close db.c and db_c. OPEN interpreter.c and interpreter_c. Scroll down to the end of the ACMD listing, which the .c file calls the prototypes for do_x functions. In stock circle, the last command is: > ACMD(do_zreset); Copy Section 1 from interpreter_c and paste it after that line. Next, scroll down to the end of the MASTER COMMAND LIST. The last lines of it in Stock Circle is: > { "zreset" , POS_DEAD , do_zreset , LVL_GRGOD, 0 }, > > { "\n", 0, 0, 0, 0 } }; /* this must be last */ Copy Section 2 from interpreter_c and paste it just above the last line (which states that it must be last). It looks like this: > { "zreset" , POS_DEAD , do_zreset , LVL_GRGOD, 0 }, > /* Romance Module Command List */ > { "askout" , POS_RESTING , do_askout , 1, 0 }, > { "accept" , POS_RESTING , do_accept , 1, 0 }, > { "reject" , POS_RESTING , do_reject , 1, 0 }, > { "propose" , POS_STANDING, do_propose , 1, 0 }, > { "breakup" , POS_STANDING, do_breakup , 1, 0 }, > { "marry" , POS_STANDING, do_marry , LVL_GOD, 0 }, > { "divorce" , POS_STANDING, do_divorce , 1, 0 }, > /* End Romance Module Command List */ > /* MatingMod Command List */ > { "conceive" , POS_STANDING, do_conceive , 1, 0}, > { "agree" , POS_STANDING, do_agree , 1, 0}, > { "deny" , POS_STANDING, do_deny , 1, 0}, > { "abort" , POS_RESTING , do_abort , LVL_GOD, 0}, > { "nomating" , POS_SLEEPING, mate_toggle , 1, 0 }, > /* End Mating Module Command List */ > { "\n", 0, 0, 0, 0 } }; /* this must be last */ Tailor the levels and command names (especially "nomating"... Many MUDs already have an ignore command, I needed to make sure there were as few duplicates as possible.) to your liking. A note on nomating: If you'd like to, you can edit the toggle command to do the same thing. I chose not to. Save and close interpreter.c and interpreter_c. OPEN limits_c and limits.c. In limits.c, scroll down to the end of void point_update()'s section for CHARACTERS. It should be something like this: > if (GET_LEVEL(i) < idle_max_level) > check_idling(i); > } > } > > /* objects */ Copy section 1 of limits_c and paste it between the last two parentheses: > if (GET_LEVEL(i) < idle_max_level) > check_idling(i); > } ***** PASTE HERE ***** > } > > /* objects */ Next, scroll up to the top of point_update, where hunger and thirst are modified. It should look like this: /* characters */ > for (i = character_list; i; i = next_char) { > next_char = i->next; > gain_condition(i, FULL, -1); > gain_condition(i, DRUNK, -1); > gain_condition(i, THIRST, -1); > > if (GET_POS(i) >= POS_STUNNED) { Copy section 2 and overwrite the three "gain_condition"s with the new code. Save and close limits.c and limits_c. OPEN structs.h and structs_h. Go down until you find where the rent codes are defined. It's just above this: > /* other #defined constants **********************************************/ Copy and paste Section 1 of structs_h above that line. Next, scroll down to struct char_player_data. It should look like this: > ubyte weight; /* PC / NPC's weight */ > ubyte height; /* PC / NPC's height */ >}; Before the bracket, copy and paste Section 2 of structs_h into structs.h. It looks like this: > ubyte weight; /* PC / NPC's weight */ > ubyte height; /* PC / NPC's height */ > int romance; /* Romance Involvement Variable */ > char *partner; /* Name of Romance Partner */ > /* MatingMod Variables (2)*/ > int ticks_left; /* Timer variable */ >}; Next, scroll down to the end of struct char_file_u. It looks like this: > time_t last_logon; /* Time (in secs) of last logon */ > char host[HOST_LENGTH+1]; /* host of last logon */ > char host[HOST_LENGTH+1]; /* host of last logon */ > >}; Copy and paste section 3 of structs_h into the space just before the bracket. It should look like this: > time_t last_logon; /* Time (in secs) of last logon */ > char host[HOST_LENGTH+1]; /* host of last logon */ > char host[HOST_LENGTH+1]; /* host of last logon */ > > /* RomanceMod additions */ > int romance; > char partner[MAX_NAME_LENGTH+1]; // Romance Variables > // MatingMod > int ticks_left; // Ticks left > >}; Save and close structs.h and structs_h. Now open utils.h and utils_h. Scroll down until you get to the char utils. At the end of that sequence, copy and paste Section 1 of utils_h into the file. Note that this can be put anywhere in utils.h, but it's easier to locate later if at the end of the char utils sequence. So, here: > #define IS_GOOD(ch) (GET_ALIGNMENT(ch) >= 350) > #define IS_EVIL(ch) (GET_ALIGNMENT(ch) <= -350) > #define IS_NEUTRAL(ch) (!IS_GOOD(ch) && !IS_EVIL(ch)) > > > /* descriptor-based utils ************************************************/ Paste it just above the comment line denoting the beginning of the descriptor-based utils. ^_^ Save and close utils.h and utils_h. Next, open act_movement_c and act.movement.c. Copy section 1, as usual. Find the end of the extern function declarations in act.movement.c, which might look something like this: >void death_cry(struct char_data *ch); >int find_eq_pos(struct char_data * ch, struct obj_data * obj, char *arg); Paste section 1 in after that bit of code. Next, copy section 2 and find the do_simple_move function. Paste the code in before the "you're too exhausted bit" but after need_movement is calculated. Prior to pasting, it'll look something like this: > /* move points needed is avg. move loss for src and destination sect type */ > need_movement = (movement_loss[SECT(ch->in_room)] + > movement_loss[SECT(EXIT(ch, dir)->to_room)]) / 2; > if (GET_MOVE(ch) < need_movement && !IS_NPC(ch)) { Insert section 2 just above that "if" statement. Save and close act.movement.c and act_movement_c. The last bit of code is a command for immortals to be able to modify the remaining time left in a pregnancy. If you like, you can leave this bit out. It is a modification of the "set" command. Open act_wizard_c and act.wizard.c First, got to the end of the list of set commands available. It might look like this: > { "sex", LVL_GRGOD, BOTH, MISC }, > { "age", LVL_GRGOD, BOTH, NUMBER }, > { "\n", 0, BOTH, MISC } > }; Copy section 1 from act_wizard_c and paste it in just before the line with the "\n" command. IT MUST GO THERE! Next, copy section 2. Find the huge switch(mode) codeblock. Find the end of Case 48 or whatever the last Case is. Note that you must put the code after the last Case number but before the default case. If the last number is not case 48, make sure that the case number in the new codeblock is changed to one more than the previous case number. (This is basic C code.. You should probably know why you're doing this.) Anyway, paste in section 2 between the default case and the last Break. It should initially look like this: > break; > default: Paste section two in between those two statements. Save and close act_wizard_c and act.wizard.c. And now, RomanceModule 0.93 is installed in your code. Compile and make the source again, test it out, and hope for the best. In addition, you may need to PWIPE at this point in order for existing players to be able to use this properly. Or maybe not. It depends on how your MUD is set up. But I warned you about that already, no? ^_^ < END INSTALLFILE > -- Version History v0.93 ----- -- Bugfixes for MatingMod -- Optimization of MatingMod -- Bugfixed the toggle -- Fixed installfile formatting (no more run-on lines!) v0.92 (Not a public release) ----- -- Initial MatingMod additions -- Added toggle for mating/dating. -- Small bugfixes for 0.90.2 v0.90.2 ------- -- Fixed load/save routine bugs. -- Fixed forced-accept bug. -- First version that actually works after a character leaves the MUD. v0.9 ------ -- Original, premature release. Very buggy. Should NOT have been released. -_- < END VH > For comments/questions/etc., reach me at yoru@mindspring.com ^_^