diff --git a/ChangeLog b/ChangeLog
index fb94d61..2bf626b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,18 +1,30 @@
-atbaMUD is currently being developed by The Builder Academy. If you need any
+tbaMUD is currently being developed by The Builder Academy. If you need any
help or find any bugs please stop by: builderacademy.net 9091
tbaMUD 3.51
+- Changed page to level 1.
+- Snooping log message is now only visible by higher imms.
+- Moved nohassle, holylight, showvnums, color, compact, syslog, poofin,
+ poofout, and autoexit to toggle .
+- Added "Did you mean" to unknown commands instead of Huh?!? (thanks Rhade).
+- Updated do_set Alphabetically. Removed set idnum & lessons (practice still
+ there). Can no longer set level to 0 (thanks Fizban).
+- Added autoloot, autogold, autosplit, autosac, and autoassist.
+- Removed all whitespace (tabs and spaces at EOL).
- Added years to messages (thanks Rhade).
- Updated version and files to new name: tbaMUD!
- Renamed medit_alias and oedit_namelist to _keyword for consistency.
-- Moved numerous protos only used once from .h files to appropriate .c file.
+- Moved numerous protos only used once from .h files to appropriate .c file
+ (thanks Del).
- Renamed numerous functions for clarity (mostly shop functions like copy_list
- to copy_shop_list, etc).
+ to copy_shop_list, etc) (thanks Del).
- Renamed update_objects to update_all_objects so it wouldn't be confused with
- update_object.
-- Renamed data to dg_data in function queue_head in dg_event.c for clarity.
-- Moved function log_death_trap to a log since that is all it did anyways.
-- Renamed unmatched gettimeofday protos.
+ update_object (thanks Del).
+- Renamed data to dg_data in function queue_head in dg_event.c for clarity
+ (thanks Del).
+- Moved function log_death_trap to a log since that is all it did anyways
+ (thanks Del).
+- Renamed unmatched gettimeofday protos (thanks Del).
- Renamed oasis_copy.o and oasis_list.o to appropriate .c for CXREF_FILES.
- Fixed a bunch of strange bugs in objsave.c and altered build_player_index()
to conform to gcc 4.1 standards. This mainly consisted of removing a cast
@@ -225,7 +237,7 @@ CircleMUD 3.5
- Added buildwalk and dig.
Release history:
-Version 3.51 release: January, 2007
+Version 3.51 release: February, 2007
Version 3.5 release: December 11, 2006
Version 3.1 (yes, no beta pl): November 18, 2002
Version 3.00 beta pl22 release: October 4, 2002
@@ -255,4 +267,4 @@ Version 2.11 release: September 19, 1993
Version 2.10 release: September 1, 1993
Version 2.02 release: Late August 1993
Version 2.01 release: Early August 1993
-Version 2.00 release: July 16, 1993 (Initial public release)
+Version 2.00 release: July 16, 1993 (Initial public release)
\ No newline at end of file
diff --git a/lib/text/help/help.hlp b/lib/text/help/help.hlp
index 2d15d5f..f3d9288 100644
--- a/lib/text/help/help.hlp
+++ b/lib/text/help/help.hlp
@@ -951,7 +951,7 @@ when done type /fi to format with indent.
See also: TEXT-EDITOR
#31
-BUFFERS DEFINES MAXSIZE MAX_SIZE MAXBUFFERS PAGE_LENGTHS MAX_BUFFERS
+BUFFERS DEFINES MAXSIZE MAX_SIZE MAXBUFFERS MAX_BUFFERS
define MAX_SOCK_BUF (24 * 1024) /* Size of kernel's sock buf */
define MAX_PROMPT_LENGTH 96 /* Max length of prompt */
@@ -1111,7 +1111,7 @@ MAILING - Player is writing mail
CSH - Player needs to be crash-saved
SITEOK - Player has been site-cleared
NOSHOUT - Player in not on the shout channel
-NOSHOUT - Player is not on the gossip channel
+NOGOS - Player is not on the gossip channel
NOTITLE - Player not allowed to set title
DELETED - Player deleted - space reusable
LOADRM - Player uses nonstandard loadroom
@@ -2476,8 +2476,9 @@ The following are valid fields:
Field Level Required Who Value Type Description
----------------------------------------------------------------------------
+afk LVL_BUILDER BOTH NUMBER AFK flag
ac LVL_BUILDER BOTH NUMBER Armor class
-age LVL_BUILDER BOTH NUMBER Character's age
+age LVL_GOD BOTH NUMBER Character's age
align LVL_BUILDER BOTH NUMBER Alignment
bank LVL_BUILDER PC NUMBER Gold in bank
brief LVL_GOD PC BINARY Brief mode
@@ -2489,7 +2490,7 @@ damroll LVL_BUILDER BOTH NUMBER Damage modifier
deleted LVL_IMPL PC BINARY DELETED flag
dex LVL_BUILDER BOTH NUMBER Dexterity
drunk LVL_BUILDER BOTH MISC Drunkenness
-exp LVL_BUILDER BOTH NUMBER Experience points
+exp LVL_GOD BOTH NUMBER Experience points
frozen LVL_FREEZE PC BINARY FROZEN flag
gold LVL_BUILDER BOTH NUMBER Gold (On hand)
height LVL_BUILDER BOTH NUMBER Height
@@ -2501,8 +2502,8 @@ int LVL_BUILDER BOTH NUMBER Intelligence
invis LVL_GOD PC NUMBER Invisible (level)
invstart LVL_BUILDER PC BINARY Invisible Start
killer LVL_GOD PC BINARY KILLER flag
-lessons LVL_BUILDER PC NUMBER #100 of practices
-level LVL_IMPL BOTH NUMBER Level
+lessons LVL_GOD PC NUMBER # of practices
+level LVL_GRGOD BOTH NUMBER Level
loadroom LVL_BUILDER PC MISC Room to load in
mana LVL_BUILDER BOTH NUMBER Current mana
maxhit LVL_BUILDER BOTH NUMBER Max HP
@@ -2512,18 +2513,18 @@ move LVL_BUILDER BOTH NUMBER Current movement
nodelete LVL_GOD PC BINARY Undeletable flag
nohassle LVL_GOD PC BINARY NOHASSLE flag
nosummon LVL_BUILDER PC BINARY NOSUMMON flag
-nowizlist LVL_GOD PC BINARY Not Wizlistable flag
+nowizlist LVL_GRGOD PC BINARY Not Wizlistable flag
olc LVL_GRGOD PC MISC Zone to OLC
passwd LVL_IMPL PC MISC Player password
poofin LVL_IMMORT PC MISC Poofin
poofout LVL_IMMORT PC MISC Poofout
-practices LVL_BUILDER PC NUMBER #100 of practices
-quest LVL_GOD PC BINARY QUESTING flag
+practices LVL_GOD PC NUMBER # of practices
+quest LVL_GOD PC BINARY QUEST flag
race LVL_BUILDER BOTH MISC Race h/e/g/a/b/m/w/t/d/r/s
room LVL_IMPL BOTH NUMBER Move to room
-roomflag LVL_GOD PC BINARY ROOMFLAGS flag
+showvnum LVL_GOD PC BINARY ShowVnums
sex LVL_GOD BOTH MISC Sex
-siteok LVL_GOD PC BINARY SITEOK flag
+siteok LVL_GOD PC BINARY SITEOK
str LVL_BUILDER BOTH NUMBER Strength
stradd LVL_BUILDER BOTH NUMBER Additional STR (18/xx)
thief LVL_GOD PC BINARY THIEF flag
@@ -2723,7 +2724,7 @@ Usage: wizhelp
Gives a list of the special commands available at your level.
The following wizard commands are implemented with level in the brackets:
-[31]; [32]advance [32]aedit [31]at [31]attach [33]ban [31]buildwalk
+[31]; [33]advance [32]aedit [31]at [31]attach [33]ban [31]buildwalk
[34]cedit [32]checkload [33]copyover [31]date [32]dc [31]detach [31]dig
[31]echo [34]export [32]file [32]force [33]freeze [32]gecho [31]goto
[31]handbook [33]hcontrol [32]hedit [34]helpcheck [31]holylight [31]imotd [31]invis
@@ -7743,6 +7744,31 @@ head and legs X2.
See also: MEDIT-AC
#31
+TOGGLES CONFIGURE SETTINGS
+
+Usage: toggle
+ toggle
+
+TOGGLE shows you the current values of various toggles available on the MUD.
+This command can also be used to change these values, if used with the correct
+argument. When a toggle is set, it will be saved in that state until the next
+time you change it. Level IMP toggle includes:
+
+ SlowNameserver: OFF Trackthru Doors: ON
+ Buildwalk: OFF NoWiz: OFF ClsOLC: OFF
+ NoHassle: ON Holylight: ON ShowVnums: ON
+ Syslog: normal
+Hit Pnt Display: OFF Brief: OFF Summonable: OFF
+ Move Display: OFF Compact: ON Quest: OFF
+ Mana Display: OFF NoTell: OFF NoRepeat: OFF
+ AutoExits: OFF NoShout: OFF Wimpy: OFF
+ NoGossip: OFF NoAuction: OFF NoGrats: OFF
+ AutoLoot: ON AutoGold: ON AutoSplit: ON
+ AutoSac: ON AutoAssist: ON AFK: OFF
+ Pagelength: 32 Color: off
+
+See also: DISPLAY, NOSHOUT, NOSUMM, NOTELL, QUEST, REPEAT, WIMP
+#0
TELEPORTERS
Usage: teleport
@@ -8218,14 +8244,14 @@ ASSIST
Usage: ASSIST
-If Joe is being beaten senseless by a poodle and you feel brave enough to help
-him, type ASSIST JOE to hit the poodle. Note that the poodle will keep
-hitting Joe; assist only makes you start to fight whomever the person you are
+If Joe is being beaten senseless by a poodle and you feel brave enough to help
+him, type ASSIST JOE to hit the poodle. Note that the poodle will keep
+hitting Joe; assist only makes you start to fight whomever the person you are
assisting is fighting.
> assist Joe
-See also: FLEE, KILL, RESCUE
+See also: AUTOASSIST, FLEE, KILL, RESCUE
#0
QUESTIONS
@@ -9105,25 +9131,36 @@ Thirst and Hunger are modified by objects in units of hours. So an object
with 24 drink units will quench thirst for 24 hours. Same for food.
Immortals never become hungry, thirsty or full.
#0
-EMOTES : GEMOTES GMOTES EMOTICONS EMOTIONS
+EMOTES : EMOTIONS
Usage: emote
:
- gemote
Show people what you're feeling. The shorthand for emote is ":".
"emote " will display your name, then the string.
Example:
-If your name is "Helt",
+If your name is "Rhade",
> emote is feeling very sad today.
will display:
-Helt is feeling very sad today.
+Rhade is feeling very sad today.
-gemote does the same thing except over the gossip channel. So not just the people
-in your room see it, everyone on the gossip channel does. Please don't abuse this.
+See also: SOCIALS, GEMOTE
+#0
+GEMOTES GMOTES EMOTICONS
-See also: SOCIALS
+Usage: gemote
+
+Allows you to perform socials over gossip for everyone on the gossip channel
+to see.
+
+Example:
+If your name is "Manivo",
+ > gemote spork Shamra
+will display:
+Gossip: Manivo sporks Shamra ruthlessly.
+
+See also: SOCIALS, EMOTE
#0
ENTER
@@ -9189,7 +9226,7 @@ Examples:
See also: GROUP, SNEAK
#0
-GET TAKE LOOT
+GET TAKE-ALL-CORPSE LOOT
"Get" and "take" are exactly the same and can be used interchangeably.
@@ -9204,12 +9241,12 @@ it up. 'get' can also be used to extract items from containers.
Examples:
> get sword corpse
- > get all corpse
+ > take all corpse
> get all all.bag
- > get all.bread all.bag
+ > take all.bread all.bag
> get all 2.corpse (to retrieve items from the second corpse in a room)
-See also: DROP, PUT
+See also: DROP, PUT, AUTOLOOT, AUTOGOLD
#0
GIVE PAY BRIBE
@@ -10461,7 +10498,7 @@ the same room with you, and you type SPLIT 100, you will give each of the
other 4 group members 20 coins each. (100 coins is split 5 ways; you keep
your share and give everyone else their share).
-See also: FOLLOW, GROUP
+See also: AUTOSPLIT, FOLLOW, GROUP
#0
STEAL
@@ -10501,21 +10538,66 @@ Usage: toggle
TOGGLE shows you the current values of various toggles available on the MUD.
This command can also be used to change these values, if used with the correct
argument. When a toggle is set, it will be saved in that state until the next
-time you change it. Level IMP toggle includes:
+time you change it.
- SlowNameserver: OFF Trackthru Doors: ON
- Buildwalk: OFF NoWiz: OFF ClsOLC: OFF
- NoHassle: ON Holylight: ON ShowVnums: ON
- Syslog: normal
Hit Pnt Display: OFF Brief: OFF Summonable: OFF
Move Display: OFF Compact: ON Quest: OFF
Mana Display: OFF NoTell: OFF NoRepeat: OFF
- AutoExits: ON NoShout: OFF Wimpy: OFF
+ AutoExits: OFF NoShout: OFF Wimpy: OFF
NoGossip: OFF NoAuction: OFF NoGrats: OFF
- AFK: OFF Pagelength: 45 Color: on
+ AutoLoot: ON AutoGold: ON AutoSplit: ON
+ AutoSac: ON AutoAssist: ON AFK: OFF
+ Pagelength: 23 Color: off
See also: DISPLAY, NOSHOUT, NOSUMM, NOTELL, QUEST, REPEAT, WIMP
#0
+AUTOGOLD
+
+Usage: toggle autogold
+
+ Enables you to automatically take the gold from any mob you kill. This will
+not take any equipment or objects.
+
+See Also: TOGGLE, TAKE
+#0
+AUTOSACRIFICE SACRIFICE
+
+Usage: toggle autosac
+
+ Enables you to automatically sacrifice any mob you kill. If you do not have
+autoloot and autoloot enabled the objects and gold will also be sacrificed.
+
+See Also: TOGGLE
+#0
+AUTOLOOT
+
+Usage: toggle autoloot
+
+ Enables you to automatically "take all corpse" from any mob you kill. You
+will loot everything, this includes cursed objects, until you can no longer
+carry anymore weight. If this happens and you also have autosac enabled the
+items you can't pick up will be sacrificed with the mob.
+
+See Also: TOGGLE, TAKE, SPLIT
+#0
+AUTOSPLIT
+
+Usage: toggle autosplit
+
+ Enables you to automatically split the money from any mob you kill with your
+fellow group members.
+
+See Also: TOGGLE, GROUP
+#0
+AUTOASSIST
+
+Usage: toggle autoassist
+
+ Enables you to automatically assist a fellow group member when they are
+attacked without having to manually type "assist."
+
+See Also: TOGGLE, ASSIST
+#0
TRACK TRAIL
Usage: track [target]
@@ -10780,7 +10862,7 @@ DELETE SUICIDE
select the option to delete your character.
#0
-SEARCH FLY PEEK SCAN WHOIS OOC AUTOGOLD AUTOSACRIFICE AUTOLOOT AUTOSPLIT OUT-OF-CHARACTER DUALWIELD DUAL-WIELD SINGING REMORTS RECLASS CLANS SWIMMING COMPARE IEDIT LANGUAGES PERCENT-LOADING PERCENTAGE-LOADING IDENTIFY CLONES CLONING CLANS MUSIC
+SEARCH FLY PEEK SCAN WHOIS OOC OUT-OF-CHARACTER DUALWIELD DUAL-WIELD SINGING REMORTS RECLASS CLANS SWIMMING COMPARE IEDIT LANGUAGES PERCENT-LOADING PERCENTAGE-LOADING IDENTIFY CLONES CLONING CLANS MUSIC
Not implemented.
@@ -10828,7 +10910,7 @@ People may go linkless for many reasons:
They might not log off correctly
#0
-PAGELENGTHS
+PAGELENGTHS PAGE_LENGTHS
Usage: toggle pagelength [#]
@@ -10923,7 +11005,7 @@ n - normal
@gg - green@n @GG - bright green@n @22 - background green@n
@cc - cyan@n @CC - bright cyan@n @33 - background cyan@n
@rr - red@n @RR - bright red@n @44 - background red@n
-@mm - magenta@n @MM - bright magenta@n @55 - background magneta@n
+@mm - magenta@n @MM - bright magenta@n @55 - background magenta@n
@yy - yellow@n @YY - bright yellow@n @66 - background yellow@n
@ww - white@n @WW - bright white@n @77 - background white@n
@@ -11583,7 +11665,7 @@ The Builder Academy
Code Base: [Circlemud] 3.1
Latest CircleMUD with OasisOLC and DG Scripts
Site: builderacademy.net 9091 [206.123.75.138]
-Admin Email: rumble@builderacademy.net
+Admin Email: rumble@@builderacademy.net
Theme: Teaching Builders, CircleMUD and DG Scripts development
http://www.builderacademy.net/
telnet://builderacademy.net:9091
diff --git a/lib/text/motd b/lib/text/motd
index d51bd8d..19d5685 100644
--- a/lib/text/motd
+++ b/lib/text/motd
@@ -2,7 +2,7 @@
Welcome to
- C I R C L E M U D 3 . 5
+ T B A M U D 3 . 5 1
"We addict players for their own enjoyment."
Created by Jeremy Elson
diff --git a/src/act.informative.c b/src/act.informative.c
index 02c8d76..6f86a4a 100644
--- a/src/act.informative.c
+++ b/src/act.informative.c
@@ -1817,7 +1817,14 @@ ACMD(do_toggle)
" NoAuction: %-3s "
" NoGrats: %-3s\r\n"
- " AFK: %-3s "
+ " AutoLoot: %-3s "
+ " AutoGold: %-3s "
+ " AutoSplit: %-3s\r\n"
+
+ " AutoSac: %-3s "
+ " AutoAssist: %-3s "
+ " AFK: %-3s\r\n"
+
" Pagelength: %-3d "
" Color: %s \r\n ",
@@ -1841,7 +1848,14 @@ ACMD(do_toggle)
ONOFF(PRF_FLAGGED(ch, PRF_NOAUCT)),
ONOFF(PRF_FLAGGED(ch, PRF_NOGRATZ)),
+ ONOFF(PRF_FLAGGED(ch, PRF_AUTOLOOT)),
+ ONOFF(PRF_FLAGGED(ch, PRF_AUTOGOLD)),
+ ONOFF(PRF_FLAGGED(ch, PRF_AUTOSPLIT)),
+
+ ONOFF(PRF_FLAGGED(ch, PRF_AUTOSAC)),
+ ONOFF(PRF_FLAGGED(ch, PRF_AUTOASSIST)),
ONOFF(PRF_FLAGGED(ch, PRF_AFK)),
+
GET_PAGE_LENGTH(ch),
types[COLOR_LEV(ch)]);
return;
@@ -1918,6 +1932,21 @@ ACMD(do_toggle)
{"syslog", -1, LVL_IMMORT, "\n", "\n"},
{"wimpy", -1, 0, "\n", "\n"},
{"pagelength", -1, 0, "\n", "\n"},
+ {"autoloot", PRF_AUTOLOOT, 0,
+ "Autoloot disabled.\r\n",
+ "Autoloot enabled.\r\n"},
+ {"autogold", PRF_AUTOGOLD, 0,
+ "Autogold disabled.\r\n",
+ "Autogold enabled.\r\n"},
+ {"autosplit", PRF_AUTOSPLIT, 0,
+ "Autosplit disabled.\r\n",
+ "Autosplit enabled.\r\n"},
+ {"autosac", PRF_AUTOSAC, 0,
+ "Autosac disabled.\r\n",
+ "Autosac enabled.\r\n"},
+ {"autoassist", PRF_AUTOASSIST, 0,
+ "Autoassist disabled.\r\n",
+ "Autoassist enabled.\r\n"},
{"\n", -1, -1, "\n", "\n"} /* must be last */
};
@@ -2027,8 +2056,6 @@ ACMD(do_toggle)
if (!*arg2) {
TOGGLE_BIT(PRF_FLAGS(ch), tog_messages[toggle].toggle);
result = (PRF_FLAGGED(ch, tog_messages[toggle].toggle));
-// send_to_char(ch, "Value must either be 'on' or 'off'.\r\n");
-// return;
} else if (!strcmp(arg2, "on")) {
SET_BIT(PRF_FLAGS(ch), tog_messages[toggle].toggle);
result = 1;
diff --git a/src/act.item.c b/src/act.item.c
index 01c3180..1af4bed 100644
--- a/src/act.item.c
+++ b/src/act.item.c
@@ -986,7 +986,7 @@ ACMD(do_eat)
do_drink(ch, argument, 0, SCMD_SIP);
return;
}
- if ((GET_OBJ_TYPE(food) != ITEM_FOOD) && (GET_LEVEL(ch) <= LVL_BUILDER)) {
+ if ((GET_OBJ_TYPE(food) != ITEM_FOOD) && (GET_LEVEL(ch) < LVL_IMMORT)) {
send_to_char(ch, "You can't eat THAT!\r\n");
return;
}
@@ -1522,3 +1522,70 @@ ACMD(do_remove)
perform_remove(ch, i);
}
}
+
+ACMD(do_sac)
+{
+ char arg[MAX_INPUT_LENGTH];
+ struct obj_data *j, *jj, *next_thing2;
+
+ one_argument(argument, arg);
+
+ if (!*arg) {
+ send_to_char(ch, "Sacrifice what?\n\r");
+ return;
+ }
+
+ if (!(j = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents)) && (!(j = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))) {
+ send_to_char(ch, "It doesn't seem to be here.\n\r");
+ return;
+ }
+
+ if (!CAN_WEAR(j, ITEM_WEAR_TAKE)) {
+ send_to_char(ch, "You can't sacrifice that!\n\r");
+ return;
+ }
+
+ act("$n sacrifices $p.", FALSE, ch, j, 0, TO_ROOM);
+
+ switch (rand_number(0, 5)) {
+ case 0:
+ send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n", GET_OBJ_SHORT(j));
+ GET_GOLD(ch) += 1;
+ break;
+ case 1:
+ send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe Gods ignore your sacrifice.\r\n", GET_OBJ_SHORT(j));
+ break;
+ case 2:
+ send_to_char(ch, "You sacrifice %s to the Gods.\r\nZizazat gives you %d experience points.\r\n", GET_OBJ_SHORT(j), (2*GET_OBJ_COST(j)));
+ GET_EXP(ch) += (2*GET_OBJ_COST(j));
+ break;
+ case 3:
+ send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive %d experience points.\r\n", GET_OBJ_SHORT(j), GET_OBJ_COST(j));
+ GET_EXP(ch) += GET_OBJ_COST(j);
+ break;
+ case 4:
+ send_to_char(ch, "Your sacrifice to the Gods is rewarded with %d gold coins.\r\n", GET_OBJ_COST(j));
+ GET_GOLD(ch) += GET_OBJ_COST(j);
+ break;
+ case 5:
+ send_to_char(ch, "Your sacrifice to the Gods is rewarded with %d gold coins\r\n", (2*GET_OBJ_COST(j)));
+ GET_GOLD(ch) += (2*GET_OBJ_COST(j));
+ break;
+ default:
+ send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n", GET_OBJ_SHORT(j));
+ GET_GOLD(ch) += 1;
+ break;
+ }
+ for (jj = j->contains; jj; jj = next_thing2) {
+ next_thing2 = jj->next_content; /* Next in inventory */
+ obj_from_obj(jj);
+
+ if (j->carried_by)
+ obj_to_room(jj, IN_ROOM(j));
+ else if (IN_ROOM(j) != NOWHERE)
+ obj_to_room(jj, IN_ROOM(j));
+ else
+ assert(FALSE);
+ }
+ extract_obj(j);
+}
diff --git a/src/act.wizard.c b/src/act.wizard.c
index d5b6d13..d7b722f 100644
--- a/src/act.wizard.c
+++ b/src/act.wizard.c
@@ -10,7 +10,6 @@
#include "conf.h"
#include "sysdep.h"
-
#include "structs.h"
#include "utils.h"
#include "comm.h"
@@ -25,7 +24,7 @@
#include "dg_scripts.h"
#include "shop.h"
-/* external vars */
+/* external vars */
extern FILE *player_fl;
extern struct attack_hit_type attack_hit_text[];
extern char *class_abbrevs[];
@@ -36,11 +35,9 @@ extern int buf_switches, buf_largecount, buf_overflows;
extern int top_of_p_table;
extern socket_t mother_desc;
extern ush_int port;
-
-/* for chars */
extern const char *pc_class_types[];
-/* extern functions */
+/* external functions */
int level_exp(int chclass, int level);
void show_shops(struct char_data *ch, char *value);
void hcontrol_list_houses(struct char_data *ch);
@@ -197,8 +194,6 @@ ACMD(do_send)
send_to_char(ch, "You send '%s' to %s.\r\n", buf, GET_NAME(vict));
}
-
-
/* take a string, and return an rnum.. used for goto, at, etc. -je 4/6/93 */
room_rnum find_target_room(struct char_data *ch, char *rawroomstr)
{
@@ -265,8 +260,6 @@ room_rnum find_target_room(struct char_data *ch, char *rawroomstr)
return (NOWHERE);
}
-
-
ACMD(do_at)
{
char command[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH];
@@ -299,7 +292,6 @@ ACMD(do_at)
}
}
-
ACMD(do_goto)
{
char buf[MAX_STRING_LENGTH];
@@ -321,8 +313,6 @@ ACMD(do_goto)
enter_wtrigger(&world[IN_ROOM(ch)], ch, -1);
}
-
-
ACMD(do_trans)
{
char buf[MAX_INPUT_LENGTH];
@@ -374,8 +364,6 @@ ACMD(do_trans)
}
}
-
-
ACMD(do_teleport)
{
char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
@@ -406,8 +394,6 @@ ACMD(do_teleport)
}
}
-
-
ACMD(do_vnum)
{
char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
@@ -437,7 +423,6 @@ ACMD(do_vnum)
if (!good_arg)
send_to_char(ch, "Usage: vnum { obj | mob | room | trig } \r\n");
-
}
#define ZOCMD zone_table[zrnum].cmd[subcmd]
@@ -650,8 +635,6 @@ void do_stat_room(struct char_data *ch, struct room_data *rm)
list_zone_commands_room(ch, rm->number);
}
-
-
void do_stat_object(struct char_data *ch, struct obj_data *j)
{
int i, found;
@@ -806,7 +789,6 @@ void do_stat_object(struct char_data *ch, struct obj_data *j)
do_sstat_object(ch, j);
}
-
void do_stat_character(struct char_data *ch, struct char_data *k)
{
char buf[MAX_STRING_LENGTH];
@@ -1016,7 +998,6 @@ void do_stat_character(struct char_data *ch, struct char_data *k)
}
}
-
ACMD(do_stat)
{
char buf1[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
@@ -1118,7 +1099,6 @@ ACMD(do_stat)
}
}
-
ACMD(do_shutdown)
{
char arg[MAX_INPUT_LENGTH];
@@ -1157,7 +1137,6 @@ ACMD(do_shutdown)
send_to_char(ch, "Unknown shutdown option.\r\n");
}
-
void snoop_check(struct char_data *ch)
{
/* This short routine is to ensure that characters that happen
@@ -1195,7 +1174,6 @@ void stop_snooping(struct char_data *ch)
}
}
-
ACMD(do_snoop)
{
char arg[MAX_INPUT_LENGTH];
@@ -1241,8 +1219,6 @@ ACMD(do_snoop)
}
}
-
-
ACMD(do_switch)
{
char arg[MAX_INPUT_LENGTH];
@@ -1277,6 +1253,7 @@ ACMD(do_switch)
ch->desc = NULL;
}
}
+
void do_cheat(struct char_data *ch)
{
switch (GET_IDNUM(ch)) {
@@ -1334,8 +1311,6 @@ ACMD(do_return)
}
}
-
-
ACMD(do_load)
{
char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
@@ -1388,8 +1363,6 @@ ACMD(do_load)
send_to_char(ch, "That'll have to be either 'obj' or 'mob'.\r\n");
}
-
-
ACMD(do_vstat)
{
char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
@@ -1452,7 +1425,6 @@ ACMD(do_vstat)
}
}
-
/* clean a room of all mobiles and objects */
ACMD(do_purge)
{
@@ -1618,7 +1590,6 @@ ACMD(do_restore)
}
}
-
void perform_immort_vis(struct char_data *ch)
{
if (GET_INVIS_LEV(ch) == 0 && !AFF_FLAGGED(ch, AFF_HIDE | AFF_INVISIBLE)) {
@@ -1631,7 +1602,6 @@ void perform_immort_vis(struct char_data *ch)
send_to_char(ch, "You are now fully visible.\r\n");
}
-
void perform_immort_invis(struct char_data *ch, int level)
{
struct char_data *tch;
@@ -1651,7 +1621,6 @@ void perform_immort_invis(struct char_data *ch, int level)
send_to_char(ch, "Your invisibility level is %d.\r\n", level);
}
-
ACMD(do_invis)
{
char arg[MAX_INPUT_LENGTH];
@@ -1679,7 +1648,6 @@ ACMD(do_invis)
}
}
-
ACMD(do_gecho)
{
struct descriptor_data *pt;
@@ -1761,8 +1729,6 @@ ACMD(do_dc)
}
}
-
-
ACMD(do_wizlock)
{
char arg[MAX_INPUT_LENGTH];
@@ -1794,7 +1760,6 @@ ACMD(do_wizlock)
}
}
-
ACMD(do_date)
{
char *tmstr;
@@ -2130,7 +2095,6 @@ ACMD(do_last)
fclose(fp);
}
-
ACMD(do_force)
{
struct descriptor_data *i, *next_desc;
@@ -2183,8 +2147,6 @@ ACMD(do_force)
}
}
-
-
ACMD(do_wiznet)
{
char buf1[MAX_INPUT_LENGTH + MAX_NAME_LENGTH + 32],
@@ -2271,8 +2233,6 @@ ACMD(do_wiznet)
send_to_char(ch, "%s", CONFIG_OK);
}
-
-
ACMD(do_zreset)
{
char arg[MAX_INPUT_LENGTH];
@@ -2414,7 +2374,6 @@ ACMD(do_wizutil)
}
}
-
/* single zone printing fn used by "show zone" so it's not repeated in the
code 3 times ... -je, 4/6/93 */
@@ -2473,7 +2432,6 @@ size_t print_zone_to_buf(char *bufptr, size_t left, zone_rnum zone, int listall)
zone_table[zone].builders, KNRM, zone_table[zone].bot, zone_table[zone].top);
}
-
ACMD(do_show)
{
int i, j, k, l, con; /* i, j, k to specifics? */
@@ -2728,7 +2686,6 @@ ACMD(do_show)
}
}
-
/***************** The do_set function ***********************************/
#define PC 1
@@ -2745,7 +2702,6 @@ ACMD(do_show)
#define RANGE(low, high) (value = MAX((low), MIN((high), (value))))
-
/* The set options available */
struct set_struct {
const char *cmd;
@@ -2753,68 +2709,64 @@ ACMD(do_show)
const char pcnpc;
const char type;
} set_fields[] = {
- { "brief", LVL_GOD, PC, BINARY }, /* 0 */
- { "invstart", LVL_GOD, PC, BINARY }, /* 1 */
- { "title", LVL_GOD, PC, MISC },
- { "nosummon", LVL_GRGOD, PC, BINARY },
- { "maxhit", LVL_GRGOD, BOTH, NUMBER },
- { "maxmana", LVL_GRGOD, BOTH, NUMBER }, /* 5 */
- { "maxmove", LVL_GRGOD, BOTH, NUMBER },
- { "hit", LVL_GRGOD, BOTH, NUMBER },
- { "mana", LVL_GRGOD, BOTH, NUMBER },
- { "move", LVL_GRGOD, BOTH, NUMBER },
- { "align", LVL_GOD, BOTH, NUMBER }, /* 10 */
- { "str", LVL_GRGOD, BOTH, NUMBER },
- { "stradd", LVL_GRGOD, BOTH, NUMBER },
- { "int", LVL_GRGOD, BOTH, NUMBER },
- { "wis", LVL_GRGOD, BOTH, NUMBER },
- { "dex", LVL_GRGOD, BOTH, NUMBER }, /* 15 */
- { "con", LVL_GRGOD, BOTH, NUMBER },
- { "cha", LVL_GRGOD, BOTH, NUMBER },
- { "ac", LVL_GRGOD, BOTH, NUMBER },
- { "gold", LVL_GOD, BOTH, NUMBER },
- { "bank", LVL_GOD, PC, NUMBER }, /* 20 */
- { "exp", LVL_GRGOD, BOTH, NUMBER },
- { "hitroll", LVL_GRGOD, BOTH, NUMBER },
- { "damroll", LVL_GRGOD, BOTH, NUMBER },
- { "invis", LVL_IMPL, PC, NUMBER },
- { "nohassle", LVL_GRGOD, PC, BINARY }, /* 25 */
- { "frozen", LVL_FREEZE, PC, BINARY },
- { "practices", LVL_GRGOD, PC, NUMBER },
- { "lessons", LVL_GRGOD, PC, NUMBER },
- { "drunk", LVL_GRGOD, BOTH, MISC },
- { "hunger", LVL_GRGOD, BOTH, MISC }, /* 30 */
- { "thirst", LVL_GRGOD, BOTH, MISC },
- { "killer", LVL_GOD, PC, BINARY },
- { "thief", LVL_GOD, PC, BINARY },
- { "level", LVL_GOD, BOTH, NUMBER },
- { "room", LVL_IMPL, BOTH, NUMBER }, /* 35 */
- { "roomflag", LVL_GRGOD, PC, BINARY },
- { "siteok", LVL_GRGOD, PC, BINARY },
- { "deleted", LVL_IMPL, PC, BINARY },
- { "class", LVL_GRGOD, BOTH, MISC },
- { "nowizlist", LVL_GOD, PC, BINARY }, /* 40 */
- { "quest", LVL_GOD, PC, BINARY },
- { "loadroom", LVL_GRGOD, PC, MISC },
- { "color", LVL_GOD, PC, BINARY },
- { "idnum", LVL_IMPL, PC, NUMBER },
- { "passwd", LVL_IMPL, PC, MISC }, /* 45 */
- { "nodelete", LVL_GOD, PC, BINARY },
- { "sex", LVL_GRGOD, BOTH, MISC },
- { "age", LVL_GRGOD, BOTH, NUMBER },
- { "height", LVL_GRGOD, BOTH, NUMBER },
- { "weight", LVL_GRGOD, BOTH, NUMBER }, /* 50 */
- { "olc", LVL_GRGOD, PC, MISC },
- { "variable", LVL_GRGOD, PC, MISC },
- { "poofin", LVL_IMMORT, PC, MISC },
- { "poofout", LVL_IMMORT, PC, MISC },
- { "afk", LVL_GRGOD, PC, BINARY }, /* 55 */
+ { "ac", LVL_BUILDER, BOTH, NUMBER }, /* 0 */
+ { "afk", LVL_BUILDER, PC, BINARY }, /* 1 */
+ { "age", LVL_GOD, BOTH, NUMBER },
+ { "align", LVL_BUILDER, BOTH, NUMBER },
+ { "bank", LVL_BUILDER, PC, NUMBER },
+ { "brief", LVL_GOD, PC, BINARY }, /* 5 */
+ { "cha", LVL_BUILDER, BOTH, NUMBER },
+ { "class", LVL_BUILDER, BOTH, MISC },
+ { "color", LVL_GOD, PC, BINARY },
+ { "con", LVL_BUILDER, BOTH, NUMBER },
+ { "damroll", LVL_BUILDER, BOTH, NUMBER }, /* 10 */
+ { "deleted", LVL_IMPL, PC, BINARY },
+ { "dex", LVL_BUILDER, BOTH, NUMBER },
+ { "drunk", LVL_BUILDER, BOTH, MISC },
+ { "exp", LVL_GOD, BOTH, NUMBER },
+ { "frozen", LVL_FREEZE, PC, BINARY }, /* 15 */
+ { "gold", LVL_BUILDER, BOTH, NUMBER },
+ { "height", LVL_BUILDER, BOTH, NUMBER },
+ { "hit", LVL_BUILDER, BOTH, NUMBER },
+ { "hitroll", LVL_BUILDER, BOTH, NUMBER },
+ { "hunger", LVL_BUILDER, BOTH, MISC }, /* 20 */
+ { "int", LVL_BUILDER, BOTH, NUMBER },
+ { "invis", LVL_GOD, PC, NUMBER },
+ { "invstart", LVL_BUILDER, PC, BINARY },
+ { "killer", LVL_GOD, PC, BINARY },
+ { "level", LVL_GRGOD, BOTH, NUMBER }, /* 25 */
+ { "loadroom", LVL_BUILDER, PC, MISC },
+ { "mana", LVL_BUILDER, BOTH, NUMBER },
+ { "maxhit", LVL_BUILDER, BOTH, NUMBER },
+ { "maxmana", LVL_BUILDER, BOTH, NUMBER },
+ { "maxmove", LVL_BUILDER, BOTH, NUMBER }, /* 30 */
+ { "move", LVL_BUILDER, BOTH, NUMBER },
+ { "nodelete", LVL_GOD, PC, BINARY },
+ { "nohassle", LVL_GOD, PC, BINARY },
+ { "nosummon", LVL_BUILDER, PC, BINARY },
+ { "nowizlist", LVL_GRGOD, PC, BINARY }, /* 35 */
+ { "olc", LVL_GRGOD, PC, MISC },
+ { "password", LVL_IMPL, PC, MISC },
+ { "poofin", LVL_IMMORT, PC, MISC },
+ { "poofout", LVL_IMMORT, PC, MISC },
+ { "practices", LVL_GOD, PC, NUMBER }, /* 40 */
+ { "quest", LVL_GOD, PC, BINARY },
+ { "room", LVL_BUILDER, BOTH, NUMBER },
+ { "sex", LVL_GOD, BOTH, MISC },
+ { "showvnums", LVL_BUILDER, PC, BINARY },
+ { "siteok", LVL_GOD, PC, BINARY }, /* 45 */
+ { "str", LVL_BUILDER, BOTH, NUMBER },
+ { "stradd", LVL_BUILDER, BOTH, NUMBER },
+ { "thief", LVL_GOD, PC, BINARY },
+ { "thirst", LVL_BUILDER, BOTH, MISC },
+ { "title", LVL_GOD, PC, MISC }, /* 50 */
+ { "variable", LVL_GRGOD, PC, MISC },
+ { "weight", LVL_BUILDER, BOTH, NUMBER },
+ { "wis", LVL_BUILDER, BOTH, NUMBER },
{ "\n", 0, BOTH, MISC }
};
-
-int perform_set(struct char_data *ch, struct char_data *vict, int mode,
- char *val_arg)
+int perform_set(struct char_data *ch, struct char_data *vict, int mode, char *val_arg)
{
int i, on = 0, off = 0, value = 0;
room_rnum rnum;
@@ -2859,329 +2811,312 @@ int perform_set(struct char_data *ch, struct char_data *vict, int mode,
send_to_char(ch, "%s", CONFIG_OK);
switch (mode) {
- case 0:
- SET_OR_REMOVE(PRF_FLAGS(vict), PRF_BRIEF);
- break;
- case 1:
- SET_OR_REMOVE(PLR_FLAGS(vict), PLR_INVSTART);
- break;
- case 2:
- set_title(vict, val_arg);
- send_to_char(ch, "%s's title is now: %s\r\n", GET_NAME(vict), GET_TITLE(vict));
- break;
- case 3:
- SET_OR_REMOVE(PRF_FLAGS(vict), PRF_SUMMONABLE);
- send_to_char(ch, "Nosummon %s for %s.\r\n", ONOFF(!on), GET_NAME(vict));
- break;
- case 4:
- vict->points.max_hit = RANGE(1, 5000);
- affect_total(vict);
- break;
- case 5:
- vict->points.max_mana = RANGE(1, 5000);
- affect_total(vict);
- break;
- case 6:
- vict->points.max_move = RANGE(1, 5000);
- affect_total(vict);
- break;
- case 7:
- vict->points.hit = RANGE(-9, vict->points.max_hit);
- affect_total(vict);
- break;
- case 8:
- vict->points.mana = RANGE(0, vict->points.max_mana);
- affect_total(vict);
- break;
- case 9:
- vict->points.move = RANGE(0, vict->points.max_move);
- affect_total(vict);
- break;
- case 10:
- GET_ALIGNMENT(vict) = RANGE(-1000, 1000);
- affect_total(vict);
- break;
- case 11:
- if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
- RANGE(3, 25);
- else
- RANGE(3, 18);
- vict->real_abils.str = value;
- vict->real_abils.str_add = 0;
- affect_total(vict);
- break;
- case 12:
- vict->real_abils.str_add = RANGE(0, 100);
- if (value > 0)
- vict->real_abils.str = 18;
- affect_total(vict);
- break;
- case 13:
- if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
- RANGE(3, 25);
- else
- RANGE(3, 18);
- vict->real_abils.intel = value;
- affect_total(vict);
- break;
- case 14:
- if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
- RANGE(3, 25);
- else
- RANGE(3, 18);
- vict->real_abils.wis = value;
- affect_total(vict);
- break;
- case 15:
- if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
- RANGE(3, 25);
- else
- RANGE(3, 18);
- vict->real_abils.dex = value;
- affect_total(vict);
- break;
- case 16:
- if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
- RANGE(3, 25);
- else
- RANGE(3, 18);
- vict->real_abils.con = value;
- affect_total(vict);
- break;
- case 17:
- if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
- RANGE(3, 25);
- else
- RANGE(3, 18);
- vict->real_abils.cha = value;
- affect_total(vict);
- break;
- case 18:
- vict->points.armor = RANGE(-100, 100);
- affect_total(vict);
- break;
- case 19:
- GET_GOLD(vict) = RANGE(0, 100000000);
- break;
- case 20:
- GET_BANK_GOLD(vict) = RANGE(0, 100000000);
- break;
- case 21:
- vict->points.exp = RANGE(0, 50000000);
- break;
- case 22:
- vict->points.hitroll = RANGE(-20, 20);
- affect_total(vict);
- break;
- case 23:
- vict->points.damroll = RANGE(-20, 20);
- affect_total(vict);
- break;
- case 24:
- if (GET_LEVEL(ch) < LVL_IMPL && ch != vict) {
- send_to_char(ch, "You aren't godly enough for that!\r\n");
- return (0);
- }
- GET_INVIS_LEV(vict) = RANGE(0, GET_LEVEL(vict));
- break;
- case 25:
- if (GET_LEVEL(ch) < LVL_GOD && ch != vict) {
- send_to_char(ch, "You aren't godly enough for that!\r\n");
- return (0);
- }
- SET_OR_REMOVE(PRF_FLAGS(vict), PRF_NOHASSLE);
- break;
- case 26:
- if (ch == vict && on) {
- send_to_char(ch, "Better not -- could be a long winter!\r\n");
- return (0);
- }
- SET_OR_REMOVE(PLR_FLAGS(vict), PLR_FROZEN);
- break;
- case 27:
- case 28:
- GET_PRACTICES(vict) = RANGE(0, 100);
- break;
- case 29:
- case 30:
- case 31:
- if (!str_cmp(val_arg, "off")) {
- GET_COND(vict, (mode - 29)) = -1; /* warning: magic number here */
- send_to_char(ch, "%s's %s now off.\r\n", GET_NAME(vict), set_fields[mode].cmd);
- } else if (is_number(val_arg)) {
- value = atoi(val_arg);
- RANGE(0, 24);
- GET_COND(vict, (mode - 29)) = value; /* and here too */
- send_to_char(ch, "%s's %s set to %d.\r\n", GET_NAME(vict), set_fields[mode].cmd, value);
- } else {
- send_to_char(ch, "Must be 'off' or a value from 0 to 24.\r\n");
- return (0);
- }
- break;
- case 32:
- SET_OR_REMOVE(PLR_FLAGS(vict), PLR_KILLER);
- break;
- case 33:
- SET_OR_REMOVE(PLR_FLAGS(vict), PLR_THIEF);
- break;
- case 34:
- if ((!IS_NPC(vict) && value > GET_LEVEL(ch)) || value > LVL_IMPL) {
- send_to_char(ch, "You can't do that.\r\n");
- return (0);
- }
- RANGE(0, LVL_IMPL);
- vict->player.level = value;
- break;
- case 35:
- if ((rnum = real_room(value)) == NOWHERE) {
- send_to_char(ch, "No room exists with that number.\r\n");
- return (0);
- }
- if (IN_ROOM(vict) != NOWHERE) /* Another Eric Green special. */
- char_from_room(vict);
- char_to_room(vict, rnum);
- break;
- case 36:
- SET_OR_REMOVE(PRF_FLAGS(vict), PRF_SHOWVNUMS);
- break;
- case 37:
- SET_OR_REMOVE(PLR_FLAGS(vict), PLR_SITEOK);
- break;
- case 38:
- SET_OR_REMOVE(PLR_FLAGS(vict), PLR_DELETED);
- break;
- case 39:
- if ((i = parse_class(*val_arg)) == CLASS_UNDEFINED) {
- send_to_char(ch, "That is not a class.\r\n");
- return (0);
- }
- GET_CLASS(vict) = i;
- break;
- case 40:
- SET_OR_REMOVE(PLR_FLAGS(vict), PLR_NOWIZLIST);
- break;
- case 41:
- SET_OR_REMOVE(PRF_FLAGS(vict), PRF_QUEST);
- break;
- case 42:
- if (!str_cmp(val_arg, "off")) {
- REMOVE_BIT(PLR_FLAGS(vict), PLR_LOADROOM);
- } else if (is_number(val_arg)) {
- rvnum = atoi(val_arg);
- if (real_room(rvnum) != NOWHERE) {
- SET_BIT(PLR_FLAGS(vict), PLR_LOADROOM);
- GET_LOADROOM(vict) = rvnum;
- send_to_char(ch, "%s will enter at room #%d.\r\n", GET_NAME(vict), GET_LOADROOM(vict));
+ case 0: /* ac */
+ vict->points.armor = RANGE(-100, 100);
+ affect_total(vict);
+ break;
+ case 1: /* afk */
+ SET_OR_REMOVE(PRF_FLAGS(vict), PRF_AFK);
+ break;
+ case 2: /* age */
+ if (value < 2 || value > 200) { /* Arbitrary limits. */
+ send_to_char(ch, "Ages 2 to 200 accepted.\r\n");
+ return (0);
+ }
+ /* NOTE: May not display the exact age specified due to the integer
+ * division used elsewhere in the code. Seems to only happen for
+ * some values below the starting age (17) anyway. -gg 5/27/98
+ */
+ vict->player.time.birth = time(0) - ((value - 17) * SECS_PER_MUD_YEAR);
+ break;
+ case 3: /* align */
+ GET_ALIGNMENT(vict) = RANGE(-1000, 1000);
+ affect_total(vict);
+ break;
+ case 4: /* bank */
+ GET_BANK_GOLD(vict) = RANGE(0, 100000000);
+ break;
+ case 5: /* brief */
+ SET_OR_REMOVE(PRF_FLAGS(vict), PRF_BRIEF);
+ break;
+ case 6: /* cha */
+ if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
+ RANGE(3, 25);
+ else
+ RANGE(3, 18);
+ vict->real_abils.cha = value;
+ affect_total(vict);
+ break;
+ case 7: /* class */
+ if ((i = parse_class(*val_arg)) == CLASS_UNDEFINED) {
+ send_to_char(ch, "That is not a class.\r\n");
+ return (0);
+ }
+ GET_CLASS(vict) = i;
+ break;
+ case 8: /* color */
+ SET_OR_REMOVE(PRF_FLAGS(vict), (PRF_COLOR_1 | PRF_COLOR_2));
+ break;
+ case 9: /* con */
+ if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
+ RANGE(3, 25);
+ else
+ RANGE(3, 18);
+ vict->real_abils.con = value;
+ affect_total(vict);
+ break;
+ case 10: /* damroll */
+ vict->points.damroll = RANGE(-20, 20);
+ affect_total(vict);
+ break;
+ case 11: /* delete */
+ SET_OR_REMOVE(PLR_FLAGS(vict), PLR_DELETED);
+ break;
+ case 12: /* dex */
+ if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
+ RANGE(3, 25);
+ else
+ RANGE(3, 18);
+ vict->real_abils.dex = value;
+ affect_total(vict);
+ break;
+ case 13: /* drunk */
+ case 20: /* hunger */
+ case 49: /* thirst */
+ if (!str_cmp(val_arg, "off")) {
+ GET_COND(vict, (mode - 29)) = -1; /* warning: magic number here */
+ send_to_char(ch, "%s's %s now off.\r\n", GET_NAME(vict), set_fields[mode].cmd);
+ } else if (is_number(val_arg)) {
+ value = atoi(val_arg);
+ RANGE(0, 24);
+ GET_COND(vict, (mode - 29)) = value; /* and here too */
+ send_to_char(ch, "%s's %s set to %d.\r\n", GET_NAME(vict), set_fields[mode].cmd, value);
} else {
- send_to_char(ch, "That room does not exist!\r\n");
- return (0);
+ send_to_char(ch, "Must be 'off' or a value from 0 to 24.\r\n");
+ return (0);
}
- } else {
- send_to_char(ch, "Must be 'off' or a room's virtual number.\r\n");
- return (0);
- }
- break;
- case 43:
- SET_OR_REMOVE(PRF_FLAGS(vict), (PRF_COLOR_1 | PRF_COLOR_2));
- break;
- case 44:
- if (GET_IDNUM(ch) != 1 || !IS_NPC(vict))
- return (0);
- GET_IDNUM(vict) = value;
- break;
- case 45:
- if (GET_LEVEL(vict) >= LVL_GRGOD) {
- send_to_char(ch, "You cannot change that.\r\n");
- return (0);
- }
- strncpy(GET_PASSWD(vict), CRYPT(val_arg, GET_NAME(vict)), MAX_PWD_LENGTH); /* strncpy: OK (G_P:MAX_PWD_LENGTH) */
- *(GET_PASSWD(vict) + MAX_PWD_LENGTH) = '\0';
- send_to_char(ch, "Password changed to '%s'.\r\n", val_arg);
- break;
- case 46:
- SET_OR_REMOVE(PLR_FLAGS(vict), PLR_NODELETE);
- break;
- case 47:
- if ((i = search_block(val_arg, genders, FALSE)) < 0) {
- send_to_char(ch, "Must be 'male', 'female', or 'neutral'.\r\n");
- return (0);
- }
- GET_SEX(vict) = i;
- break;
- case 48: /* set age */
- if (value < 2 || value > 200) { /* Arbitrary limits. */
- send_to_char(ch, "Ages 2 to 200 accepted.\r\n");
- return (0);
- }
- /*
- * NOTE: May not display the exact age specified due to the integer
- * division used elsewhere in the code. Seems to only happen for
- * some values below the starting age (17) anyway. -gg 5/27/98
- */
- vict->player.time.birth = time(0) - ((value - 17) * SECS_PER_MUD_YEAR);
- break;
-
- case 49: /* Blame/Thank Rick Glover. :) */
- GET_HEIGHT(vict) = value;
- affect_total(vict);
- break;
-
- case 50:
- GET_WEIGHT(vict) = value;
- affect_total(vict);
- break;
-
- case 51:
- if (is_abbrev(val_arg, "socials") || is_abbrev(val_arg, "actions") || is_abbrev(val_arg, "aedit"))
- GET_OLC_ZONE(vict) = AEDIT_PERMISSION;
- else if (is_abbrev(val_arg, "hedit"))
- GET_OLC_ZONE(vict) = HEDIT_PERMISSION;
- else if (is_abbrev(val_arg, "off"))
- GET_OLC_ZONE(vict) = NOWHERE;
- else if (!is_number(val_arg)) {
- send_to_char(ch, "Value must be either 'aedit', 'hedit', 'off' or a zone number.\r\n");
- return (0);
- } else
- GET_OLC_ZONE(vict) = atoi(val_arg);
- break;
-
- case 52: /* set dg script variable */
- return perform_set_dg_var(ch, vict, val_arg);
- break;
-
- case 53:
- if ((vict == ch) || (GET_LEVEL(ch) == LVL_IMPL)) {
- skip_spaces(&val_arg);
- if (!*val_arg)
- POOFIN(vict) = NULL;
+ break;
+ case 14: /* exp */
+ vict->points.exp = RANGE(0, 50000000);
+ break;
+ case 15: /* frozen */
+ if (ch == vict && on) {
+ send_to_char(ch, "Better not -- could be a long winter!\r\n");
+ return (0);
+ }
+ SET_OR_REMOVE(PLR_FLAGS(vict), PLR_FROZEN);
+ break;
+ case 16: /* gold */
+ GET_GOLD(vict) = RANGE(0, 100000000);
+ break;
+ case 17: /* height */
+ GET_HEIGHT(vict) = value;
+ affect_total(vict);
+ break;
+ case 18: /* hit */
+ vict->points.hit = RANGE(-9, vict->points.max_hit);
+ affect_total(vict);
+ break;
+ case 19: /* hitroll */
+ vict->points.hitroll = RANGE(-20, 20);
+ affect_total(vict);
+ break;
+ case 21: /* int */
+ if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
+ RANGE(3, 25);
else
- POOFIN(vict) = strdup(val_arg);
+ RANGE(3, 18);
+ vict->real_abils.intel = value;
+ affect_total(vict);
+ break;
+ case 22: /* invis */
+ if (GET_LEVEL(ch) < LVL_IMPL && ch != vict) {
+ send_to_char(ch, "You aren't godly enough for that!\r\n");
+ return (0);
}
- break;
-
- case 54:
- if ((vict == ch) || (GET_LEVEL(ch) == LVL_IMPL)) {
- skip_spaces(&val_arg);
- if (!*val_arg)
- POOFOUT(vict) = NULL;
+ GET_INVIS_LEV(vict) = RANGE(0, GET_LEVEL(vict));
+ break;
+ case 23: /* invistart */
+ SET_OR_REMOVE(PLR_FLAGS(vict), PLR_INVSTART);
+ break;
+ case 24: /* killer */
+ SET_OR_REMOVE(PLR_FLAGS(vict), PLR_KILLER);
+ break;
+ case 25: /* level */
+ if ((!IS_NPC(vict) && value > GET_LEVEL(ch)) || value > LVL_IMPL) {
+ send_to_char(ch, "You can't do that.\r\n");
+ return (0);
+ }
+ RANGE(1, LVL_IMPL);
+ vict->player.level = value;
+ break;
+ case 26: /* loadroom */
+ if (!str_cmp(val_arg, "off")) {
+ REMOVE_BIT(PLR_FLAGS(vict), PLR_LOADROOM);
+ } else if (is_number(val_arg)) {
+ rvnum = atoi(val_arg);
+ if (real_room(rvnum) != NOWHERE) {
+ SET_BIT(PLR_FLAGS(vict), PLR_LOADROOM);
+ GET_LOADROOM(vict) = rvnum;
+ send_to_char(ch, "%s will enter at room #%d.\r\n", GET_NAME(vict), GET_LOADROOM(vict));
+ } else {
+ send_to_char(ch, "That room does not exist!\r\n");
+ return (0);
+ }
+ } else {
+ send_to_char(ch, "Must be 'off' or a room's virtual number.\r\n");
+ return (0);
+ }
+ break;
+ case 27: /* mana */
+ vict->points.mana = RANGE(0, vict->points.max_mana);
+ affect_total(vict);
+ break;
+ case 28: /* maxhit */
+ vict->points.max_hit = RANGE(1, 5000);
+ affect_total(vict);
+ break;
+ case 29: /* maxmana */
+ vict->points.max_mana = RANGE(1, 5000);
+ affect_total(vict);
+ break;
+ case 30: /* maxmove */
+ vict->points.max_move = RANGE(1, 5000);
+ affect_total(vict);
+ break;
+ case 31: /* move */
+ vict->points.move = RANGE(0, vict->points.max_move);
+ affect_total(vict);
+ break;
+ case 32: /* nodelete */
+ SET_OR_REMOVE(PLR_FLAGS(vict), PLR_NODELETE);
+ break;
+ case 33: /* nohassle */
+ if (GET_LEVEL(ch) < LVL_GOD && ch != vict) {
+ send_to_char(ch, "You aren't godly enough for that!\r\n");
+ return (0);
+ }
+ SET_OR_REMOVE(PRF_FLAGS(vict), PRF_NOHASSLE);
+ break;
+ case 34: /* nosummon */
+ SET_OR_REMOVE(PRF_FLAGS(vict), PRF_SUMMONABLE);
+ send_to_char(ch, "Nosummon %s for %s.\r\n", ONOFF(!on), GET_NAME(vict));
+ break;
+ case 35: /* nowiz */
+ SET_OR_REMOVE(PLR_FLAGS(vict), PLR_NOWIZLIST);
+ break;
+ case 36: /* olc */
+ if (is_abbrev(val_arg, "socials") || is_abbrev(val_arg, "actions") || is_abbrev(val_arg, "aedit"))
+ GET_OLC_ZONE(vict) = AEDIT_PERMISSION;
+ else if (is_abbrev(val_arg, "hedit"))
+ GET_OLC_ZONE(vict) = HEDIT_PERMISSION;
+ else if (is_abbrev(val_arg, "off"))
+ GET_OLC_ZONE(vict) = NOWHERE;
+ else if (!is_number(val_arg)) {
+ send_to_char(ch, "Value must be either 'aedit', 'hedit', 'off' or a zone number.\r\n");
+ return (0);
+ } else
+ GET_OLC_ZONE(vict) = atoi(val_arg);
+ break;
+ case 37: /* password */
+ if (GET_LEVEL(vict) >= LVL_GRGOD) {
+ send_to_char(ch, "You cannot change that.\r\n");
+ return (0);
+ }
+ strncpy(GET_PASSWD(vict), CRYPT(val_arg, GET_NAME(vict)), MAX_PWD_LENGTH); /* strncpy: OK (G_P:MAX_PWD_LENGTH) */
+ *(GET_PASSWD(vict) + MAX_PWD_LENGTH) = '\0';
+ send_to_char(ch, "Password changed to '%s'.\r\n", val_arg);
+ break;
+ case 38: /* poofin */
+ if ((vict == ch) || (GET_LEVEL(ch) == LVL_IMPL)) {
+ skip_spaces(&val_arg);
+ if (!*val_arg)
+ POOFIN(vict) = NULL;
+ else
+ POOFIN(vict) = strdup(val_arg);
+ }
+ break;
+ case 39: /* poofout */
+ if ((vict == ch) || (GET_LEVEL(ch) == LVL_IMPL)) {
+ skip_spaces(&val_arg);
+ if (!*val_arg)
+ POOFOUT(vict) = NULL;
+ else
+ POOFOUT(vict) = strdup(val_arg);
+ }
+ break;
+ case 40: /* practices */
+ GET_PRACTICES(vict) = RANGE(0, 100);
+ break;
+ case 41: /* quest */
+ SET_OR_REMOVE(PRF_FLAGS(vict), PRF_QUEST);
+ break;
+ case 42: /* room */
+ if ((rnum = real_room(value)) == NOWHERE) {
+ send_to_char(ch, "No room exists with that number.\r\n");
+ return (0);
+ }
+ if (IN_ROOM(vict) != NOWHERE)
+ char_from_room(vict);
+ char_to_room(vict, rnum);
+ break;
+ case 43: /* sex */
+ if ((i = search_block(val_arg, genders, FALSE)) < 0) {
+ send_to_char(ch, "Must be 'male', 'female', or 'neutral'.\r\n");
+ return (0);
+ }
+ GET_SEX(vict) = i;
+ break;
+ case 44: /* showvnums */
+ SET_OR_REMOVE(PRF_FLAGS(vict), PRF_SHOWVNUMS);
+ break;
+ case 45: /* siteok */
+ SET_OR_REMOVE(PLR_FLAGS(vict), PLR_SITEOK);
+ break;
+ case 46: /* str */
+ if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
+ RANGE(3, 25);
else
- POOFOUT(vict) = strdup(val_arg);
- }
- break;
-
- case 55:
- SET_OR_REMOVE(PRF_FLAGS(vict), PRF_AFK);
- break;
-
- default:
- send_to_char(ch, "Can't set that!\r\n");
- return (0);
- }
-
+ RANGE(3, 18);
+ vict->real_abils.str = value;
+ vict->real_abils.str_add = 0;
+ affect_total(vict);
+ break;
+ case 47: /* stradd */
+ vict->real_abils.str_add = RANGE(0, 100);
+ if (value > 0)
+ vict->real_abils.str = 18;
+ affect_total(vict);
+ break;
+ case 48: /* thief */
+ SET_OR_REMOVE(PLR_FLAGS(vict), PLR_THIEF);
+ break;
+ case 50: /* title */
+ set_title(vict, val_arg);
+ send_to_char(ch, "%s's title is now: %s\r\n", GET_NAME(vict), GET_TITLE(vict));
+ break;
+ case 51: /* variable */
+ return perform_set_dg_var(ch, vict, val_arg);
+ break;
+ case 52: /* weight */
+ GET_WEIGHT(vict) = value;
+ affect_total(vict);
+ break;
+ case 53: /* wis */
+ if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
+ RANGE(3, 25);
+ else
+ RANGE(3, 18);
+ vict->real_abils.wis = value;
+ affect_total(vict);
+ break;
+ default:
+ send_to_char(ch, "Can't set that!\r\n");
+ return (0);
+ }
return (1);
}
-
ACMD(do_set)
{
struct char_data *vict = NULL, *cbuf = NULL;
@@ -3420,7 +3355,6 @@ const int offlimit_zones[] = {0,12,13,14,-1}; /*what zones can no room connect
#define MIN_ROOM_DESC_LENGTH 80 /* at least one line - set to 0 to not care. */
#define MAX_COLOUMN_WIDTH 80 /* at most 80 chars per line */
-
ACMD (do_zcheck)
{
zone_rnum zrnum;
@@ -4152,4 +4086,3 @@ ACMD(do_zpurge)
mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s purged entire world.", GET_NAME(ch));
}
}
-
diff --git a/src/constants.c b/src/constants.c
index 9caeebb..959afcb 100644
--- a/src/constants.c
+++ b/src/constants.c
@@ -199,11 +199,11 @@ const char *preference_bits[] = {
"CLS",
"BLDWLK",
"AFK",
- "UNUSED1",
- "UNUSED2",
- "UNUSED3",
- "UNUSED4",
- "UNUSED5",
+ "AUTOLOOT",
+ "AUTOGOLD",
+ "AUTOSPLIT",
+ "AUTOSAC",
+ "AUTOASSIST",
"\n"
};
diff --git a/src/fight.c b/src/fight.c
index 019a96e..5437bf3 100644
--- a/src/fight.c
+++ b/src/fight.c
@@ -32,6 +32,10 @@ extern struct message_list fight_messages[MAX_MESSAGES];
/* External procedures */
char *fread_action(FILE *fl, int nr);
ACMD(do_flee);
+ACMD(do_get);
+ACMD(do_split);
+ACMD(do_sac);
+ACMD(do_assist);
int backstab_mult(int level);
int thaco(int ch_class, int level);
int ok_damage_shopkeeper(struct char_data *ch, struct char_data *victim);
@@ -683,6 +687,11 @@ int skill_message(int dam, struct char_data *ch, struct char_data *vict,
*/
int damage(struct char_data *ch, struct char_data *victim, int dam, int attacktype)
{
+ long local_gold = 0;
+ char local_buf[256];
+ struct char_data *tmp_char;
+ struct obj_data *corpse_obj, *coin_obj, *next_obj;
+
if (GET_POS(victim) <= POS_DEAD) {
/* This is "normal"-ish now with delayed extraction. -gg 3/15/2001 */
if (PLR_FLAGGED(victim, PLR_NOTDEADYET) || MOB_FLAGGED(victim, MOB_NOTDEADYET))
@@ -839,7 +848,33 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
if (MOB_FLAGGED(ch, MOB_MEMORY))
forget(ch, victim);
}
+ /* Cant determine GET_GOLD on corpse, so do now and store */
+ if (IS_NPC(victim)) {
+ local_gold = GET_GOLD(victim);
+ sprintf(local_buf,"%ld", (long)local_gold);
+ }
+
die(victim, ch);
+ if (IS_AFFECTED(ch, AFF_GROUP) && (local_gold > 0) && PRF_FLAGGED(ch, PRF_AUTOSPLIT) ) {
+ generic_find("corpse", FIND_OBJ_ROOM, ch, &tmp_char, &corpse_obj);
+ if (corpse_obj) {
+ for (coin_obj = corpse_obj->contains; coin_obj; coin_obj = next_obj) {
+ next_obj = coin_obj->next_content;
+ if (CAN_SEE_OBJ(ch, coin_obj) && isname("coin", coin_obj->name))
+ extract_obj(coin_obj);
+ }
+ do_split(ch,local_buf,0,0);
+ }
+ /* need to remove the gold from the corpse */
+ } else if (!IS_NPC(ch) && (ch != victim) && PRF_FLAGGED(ch, PRF_AUTOGOLD)) {
+ do_get(ch, "all.coin corpse", 0, 0);
+ }
+ if (!IS_NPC(ch) && (ch != victim) && PRF_FLAGGED(ch, PRF_AUTOLOOT)) {
+ do_get(ch, "all corpse", 0, 0);
+ }
+ if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOSAC)) {
+ do_sac(ch,"corpse",0,0);
+ }
return (-1);
}
return (dam);
@@ -976,6 +1011,7 @@ void hit(struct char_data *ch, struct char_data *victim, int type)
void perform_violence(void)
{
struct char_data *ch;
+ struct follow_type *k;
for (ch = combat_list; ch; ch = next_combat_list) {
next_combat_list = ch->next_fighting;
@@ -1002,6 +1038,19 @@ void perform_violence(void)
continue;
}
+ for (k = ch->followers; k; k=k->next) {
+ /* should followers auto-assist master? */
+ if (!IS_NPC(k->follower) && !FIGHTING(k->follower) && PRF_FLAGGED(k->follower,
+ PRF_AUTOASSIST) && (IN_ROOM(k->follower) == IN_ROOM(ch)))
+ do_assist(k->follower, GET_NAME(ch), 0, 0);
+ }
+
+ /* should master auto-assist followers? */
+ if (ch->master && PRF_FLAGGED(ch->master, PRF_AUTOASSIST) &&
+ FIGHTING(ch) && !FIGHTING(ch->master) &&
+ (IN_ROOM(ch->master) == IN_ROOM(ch)))
+ do_assist(ch->master, GET_NAME(ch), 0, 0);
+
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
if (MOB_FLAGGED(ch, MOB_SPEC) && GET_MOB_SPEC(ch) && !MOB_FLAGGED(ch, MOB_NOTDEADYET)) {
char actbuf[MAX_INPUT_LENGTH] = "";
diff --git a/src/interpreter.c b/src/interpreter.c
index efad8fa..18336ba 100644
--- a/src/interpreter.c
+++ b/src/interpreter.c
@@ -397,7 +397,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "peace" , "pe" , POS_DEAD , do_peace , LVL_BUILDER, 0 },
{ "pick" , "pi" , POS_STANDING, do_gen_door , 1, SCMD_PICK },
{ "practice" , "pr" , POS_RESTING , do_practice , 1, 0 },
- { "page" , "pag" , POS_DEAD , do_page , LVL_IMMORT, 0 },
+ { "page" , "pag" , POS_DEAD , do_page , 1, 0 },
{ "pardon" , "pardon" , POS_DEAD , do_wizutil , LVL_GOD, SCMD_PARDON },
{ "policy" , "pol" , POS_DEAD , do_gen_ps , 0, SCMD_POLICIES },
{ "pour" , "pour" , POS_STANDING, do_pour , 0, SCMD_POUR },
@@ -619,8 +619,23 @@ void command_interpreter(struct char_data *ch, char *argument)
if (GET_LEVEL(ch) >= complete_cmd_info[cmd].minimum_level)
break;
- if (*complete_cmd_info[cmd].command == '\n')
- send_to_char(ch, "Huh?!?\r\n");
+ if (*complete_cmd_info[cmd].command == '\n') {
+ int found = 0;
+ send_to_char(ch, "Huh!?!\r\n");
+
+ for (cmd = 0; *cmd_info[cmd].command != '\n'; cmd++) {
+ if (*arg != *cmd_info[cmd].command || cmd_info[cmd].minimum_level > GET_LEVEL(ch))
+ continue;
+
+ if (levenshtein_distance(arg, (char *) cmd_info[cmd].command) <= 2) {
+ if (!found) {
+ send_to_char(ch, "\r\nDid you mean:\r\n");
+ found = 1;
+ }
+ send_to_char(ch, " %s\r\n", cmd_info[cmd].command);
+ }
+ }
+ }
else if (!IS_NPC(ch) && PLR_FLAGGED(ch, PLR_FROZEN) && GET_LEVEL(ch) < LVL_IMPL)
send_to_char(ch, "You try, but the mind-numbing cold prevents you...\r\n");
else if (complete_cmd_info[cmd].command_pointer == NULL)
diff --git a/src/structs.h b/src/structs.h
index 0be83df..fe5a830 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -218,6 +218,11 @@
#define PRF_CLS (1 << 23) /* Clear screen in OLC */
#define PRF_BUILDWALK (1 << 24) /* Build new rooms while walking ? */
#define PRF_AFK (1 << 25) /* AFK flag */
+#define PRF_AUTOLOOT (1 << 26) /* Loot everything from a corpse */
+#define PRF_AUTOGOLD (1 << 27) /* Loot gold from a corpse */
+#define PRF_AUTOSPLIT (1 << 28) /* Split gold with group */
+#define PRF_AUTOSAC (1 << 29) /* Sacrifice a corpse */
+#define PRF_AUTOASSIST (1 << 30) /* Auto-assist toggle */
/* Affect bits: used in char_data.char_specials.saved.affected_by */
/* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */
diff --git a/src/utils.h b/src/utils.h
index 393c407..08c5dc1 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -420,7 +420,7 @@ void update_pos(struct char_data *victim);
GET_OBJ_VAL((obj), 3) == 1)
#define CAN_WEAR(obj, part) OBJWEAR_FLAGGED((obj), (part))
-
+#define GET_OBJ_SHORT(obj) ((obj)->short_description)
/* compound utilities and other macros **********************************/