ACMD(do_contact) Ah, yes, meddling in mortal affairs, playing with the peasants' minds... such is the life of an immortal. Come to mortals as visions, or place thoughts in their minds, and you're bound to leave a mark. Contact is a mortal command to contact the immortal who last screwed with their head. Here's how it works: when an immortal uses the 'send' command to get in touch with a player, that imm's name gets stored as the player's contact. The player can then type 'contact' (arguments are ignored... there's no choice as to who they can contact) and, if the immortal is online, visible or not, they will receive a message that the player is trying to contact them. If the immortal is not online, or the player has no contact, then they get a message saying that their calls go unanswered. The player will keep that immortal as a contact until either another immortal uses 'send' on them, or a LVL_GOD+ does 'set player contact off'. You can also set a player's contact using the set command. This is a great thing for personal quests, or, if you just like screwing with mortals :) I suggest you backup the following files before doing anything. Also, if you do not have ascii pfiles, I have made a change to the player_special_data_saved struct, and it will screw up the pfiles. Files affected: act.comm.c act.wizard.c db.c interpreter.c structs.h utils.h --------------------------------------- ACT.COMM.C add to external func protos: struct char_data *find_char(long n); add to local protos: ACMD(do_contact); add the following func: ACMD(do_contact) { struct char_data *contact; if (GET_CONTACT(ch)) { if ((contact = find_char(get_id_by_name(GET_CONTACT(ch)))) != NULL) { if (STATE(contact->desc) == CON_PLAYING) { sprintf(buf, "%s is trying to contact you.\r\n", GET_NAME(ch)); send_to_char(buf, contact); sprintf(buf, "You attempt to contact %s.\r\n", GET_NAME(contact)); send_to_char(buf, ch); return; } } } send_to_char("Your calls seem to go unanswered.\r\n", ch); } ACT.WIZARD.C add the following func (prototype at top if necessary): int set_contact(struct char_data *ch, char *name) { if (!strcmp(name, "off")) { free(GET_CONTACT(ch)); return TRUE; } if (get_id_by_name(name) < 0) return FALSE; if (GET_CONTACT(ch) != NULL) free(GET_CONTACT(ch)); GET_CONTACT(ch) = str_dup(name); return TRUE; } in do_send, after the send_to_char("\r\n", vict);: if (GET_LEVEL(vict) < LVL_IMMORT) { if (GET_CONTACT(vict) != NULL) { if (strcmp(GET_CONTACT(vict), GET_NAME(ch))) result = set_contact(vict, GET_NAME(ch)); } else result = set_contact(vict, GET_NAME(ch)); } and add int result; to the variable definitions. in do_set, add to the set_struct: { "contact", LVL_GOD, PC, MISC }, add case to perform_set: case 59: // or whatever the next number is if (GET_LEVEL(vict) >= LVL_IMMORT) { send_to_char("Can't set that on Immortals!\r\n", ch); return (0); } if (set_contact(vict, val_arg)) sprintf(output, "%s's contact is now: %s", GET_NAME(vict), ((GET_CONTACT(vict) != NULL) ? GET_CONTACT(vict) : "off")); else { send_to_char("Invalid contact name.\r\n", ch); return (0); } break; in do_stat_character, somewhere in PC section: sprintf(buf, "Contact: %s\r\n", ((GET_CONTACT(k) != NULL) ? GET_CONTACT(k) : "Nobody")); send_to_char(buf, ch); DB.C in save_char add: if(GET_CONTACT(ch) != NULL) fbprintf(fl, "Cont: %s\n", GET_CONTACT(ch)); in load_char: add to initializations: GET_CONTACT(ch) = NULL; in the tag switch add to case C: else if(!strcmp(tag, "Cont")) GET_CONTACT(ch) = str_dup(line); INTERPRETER.C add to the ACMD protos: ACMD(do_contact); add to the master command list: { "contact" , "cont" , POS_RESTING , do_contact , 0, 0 }, STRUCTS.H add to struct player_special_data_saved: char *contact; /* name of immortal contact */ //WARNING: if you do not have ascii pfiles, this will screw up your playerfile. UTILS.H add to the player macros: #define GET_CONTACT(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.contact)) ------------------------------------- As per the standard disclaimer, I am not responsible if this screws up your mud. I warned you to backup first. As usual, if you have any problems with this, or have any further questions as to its use, please feel free to contact me at cheron@arcanerealms.org. If you use this, please, I ask that you send me an email simply stating that you are using it. I don't need to go in your credits, but if you wish to do so, feel free. I'd just like an email. Hope you enjoy! Cathy Gore aka Cheron, Arcane Realms