From 6e584e104e48b8257480d8c5be304aee7b41240a Mon Sep 17 00:00:00 2001 From: Rumble Date: Mon, 15 Jan 2007 01:52:48 +0000 Subject: [PATCH] Updated Changelog and helpfiles and put do_gen_tog back in, doh! still want the old commands too. --- src/act.other.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++ src/interpreter.c | 22 +++++++- 2 files changed, 159 insertions(+), 2 deletions(-) diff --git a/src/act.other.c b/src/act.other.c index fc446c0..a217978 100644 --- a/src/act.other.c +++ b/src/act.other.c @@ -56,6 +56,7 @@ ACMD(do_report); ACMD(do_split); ACMD(do_use); ACMD(do_display); +ACMD(do_gen_tog); ACMD(do_gen_write); ACMD(do_file); @@ -793,6 +794,144 @@ ACMD(do_gen_write) send_to_char(ch, "Okay. Thanks!\r\n"); } +#define TOG_OFF 0 +#define TOG_ON 1 + +#define PRF_TOG_CHK(ch,flag) ((TOGGLE_BIT(PRF_FLAGS(ch), (flag))) & (flag)) + +ACMD(do_gen_tog) +{ + long result; + + const char *tog_messages[][2] = { + {"You are now safe from summoning by other players.\r\n", + "You may now be summoned by other players.\r\n"}, + {"Nohassle disabled.\r\n", + "Nohassle enabled.\r\n"}, + {"Brief mode off.\r\n", + "Brief mode on.\r\n"}, + {"Compact mode off.\r\n", + "Compact mode on.\r\n"}, + {"You can now hear tells.\r\n", + "You are now deaf to tells.\r\n"}, + {"You can now hear auctions.\r\n", + "You are now deaf to auctions.\r\n"}, + {"You can now hear shouts.\r\n", + "You are now deaf to shouts.\r\n"}, + {"You can now hear gossip.\r\n", + "You are now deaf to gossip.\r\n"}, + {"You can now hear the congratulation messages.\r\n", + "You are now deaf to the congratulation messages.\r\n"}, + {"You can now hear the Wiz-channel.\r\n", + "You are now deaf to the Wiz-channel.\r\n"}, + {"You are no longer part of the Quest.\r\n", + "Okay, you are part of the Quest!\r\n"}, + {"You will no longer see the room flags.\r\n", + "You will now see the room flags.\r\n"}, + {"You will now have your communication repeated.\r\n", + "You will no longer have your communication repeated.\r\n"}, + {"HolyLight mode off.\r\n", + "HolyLight mode on.\r\n"}, + {"Nameserver_is_slow changed to NO; IP addresses will now be resolved.\r\n", + "Nameserver_is_slow changed to YES; sitenames will no longer be resolved.\r\n"}, + {"Autoexits disabled.\r\n", + "Autoexits enabled.\r\n"}, + {"Will no longer track through doors.\r\n", + "Will now track through doors.\r\n"}, + {"Will no longer clear screen in OLC.\r\n", + "Will now clear screen in OLC.\r\n"}, + {"Buildwalk Off.\r\n", + "Buildwalk On.\r\n"}, + {"AFK flag is now off.\r\n", + "AFK flag is now on.\r\n"} + }; + + + if (IS_NPC(ch)) + return; + + switch (subcmd) { + case SCMD_NOSUMMON: + result = PRF_TOG_CHK(ch, PRF_SUMMONABLE); + break; + case SCMD_NOHASSLE: + result = PRF_TOG_CHK(ch, PRF_NOHASSLE); + break; + case SCMD_BRIEF: + result = PRF_TOG_CHK(ch, PRF_BRIEF); + break; + case SCMD_COMPACT: + result = PRF_TOG_CHK(ch, PRF_COMPACT); + break; + case SCMD_NOTELL: + result = PRF_TOG_CHK(ch, PRF_NOTELL); + break; + case SCMD_NOAUCTION: + result = PRF_TOG_CHK(ch, PRF_NOAUCT); + break; + case SCMD_NOSHOUT: + result = PRF_TOG_CHK(ch, PRF_NOSHOUT); + break; + case SCMD_NOGOSSIP: + result = PRF_TOG_CHK(ch, PRF_NOGOSS); + break; + case SCMD_NOGRATZ: + result = PRF_TOG_CHK(ch, PRF_NOGRATZ); + break; + case SCMD_NOWIZ: + result = PRF_TOG_CHK(ch, PRF_NOWIZ); + break; + case SCMD_QUEST: + result = PRF_TOG_CHK(ch, PRF_QUEST); + break; + case SCMD_SHOWVNUMS: + result = PRF_TOG_CHK(ch, PRF_SHOWVNUMS); + break; + case SCMD_NOREPEAT: + result = PRF_TOG_CHK(ch, PRF_NOREPEAT); + break; + case SCMD_HOLYLIGHT: + result = PRF_TOG_CHK(ch, PRF_HOLYLIGHT); + break; + case SCMD_AUTOEXIT: + result = PRF_TOG_CHK(ch, PRF_AUTOEXIT); + break; + case SCMD_CLS: + result = PRF_TOG_CHK(ch, PRF_CLS); + break; + case SCMD_BUILDWALK: + if (GET_LEVEL(ch) < LVL_BUILDER) { + send_to_char(ch, "Builders only, sorry.\r\n"); + return; + } + result = PRF_TOG_CHK(ch, PRF_BUILDWALK); + if (PRF_FLAGGED(ch, PRF_BUILDWALK)) + mudlog(CMP, GET_LEVEL(ch), TRUE, + "OLC: %s turned buildwalk on. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch)); + else + mudlog(CMP, GET_LEVEL(ch), TRUE, + "OLC: %s turned buildwalk off. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch)); + break; + case SCMD_AFK: + result = PRF_TOG_CHK(ch, PRF_AFK); + if (PRF_FLAGGED(ch, PRF_AFK)) + act("$n has gone AFK.", TRUE, ch, 0, 0, TO_ROOM); + else + act("$n has come back from AFK.", TRUE, ch, 0, 0, TO_ROOM); + break; + default: + log("SYSERR: Unknown subcmd %d in do_gen_toggle.", subcmd); + return; + } + + if (result) + send_to_char(ch, "%s", tog_messages[subcmd][TOG_ON]); + else + send_to_char(ch, "%s", tog_messages[subcmd][TOG_OFF]); + + return; +} + ACMD(do_file) { FILE *req_file; diff --git a/src/interpreter.c b/src/interpreter.c index 8a2bdec..3dde9d0 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -262,15 +262,19 @@ cpp_extern const struct command_info cmd_info[] = { { "advance" , "adv" , POS_DEAD , do_advance , LVL_GOD, 0 }, { "aedit" , "aed" , POS_DEAD , do_oasis , LVL_GOD, SCMD_OASIS_AEDIT }, { "alias" , "ali" , POS_DEAD , do_alias , 0, 0 }, + { "afk" , "afk" , POS_DEAD , do_gen_tog , 0, SCMD_AFK }, { "assist" , "as" , POS_FIGHTING, do_assist , 1, 0 }, { "ask" , "ask" , POS_RESTING , do_spec_comm, 0, SCMD_ASK }, { "astat" , "ast" , POS_DEAD , do_astat , 0, 0 }, { "auction" , "auc" , POS_SLEEPING, do_gen_comm , 0, SCMD_AUCTION }, - + { "autoexits" , "autoex" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOEXIT }, + { "backstab" , "ba" , POS_STANDING, do_backstab , 1, 0 }, { "ban" , "ban" , POS_DEAD , do_ban , LVL_GRGOD, 0 }, { "balance" , "bal" , POS_STANDING, do_not_here , 1, 0 }, { "bash" , "bas" , POS_FIGHTING, do_bash , 1, 0 }, + { "brief" , "br" , POS_DEAD , do_gen_tog , 0, SCMD_BRIEF }, + { "buildwalk", "buildwalk", POS_STANDING, do_gen_tog, LVL_BUILDER, SCMD_BUILDWALK }, { "buy" , "bu" , POS_STANDING, do_not_here , 0, 0 }, { "bug" , "bug" , POS_DEAD , do_gen_write, 0, SCMD_BUG }, @@ -281,8 +285,10 @@ cpp_extern const struct command_info cmd_info[] = { { "close" , "cl" , POS_SITTING , do_gen_door , 0, SCMD_CLOSE }, { "clear" , "cle" , POS_DEAD , do_gen_ps , 0, SCMD_CLEAR }, { "cls" , "cls" , POS_DEAD , do_gen_ps , 0, SCMD_CLEAR }, + { "clsolc" , "clsolc" , POS_DEAD , do_gen_tog , 0, SCMD_CLS }, { "consider" , "con" , POS_RESTING , do_consider , 0, 0 }, { "commands" , "com" , POS_DEAD , do_commands , 0, SCMD_COMMANDS }, + { "compact" , "comp" , POS_DEAD , do_gen_tog , 0, SCMD_COMPACT }, { "copyover" , "copyover", POS_DEAD , do_copyover , LVL_GRGOD, 0 }, { "credits" , "cred" , POS_DEAD , do_gen_ps , 0, SCMD_CREDITS }, @@ -337,6 +343,7 @@ cpp_extern const struct command_info cmd_info[] = { { "hit" , "hit" , POS_FIGHTING, do_hit , 0, SCMD_HIT }, { "hold" , "hold" , POS_RESTING , do_grab , 1, 0 }, { "holler" , "holler" , POS_RESTING , do_gen_comm , 1, SCMD_HOLLER }, + { "holylight", "holy" , POS_DEAD , do_gen_tog , LVL_IMMORT, SCMD_HOLYLIGHT }, { "house" , "house" , POS_RESTING , do_house , 0, 0 }, { "inventory", "i" , POS_DEAD , do_inventory, 0, 0 }, @@ -368,7 +375,16 @@ cpp_extern const struct command_info cmd_info[] = { { "mute" , "mute" , POS_DEAD , do_wizutil , LVL_GOD, SCMD_SQUELCH }, { "news" , "news" , POS_SLEEPING, do_gen_ps , 0, SCMD_NEWS }, + { "noauction", "noauction",POS_DEAD , do_gen_tog , 0, SCMD_NOAUCTION }, + { "nogossip" , "nogossip", POS_DEAD , do_gen_tog , 0, SCMD_NOGOSSIP }, + { "nograts" , "nograts" , POS_DEAD , do_gen_tog , 0, SCMD_NOGRATZ }, + { "nohassle" , "nohassle", POS_DEAD , do_gen_tog , LVL_IMMORT, SCMD_NOHASSLE }, + { "norepeat" , "norepeat", POS_DEAD , do_gen_tog , 0, SCMD_NOREPEAT }, + { "noshout" , "noshout" , POS_SLEEPING, do_gen_tog , 1, SCMD_NOSHOUT }, + { "nosummon" , "nosummon", POS_DEAD , do_gen_tog , 1, SCMD_NOSUMMON }, + { "notell" , "notell" , POS_DEAD , do_gen_tog , 1, SCMD_NOTELL }, { "notitle" , "notitle" , POS_DEAD , do_wizutil , LVL_GOD, SCMD_NOTITLE }, + { "nowiz" , "nowiz" , POS_DEAD , do_gen_tog , LVL_IMMORT, SCMD_NOWIZ }, { "open" , "o" , POS_SITTING , do_gen_door , 0, SCMD_OPEN }, { "order" , "ord" , POS_RESTING , do_order , 1, 0 }, @@ -390,6 +406,7 @@ cpp_extern const struct command_info cmd_info[] = { { "quaff" , "qua" , POS_RESTING , do_use , 0, SCMD_QUAFF }, { "qecho" , "qec" , POS_DEAD , do_qcomm , LVL_GOD, SCMD_QECHO }, + { "quest" , "que" , POS_DEAD , do_gen_tog , 0, SCMD_QUEST }, { "qui" , "qui" , POS_DEAD , do_quit , 0, 0 }, { "quit" , "quit" , POS_DEAD , do_quit , 0, SCMD_QUIT }, { "qsay" , "qsay" , POS_RESTING , do_qcomm , 0, SCMD_QSAY }, @@ -410,7 +427,8 @@ cpp_extern const struct command_info cmd_info[] = { { "redit" , "redit" , POS_DEAD , do_oasis , LVL_BUILDER, SCMD_OASIS_REDIT }, { "rlist" , "rlist" , POS_DEAD , do_oasis , LVL_BUILDER, SCMD_OASIS_RLIST }, { "rclone" , "rclone" , POS_DEAD , do_room_copy, LVL_BUILDER, 0 }, - + { "roomflags", "roomflags", POS_DEAD , do_gen_tog , LVL_IMMORT, SCMD_SHOWVNUMS }, + { "say" , "s" , POS_RESTING , do_say , 0, 0 }, { "score" , "sc" , POS_DEAD , do_score , 0, 0 }, { "sit" , "si" , POS_RESTING , do_sit , 0, 0 },