Who: JasonYarber@hotmail.com What: Recall When: May 17, 2002 Where: act.other.c, db.c Why: This will add a recall command with the ability to set your recall room to whatever room you happen to be in, and reset it back to the mortal start room. The room that your recall is set to, is also saved with the character if your using ascii pfiles. How: ------------------------------------------------------------------------------ @@ Open act.other.c and at the bottom of the file add: ACMD(do_recall) { extern sh_int r_mortal_start_room; one_argument(argument, arg); if (IS_NPC(ch)) { send_to_char("Monsters can't recall!!\r\n", ch); return; } if (GET_RECALL(ch) <= 1) // Simply sanity check to avoid a crash GET_RECALL(ch) = r_mortal_start_room; if (!*arg) { if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_NORECALL)) { send_to_char("A magical shroud prevents recall!\r\n", ch); return; } send_to_char("Recalling.\r\n", ch); act("$n recalls.", TRUE, ch, 0, 0, TO_ROOM); char_from_room(ch); char_to_room(ch, GET_RECALL(ch)); act("$n appears in a swirling mist.", TRUE, ch, 0, 0, TO_ROOM); look_at_room(ch, 0); return; } else if (!str_cmp(arg, "set")) { sprintf(buf, "Recall set.\r\n"); send_to_char(buf, ch); GET_RECALL(ch) = IN_ROOM(ch); return; } else if (!str_cmp(arg, "reset")) { sprintf(buf, "Recall reset.\r\n"); send_to_char(buf, ch); GET_RECALL(ch) = r_mortal_start_room; return; } else { sprintf(buf, "Recall what?\r\n"); return; } } @@ Save and close act.other.c ------------------------------------------------------------------------------- @@ Open interpreter.c and in the function prototypes add in: ACMD(do_recall); @@ Go into the Master Command list below the function prototypes and add: { "recall" , POS_RESTING , do_recall , 0, 0 }, @@ Save and close interpreter.c ------------------------------------------------------------------------------- @@ Open db.c and in int load_char(char *name, struct char_data *ch) look for: GET_LOADROOM(ch) = PFDEF_LOADROOM; @@ Immediatly under that put: GET_RECALL(ch) = PFDEF_RECALLROOM; @@ In the same function look for: if(!strcmp(tag, "Room")) { GET_LOADROOM(ch) = num; IN_ROOM(ch) = num; } @@ Change it to: if(!strcmp(tag, "Recl")) GET_RECALL(ch) = num; else if(!strcmp(tag, "Room")) { GET_LOADROOM(ch) = num; IN_ROOM(ch) = num; } @@ In void save_char(struct char_data * ch, room_rnum load_room) look for: if(GET_LOADROOM(ch) != PFDEF_LOADROOM) fbprintf(fl, "Room: %d\n", GET_LOADROOM(ch)); @@ Immediatly under that put: if(GET_RECALL(ch) != PFDEF_RECALLROOM) fbprintf(fl, "Recl: %d\n", GET_RECALL(ch)); @@ Save and close db.c ------------------------------------------------------------------------------- @@ Open structs.h and in struct char_data look for: room_rnum was_in_room; @@ Immediatly under that put: room_rnum recall_room; @@ Save and close structs.h ------------------------------------------------------------------------------- @@ Open pfdefaults.h and look for: #define PFDEF_LOADROOM @@ Immediately under that put: #define PFDEF_RECALLROOM 0 @@ Save and close pfdefaults.h ------------------------------------------------------------------------------- @@ Open utils.h and look for: #define GET_AGE(ch) @@ Immediatly under that put: #define GET_RECALL(ch) ((ch)->recall_room) @@ Save and close utils.h ------------------------------------------------------------------------------- I think that's everything that needs to be done, it's been a while since I actually created this, so it took me a bit to remember what all I did, but it should all be there.