diff --git a/.gitignore b/.gitignore index 9eb0607..ee5f064 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ config.log config.cache config.status +syslog +syslog.CRASH +*.swp diff --git a/lib/etc/.gitignore b/lib/etc/.gitignore index 580a3a3..03dd21c 100644 --- a/lib/etc/.gitignore +++ b/lib/etc/.gitignore @@ -3,3 +3,4 @@ players plrmail badsites board.immort +time diff --git a/lib/plrobjs/.gitignore b/lib/plrobjs/.gitignore new file mode 100644 index 0000000..cd74b2b --- /dev/null +++ b/lib/plrobjs/.gitignore @@ -0,0 +1 @@ +*.objs diff --git a/log/.gitignore b/log/.gitignore new file mode 100644 index 0000000..c263b72 --- /dev/null +++ b/log/.gitignore @@ -0,0 +1,12 @@ +syslog* +badpws +delete +dts +errors +godcmds +levels +newplayers +rentgone +restarts +rip +usage diff --git a/src/act.informative.c b/src/act.informative.c index 3454336..ec62dd9 100644 --- a/src/act.informative.c +++ b/src/act.informative.c @@ -173,6 +173,9 @@ void show_obj_modifiers(struct obj_data *obj, struct char_data *ch) if (OBJ_FLAGGED(obj, ITEM_HUM)) send_to_char(ch, " ..It emits a faint humming sound!"); + + if (IS_BURIED(obj)) + send_to_char(ch, " ... It is buried!"); } @@ -1608,10 +1611,12 @@ ACMD(do_toggle) " Deaf: %-3s " " Wimp Level: %-3s\r\n" - " Gossip Channel: %-3s " - "Auction Channel: %-3s " - " Grats Channel: %-3s\r\n" + " Auto Loot: %-3s " + " Auto Drain: %-3s " + " Gossip Channel: %-3s\r\n" + "Auction Channel: %-3s " + " Grats Channel: %-3s " " Color Level: %s\r\n", ONOFF(PRF_FLAGGED(ch, PRF_DISPHP)), @@ -1629,6 +1634,8 @@ ACMD(do_toggle) ONOFF(PRF_FLAGGED(ch, PRF_AUTOEXIT)), YESNO(PRF_FLAGGED(ch, PRF_DEAF)), buf2, + ONOFF(PRF_FLAGGED(ch, PRF_AUTOLOOT)), + ONOFF(PRF_FLAGGED(ch, PRF_AUTODRAIN)), ONOFF(!PRF_FLAGGED(ch, PRF_NOGOSS)), ONOFF(!PRF_FLAGGED(ch, PRF_NOAUCT)), diff --git a/src/act.other.c b/src/act.other.c index d2f341c..b61d397 100644 --- a/src/act.other.c +++ b/src/act.other.c @@ -913,7 +913,11 @@ ACMD(do_gen_tog) {"Autoexits disabled.\r\n", "Autoexits enabled.\r\n"}, {"Will no longer track through doors.\r\n", - "Will now track through doors.\r\n"} + "Will now track through doors.\r\n"}, + {"AutoLoot disabled.\r\n", + "AutoLoot enabled.\r\n"}, + {"AutoDrain disabled.\r\n", + "AutoDrain enabled.\r\n"} }; @@ -969,6 +973,12 @@ ACMD(do_gen_tog) case SCMD_AUTOEXIT: result = PRF_TOG_CHK(ch, PRF_AUTOEXIT); break; + case SCMD_AUTOLOOT: + result = PRF_TOG_CHK(ch, PRF_AUTOLOOT); + break; + case SCMD_AUTODRAIN: + result = PRF_TOG_CHK(ch, PRF_AUTODRAIN); + break; case SCMD_TRACK: result = (track_through_doors = !track_through_doors); break; @@ -1091,16 +1101,14 @@ ACMD(do_dig) /* ** search for an object in the room that has a ITEM_BURIED flag */ - obj = world[IN_ROOM(ch)].contents; - - while (obj != NULL) + for (obj = world[IN_ROOM(ch)].contents; obj; obj = obj->next) { if (IS_BURIED(obj)) { /* Remove the buried bit so the player can see it. */ REMOVE_BIT(GET_OBJ_EXTRA(obj), ITEM_BURIED); - if(CAN_SEE_OBJ(ch, obj)) + if (CAN_SEE_OBJ(ch, obj)) { found_item = 1; /* player found something */ @@ -1113,13 +1121,10 @@ ACMD(do_dig) else { /* add the bit back becuase the player can't unbury what - ** what he can't find... */ + ** he can't find... */ SET_BIT(GET_OBJ_EXTRA(obj), ITEM_BURIED); } } - - /* go to the next obj */ - obj = obj->next; } /* if the player didn't find anything */ @@ -1133,7 +1138,8 @@ ACMD(do_drain) struct obj_data *obj; int HIT = 0, MANA = 0, - MOVE = 0; + MOVE = 0, + reward; one_argument(argument, arg); @@ -1150,14 +1156,31 @@ ACMD(do_drain) } act("$n bends down and touches $p which slowly disappears.\r\n", FALSE, ch, obj, NULL, TO_ROOM); - act("You bend down and drain $p.\r\n", FALSE, ch, obj, NULL, TO_ROOM); + act("You bend down and drain $p.\r\n", FALSE, ch, obj, NULL, TO_CHAR); - HIT = rand() % GET_LEVEL(ch) * 2 + 1; - MANA = rand() % GET_LEVEL(ch) + 1; - MOVE = rand() % 15 + 1; - GET_HIT(ch) = GET_HIT(ch) + HIT; - GET_MANA(ch) = GET_MANA(ch) + MANA; - GET_MOVE(ch) = GET_MOVE(ch) + MOVE; + if ((reward = rand_number(1, 2)) == 1) + { + HIT = rand_number(1, GET_LEVEL(ch) * 2); + MANA = rand_number(1, GET_LEVEL(ch)); + MOVE = rand_number(1, 15); + GET_HIT(ch) += HIT; + GET_MANA(ch) += MANA; + GET_MOVE(ch) += MOVE; + send_to_char(ch, "The Gods rewarded you with %dH %dM %dV\r\n", HIT, MANA, MOVE); + } + else if (reward == 2) + { + int amount = rand_number(1, 5); + GET_GOLD(ch) += amount; + send_to_char(ch, "The Gods rewarded you with %d gold coin%s\r\n", amount, (amount > 1) ? "s" : ""); + } + else + { + int amount = rand_number(1, GET_LEVEL(ch) * 5); + + gain_exp(ch, amount); + send_to_char(ch, "The Gods rewarded you with %d experience point%s.\r\n", amount, (amount >1) ? "s" : ""); + } extract_obj(obj); } diff --git a/src/config.c b/src/config.c index f060abf..f04b1f2 100644 --- a/src/config.c +++ b/src/config.c @@ -58,7 +58,7 @@ int pk_allowed = NO; int pt_allowed = NO; /* minimum level a player must be to shout/holler/gossip/auction */ -int level_can_shout = 1; +int level_can_shout = 2; /* number of movement points it costs to holler */ int holler_move_cost = 20; @@ -93,7 +93,7 @@ int dts_are_dumps = YES; * able to carry around things like boards. That's not necessarily a bad * thing, but this will be left at a default of 'NO' for historic reasons. */ -int load_into_inventory = NO; +int load_into_inventory = YES; /* "okay" etc. */ const char *OK = "Okay.\r\n"; diff --git a/src/constants.c b/src/constants.c index 4bf4571..a091687 100644 --- a/src/constants.c +++ b/src/constants.c @@ -184,6 +184,8 @@ const char *preference_bits[] = { "NO_GOS", "NO_GTZ", "RMFLG", + "AUTOLOOT", + "AUTODRAIN", "\n" }; diff --git a/src/fight.c b/src/fight.c index 1a321d3..f0583fd 100644 --- a/src/fight.c +++ b/src/fight.c @@ -36,6 +36,8 @@ extern int max_npc_corpse_time, max_pc_corpse_time; /* External procedures */ char *fread_action(FILE *fl, int nr); ACMD(do_flee); +ACMD(do_get); +ACMD(do_drain); int backstab_mult(int level); int thaco(int ch_class, int level); int ok_damage_shopkeeper(struct char_data *ch, struct char_data *victim); @@ -832,6 +834,15 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty forget(ch, victim); } die(victim); + + /* If AUTOLOOT is enabled, loot everything from corpse */ + if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOLOOT)) + do_get(ch, "all corpse", 0, 0); + + /* IF AUTODRAIN is enabled, drain corpse */ + if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTODRAIN)) + do_drain(ch, "corpse", 0, 0); + return (-1); } return (dam); diff --git a/src/interpreter.c b/src/interpreter.c index eb9ae48..44814ca 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -223,6 +223,8 @@ cpp_extern const struct command_info cmd_info[] = { { "ask" , POS_RESTING , do_spec_comm, 0, SCMD_ASK }, { "auction" , POS_SLEEPING, do_gen_comm , 0, SCMD_AUCTION }, { "autoexit" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOEXIT }, + { "autoloot" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOLOOT }, + { "autodrain", POS_DEAD , do_gen_tog , 0, SCMD_AUTODRAIN }, { "bounce" , POS_STANDING, do_action , 0, 0 }, { "backstab" , POS_STANDING, do_backstab , 1, 0 }, diff --git a/src/interpreter.h b/src/interpreter.h index 982c5ed..54f342d 100644 --- a/src/interpreter.h +++ b/src/interpreter.h @@ -119,6 +119,8 @@ struct alias_data { #define SCMD_SLOWNS 14 #define SCMD_AUTOEXIT 15 #define SCMD_TRACK 16 +#define SCMD_AUTOLOOT 17 +#define SCMD_AUTODRAIN 18 /* do_wizutil */ #define SCMD_REROLL 0 diff --git a/src/structs.h b/src/structs.h index 9fbf7ac..57bb131 100644 --- a/src/structs.h +++ b/src/structs.h @@ -215,6 +215,8 @@ #define PRF_NOGRATZ (1 << 20) /* Can't hear grats channel */ #define PRF_ROOMFLAGS (1 << 21) /* Can see room flags (ROOM_x) */ #define PRF_DISPAUTO (1 << 22) /* Show prompt HP, MP, MV when < 30%. */ +#define PRF_AUTOLOOT (1 << 23) /* Automatically loot corpses */ +#define PRF_AUTODRAIN (1 << 24) /* Automatically drain corpses */ /* Affect bits: used in char_data.char_specials.saved.affected_by */ /* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */ @@ -314,7 +316,6 @@ #define ITEM_PEN 21 /* Item is a pen */ #define ITEM_BOAT 22 /* Item is a boat */ #define ITEM_FOUNTAIN 23 /* Item is a fountain */ -#define ITEM_BURIED 24 /* Item is buried */ /* Take/Wear flags: used by obj_data.obj_flags.wear_flags */ @@ -353,6 +354,7 @@ #define ITEM_ANTI_THIEF (1 << 14) /* Not usable by thieves */ #define ITEM_ANTI_WARRIOR (1 << 15) /* Not usable by warriors */ #define ITEM_NOSELL (1 << 16) /* Shopkeepers won't touch it */ +#define ITEM_BURIED (1 << 17) /* Item is buried */ /* Modifier constants used with obj affects ('A' fields) */