diff -BbuprN -x '*.0' srcbak/act.movement.c src/act.movement.c --- srcbak/act.movement.c 2004-09-27 13:31:00.000000000 -0400 +++ src/act.movement.c 2004-09-27 13:26:07.000000000 -0400 @@ -29,6 +29,7 @@ void death_cry(struct char_data *ch); int find_eq_pos(struct char_data *ch, struct obj_data *obj, char *arg); int buildwalk(struct char_data *ch, int dir); struct obj_data *find_vehicle_by_vnum(int vnum); +void timed_dt(struct char_data *ch); /* local functions */ int has_boat(struct char_data *ch); @@ -216,6 +217,9 @@ int do_simple_move(struct char_data *ch, if (ch->desc != NULL) look_at_room(IN_ROOM(ch), ch, 0); + if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_TIMED_DT) && GET_LEVEL(ch) < LVL_IMMORT) + timed_dt(NULL); + if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_DEATH) && GET_LEVEL(ch) < LVL_IMMORT) { log_death_trap(ch); death_cry(ch); diff -BbuprN -x '*.0' srcbak/comm.c src/comm.c --- srcbak/comm.c 2004-09-27 13:31:17.000000000 -0400 +++ src/comm.c 2004-09-27 13:26:07.000000000 -0400 @@ -176,6 +176,7 @@ void Free_Invalid_List(void); void free_command_list(void); void load_config(void); void affect_update_violence(void); /* In magic.c */ +void timed_dt(struct char_data *ch); #ifdef __CXREF__ #undef FD_ZERO @@ -1032,6 +1033,9 @@ void heartbeat(int heart_pulse) if (!(heart_pulse % PULSE_CURRENT)) current_update(); + if (!(heart_pulse % (30 * PASSES_PER_SEC))) + timed_dt(NULL); + /* Every pulse! Don't want them to stink the place up... */ extract_pending_chars(); } diff -BbuprN -x '*.0' srcbak/constants.c src/constants.c --- srcbak/constants.c 2004-09-27 13:25:32.000000000 -0400 +++ src/constants.c 2004-09-27 13:26:07.000000000 -0400 @@ -117,6 +117,8 @@ const char *room_bits[] = { "*", /* BFS MARK */ "VEHICLE", "UNDERGROUND", + "CURRENT", + "TIMED_DT", "\n" }; diff -BbuprN -x '*.0' srcbak/db.c src/db.c --- srcbak/db.c 2004-09-27 13:25:32.000000000 -0400 +++ src/db.c 2004-09-27 13:26:07.000000000 -0400 @@ -1150,6 +1150,7 @@ void parse_room(FILE *fl, int virtual_nr world[room_nr].contents = NULL; world[room_nr].people = NULL; world[room_nr].light = 0; /* Zero light sources */ + world[room_nr].timed = -1; for (i = 0; i < NUM_OF_DIRS; i++) world[room_nr].dir_option[i] = NULL; diff -BbuprN -x '*.0' srcbak/limits.c src/limits.c --- srcbak/limits.c 2004-09-27 13:25:32.000000000 -0400 +++ src/limits.c 2004-09-27 13:26:07.000000000 -0400 @@ -536,3 +536,67 @@ void point_update(void) } } } + +void timed_dt(struct char_data *ch) +{ + struct char_data *vict; + room_rnum rrnum; + + if (ch == NULL) { + /* BY -WELCOR + first make sure all rooms in the world have thier 'timed' + value decreased if its not -1. + */ + + for (rrnum = 0; rrnum < top_of_world; rrnum++) + world[rrnum].timed -= (world[rrnum].timed != -1); + + for (vict = character_list; vict ;vict = vict->next){ + if (IS_NPC(vict)) + continue; + + if (IN_ROOM(vict) == NOWHERE) + continue; + + if(!ROOM_FLAGGED(IN_ROOM(vict), ROOM_TIMED_DT)) + continue; + + timed_dt(vict); + } + return; + } + + /*Called with a non-null ch. let's check the room. */ + + /*if the room wasn't triggered (i.e timed wasn't set), just set it + and return again. + */ + + if (world[IN_ROOM(ch)].timed < 0) { + world[IN_ROOM(ch)].timed = rand_number(2, 5); + return; + } + + /* We know ch is in a dt room with timed >= 0 - see if its the end. + * + */ + if (world[IN_ROOM(ch)].timed == 0) { + for (vict = world[IN_ROOM(ch)].people; vict; vict = vict->next_in_room) + { + if (IS_NPC(vict)) + continue; + if (GET_LEVEL(vict) >= LVL_IMMORT) + continue; + + /* Skip those alread dead people */ + /* extract char() jest sets the bit*/ + if (PLR_FLAGGED(vict, PLR_NOTDEADYET)) + continue; + + log_death_trap(vict); + death_cry(vict); + extract_char(vict); + } + } +} + diff -BbuprN -x '*.0' srcbak/oasis.h src/oasis.h --- srcbak/oasis.h 2004-09-27 13:25:32.000000000 -0400 +++ src/oasis.h 2004-09-27 13:26:07.000000000 -0400 @@ -31,7 +31,7 @@ * Macros, defines, structs and globals for the OLC suite. You will need * to adjust these numbers if you ever add more. */ -#define NUM_ROOM_FLAGS 19 +#define NUM_ROOM_FLAGS 20 #define NUM_ROOM_SECTORS 10 #define NUM_MOB_FLAGS 19 diff -BbuprN -x '*.0' srcbak/structs.h src/structs.h --- srcbak/structs.h 2004-09-27 13:29:39.000000000 -0400 +++ src/structs.h 2004-09-27 13:26:07.000000000 -0400 @@ -102,7 +102,7 @@ #define ROOM_VEHICLE 16 /* Requires a vehicle to pass */ #define ROOM_UNDERGROUND 17 /* Room is below ground */ #define ROOM_CURRENT 18 - +#define ROOM_TIMED_DT 19 /* Exit info: used in room_data.dir_option.exit_info */ #define EX_ISDOOR (1 << 0) /* Exit is a door */ @@ -886,6 +886,8 @@ struct room_data { struct obj_data *contents; /* List of items in room */ struct char_data *people; /* List of NPC / PC in room */ + + int timed; /* For timed Dt's */ }; /* ====================================================================== */