Name : Quell_Patch Version : PennMUSH 1.7.7p23 Credits : Pelle Haukali Files : src/cmdlocal.c, src/flaglocal.c Syntax : patch -p0 < Quell_Patch This command adds the @QUELL command, without help files. It's a Wiz/Roy only command. For wizards, it demotes you temporarily to Mortal, and re-sets the flag when the command is used again (a toggle). It does the same for ROYALS. Wizards may specify the ROYAL switch to be temp-demoted to ROYALTY. Also adds flags: QUELL_W, QUELL_R (Internal). *** cmdlocal.c.old Fri Oct 10 17:39:46 2003 --- cmdlocal.c Fri Oct 10 17:39:16 2003 *************** *** 23,28 **** --- 23,30 ---- #include "lock.h" #include "log.h" + #define Quell(x) (has_flag_by_name(player, "QUELL_W", NOTYPE) || has_flag_by_name(player, "QUELL_R", NOTYPE) || has_flag_by_name(player, "QUELL_WR", NOTYPE)) + extern HASHTAB htab_reserved_aliases; /* Called during the command init sequence before any commands are *************** *** 46,51 **** --- 48,101 ---- reserve_alias("D"); } + COMMAND (cmd_local_quell) { + + if(God(player)){ + notify(player,T("You must first leave a letter of resignation.")); + return; + } + + if (SW_ISSET(sw, SWITCH_ROYAL) && !Wizard(player)) { + notify(player, "You rub your magic lamp but nothing happens."); + return; + } + + if (Wizard(player) && !Quell(player) && SW_ISSET(sw, SWITCH_ROYAL)) { + notify(player, "You give away your staff and pick up a scepter."); + set_flag(1, player, "WIZARD", 1, 0, 0); + set_flag(1, player, "ROYAL", 0, 0, 0); + set_flag_internal(player, "QUELL_W"); + return; + } + + if (Wizard(player) && !Quell(player)) { + notify(player, "You hand your staff to your apprentice and put on some rags."); + set_flag(1, player, "WIZARD", 1, 0, 0); + set_flag_internal(player, "QUELL_W"); + return; + } + + if (has_flag_by_name(player, "ROYAL", NOTYPE) && !Quell(player)) { + notify(player, "You hand your scepter to your evil twin and put on some rags."); + set_flag(1, player, "ROYAL", 1, 0, 0); + set_flag_internal(player, "QUELL_R"); + return; + } + + if (has_flag_by_name(player, "QUELL_R", NOTYPE)) { + notify(player, "Hurray! Your evil twin returns the scepter, grumbling."); + set_flag(1, player, "ROYAL", 0, 0, 0); + clear_flag_internal(player, "QUELL_R"); + return; + } + + if (has_flag_by_name(player, "QUELL_W", NOTYPE)) { + notify(player, "Your apprentice shoves your staff in your face."); + set_flag(1, player, "WIZARD", 0, 0, 0); + clear_flag_internal(player, "QUELL_W"); + return; + } + } /* Called during the command init sequence. * This is where you'd put calls to command_add to insert a local *************** *** 64,67 **** --- 114,118 ---- void local_commands() { + command_add("@QUELL", CMD_T_ANY, "WIZARD ROYAL QUELL_R QUELL_W", 0, "ROYAL", cmd_local_quell); } *** flaglocal.c.old Fri Oct 10 17:44:22 2003 --- flaglocal.c Fri Oct 10 17:44:01 2003 *************** *** 34,37 **** --- 34,39 ---- void local_flags() { + add_flag("QUELL_R", 0, TYPE_PLAYER, F_INTERNAL, F_ANY); + add_flag("QUELL_W", 0, TYPE_PLAYER, F_INTERNAL, F_ANY); }