diff -puN ./src/act.informative.c ./src128bit/act.informative.c
--- ./src/act.informative.c	Wed Aug 14 19:36:06 2002
+++ ./src128bit/act.informative.c	Mon Aug 12 12:02:04 2002
@@ -419,8 +419,7 @@ void look_at_room(struct char_data *ch, 
   send_to_char(ch, "%s", CCCYN(ch, C_NRM));
   if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_ROOMFLAGS)) {
     char buf[MAX_STRING_LENGTH];
-
-    sprintbit(ROOM_FLAGS(IN_ROOM(ch)), room_bits, buf, sizeof(buf));
+    sprintbitarray(ROOM_FLAGS(IN_ROOM(ch)), room_bits, RF_ARRAY_MAX, buf);
     send_to_char(ch, "[%5d] %s [ %s]", GET_ROOM_VNUM(IN_ROOM(ch)), world[IN_ROOM(ch)].name, buf);
   } else
     send_to_char(ch, "%s", world[IN_ROOM(ch)].name);
@@ -1542,8 +1541,8 @@ ACMD(do_color)
     send_to_char(ch, "Usage: color { Off | Sparse | Normal | Complete }\r\n");
     return;
   }
-  REMOVE_BIT(PRF_FLAGS(ch), PRF_COLOR_1 | PRF_COLOR_2);
-  SET_BIT(PRF_FLAGS(ch), (PRF_COLOR_1 * (tp & 1)) | (PRF_COLOR_2 * (tp & 2) >> 1));
+  REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1 | PRF_COLOR_2);
+  SET_BIT_AR(PRF_FLAGS(ch), (PRF_COLOR_1 * (tp & 1)) | (PRF_COLOR_2 * (tp & 2) >> 1));
 
   send_to_char(ch, "Your %scolor%s is now %s.\r\n", CCRED(ch, C_SPR), CCNRM(ch, C_OFF), ctypes[tp]);
 }
diff -puN ./src/act.item.c ./src128bit/act.item.c
--- ./src/act.item.c	Wed Aug 14 19:36:06 2002
+++ ./src128bit/act.item.c	Mon Aug 12 12:02:04 2002
@@ -82,7 +82,7 @@ void perform_put(struct char_data *ch, s
 
     /* Yes, I realize this is strange until we have auto-equip on rent. -gg */
     if (OBJ_FLAGGED(obj, ITEM_NODROP) && !OBJ_FLAGGED(cont, ITEM_NODROP)) {
-      SET_BIT(GET_OBJ_EXTRA(cont), ITEM_NODROP);
+      SET_BIT_AR(GET_OBJ_EXTRA(cont), ITEM_NODROP);
       act("You get a strange feeling as you put $p in $P.", FALSE,
                 ch, obj, cont, TO_CHAR);
     } else
diff -puN ./src/act.movement.c ./src128bit/act.movement.c
--- ./src/act.movement.c	Wed Aug 14 19:36:06 2002
+++ ./src128bit/act.movement.c	Mon Aug 12 12:02:04 2002
@@ -757,7 +757,7 @@ ACMD(do_follow)
       }
       if (ch->master)
 	stop_follower(ch);
-      REMOVE_BIT(AFF_FLAGS(ch), AFF_GROUP);
+      REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_GROUP);
       add_follower(ch, leader);
     }
   }
diff -puN ./src/act.other.c ./src128bit/act.other.c
--- ./src/act.other.c	Wed Aug 14 19:36:06 2002
+++ ./src128bit/act.other.c	Wed Aug 14 10:05:34 2002
@@ -183,14 +183,14 @@ ACMD(do_hide)
   send_to_char(ch, "You attempt to hide yourself.\r\n");
 
   if (AFF_FLAGGED(ch, AFF_HIDE))
-    REMOVE_BIT(AFF_FLAGS(ch), AFF_HIDE);
+    REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_HIDE);
 
   percent = rand_number(1, 101);	/* 101% is a complete failure */
 
   if (percent > GET_SKILL(ch, SKILL_HIDE) + dex_app_skill[GET_DEX(ch)].hide)
     return;
 
-  SET_BIT(AFF_FLAGS(ch), AFF_HIDE);
+  SET_BIT_AR(AFF_FLAGS(ch), AFF_HIDE);
 }
 
 
@@ -370,7 +370,7 @@ int perform_group(struct char_data *ch, 
   if (AFF_FLAGGED(vict, AFF_GROUP) || !CAN_SEE(ch, vict))
     return (0);
 
-  SET_BIT(AFF_FLAGS(vict), AFF_GROUP);
+  SET_BIT_AR(AFF_FLAGS(vict), AFF_GROUP);
   if (ch != vict)
     act("$N is now a member of your group.", FALSE, ch, 0, vict, TO_CHAR);
   act("You are now a member of $n's group.", FALSE, ch, 0, vict, TO_VICT);
@@ -454,7 +454,7 @@ ACMD(do_group)
 	act("$N is no longer a member of your group.", FALSE, ch, 0, vict, TO_CHAR);
       act("You have been kicked out of $n's group!", FALSE, ch, 0, vict, TO_VICT);
       act("$N has been kicked out of $n's group!", FALSE, ch, 0, vict, TO_NOTVICT);
-      REMOVE_BIT(AFF_FLAGS(vict), AFF_GROUP);
+      REMOVE_BIT_AR(AFF_FLAGS(vict), AFF_GROUP);
     }
   }
 }
@@ -478,14 +478,14 @@ ACMD(do_ungroup)
     for (f = ch->followers; f; f = next_fol) {
       next_fol = f->next;
       if (AFF_FLAGGED(f->follower, AFF_GROUP)) {
-	REMOVE_BIT(AFF_FLAGS(f->follower), AFF_GROUP);
+	REMOVE_BIT_AR(AFF_FLAGS(f->follower), AFF_GROUP);
         act("$N has disbanded the group.", TRUE, f->follower, NULL, ch, TO_CHAR);
         if (!AFF_FLAGGED(f->follower, AFF_CHARM))
 	  stop_follower(f->follower);
       }
     }
 
-    REMOVE_BIT(AFF_FLAGS(ch), AFF_GROUP);
+    REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_GROUP);
     send_to_char(ch, "You disband the group.\r\n");
     return;
   }
@@ -503,7 +503,7 @@ ACMD(do_ungroup)
     return;
   }
 
-  REMOVE_BIT(AFF_FLAGS(tch), AFF_GROUP);
+  REMOVE_BIT_AR(AFF_FLAGS(tch), AFF_GROUP);
 
   act("$N is no longer a member of your group.", FALSE, ch, 0, tch, TO_CHAR);
   act("You have been kicked out of $n's group!", FALSE, ch, 0, tch, TO_VICT);
@@ -743,23 +743,26 @@ ACMD(do_display)
     send_to_char(ch, "Usage: prompt { { H | M | V } | all | none }\r\n");
     return;
   }
-  if (!str_cmp(argument, "on") || !str_cmp(argument, "all"))
-    SET_BIT(PRF_FLAGS(ch), PRF_DISPHP | PRF_DISPMANA | PRF_DISPMOVE);
-  else if (!str_cmp(argument, "off") || !str_cmp(argument, "none"))
-    REMOVE_BIT(PRF_FLAGS(ch), PRF_DISPHP | PRF_DISPMANA | PRF_DISPMOVE);
-  else {
-    REMOVE_BIT(PRF_FLAGS(ch), PRF_DISPHP | PRF_DISPMANA | PRF_DISPMOVE);
+  if (!str_cmp(argument, "on") || !str_cmp(argument, "all")) {
+    SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP);
+    SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA);
+	SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE);
+  } else if (!str_cmp(argument, "off") || !str_cmp(argument, "none")) {
+    REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP);
+    REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA);
+	REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE);
+  } else {
 
     for (i = 0; i < strlen(argument); i++) {
       switch (LOWER(argument[i])) {
       case 'h':
-	SET_BIT(PRF_FLAGS(ch), PRF_DISPHP);
+	SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP);
 	break;
       case 'm':
-	SET_BIT(PRF_FLAGS(ch), PRF_DISPMANA);
+	SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA);
 	break;
       case 'v':
-	SET_BIT(PRF_FLAGS(ch), PRF_DISPMOVE);
+	SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE);
 	break;
       default:
 	send_to_char(ch, "Usage: prompt { { H | M | V } | all | none }\r\n");
@@ -835,8 +838,6 @@ ACMD(do_gen_write)
 
 #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)
 {
diff -puN ./src/act.wizard.c ./src128bit/act.wizard.c
--- ./src/act.wizard.c	Wed Aug 14 19:36:06 2002
+++ ./src128bit/act.wizard.c	Mon Aug 12 12:02:04 2002
@@ -35,6 +35,7 @@ extern int circle_restrict;
 extern int load_into_inventory;
 extern int buf_switches, buf_largecount, buf_overflows;
 extern int top_of_p_table;
+extern struct player_index_element *player_table;
 
 /* for chars */
 extern const char *pc_class_types[];
@@ -95,6 +96,8 @@ ACMD(do_show);
 ACMD(do_set);
 void snoop_check(struct char_data *ch);
 ACMD(do_saveall);
+ACMD(do_players);
+ACMD(do_restoreall);
 
 ACMD(do_echo)
 {
@@ -387,7 +390,7 @@ void do_stat_room(struct char_data *ch)
 	  zone_table[rm->zone].number, CCGRN(ch, C_NRM), rm->number,
 	  CCNRM(ch, C_NRM), IN_ROOM(ch), buf2);
 
-  sprintbit(rm->room_flags, room_bits, buf2, sizeof(buf2));
+  sprintbitarray(rm->room_flags, room_bits, RF_ARRAY_MAX, buf2);
   send_to_char(ch, "SpecProc: %s, Flags: %s\r\n", rm->func == NULL ? "None" : "Exists", buf2);
 
   send_to_char(ch, "Description:\r\n%s", rm->description ? rm->description : "  None.\r\n");
@@ -482,13 +485,13 @@ void do_stat_object(struct char_data *ch
     send_to_char(ch, "%s\r\n", CCNRM(ch, C_NRM));
   }
 
-  sprintbit(GET_OBJ_WEAR(j), wear_bits, buf, sizeof(buf));
+  sprintbitarray(GET_OBJ_WEAR(j), wear_bits, TW_ARRAY_MAX, buf);
   send_to_char(ch, "Can be worn on: %s\r\n", buf);
 
-  sprintbit(GET_OBJ_AFFECT(j), affected_bits, buf, sizeof(buf));
+  sprintbitarray(GET_OBJ_AFFECT(j), affected_bits, AF_ARRAY_MAX, buf);
   send_to_char(ch, "Set char bits : %s\r\n", buf);
 
-  sprintbit(GET_OBJ_EXTRA(j), extra_bits, buf, sizeof(buf));
+  sprintbitarray(GET_OBJ_EXTRA(j), extra_bits, EF_ARRAY_MAX, buf);
   send_to_char(ch, "Extra flags   : %s\r\n", buf);
 
   sprintf(buf, "Weight: %d, Value: %d, Cost/day: %d, Timer: %d, Min Level: %d\r\n",
@@ -685,15 +688,14 @@ void do_stat_character(struct char_data 
   if (IS_NPC(k)) {
     sprinttype(k->mob_specials.default_pos, position_types, buf, sizeof(buf));
     send_to_char(ch, ", Default position: %s\r\n", buf);
-    sprintbit(MOB_FLAGS(k), action_bits, buf, sizeof(buf));
+    sprintbitarray(MOB_FLAGS(k), action_bits, PM_ARRAY_MAX, buf);
     send_to_char(ch, "NPC flags: %s%s%s\r\n", CCCYN(ch, C_NRM), buf, CCNRM(ch, C_NRM));
   } else {
     send_to_char(ch, ", Idle Timer (in tics) [%d]\r\n", k->char_specials.timer);
-
-    sprintbit(PLR_FLAGS(k), player_bits, buf, sizeof(buf));
+	sprintbitarray(PLR_FLAGS(k), player_bits, PM_ARRAY_MAX, buf);
     send_to_char(ch, "PLR: %s%s%s\r\n", CCCYN(ch, C_NRM), buf, CCNRM(ch, C_NRM));
 
-    sprintbit(PRF_FLAGS(k), preference_bits, buf, sizeof(buf));
+    sprintbitarray(PRF_FLAGS(k), preference_bits, PR_ARRAY_MAX, buf);
     send_to_char(ch, "PRF: %s%s%s\r\n", CCGRN(ch, C_NRM), buf, CCNRM(ch, C_NRM));
   }
 
@@ -730,7 +732,7 @@ void do_stat_character(struct char_data 
   }
 
   /* Showing the bitvector */
-  sprintbit(AFF_FLAGS(k), affected_bits, buf, sizeof(buf));
+  sprintbitarray(AFF_FLAGS(k), affected_bits, AF_ARRAY_MAX, buf);
   send_to_char(ch, "AFF: %s%s%s\r\n", CCYEL(ch, C_NRM), buf, CCNRM(ch, C_NRM));
 
   /* Routine to show what spells a char is affected by */
@@ -745,7 +747,7 @@ void do_stat_character(struct char_data 
 	if (aff->modifier)
 	  send_to_char(ch, ", ");
 
-	sprintbit(aff->bitvector, affected_bits, buf, sizeof(buf));
+	strcpy(buf, affected_bits[aff->bitvector]);
         send_to_char(ch, "sets %s", buf);
       }
       send_to_char(ch, "\r\n");
@@ -799,7 +801,6 @@ ACMD(do_stat)
   char buf1[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
   struct char_data *victim;
   struct obj_data *object;
-  struct char_file_u tmp_store;
 
   half_chop(argument, buf1, buf2);
 
@@ -834,9 +835,8 @@ ACMD(do_stat)
     else {
       CREATE(victim, struct char_data, 1);
       clear_char(victim);
-      if (load_char(buf2, &tmp_store) >= 0) {
-	store_to_char(&tmp_store, victim);
-	victim->player.time.logon = tmp_store.last_logon;
+      CREATE(victim->player_specials, struct player_special_data, 1);
+      if (load_char(buf2, victim) >= 0) {
 	char_to_room(victim, 0);
 	if (GET_LEVEL(victim) > GET_LEVEL(ch))
 	  send_to_char(ch, "Sorry, you can't do that.\r\n");
@@ -845,7 +845,7 @@ ACMD(do_stat)
 	extract_char_final(victim);
       } else {
 	send_to_char(ch, "There is no such player.\r\n");
-	free(victim);
+	free_char(victim);
       }
     }
   } else if (is_abbrev(buf1, "object")) {
@@ -1249,8 +1249,10 @@ ACMD(do_syslog)
     send_to_char(ch, "Usage: syslog { Off | Brief | Normal | Complete }\r\n");
     return;
   }
-  REMOVE_BIT(PRF_FLAGS(ch), PRF_LOG1 | PRF_LOG2);
-  SET_BIT(PRF_FLAGS(ch), (PRF_LOG1 * (tp & 1)) | (PRF_LOG2 * (tp & 2) >> 1));
+  REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
+  REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
+  if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
+  if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
 
   send_to_char(ch, "Your syslog is now %s.\r\n", logtypes[tp]);
 }
@@ -1332,8 +1334,10 @@ ACMD(do_advance)
     /* If they are no longer an immortal, let's remove some of the
      * nice immortal only flags, shall we?
      */
-    REMOVE_BIT(PRF_FLAGS(victim), PRF_LOG1 | PRF_LOG2);
-    REMOVE_BIT(PRF_FLAGS(victim), PRF_NOHASSLE | PRF_HOLYLIGHT);
+    REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
+    REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
+    REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_NOHASSLE);
+    REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_HOLYLIGHT);
     run_autowiz();
   }
 
@@ -1614,25 +1618,32 @@ ACMD(do_date)
 ACMD(do_last)
 {
   char arg[MAX_INPUT_LENGTH];
-  struct char_file_u chdata;
+  struct char_data *vict = NULL;
 
   one_argument(argument, arg);
   if (!*arg) {
     send_to_char(ch, "For whom do you wish to search?\r\n");
     return;
   }
-  if (load_char(arg, &chdata) < 0) {
+  CREATE(vict, struct char_data, 1);
+  clear_char(vict);
+  CREATE(vict->player_specials, struct player_special_data, 1);
+  if (load_char(arg, vict) <  0) {
     send_to_char(ch, "There is no such player.\r\n");
+    free_char(vict);
     return;
   }
-  if ((chdata.level > GET_LEVEL(ch)) && (GET_LEVEL(ch) < LVL_IMPL)) {
+  if ((GET_LEVEL(vict) > GET_LEVEL(ch)) && (GET_LEVEL(ch) < LVL_IMPL)) {
     send_to_char(ch, "You are not sufficiently godly for that!\r\n");
     return;
   }
   send_to_char(ch, "[%5ld] [%2d %s] %-12s : %-18s : %-20s\r\n",
-	  chdata.char_specials_saved.idnum, chdata.level,
-	  class_abbrevs[(int) chdata.chclass], chdata.name, chdata.host,
-	  ctime(&chdata.last_logon));
+    GET_IDNUM(vict), (int) GET_LEVEL(vict),
+    class_abbrevs[(int) GET_CLASS(vict)], GET_NAME(vict),
+    vict->player_specials->host && *vict->player_specials->host
+    ? vict->player_specials->host : "(NOHOST)",
+    ctime(&vict->player.time.logon));
+  free_char(vict);
 }
 
 
@@ -1847,8 +1858,9 @@ ACMD(do_wizutil)
 	send_to_char(ch, "Your victim is not flagged.\r\n");
 	return;
       }
-      REMOVE_BIT(PLR_FLAGS(vict), PLR_THIEF | PLR_KILLER);
-      send_to_char(ch, "Pardoned.\r\n");
+      REMOVE_BIT_AR(PLR_FLAGS(vict), PLR_THIEF);
+      REMOVE_BIT_AR(PLR_FLAGS(vict), PLR_KILLER);
+	  send_to_char(ch, "Pardoned.\r\n");
       send_to_char(vict, "You have been pardoned by the Gods!\r\n");
       mudlog(BRF, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s pardoned by %s", GET_NAME(vict), GET_NAME(ch));
       break;
@@ -1873,7 +1885,7 @@ ACMD(do_wizutil)
 	send_to_char(ch, "Your victim is already pretty cold.\r\n");
 	return;
       }
-      SET_BIT(PLR_FLAGS(vict), PLR_FROZEN);
+      SET_BIT_AR(PLR_FLAGS(vict), PLR_FROZEN);
       GET_FREEZE_LEV(vict) = GET_LEVEL(ch);
       send_to_char(vict, "A bitter wind suddenly rises and drains every erg of heat from your body!\r\nYou feel frozen!\r\n");
       send_to_char(ch, "Frozen.\r\n");
@@ -1891,7 +1903,7 @@ ACMD(do_wizutil)
 	return;
       }
       mudlog(BRF, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s un-frozen by %s.", GET_NAME(vict), GET_NAME(ch));
-      REMOVE_BIT(PLR_FLAGS(vict), PLR_FROZEN);
+      REMOVE_BIT_AR(PLR_FLAGS(vict), PLR_FROZEN);
       send_to_char(vict, "A fireball suddenly explodes in front of you, melting the ice!\r\nYou feel thawed.\r\n");
       send_to_char(ch, "Thawed.\r\n");
       act("A sudden fireball conjured from nowhere thaws $n!", FALSE, vict, 0, 0, TO_ROOM);
@@ -1933,13 +1945,12 @@ size_t print_zone_to_buf(char *bufptr, s
 
 ACMD(do_show)
 {
-  struct char_file_u vbuf;
   int i, j, k, l, con;		/* i, j, k to specifics? */
   size_t len, nlen;
   zone_rnum zrn;
   zone_vnum zvn;
   byte self = FALSE;
-  struct char_data *vict;
+  struct char_data *vict = NULL;
   struct obj_data *obj;
   struct descriptor_data *d;
   char field[MAX_INPUT_LENGTH], value[MAX_INPUT_LENGTH],
@@ -2019,19 +2030,28 @@ ACMD(do_show)
       return;
     }
 
-    if (load_char(value, &vbuf) < 0) {
+    CREATE(vict, struct char_data, 1);
+    clear_char(vict);
+    CREATE(vict->player_specials, struct player_special_data, 1);
+    if (load_char(value, vict) < 0) {
       send_to_char(ch, "There is no such player.\r\n");
+      free_char(vict);
       return;
     }
-
-    send_to_char(ch, "Player: %-12s (%s) [%2d %s]\r\n", vbuf.name,
-	genders[(int) vbuf.sex], vbuf.level, class_abbrevs[(int) vbuf.chclass]);
+    send_to_char(ch, "Player: %-12s (%s) [%2d %s]\r\n", GET_NAME(vict),
+      genders[(int) GET_SEX(vict)], GET_LEVEL(vict), class_abbrevs[(int)
+      GET_CLASS(vict)]);
     send_to_char(ch, "Au: %-8d  Bal: %-8d  Exp: %-8d  Align: %-5d  Lessons: %-3d\r\n",
-	vbuf.points.gold, vbuf.points.bank_gold, vbuf.points.exp,
-	vbuf.char_specials_saved.alignment, vbuf.player_specials_saved.spells_to_learn);
+      GET_GOLD(vict), GET_BANK_GOLD(vict), GET_EXP(vict),
+      GET_ALIGNMENT(vict), GET_PRACTICES(vict));
+
     /* ctime() uses static buffer: do not combine. */
-    send_to_char(ch, "Started: %-20.16s  ", ctime(&vbuf.birth));
-    send_to_char(ch, "Last: %-20.16s  Played: %3dh %2dm\r\n", ctime(&vbuf.last_logon), vbuf.played / 3600, vbuf.played / 60 % 60);
+    send_to_char(ch, "Started: %-20.16s  ", ctime(&vict->player.time.birth));
+    send_to_char(ch, "Last: %-20.16s  Played: %3dh %2dm\r\n",
+      ctime(&vict->player.time.logon),
+      (int) (vict->player.time.played / 3600),
+      (int) (vict->player.time.played / 60 % 60));
+    free_char(vict);
     break;
 
   /* show rent */
@@ -2166,8 +2186,8 @@ ACMD(do_show)
 #define NUMBER	2
 
 #define SET_OR_REMOVE(flagset, flags) { \
-	if (on) SET_BIT(flagset, flags); \
-	else if (off) REMOVE_BIT(flagset, flags); }
+	if (on) SET_BIT_AR(flagset, flags); \
+	else if (off) REMOVE_BIT_AR(flagset, flags); }
 
 #define RANGE(low, high) (value = MAX((low), MIN((high), (value))))
 
@@ -2487,11 +2507,11 @@ int perform_set(struct char_data *ch, st
     break;
   case 42:
     if (!str_cmp(val_arg, "off")) {
-      REMOVE_BIT(PLR_FLAGS(vict), PLR_LOADROOM);
+      REMOVE_BIT_AR(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);
+        SET_BIT_AR(PLR_FLAGS(vict), PLR_LOADROOM);
 	GET_LOADROOM(vict) = rvnum;
 	send_to_char(ch, "%s will enter at room #%d.", GET_NAME(vict), GET_LOADROOM(vict));
       } else {
@@ -2573,7 +2593,6 @@ int perform_set(struct char_data *ch, st
 ACMD(do_set)
 {
   struct char_data *vict = NULL, *cbuf = NULL;
-  struct char_file_u tmp_store;
   char field[MAX_INPUT_LENGTH], name[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH];
   int mode, len, player_i = 0, retval;
   char is_file = 0, is_player = 0;
@@ -2613,8 +2632,8 @@ ACMD(do_set)
     /* try to load the player off disk */
     CREATE(cbuf, struct char_data, 1);
     clear_char(cbuf);
-    if ((player_i = load_char(name, &tmp_store)) > -1) {
-      store_to_char(&tmp_store, cbuf);
+    CREATE(cbuf->player_specials, struct player_special_data, 1);
+    if ((player_i = load_char(name, cbuf)) > -1) {
       if (GET_LEVEL(cbuf) >= GET_LEVEL(ch)) {
 	free_char(cbuf);
 	send_to_char(ch, "Sorry, you can't do that.\r\n");
@@ -2622,7 +2641,7 @@ ACMD(do_set)
       }
       vict = cbuf;
     } else {
-      free(cbuf);
+      free_char(cbuf);
       send_to_char(ch, "There is no such player.\r\n");
       return;
     }
@@ -2642,9 +2661,8 @@ ACMD(do_set)
     if (!is_file && !IS_NPC(vict))
       save_char(vict);
     if (is_file) {
-      char_to_store(vict, &tmp_store);
-      fseek(player_fl, (player_i) * sizeof(struct char_file_u), SEEK_SET);
-      fwrite(&tmp_store, sizeof(struct char_file_u), 1, player_fl);
+      GET_PFILEPOS(cbuf) = player_i;
+      save_char(cbuf);
       send_to_char(ch, "Saved in file.\r\n");
     }
   }
@@ -2663,3 +2681,52 @@ ACMD(do_saveall)
     send_to_char(ch, "World files saved.\n\r");
  }
 }
+
+ACMD(do_players)
+{
+  int i, count = 0;
+  char buf[MAX_INPUT_LENGTH];
+  *buf = 0;
+
+  for (i = 0; i <= top_of_p_table; i++) {
+    sprintf(buf, "%s  %-20.20s", buf, (player_table + i)->name);
+    count++;
+    if (count == 3) {
+      count = 0;
+      strcat(buf, "\r\n");
+    }
+  }
+  page_string(ch->desc, buf, 1);
+}
+
+ACMD(do_restoreall){
+        struct descriptor_data *pt;
+
+        for (pt = descriptor_list; pt; pt = pt->next){
+                if (STATE(pt) == CON_PLAYING && pt->character && pt->character != ch){
+                        GET_HIT(pt->character) = GET_MAX_HIT(pt->character);
+                        GET_MANA(pt->character) = GET_MAX_MANA(pt->character);
+                        GET_MOVE(pt->character) = GET_MAX_MOVE(pt->character);
+
+                        if ((GET_LEVEL(ch) >= LVL_GRGOD) && (GET_LEVEL(pt->character)>= LVL_IMMORT)) {
+                    /*   for (i = 1; i <= MAX_SKILLS; i++)
+                        SET_SKILL(vict, i, 100);*/
+
+                        if (GET_LEVEL(pt->character) >= LVL_IMMORT) {
+                                pt->character->real_abils.str_add = 100;
+                                pt->character->real_abils.intel = 25;
+                                pt->character->real_abils.wis = 25;
+                                pt->character->real_abils.dex = 25;
+                                pt->character->real_abils.str = 25;
+                                pt->character->real_abils.con = 25;
+                                pt->character->real_abils.cha = 25;
+                        }
+                        pt->character->aff_abils = pt->character->real_abils;
+                        }
+                        update_pos(pt->character);
+                        send_to_char(ch, OK);
+                        act("You have been fully healed by $N!", FALSE, pt->character, 0, ch, TO_CHAR);
+                }
+        }
+}
+
diff -puN ./src/class.c ./src128bit/class.c
--- ./src/class.c	Tue Apr 30 21:00:32 2002
+++ ./src128bit/class.c	Mon Aug 12 12:02:06 2002
@@ -1507,7 +1507,7 @@ void do_start(struct char_data *ch)
   GET_COND(ch, DRUNK) = 0;
 
   if (siteok_everyone)
-    SET_BIT(PLR_FLAGS(ch), PLR_SITEOK);
+    SET_BIT_AR(PLR_FLAGS(ch), PLR_SITEOK);
 }
 
 
@@ -1565,7 +1565,7 @@ void advance_level(struct char_data *ch)
   if (GET_LEVEL(ch) >= LVL_IMMORT) {
     for (i = 0; i < 3; i++)
       GET_COND(ch, i) = (char) -1;
-    SET_BIT(PRF_FLAGS(ch), PRF_HOLYLIGHT);
+    SET_BIT_AR(PRF_FLAGS(ch), PRF_HOLYLIGHT);
   }
 
   snoop_check(ch);
diff -puN ./src/color.c ./src128bit/color.c
--- ./src/color.c	Thu Jan  1 00:00:00 1970
+++ ./src128bit/color.c	Tue Apr  1 19:48:32 1997
@@ -0,0 +1,149 @@
+/* ************************************************************************
+*   File: colour.c                                      Part of CircleMUD *
+*  Usage: interprets inline colour codes                                  *
+*  Name: Easy Colour v2.2                                                 *
+*                                                                         *
+*  All rights reserved.  See license.doc for complete information.        *
+*  Modifications Copyright Trevor Man 1997                                *
+*  Based on the Easy Color patch by mud@proimages.proimages.com           *
+*  Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
+*  CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.               *
+************************************************************************ */
+
+#include "conf.h"
+
+#define CNRM  "\x1B[0;0m"
+#define CBLK  "\x1B[0;30m"
+#define CRED  "\x1B[0;31m"
+#define CGRN  "\x1B[0;32m"
+#define CYEL  "\x1B[0;33m"
+#define CBLU  "\x1B[0;34m"
+#define CMAG  "\x1B[0;35m"
+#define CCYN  "\x1B[0;36m"
+#define CWHT  "\x1B[0;37m"
+#define CNUL  ""
+
+#define BBLK  "\x1B[1;30m"
+#define BRED  "\x1B[1;31m"
+#define BGRN  "\x1B[1;32m"
+#define BYEL  "\x1B[1;33m"
+#define BBLU  "\x1B[1;34m"
+#define BMAG  "\x1B[1;35m"
+#define BCYN  "\x1B[1;36m"
+#define BWHT  "\x1B[1;37m"
+
+#define BKBLK  "\x1B[40m"
+#define BKRED  "\x1B[41m"
+#define BKGRN  "\x1B[42m"
+#define BKYEL  "\x1B[43m"
+#define BKBLU  "\x1B[44m"
+#define BKMAG  "\x1B[45m"
+#define BKCYN  "\x1B[46m"
+#define BKWHT  "\x1B[47m"
+
+#define CAMP  "&"
+#define CSLH  "\\"
+
+#define CUDL  "\x1B[4m"	/* Underline ANSI code */
+#define CFSH  "\x1B[5m"	/* Flashing ANSI code.  Change to #define CFSH "" if
+                         * you want to disable flashing colour codes
+                         */
+#define CRVS  "\x1B[7m" /* Reverse video ANSI code */
+
+const char *COLOURLIST[] = {CNRM, CRED, CGRN, CYEL, CBLU, CMAG, CCYN, CWHT,
+			    BRED, BGRN, BYEL, BBLU, BMAG, BCYN, BWHT,
+			    BKRED, BKGRN, BKYEL, BKBLU, BKMAG, BKCYN, BKWHT,
+			    CAMP, CSLH, BKBLK, CBLK, CFSH, CRVS, CUDL, BBLK };
+
+#define MAX_COLORS 30
+
+int isnum(char s)
+{
+  return( (s>='0') && (s<='9') );
+}
+
+int is_colour(char code)
+{
+  switch (code) {
+  /* Normal colours */
+  case  'k': return 25; break;	/* Black */
+  case  'r': return 1;	break;	/* Red */
+  case  'g': return 2;	break;	/* Green */
+  case  'y': return 3;	break;	/* Yellow */
+  case  'b': return 4;	break;	/* Blue */
+  case  'm': return 5;	break;	/* Magenta */
+  case  'c': return 6;	break;	/* Cyan */
+  case  'w': return 7;	break;	/* White */
+
+  /* Bold colours */
+  case  'K': return 29; break;  /* Bold black (Just for completeness) */
+  case  'R': return 8;	break;	/* Bold red */
+  case  'G': return 9;	break;	/* Bold green */
+  case  'Y': return 10;	break;	/* Bold yellow */
+  case  'B': return 11;	break;	/* Bold blue */
+  case  'M': return 12;	break;	/* Bold magenta */
+  case  'C': return 13;	break;	/* Bold cyan */
+  case  'W': return 14;	break;	/* Bold white */
+  
+  /* Background colours */
+  case  '0': return 24;	break; 	/* Black background */
+  case  '1': return 15;	break;	/* Red background */
+  case  '2': return 16;	break;	/* Green background */
+  case  '3': return 17;	break;	/* Yellow background */
+  case  '4': return 18;	break;	/* Blue background */
+  case  '5': return 19;	break;	/* Magenta background */
+  case  '6': return 20;	break;	/* Cyan background */
+  case  '7': return 21;	break;	/* White background */
+
+  /* Misc characters */
+  case  '&': return 22;	break;	/* The & character */
+  case '\\': return 23;	break;	/* The \ character */
+  
+  /* Special codes */
+  case  'n': return 0;	break;	/* Normal */
+  case  'f': return 26;	break;	/* Flash */
+  case  'v': return 27; break;	/* Reverse video */
+  case  'u': return 28; break;	/* Underline (Only for mono screens) */
+
+  default:   return -1;	break;
+  }
+  return -1;
+}
+
+void proc_color(char *inbuf, int colour)
+{
+  register int j = 0, p = 0;
+  int k, max, c = 0;
+  char out_buf[32768];
+
+  if (inbuf[0] == '\0')
+    return;
+
+  while (inbuf[j] != '\0') {
+    if ((inbuf[j]=='\\') && (inbuf[j+1]=='c')
+        && isnum(inbuf[j + 2]) && isnum(inbuf[j + 3])) {
+      c = (inbuf[j + 2] - '0')*10 + inbuf[j + 3]-'0';
+      j += 4;
+    } else if ((inbuf[j] == '&') && !(is_colour(inbuf[j + 1]) == -1)) {
+      c = is_colour(inbuf[j + 1]);
+      j += 2;
+    } else {
+      out_buf[p] = inbuf[j];
+      j++;
+      p++;
+      continue;
+    }
+    if (c > MAX_COLORS)
+      c = 0;
+    max = strlen(COLOURLIST[c]);
+    if (colour || max == 1)
+      for (k = 0; k < max; k++) {
+        out_buf[p] = COLOURLIST[c][k];
+	p++;
+      }
+  }
+
+  out_buf[p] = '\0';
+
+  strcpy(inbuf, out_buf);
+}
diff -puN ./src/comm.c ./src128bit/comm.c
--- ./src/comm.c	Wed Aug 14 19:36:06 2002
+++ ./src128bit/comm.c	Wed Aug  7 18:27:36 2002
@@ -12,6 +12,7 @@
 
 #include "conf.h"
 #include "sysdep.h"
+#include "screen.h"
 
 #if CIRCLE_GNU_LIBC_MEMORY_TRACK
 # include <mcheck.h>
@@ -82,7 +83,6 @@ extern const char *circlemud_version;
 extern int circle_restrict;
 extern int mini_mud;
 extern int no_rent_check;
-extern FILE *player_fl;
 extern ush_int DFLT_PORT;
 extern const char *DFLT_DIR;
 extern const char *DFLT_IP;
@@ -95,6 +95,7 @@ extern int *cmd_sort_info;
 
 extern struct time_info_data time_info;		/* In db.c */
 extern char *help;
+void proc_color(char *inbuf, int color);
 
 /* local globals */
 struct descriptor_data *descriptor_list = NULL;		/* master desc list */
@@ -388,7 +389,6 @@ void init_game(ush_int port)
     close_socket(descriptor_list);
 
   CLOSE_SOCKET(mother_desc);
-  fclose(player_fl);
 
   if (circle_reboot != 2)
     save_all();
@@ -859,7 +859,6 @@ void heartbeat(int heart_pulse)
     weather_and_time(1);
     affect_update();
     point_update();
-    fflush(player_fl);
   }
 
   if (auto_save && !(heart_pulse % PULSE_AUTOSAVE)) {	/* 1 minute */
@@ -1418,6 +1417,8 @@ int process_output(struct descriptor_dat
   /* add the extra CRLF if the person isn't in compact mode */
   if (STATE(t) == CON_PLAYING && t->character && !IS_NPC(t->character) && !PRF_FLAGGED(t->character, PRF_COMPACT))
     strcat(i, "\r\n");	/* strcpy: OK (i:MAX_SOCK_BUF reserves space) */
+  if(t->character)
+    proc_color(i, (clr(t->character, C_NRM)));
 
   /* add a prompt */
   strcat(i, make_prompt(t));	/* strcpy: OK (i:MAX_SOCK_BUF reserves space) */
diff -puN ./src/conf.h ./src128bit/conf.h
--- ./src/conf.h	Thu Jan  1 00:00:00 1970
+++ ./src128bit/conf.h	Fri Jun 14 14:06:42 2002
@@ -0,0 +1,336 @@
+/* src/conf.h.  Generated automatically by configure.  */
+/* src/conf.h.in.  Generated automatically from configure.in by autoheader.  */
+
+/* Define to empty if the keyword does not work.  */
+/* #undef const */
+
+/* Define if you don't have vprintf but do have _doprnt.  */
+/* #undef HAVE_DOPRNT */
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define if you have the vprintf function.  */
+/* #undef HAVE_VPRINTF */
+
+/* Define to `int' if <sys/types.h> doesn't define.  */
+/* #undef pid_t */
+
+/* Define as the return type of signal handlers (int or void).  */
+#define RETSIGTYPE void
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+/* #undef size_t */
+
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
+
+/* Define if you can safely include both <sys/time.h> and <time.h>.  */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define if we're compiling CircleMUD under any type of UNIX system.  */
+#define CIRCLE_UNIX 1
+
+/* Define if the system is capable of using crypt() to encrypt.  */
+#define CIRCLE_CRYPT 1
+
+/* Define if we don't have proper support for the system's crypt().  */
+/* #undef HAVE_UNSAFE_CRYPT */
+
+/* Define is the system has struct in_addr.  */
+#define HAVE_STRUCT_IN_ADDR 1
+
+/* Define to `int' if <sys/socket.h> doesn't define.  */
+/* #undef socklen_t */
+
+/* Define if your system has compression support in zlib. */
+#define HAVE_ZLIB 1
+
+/* Define to `int' if <sys/types.h> doesn't define.  */
+/* #undef ssize_t */
+
+/* Define if you have the gettimeofday function.  */
+/* #undef HAVE_GETTIMEOFDAY */
+
+/* Define if you have the inet_addr function.  */
+#define HAVE_INET_ADDR 1
+
+/* Define if you have the inet_aton function.  */
+#define HAVE_INET_ATON 1
+
+/* Define if you have the select function.  */
+/* #undef HAVE_SELECT */
+
+/* Define if you have the snprintf function.  */
+/* #undef HAVE_SNPRINTF */
+
+/* Define if you have the strcasecmp function.  */
+/* #undef HAVE_STRCASECMP */
+
+/* Define if you have the strdup function.  */
+/* #undef HAVE_STRDUP */
+
+/* Define if you have the strerror function.  */
+/* #undef HAVE_STRERROR */
+
+/* Define if you have the stricmp function.  */
+/* #undef HAVE_STRICMP */
+
+/* Define if you have the strlcpy function.  */
+/* #undef HAVE_STRLCPY */
+
+/* Define if you have the strncasecmp function.  */
+/* #undef HAVE_STRNCASECMP */
+
+/* Define if you have the strnicmp function.  */
+/* #undef HAVE_STRNICMP */
+
+/* Define if you have the strstr function.  */
+/* #undef HAVE_STRSTR */
+
+/* Define if you have the vsnprintf function.  */
+/* #undef HAVE_VSNPRINTF */
+
+/* Define if you have the <arpa/inet.h> header file.  */
+#define HAVE_ARPA_INET_H 1
+
+/* Define if you have the <arpa/telnet.h> header file.  */
+#define HAVE_ARPA_TELNET_H 1
+
+/* Define if you have the <assert.h> header file.  */
+#define HAVE_ASSERT_H 1
+
+/* Define if you have the <crypt.h> header file.  */
+#define HAVE_CRYPT_H 1
+
+/* Define if you have the <errno.h> header file.  */
+#define HAVE_ERRNO_H 1
+
+/* Define if you have the <fcntl.h> header file.  */
+#define HAVE_FCNTL_H 1
+
+/* Define if you have the <limits.h> header file.  */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <mcheck.h> header file.  */
+/* #undef HAVE_MCHECK_H */
+
+/* Define if you have the <memory.h> header file.  */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the <net/errno.h> header file.  */
+/* #undef HAVE_NET_ERRNO_H */
+
+/* Define if you have the <netdb.h> header file.  */
+#define HAVE_NETDB_H 1
+
+/* Define if you have the <netinet/in.h> header file.  */
+#define HAVE_NETINET_IN_H 1
+
+/* Define if you have the <signal.h> header file.  */
+#define HAVE_SIGNAL_H 1
+
+/* Define if you have the <string.h> header file.  */
+#define HAVE_STRING_H 1
+
+/* Define if you have the <strings.h> header file.  */
+#define HAVE_STRINGS_H 1
+
+/* Define if you have the <sys/fcntl.h> header file.  */
+#define HAVE_SYS_FCNTL_H 1
+
+/* Define if you have the <sys/resource.h> header file.  */
+#define HAVE_SYS_RESOURCE_H 1
+
+/* Define if you have the <sys/select.h> header file.  */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define if you have the <sys/socket.h> header file.  */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define if you have the <sys/stat.h> header file.  */
+#define HAVE_SYS_STAT_H 1
+
+/* Define if you have the <sys/time.h> header file.  */
+#define HAVE_SYS_TIME_H 1
+
+/* Define if you have the <sys/types.h> header file.  */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define if you have the <sys/uio.h> header file.  */
+#define HAVE_SYS_UIO_H 1
+
+/* Define if you have the <unistd.h> header file.  */
+#define HAVE_UNISTD_H 1
+
+/* Define if you have the malloc library (-lmalloc).  */
+/* #undef HAVE_LIBMALLOC */
+
+/* Check for a prototype to accept. */
+/* #undef NEED_ACCEPT_PROTO */
+
+/* Check for a prototype to atoi. */
+/* #undef NEED_ATOI_PROTO */
+
+/* Check for a prototype to atol. */
+/* #undef NEED_ATOL_PROTO */
+
+/* Check for a prototype to bind. */
+/* #undef NEED_BIND_PROTO */
+
+/* Check for a prototype to bzero. */
+/* #undef NEED_BZERO_PROTO */
+
+/* Check for a prototype to chdir. */
+/* #undef NEED_CHDIR_PROTO */
+
+/* Check for a prototype to close. */
+/* #undef NEED_CLOSE_PROTO */
+
+/* Check for a prototype to crypt. */
+/* #undef NEED_CRYPT_PROTO */
+
+/* Check for a prototype to fclose. */
+/* #undef NEED_FCLOSE_PROTO */
+
+/* Check for a prototype to fcntl. */
+/* #undef NEED_FCNTL_PROTO */
+
+/* Check for a prototype to fflush. */
+/* #undef NEED_FFLUSH_PROTO */
+
+/* Check for a prototype to fprintf. */
+/* #undef NEED_FPRINTF_PROTO */
+
+/* Check for a prototype to fputc. */
+/* #undef NEED_FPUTC_PROTO */
+
+/* Check for a prototype to fputs. */
+/* #undef NEED_FPUTS_PROTO */
+
+/* Check for a prototype to fread. */
+/* #undef NEED_FREAD_PROTO */
+
+/* Check for a prototype to fscanf. */
+/* #undef NEED_FSCANF_PROTO */
+
+/* Check for a prototype to fseek. */
+/* #undef NEED_FSEEK_PROTO */
+
+/* Check for a prototype to fwrite. */
+/* #undef NEED_FWRITE_PROTO */
+
+/* Check for a prototype to getpeername. */
+/* #undef NEED_GETPEERNAME_PROTO */
+
+/* Check for a prototype to getpid. */
+/* #undef NEED_GETPID_PROTO */
+
+/* Check for a prototype to getrlimit. */
+/* #undef NEED_GETRLIMIT_PROTO */
+
+/* Check for a prototype to getsockname. */
+/* #undef NEED_GETSOCKNAME_PROTO */
+
+/* Check for a prototype to gettimeofday. */
+/* #undef NEED_GETTIMEOFDAY_PROTO */
+
+/* Check for a prototype to htonl. */
+/* #undef NEED_HTONL_PROTO */
+
+/* Check for a prototype to htons. */
+/* #undef NEED_HTONS_PROTO */
+
+/* Check for a prototype to inet_addr. */
+/* #undef NEED_INET_ADDR_PROTO */
+
+/* Check for a prototype to inet_aton. */
+/* #undef NEED_INET_ATON_PROTO */
+
+/* Check for a prototype to inet_ntoa. */
+/* #undef NEED_INET_NTOA_PROTO */
+
+/* Check for a prototype to listen. */
+/* #undef NEED_LISTEN_PROTO */
+
+/* Check for a prototype to ntohl. */
+/* #undef NEED_NTOHL_PROTO */
+
+/* Check for a prototype to perror. */
+/* #undef NEED_PERROR_PROTO */
+
+/* Check for a prototype to printf. */
+/* #undef NEED_PRINTF_PROTO */
+
+/* Check for a prototype to qsort. */
+/* #undef NEED_QSORT_PROTO */
+
+/* Check for a prototype to read. */
+/* #undef NEED_READ_PROTO */
+
+/* Check for a prototype to remove. */
+/* #undef NEED_REMOVE_PROTO */
+
+/* Check for a prototype to rewind. */
+/* #undef NEED_REWIND_PROTO */
+
+/* Check for a prototype to select. */
+/* #undef NEED_SELECT_PROTO */
+
+/* Check for a prototype to setitimer. */
+/* #undef NEED_SETITIMER_PROTO */
+
+/* Check for a prototype to setrlimit. */
+/* #undef NEED_SETRLIMIT_PROTO */
+
+/* Check for a prototype to setsockopt. */
+/* #undef NEED_SETSOCKOPT_PROTO */
+
+/* Check for a prototype to snprintf. */
+/* #undef NEED_SNPRINTF_PROTO */
+
+/* Check for a prototype to socket. */
+/* #undef NEED_SOCKET_PROTO */
+
+/* Check for a prototype to sprintf. */
+/* #undef NEED_SPRINTF_PROTO */
+
+/* Check for a prototype to sscanf. */
+/* #undef NEED_SSCANF_PROTO */
+
+/* Check for a prototype to strcasecmp. */
+/* #undef NEED_STRCASECMP_PROTO */
+
+/* Check for a prototype to strdup. */
+/* #undef NEED_STRDUP_PROTO */
+
+/* Check for a prototype to strerror. */
+/* #undef NEED_STRERROR_PROTO */
+
+/* Check for a prototype to stricmp. */
+/* #undef NEED_STRICMP_PROTO */
+
+/* Check for a prototype to strlcpy. */
+/* #undef NEED_STRLCPY_PROTO */
+
+/* Check for a prototype to strncasecmp. */
+/* #undef NEED_STRNCASECMP_PROTO */
+
+/* Check for a prototype to strnicmp. */
+/* #undef NEED_STRNICMP_PROTO */
+
+/* Check for a prototype to system. */
+/* #undef NEED_SYSTEM_PROTO */
+
+/* Check for a prototype to time. */
+/* #undef NEED_TIME_PROTO */
+
+/* Check for a prototype to unlink. */
+/* #undef NEED_UNLINK_PROTO */
+
+/* Check for a prototype to vsnprintf. */
+/* #undef NEED_VSNPRINTF_PROTO */
+
+/* Check for a prototype to write. */
+/* #undef NEED_WRITE_PROTO */
+
diff -puN ./src/config.c ./src128bit/config.c
--- ./src/config.c	Tue Dec 11 18:30:06 2001
+++ ./src128bit/config.c	Wed Aug  7 14:05:46 2002
@@ -160,6 +160,50 @@ int crash_file_timeout = 10;
 /* Lifetime of normal rent files in days */
 int rent_file_timeout = 30;
 
+/* Do you want to automatically wipe players who've been gone too long? */
+int auto_pwipe = NO;
+
+/* Autowipe deletion criteria
+   This struct holds information used to determine which players to wipe
+   then the mud boots.  The levels must be in ascending order, with a
+   descending level marking the end of the array.  A level -1 entry in the
+   beginning is the case for players with the PLR_DELETED flag.  The
+   values below match the stock purgeplay.c criteria.
+
+   Detailed explanation by array element:
+   * Element 0, level -1, days 0: Players with PLR_DELETED flag are always
+	wiped.
+   * Element 1, level 0, days 0: Players at level 0 have created a
+	character, but have never actually entered the game, so always
+	wipe them.
+   * Element 2, level 1, days 4: Players at level 1 are wiped if they
+	haven't logged on in the past 4 days.
+   * Element 3, level 4, days 7: Players level 2 through 4 are wiped if
+	they haven't logged on in the past 7 days.
+   * Element 4, level 10, days 30: Players level 5-10 get 30 days.
+   * Element 5, level LVL_IMMORT - 1, days 60: All other mortals get
+	60 days.
+   * Element 6, level LVL_IMPL, days 90: Immortals get 90 days.
+   * Element 7: Because -2 is less than LVL_IMPL, this is assumed to
+	be the end of the criteria.  The days entry is not used in this
+	case.
+*/
+struct pclean_criteria_data pclean_criteria[] = {
+/*	LEVEL		DAYS	*/
+  {	-1		,0	}, /* players with PLR_DELETE flag */
+  {	0		,0	}, /* level 0 */
+  {	1		,4	},
+  {	4		,7	},
+  {	10		,30	},
+  {	LVL_IMMORT - 1	,60	}, /* highest mortal */
+  {	LVL_IMPL	,90	}, /* all immortals */
+  {	-2		,0	}  /* no more level checks */
+};
+
+/* Do you want players who self-delete to be wiped immediately with no
+   backup?
+*/
+int selfdelete_fastwipe = YES;
 
 /****************************************************************************/
 /****************************************************************************/
@@ -199,7 +243,7 @@ room_vnum donation_room_3 = NOWHERE;	/* 
  * Change the PORT= line in autorun instead of (or in addition to)
  * changing this.
  */
-ush_int DFLT_PORT = 4000;
+ush_int DFLT_PORT = 6666;
 
 /*
  * IP address to which the MUD should bind.  This is only useful if
diff -puN ./src/constants.c ./src128bit/constants.c
--- ./src/constants.c	Wed Aug 14 19:36:08 2002
+++ ./src128bit/constants.c	Wed Aug 14 17:10:16 2002
@@ -183,7 +183,8 @@ const char *preference_bits[] = {
   "NO_AUC",
   "NO_GOS",
   "NO_GTZ",
-  "RMFLG",
+  "RMFLG",
+  "CLS",
   "\n"
 };
 
@@ -191,6 +192,7 @@ const char *preference_bits[] = {
 /* AFF_x */
 const char *affected_bits[] =
 {
+  "\0", /* DO NOT REMOVE!! */
   "BLIND",
   "INVIS",
   "DET-ALIGN",
diff -puN ./src/db.c ./src128bit/db.c
--- ./src/db.c	Wed Aug 14 19:36:08 2002
+++ ./src128bit/db.c	Mon Aug 12 12:53:12 2002
@@ -24,6 +24,8 @@
 #include "interpreter.h"
 #include "house.h"
 #include "constants.h"
+#include "diskio.h"
+#include "pfdefaults.h"
 #include "dg_scripts.h"
 
 /**************************************************************************
@@ -48,8 +50,8 @@ zone_rnum top_of_zone_table = 0;/* top e
 struct message_list fight_messages[MAX_MESSAGES];	/* fighting messages	 */
 
 struct player_index_element *player_table = NULL;	/* index to plr file	 */
-FILE *player_fl = NULL;		/* file desc of player file	 */
 int top_of_p_table = 0;		/* ref to top of table		 */
+int top_of_p_file = 0;  /* ref of size of pfile   */
 long top_idnum = 0;		/* highest idnum in use		 */
 
 struct index_data **trig_index; /* index table for triggers      */
@@ -148,6 +150,9 @@ void Read_Invalid_List(void);
 void boot_the_shops(FILE *shop_f, char *filename, int rec_count);
 int hsort(const void *a, const void *b);
 void prune_crlf(char *txt);
+void sprintbits(long vektor, char *outstring);
+void tag_argument(char *argument, char *tag);
+void clean_pfiles(void);
 void destroy_shops(void);
 void free_object_strings(struct obj_data *obj);
 void free_object_strings_proto(struct obj_data *obj);
@@ -161,6 +166,16 @@ extern room_vnum frozen_start_room;
 extern struct descriptor_data *descriptor_list;
 extern const char *unused_spellname;	/* spell_parser.c */
 
+/* external ascii pfile vars */
+extern struct pclean_criteria_data pclean_criteria[];
+extern int selfdelete_fastwipe;
+extern int auto_pwipe;
+
+/* ascii pfiles - set this TRUE if you want poofin/poofout
+   +    strings saved in the pfiles
+   + */
+#define ASCII_SAVE_POOFS  FALSE
+
 /*************************************************************************
 *  routines for booting the system                                       *
 *************************************************************************/
@@ -427,6 +442,11 @@ void boot_db(void)
   log("Generating player index.");
   build_player_index();
 
+  if(auto_pwipe) {
+    log("Cleaning out the pfiles.");
+    clean_pfiles();
+  }
+
   log("Loading fight messages.");
   load_messages();
 
@@ -568,58 +588,44 @@ void free_player_index(void)
   top_of_p_table = 0;
 }
 
-
+/* new version to build player index for ascii pfiles */
 /* generate index table for the player file */
 void build_player_index(void)
 {
-  int nr = -1, i;
-  long size, recs;
-  struct char_file_u dummy;
-
-  if (!(player_fl = fopen(PLAYER_FILE, "r+b"))) {
-    if (errno != ENOENT) {
-      perror("SYSERR: fatal error opening playerfile");
-      exit(1);
-    } else {
-      log("No playerfile.  Creating a new one.");
-      touch(PLAYER_FILE);
-      if (!(player_fl = fopen(PLAYER_FILE, "r+b"))) {
-	perror("SYSERR: fatal error opening playerfile");
-	exit(1);
-      }
-    }
+   int rec_count = 0, i;
+   FBFILE *plr_index;
+   char index_name[40], line[256], bits[64];
+   char arg2[80];
+
+   sprintf(index_name, "%s", PLR_INDEX_FILE);
+   if(!(plr_index = fbopen(index_name, FB_READ))) {
+     top_of_p_table = -1;
+     log("No player index file!  First new char will be IMP!");
+     return;
   }
+  while(fbgetline(plr_index, line))
+    if(*line != '~')
+      rec_count++;
+  fbrewind(plr_index);
 
-  fseek(player_fl, 0L, SEEK_END);
-  size = ftell(player_fl);
-  rewind(player_fl);
-  if (size % sizeof(struct char_file_u))
-    log("\aWARNING:  PLAYERFILE IS PROBABLY CORRUPT!");
-  recs = size / sizeof(struct char_file_u);
-  if (recs) {
-    log("   %ld players in database.", recs);
-    CREATE(player_table, struct player_index_element, recs);
-  } else {
+  if(rec_count == 0) {
     player_table = NULL;
     top_of_p_table = -1;
     return;
   }
-
-  for (;;) {
-    fread(&dummy, sizeof(struct char_file_u), 1, player_fl);
-    if (feof(player_fl))
-      break;
-
-    /* new record */
-    nr++;
-    CREATE(player_table[nr].name, char, strlen(dummy.name) + 1);
-    for (i = 0; (*(player_table[nr].name + i) = LOWER(*(dummy.name + i))); i++)
-      ;
-    player_table[nr].id = dummy.char_specials_saved.idnum;
-    top_idnum = MAX(top_idnum, dummy.char_specials_saved.idnum);
+  CREATE(player_table, struct player_index_element, rec_count);
+  for(i = 0; i < rec_count; i++) {
+    fbgetline(plr_index, line);
+    sscanf(line, "%ld %s %d %s %d", &player_table[i].id, arg2,
+      &player_table[i].level, bits, (int *)&player_table[i].last);
+    CREATE(player_table[i].name, char, strlen(arg2) + 1);
+    strcpy(player_table[i].name, arg2);
+    player_table[i].flags = asciiflag_conv(bits);
+    top_idnum = MAX(top_idnum, player_table[i].id);
   }
 
-  top_of_p_table = nr;
+  fbclose(plr_index);
+  top_of_p_file = top_of_p_table = i - 1;
 }
 
 /*
@@ -935,8 +941,9 @@ bitvector_t asciiflag_conv(char *flag)
 void parse_room(FILE *fl, int virtual_nr)
 {
   static int room_nr = 0, zone = 0;
-  int t[10], i;
-  char line[READ_SIZE], flags[128], buf2[MAX_STRING_LENGTH], buf[128];
+  int t[10], i, taeller;
+  char line[READ_SIZE], flags[READ_SIZE], flags2[READ_SIZE], flags3[READ_SIZE]; 
+  char flags4[READ_SIZE], buf2[MAX_STRING_LENGTH], buf[128];
   struct extra_descr_data *new_descr;
   char letter;
 
@@ -963,16 +970,22 @@ void parse_room(FILE *fl, int virtual_nr
     exit(1);
   }
 
-  if (sscanf(line, " %d %s %d ", t, flags, t + 2) != 3) {
+  if (sscanf(line, " %d %s %s %s %s %d ", t, flags, flags2, flags3, flags4, t + 2) != 6) {
     log("SYSERR: Format error in roomflags/sector type of room #%d",
 	virtual_nr);
     exit(1);
   }
+
   /* t[0] is the zone number; ignored with the zone-file system */
 
-  world[room_nr].room_flags = asciiflag_conv(flags);
+  world[room_nr].room_flags[0] = asciiflag_conv(flags);
+  world[room_nr].room_flags[1] = asciiflag_conv(flags2);
+  world[room_nr].room_flags[2] = asciiflag_conv(flags3);
+  world[room_nr].room_flags[3] = asciiflag_conv(flags4);
   sprintf(flags, "object #%d", virtual_nr);	/* sprintf: OK (until 399-bit integers) */
-  check_bitvector_names(world[room_nr].room_flags, room_bits_count, flags, "room");
+  
+  for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) 
+    check_bitvector_names(world[room_nr].room_flags[taeller], room_bits_count, flags, "room");
 
   world[room_nr].sector_type = t[2];
 
@@ -1366,9 +1379,9 @@ void parse_enhanced_mob(FILE *mob_f, int
 void parse_mobile(FILE *mob_f, int nr)
 {
   static int i = 0;
-  int j, t[10];
-  char line[READ_SIZE], *tmpptr, letter;
-  char f1[128], f2[128], buf2[128];
+  int j, t[10], taeller;
+  char line[READ_SIZE], buf2[MAX_STRING_LENGTH], *tmpptr, letter;
+  char f1[128], f2[128], f3[128], f4[128], f5[128], f6[128], f7[128], f8[128];
 
   mob_index[i].vnum = nr;
   mob_index[i].number = 0;
@@ -1403,26 +1416,36 @@ void parse_mobile(FILE *mob_f, int nr)
   }
 
 #ifdef CIRCLE_ACORN	/* Ugh. */
-  if (sscanf(line, "%s %s %d %s", f1, f2, t + 2, &letter) != 4) {
+  if (sscanf(line, "%s %s %s %s %s %s %s %s %d %s", f1, f2, f3, f4, f5, f6, f7, f8, 
+	  t + 2, &letter) != 10) {
 #else
-  if (sscanf(line, "%s %s %d %c", f1, f2, t + 2, &letter) != 4) {
+  if (sscanf(line, "%s %s %s %s %s %s %s %s %d %c", f1, f2, f3, f4, f5, f6, f7, f8, 
+	  t + 2, &letter) != 10) {
 #endif
     log("SYSERR: Format error after string section of mob #%d\n"
 	"...expecting line of form '# # # {S | E}'", nr);
     exit(1);
   }
 
-  MOB_FLAGS(mob_proto + i) = asciiflag_conv(f1);
-  SET_BIT(MOB_FLAGS(mob_proto + i), MOB_ISNPC);
+  MOB_FLAGS(mob_proto + i)[0] = asciiflag_conv(f1);
+  MOB_FLAGS(mob_proto + i)[1] = asciiflag_conv(f2);
+  MOB_FLAGS(mob_proto + i)[2] = asciiflag_conv(f3);
+  MOB_FLAGS(mob_proto + i)[3] = asciiflag_conv(f4);
+  SET_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_ISNPC);
   if (MOB_FLAGGED(mob_proto + i, MOB_NOTDEADYET)) {
     /* Rather bad to load mobiles with this bit already set. */
     log("SYSERR: Mob #%d has reserved bit MOB_NOTDEADYET set.", nr);
-    REMOVE_BIT(MOB_FLAGS(mob_proto + i), MOB_NOTDEADYET);
+    REMOVE_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_NOTDEADYET);
+  }
+  AFF_FLAGS(mob_proto + i)[0] = asciiflag_conv(f5);
+  AFF_FLAGS(mob_proto + i)[1] = asciiflag_conv(f6);
+  AFF_FLAGS(mob_proto + i)[2] = asciiflag_conv(f7);
+  AFF_FLAGS(mob_proto + i)[3] = asciiflag_conv(f8);
+  
+  for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) {
+    check_bitvector_names(AFF_FLAGS(mob_proto + i)[taeller], affected_bits_count, buf2, "mobile affect");
+    check_bitvector_names(MOB_FLAGS(mob_proto + i)[taeller], action_bits_count, buf2, "mobile");
   }
-  check_bitvector_names(MOB_FLAGS(mob_proto + i), action_bits_count, buf2, "mobile");
-
-  AFF_FLAGS(mob_proto + i) = asciiflag_conv(f2);
-  check_bitvector_names(AFF_FLAGS(mob_proto + i), affected_bits_count, buf2, "mobile affect");
 
   GET_ALIGNMENT(mob_proto + i) = t[2];
 
@@ -1472,8 +1495,10 @@ char *parse_object(FILE *obj_f, int nr)
   static int i = 0;
   static char line[READ_SIZE];
   int t[10], j, retval;
-  char *tmpptr;
-  char f1[READ_SIZE], f2[READ_SIZE], buf2[128];
+  char *tmpptr, buf2[128];
+  char f1[READ_SIZE], f2[READ_SIZE], f3[READ_SIZE], f4[READ_SIZE];
+  char f5[READ_SIZE], f6[READ_SIZE], f7[READ_SIZE], f8[READ_SIZE];
+  char f9[READ_SIZE], f10[READ_SIZE], f11[READ_SIZE], f12[READ_SIZE];
   struct extra_descr_data *new_descr;
 
   obj_index[i].vnum = nr;
@@ -1506,21 +1531,30 @@ char *parse_object(FILE *obj_f, int nr)
     log("SYSERR: Expecting first numeric line of %s, but file ended!", buf2);
     exit(1);
   }
-  if ((retval = sscanf(line, " %d %s %s %d", t, f1, f2, t + 3)) != 4) {
+  if ((retval = sscanf(line, " %d %s %s %s %s %s %s %s %s %s %s %s %s", t, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12)) != 13) {
     if (retval == 3)
       t[3] = 0;
     else {
-      log("SYSERR: Format error in first numeric line (expecting 4 args, got %d), %s", retval, buf2);
+      log("SYSERR: Format error in first numeric line (expecting 13 args, got %d), %s", retval, buf2);
     exit(1);
   }
   }
 
   /* Object flags checked in check_object(). */
   GET_OBJ_TYPE(obj_proto + i) = t[0];
-  GET_OBJ_EXTRA(obj_proto + i) = asciiflag_conv(f1);
-  GET_OBJ_WEAR(obj_proto + i) = asciiflag_conv(f2);
-  GET_OBJ_PERM(obj_proto + i) = t[3];
-
+  GET_OBJ_EXTRA(obj_proto + i)[0] = asciiflag_conv(f1);
+  GET_OBJ_EXTRA(obj_proto + i)[1] = asciiflag_conv(f2);
+  GET_OBJ_EXTRA(obj_proto + i)[2] = asciiflag_conv(f3);
+  GET_OBJ_EXTRA(obj_proto + i)[3] = asciiflag_conv(f4);
+  GET_OBJ_WEAR(obj_proto + i)[0] = asciiflag_conv(f5);
+  GET_OBJ_WEAR(obj_proto + i)[1] = asciiflag_conv(f6);
+  GET_OBJ_WEAR(obj_proto + i)[2] = asciiflag_conv(f7);
+  GET_OBJ_WEAR(obj_proto + i)[3] = asciiflag_conv(f8);
+  GET_OBJ_PERM(obj_proto + i)[0] = asciiflag_conv(f9);
+  GET_OBJ_PERM(obj_proto + i)[1] = asciiflag_conv(f10);
+  GET_OBJ_PERM(obj_proto + i)[2] = asciiflag_conv(f11);
+  GET_OBJ_PERM(obj_proto + i)[3] = asciiflag_conv(f12);
+
   if (!get_line(obj_f, line)) {
     log("SYSERR: Expecting second numeric line of %s, but file ended!", buf2);
     exit(1);
@@ -2347,233 +2381,437 @@ char *get_name_by_id(long id)
   return (NULL);
 }
 
+#define NUM_OF_SAVE_THROWS 5
 
+/* new load_char reads ascii pfiles */
 /* Load a char, TRUE if loaded, FALSE if not */
-int load_char(const char *name, struct char_file_u *char_element)
+int load_char(char *name, struct char_data *ch)
 {
-  int player_i;
+  int id, num = 0, num2 = 0, num3 = 0, num4 = 0, num5 = 0, i;
+  FBFILE *fl;
+  char filename[40];
+  char buf[128], line[MAX_INPUT_LENGTH + 1], tag[6];
+  char f1[128], f2[128], f3[128], f4[128];
+  struct affected_type af;
 
-  if ((player_i = get_ptable_by_name(name)) >= 0) {
-    fseek(player_fl, player_i * sizeof(struct char_file_u), SEEK_SET);
-    fread(char_element, sizeof(struct char_file_u), 1, player_fl);
-    return (player_i);
-  } else
+  if((id = get_ptable_by_name(name)) < 0)
     return (-1);
-}
-
-
-
-
-/*
- * write the vital data of a player to the player file
- *
- * And that's it! No more fudging around with the load room.
- * Unfortunately, 'host' modifying is still here due to lack
- * of that variable in the char_data structure.
+  else {
+    sprintf(filename, "%s%s%c%s%s%s", PLR_PREFIX, SLASH, *player_table[id].name,
+      SLASH, player_table[id].name, PLR_SUFFIX);
+    if(!(fl = fbopen(filename, FB_READ))) {
+      mudlog(NRM, LVL_GOD, TRUE, "SYSERR: Couldn't open player file %s", filename);
+      return (-1);
+    }
+    /* character initializations */
+    /* initializations necessary to keep some things straight */
+    ch->affected = NULL;
+    for(i = 1; i <= MAX_SKILLS; i++) GET_SKILL(ch, i) = 0;
+    GET_SEX(ch) = PFDEF_SEX;
+    GET_CLASS(ch) = PFDEF_CLASS;
+    GET_LEVEL(ch) = PFDEF_LEVEL;
+    GET_HOME(ch) = PFDEF_HOMETOWN;
+    GET_HEIGHT(ch) = PFDEF_HEIGHT;
+    GET_WEIGHT(ch) = PFDEF_WEIGHT;
+    GET_ALIGNMENT(ch) = PFDEF_ALIGNMENT;
+    for(i = 0; i < NUM_OF_SAVE_THROWS; i++) GET_SAVE(ch, i) = PFDEF_SAVETHROW;
+    GET_LOADROOM(ch) = PFDEF_LOADROOM;
+    GET_INVIS_LEV(ch) = PFDEF_INVISLEV;
+    GET_FREEZE_LEV(ch) = PFDEF_FREEZELEV;
+    GET_WIMP_LEV(ch) = PFDEF_WIMPLEV;
+    GET_COND(ch, FULL) = PFDEF_HUNGER;
+    GET_COND(ch, THIRST) = PFDEF_THIRST;
+    GET_COND(ch, DRUNK) = PFDEF_DRUNK;
+    GET_BAD_PWS(ch) = PFDEF_BADPWS;
+    GET_PRACTICES(ch) = PFDEF_PRACTICES;
+    GET_GOLD(ch) = PFDEF_GOLD;
+    GET_BANK_GOLD(ch) = PFDEF_BANK;
+    GET_EXP(ch) = PFDEF_EXP;
+    GET_HITROLL(ch) = PFDEF_HITROLL;
+    GET_DAMROLL(ch) = PFDEF_DAMROLL;
+    GET_AC(ch) = PFDEF_AC;
+    ch->real_abils.str = PFDEF_STR;
+    ch->real_abils.str_add = PFDEF_STRADD;
+    ch->real_abils.dex = PFDEF_DEX;
+    ch->real_abils.intel = PFDEF_INT;
+    ch->real_abils.wis = PFDEF_WIS;
+    ch->real_abils.con = PFDEF_CON;
+    ch->real_abils.cha = PFDEF_CHA;
+    GET_HIT(ch) = PFDEF_HIT;
+    GET_MAX_HIT(ch) = PFDEF_MAXHIT;
+    GET_MANA(ch) = PFDEF_MANA;
+    GET_MAX_MANA(ch) = PFDEF_MAXMANA;
+    GET_MOVE(ch) = PFDEF_MOVE;
+    GET_MAX_MOVE(ch) = PFDEF_MAXMOVE;
+    
+	for (i = 0; i < AF_ARRAY_MAX; i++)
+     AFF_FLAGS(ch)[i] = 0;
+    for (i = 0; i < PM_ARRAY_MAX; i++)
+     PLR_FLAGS(ch)[i] = 0;
+    for (i = 0; i < PR_ARRAY_MAX; i++)
+     PRF_FLAGS(ch)[i] = 0;
+		
+	while(fbgetline(fl, line)) {
+      tag_argument(line, tag);
+      num = atoi(line);
+      switch (*tag) {
+	case 'A':
+	  if(!strcmp(tag, "Ac  ")) GET_AC(ch) = num;
+	  else if (!strcmp(tag, "Act ")) {
+        sscanf(line, "%s %s %s %s", f1, f2, f3, f4);
+          PLR_FLAGS(ch)[0] = asciiflag_conv(f1);
+          PLR_FLAGS(ch)[1] = asciiflag_conv(f2);
+          PLR_FLAGS(ch)[2] = asciiflag_conv(f3);
+          PLR_FLAGS(ch)[3] = asciiflag_conv(f4);
+	  } else if (!strcmp(tag, "Aff ")) {
+        sscanf(line, "%s %s %s %s", f1, f2, f3, f4);
+          AFF_FLAGS(ch)[0] = asciiflag_conv(f1);
+          AFF_FLAGS(ch)[1] = asciiflag_conv(f2);
+          AFF_FLAGS(ch)[2] = asciiflag_conv(f3);
+          AFF_FLAGS(ch)[3] = asciiflag_conv(f4);
+	  } else if (!strcmp(tag, "Affs")) {
+	    i = 0;
+	    do {
+	      fbgetline(fl, line);
+	      sscanf(line, "%d %d %d %d %d", &num, &num2, &num3, &num4, &num5);
+	      if(num > 0) {
+		af.type = num;
+		af.duration = num2;
+		af.modifier = num3;
+		af.location = num4;
+		af.bitvector = num5;
+		affect_to_char(ch, &af);
+		i++;
+	      }
+	    } while (num != 0);
+	  } else if(!strcmp(tag, "Alin")) GET_ALIGNMENT(ch) = num;
+	  break;
+	case 'B':
+	  if(!strcmp(tag, "Badp")) GET_BAD_PWS(ch) = num;
+	  else if(!strcmp(tag, "Bank")) GET_BANK_GOLD(ch) = num;
+	  else if(!strcmp(tag, "Brth")) ch->player.time.birth = num;
+	  break;
+	case 'C':
+	  if(!strcmp(tag, "Cha ")) ch->real_abils.cha = num;
+	  else if(!strcmp(tag, "Clas")) GET_CLASS(ch) = num;
+	  else if(!strcmp(tag, "Con ")) ch->real_abils.con = num;
+	  break;
+	case 'D':
+	  if(!strcmp(tag, "Desc")) ch->player.description = fbgetstring(fl);
+	  else if(!strcmp(tag, "Dex ")) ch->real_abils.dex = num;
+	  else if(!strcmp(tag, "Drnk")) GET_COND(ch, DRUNK) = num;
+	  else if(!strcmp(tag, "Drol")) GET_DAMROLL(ch) = num;
+	  break;
+	case 'E':
+	  if(!strcmp(tag, "Exp ")) GET_EXP(ch) = num;
+	  break;
+	case 'F':
+	  if(!strcmp(tag, "Frez")) GET_FREEZE_LEV(ch) = num;
+	  break;
+	case 'G':
+	  if(!strcmp(tag, "Gold")) GET_GOLD(ch) = num;
+	  break;
+	case 'H':
+	  if(!strcmp(tag, "Hit ")) {
+	    sscanf(line, "%d/%d", &num, &num2);
+	    GET_HIT(ch) = num;
+	    GET_MAX_HIT(ch) = num2;
+	  } else if(!strcmp(tag, "Hite")) GET_HEIGHT(ch) = num;
+	  else if(!strcmp(tag, "Home")) GET_HOME(ch) = num;
+	  else if(!strcmp(tag, "Host")) ch->player_specials->host = strdup(line);
+	  else if(!strcmp(tag, "Hrol")) GET_HITROLL(ch) = num;
+	  else if(!strcmp(tag, "Hung")) GET_COND(ch, FULL) = num;
+	  break;
+	case 'I':
+	  if(!strcmp(tag, "Id  ")) GET_IDNUM(ch) = num;
+	  else if(!strcmp(tag, "Int ")) ch->real_abils.intel = num;
+	  else if(!strcmp(tag, "Invs")) GET_INVIS_LEV(ch) = num;
+	  break;
+	case 'L':
+	  if(!strcmp(tag, "Last")) ch->player.time.logon = num;
+	  else if(!strcmp(tag, "Lern")) GET_PRACTICES(ch) = num;
+	  else if(!strcmp(tag, "Levl")) GET_LEVEL(ch) = num;
+	  break;
+	case 'M':
+	  if(!strcmp(tag, "Mana")) {
+	    sscanf(line, "%d/%d", &num, &num2);
+	    GET_MANA(ch) = num;
+	    GET_MAX_MANA(ch) = num2;
+	  } else if(!strcmp(tag, "Move")) {
+	    sscanf(line, "%d/%d", &num, &num2);
+	    GET_MOVE(ch) = num;
+	    GET_MAX_MOVE(ch) = num2;
+	  }
+	  break;
+	case 'N':
+	  if(!strcmp(tag, "Name")) GET_PC_NAME(ch) = strdup(line);
+	  break;
+	case 'P':
+	  if(!strcmp(tag, "Pass")) strcpy(GET_PASSWD(ch), line);
+	  else if(!strcmp(tag, "Plyd")) ch->player.time.played = num;
+#ifdef ASCII_SAVE_POOFS
+	  else if(!strcmp(tag, "PfIn")) POOFIN(ch) = strdup(line);
+	  else if(!strcmp(tag, "PfOt")) POOFOUT(ch) = strdup(line);
+#endif
+	  else if (!strcmp(tag, "Pref"))
+		sscanf(line, "%s %s %s %s", f1, f2, f3, f4);
+          PRF_FLAGS(ch)[0] = asciiflag_conv(f1);
+          PRF_FLAGS(ch)[1] = asciiflag_conv(f2);
+          PRF_FLAGS(ch)[2] = asciiflag_conv(f3);
+          PRF_FLAGS(ch)[3] = asciiflag_conv(f4);
+	  break;
+	case 'R':
+	  if(!strcmp(tag, "Room")) GET_LOADROOM(ch) = num;
+	  break;
+	case 'S':
+	  if(!strcmp(tag, "Sex ")) GET_SEX(ch) = num;
+	  else if(!strcmp(tag, "Skil")) {
+	    do {
+	      fbgetline(fl, line);
+	      sscanf(line, "%d %d", &num, &num2);
+	      if(num != 0) GET_SKILL(ch, num) = num2;
+	    } while (num != 0);
+	  } else if(!strcmp(tag, "Str ")) {
+	    sscanf(line, "%d/%d", &num, &num2);
+	    ch->real_abils.str = num;
+	    ch->real_abils.str_add = num2;
+	  }
+	  break;
+	case 'T':
+	  if(!strcmp(tag, "Thir")) GET_COND(ch, THIRST) = num;
+	  else if(!strcmp(tag, "Thr1")) GET_SAVE(ch, 0) = num;
+	  else if(!strcmp(tag, "Thr2")) GET_SAVE(ch, 1) = num;
+	  else if(!strcmp(tag, "Thr3")) GET_SAVE(ch, 2) = num;
+	  else if(!strcmp(tag, "Thr4")) GET_SAVE(ch, 3) = num;
+	  else if(!strcmp(tag, "Thr5")) GET_SAVE(ch, 4) = num;
+	  else if(!strcmp(tag, "Titl")) GET_TITLE(ch) = strdup(line);
+	  break;
+	case 'W':
+	  if(!strcmp(tag, "Wate")) GET_WEIGHT(ch) = num;
+	  else if(!strcmp(tag, "Wimp")) GET_WIMP_LEV(ch) = num;
+	  else if(!strcmp(tag, "Wis ")) ch->real_abils.wis = num;
+	  break;
+	default:
+	  sprintf(buf, "SYSERR: Unknown tag %s in pfile %s", tag, name);
+      }
+    }
+  }
+  affect_total(ch);
+  /* initialization for imms */
+  if(GET_LEVEL(ch) >= LVL_IMMORT) {
+    for(i = 1; i <= MAX_SKILLS; i++) GET_SKILL(ch, i) = 100;
+    GET_COND(ch, FULL) = -1;
+    GET_COND(ch, THIRST) = -1;
+    GET_COND(ch, DRUNK) = -1;
+  }
+  fbclose(fl);
+  return(id);
+}
+
+/* remove ^M's from file output */
+/* There may be a similar function in Oasis (and I'm sure it's part of obuild).
+ * Remove this if you get amultiple definition error or if it you want to use a
+ * substitute
  */
-void save_char(struct char_data *ch)
+void kill_ems(char *str)
 {
-  struct char_file_u st;
-
-  if (IS_NPC(ch) || !ch->desc || GET_PFILEPOS(ch) < 0)
-    return;
-
-  char_to_store(ch, &st);
-
-  strncpy(st.host, ch->desc->host, HOST_LENGTH);	/* strncpy: OK (s.host:HOST_LENGTH+1) */
-  st.host[HOST_LENGTH] = '\0';
-
-  fseek(player_fl, GET_PFILEPOS(ch) * sizeof(struct char_file_u), SEEK_SET);
-  fwrite(&st, sizeof(struct char_file_u), 1, player_fl);
-  save_char_vars(ch);
+  char *ptr1, *ptr2, *tmp;
+  tmp = str;
+  ptr1 = str;
+  ptr2 = str;
+  while(*ptr1)
+    if((*(ptr2++) = *(ptr1++)) == '\r') if(*ptr1 == '\r') ptr1++;
+  *ptr2 = '\0';
 }
 
-
-
-/* copy data from the file structure to a char struct */
-void store_to_char(struct char_file_u *st, struct char_data *ch)
-{
-  int i;
-
-  /* to save memory, only PC's -- not MOB's -- have player_specials */
-  if (ch->player_specials == NULL)
-    CREATE(ch->player_specials, struct player_special_data, 1);
-
-  GET_SEX(ch) = st->sex;
-  GET_CLASS(ch) = st->chclass;
-  GET_LEVEL(ch) = st->level;
-
-  ch->player.short_descr = NULL;
-  ch->player.long_descr = NULL;
-  ch->player.title = strdup(st->title);
-  ch->player.description = strdup(st->description);
-
-  ch->player.hometown = st->hometown;
-  ch->player.time.birth = st->birth;
-  ch->player.time.played = st->played;
-  ch->player.time.logon = time(0);
-
-  ch->player.weight = st->weight;
-  ch->player.height = st->height;
-
-  ch->real_abils = st->abilities;
-  ch->aff_abils = st->abilities;
-  ch->points = st->points;
-  ch->char_specials.saved = st->char_specials_saved;
-  ch->player_specials->saved = st->player_specials_saved;
-  POOFIN(ch) = NULL;
-  POOFOUT(ch) = NULL;
-  GET_LAST_TELL(ch) = NOBODY;
-
-  if (ch->points.max_mana < 100)
-    ch->points.max_mana = 100;
-
-  ch->char_specials.carry_weight = 0;
-  ch->char_specials.carry_items = 0;
-  ch->points.armor = 100;
-  ch->points.hitroll = 0;
-  ch->points.damroll = 0;
-
-  if (ch->player.name)
-    free(ch->player.name);
-  ch->player.name = strdup(st->name);
-  strlcpy(ch->player.passwd, st->pwd, sizeof(ch->player.passwd));
-
-  /* Add all spell effects */
-  for (i = 0; i < MAX_AFFECT; i++) {
-    if (st->affected[i].type)
-      affect_to_char(ch, &st->affected[i]);
-  }
-
-  /*
-   * If you're not poisioned and you've been away for more than an hour of
-   * real time, we'll set your HMV back to full
-   */
-
-  if (!AFF_FLAGGED(ch, AFF_POISON) &&
-	time(0) - st->last_logon >= SECS_PER_REAL_HOUR) {
-    GET_HIT(ch) = GET_MAX_HIT(ch);
-    GET_MOVE(ch) = GET_MAX_MOVE(ch);
-    GET_MANA(ch) = GET_MAX_MANA(ch);
-  }
-}				/* store_to_char */
-
-
-
-
-/* copy vital data from a players char-structure to the file structure */
-void char_to_store(struct char_data *ch, struct char_file_u *st)
+/* write the vital data of a player to the player file
+ * NOTE: load_room should be an *RNUM* now.  It is converted to a vnum here.
+ */
+/* This is the ascii pfiles save routine */
+void save_char(struct char_data * ch)
 {
-  int i;
-  struct affected_type *af;
+  FBFILE *fl;
+  char outname[40], bits[127], buf[MAX_STRING_LENGTH];
+  int i, id, save_index = FALSE;
+  struct affected_type *aff, tmp_aff[MAX_AFFECT];
   struct obj_data *char_eq[NUM_WEARS];
-
-  /* Unaffect everything a character can be affected by */
-
-  for (i = 0; i < NUM_WEARS; i++) {
-    if (GET_EQ(ch, i)) {
-      char_eq[i] = unequip_char(ch, i);
-#ifndef NO_EXTRANEOUS_TRIGGERS
-      remove_otrigger(char_eq[i], ch);
-#endif
-    } else
-      char_eq[i] = NULL;
-  }
-
-  for (af = ch->affected, i = 0; i < MAX_AFFECT; i++) {
-    if (af) {
-      st->affected[i] = *af;
-      st->affected[i].next = 0;
-      af = af->next;
-    } else {
-      st->affected[i].type = 0;	/* Zero signifies not used */
-      st->affected[i].duration = 0;
-      st->affected[i].modifier = 0;
-      st->affected[i].location = 0;
-      st->affected[i].bitvector = 0;
-      st->affected[i].next = 0;
-    }
-  }
-
-
-  /*
-   * remove the affections so that the raw values are stored; otherwise the
-   * effects are doubled when the char logs back in.
+  if (IS_NPC(ch) || GET_PFILEPOS(ch) < 0) return;
+  /* This version of save_char allows ch->desc to be null (to allow "set file"
+   * to use it).  This causes the player's last host and probably last login to
+   * null out.
    */
-
-  while (ch->affected)
-    affect_remove(ch, ch->affected);
-
-  if ((i >= MAX_AFFECT) && af && af->next)
-    log("SYSERR: WARNING: OUT OF STORE ROOM FOR AFFECTED TYPES!!!");
-
-  ch->aff_abils = ch->real_abils;
-
-  st->birth = ch->player.time.birth;
-  st->played = ch->player.time.played;
-  st->played += time(0) - ch->player.time.logon;
-  st->last_logon = time(0);
-
-  ch->player.time.played = st->played;
-  ch->player.time.logon = time(0);
-
-  st->hometown = ch->player.hometown;
-  st->weight = GET_WEIGHT(ch);
-  st->height = GET_HEIGHT(ch);
-  st->sex = GET_SEX(ch);
-  st->chclass = GET_CLASS(ch);
-  st->level = GET_LEVEL(ch);
-  st->abilities = ch->real_abils;
-  st->points = ch->points;
-  st->char_specials_saved = ch->char_specials.saved;
-  st->player_specials_saved = ch->player_specials->saved;
-
-  st->points.armor = 100;
-  st->points.hitroll = 0;
-  st->points.damroll = 0;
-
-  if (GET_TITLE(ch))
-    strlcpy(st->title, GET_TITLE(ch), MAX_TITLE_LENGTH);
-  else
-    *st->title = '\0';
-
-  if (ch->player.description) {
-    if (strlen(ch->player.description) >= sizeof(st->description)) {
-      log("SYSERR: char_to_store: %s's description length: %d, max: %d! "
-         "Truncated.", GET_PC_NAME(ch), strlen(ch->player.description),
-         sizeof(st->description));
-      ch->player.description[sizeof(st->description) - 3] = '\0';
-      strcat(ch->player.description, "\r\n");	/* strcat: OK (previous line makes room) */
+  /* strcpy(player.pwd, GET_PASSWD(ch)); */
+  {
+    for (i = 0; (*(bits + i) = LOWER(*(GET_NAME(ch) + i))); i++);
+    sprintf(outname, "%s%s%c%s%s%s", PLR_PREFIX, SLASH, *bits,
+      SLASH, bits, PLR_SUFFIX);
+    if (!(fl = fbopen(outname, FB_WRITE))) {
+      mudlog(NRM, LVL_GOD, TRUE,
+	"SYSERR: Couldn't open player file %s for write", outname);
+      return;
     }
-    strcpy(st->description, ch->player.description);	/* strcpy: OK (checked above) */
-  } else
-    *st->description = '\0';
-
-  strcpy(st->name, GET_NAME(ch));	/* strcpy: OK (that's what GET_NAME came from) */
-  strcpy(st->pwd, GET_PASSWD(ch));	/* strcpy: OK (that's what GET_PASSWD came from) */
-
-  /* add spell and eq affections back in now */
-  for (i = 0; i < MAX_AFFECT; i++) {
-    if (st->affected[i].type)
-      affect_to_char(ch, &st->affected[i]);
-  }
-
-  for (i = 0; i < NUM_WEARS; i++) {
-    if (char_eq[i]) {
-#ifndef NO_EXTRANEOUS_TRIGGERS
-      if (wear_otrigger(char_eq[i], ch, i))
-#endif
-      equip_char(ch, char_eq[i], i);
-#ifndef NO_EXTRANEOUS_TRIGGERS
-      else
-        obj_to_char(char_eq[i], ch);
+    /* remove affects from eq and spells (from char_to_store) */
+    /* Unaffect everything a character can be affected by */
+    for (i = 0; i < NUM_WEARS; i++) {
+      if (GET_EQ(ch, i)) char_eq[i] = unequip_char(ch, i);
+      else char_eq[i] = NULL;
+    }
+    for (aff = ch->affected, i = 0; i < MAX_AFFECT; i++) {
+      if (aff) {
+	tmp_aff[i] = *aff;
+	tmp_aff[i].next = 0;
+	aff = aff->next;
+      } else {
+	tmp_aff[i].type = 0;  /* Zero signifies not used */
+	tmp_aff[i].duration = 0;
+	tmp_aff[i].modifier = 0;
+	tmp_aff[i].location = 0;
+	tmp_aff[i].bitvector = 0;
+	tmp_aff[i].next = 0;
+      }
+    }
+    /* remove the affections so that the raw values are stored; otherwise the
+     * effects are doubled when the char logs back in.
+     */
+    while (ch->affected) affect_remove(ch, ch->affected);
+    if ((i >= MAX_AFFECT) && aff && aff->next)
+      log("SYSERR: WARNING: OUT OF STORE ROOM FOR AFFECTED TYPES!!!");
+    ch->aff_abils = ch->real_abils;
+    /* end char_to_store code */
+    if(GET_NAME(ch)) fbprintf(fl, "Name: %s\n", GET_NAME(ch));
+    if(GET_PASSWD(ch)) fbprintf(fl, "Pass: %s\n", GET_PASSWD(ch));
+    if(GET_TITLE(ch)) fbprintf(fl, "Titl: %s\n", GET_TITLE(ch));
+    if(ch->player.description && *ch->player.description) {
+      strcpy(buf, ch->player.description);
+      kill_ems(buf);
+      fbprintf(fl, "Desc:\n%s~\n", buf);
+    }
+#ifdef ASCII_SAVE_POOFS
+    if(POOFIN(ch)) fbprintf(fl, "PfIn: %s\n", POOFIN(ch));
+    if(POOFOUT(ch)) fbprintf(fl, "PfOt: %s\n", POOFOUT(ch));
 #endif
+    if(GET_SEX(ch) != PFDEF_SEX) fbprintf(fl, "Sex : %d\n", GET_SEX(ch));
+    if(GET_CLASS(ch) != PFDEF_CLASS) fbprintf(fl, "Clas: %d\n", GET_CLASS(ch));
+    if(GET_LEVEL(ch) != PFDEF_LEVEL) fbprintf(fl, "Levl: %d\n", GET_LEVEL(ch));
+    if(GET_HOME(ch) != PFDEF_HOMETOWN) fbprintf(fl, "Home: %d\n", GET_HOME(ch));
+    fbprintf(fl, "Brth: %d\n", ch->player.time.birth);
+    fbprintf(fl, "Plyd: %d\n", ch->player.time.played);
+    fbprintf(fl, "Last: %d\n", ch->player.time.logon);
+    if(ch->player_specials->host)
+      fbprintf(fl, "Host: %s\n", ch->player_specials->host);
+    if(GET_HEIGHT(ch) != PFDEF_HEIGHT)
+      fbprintf(fl, "Hite: %d\n", GET_HEIGHT(ch));
+    if(GET_WEIGHT(ch) != PFDEF_HEIGHT)
+      fbprintf(fl, "Wate: %d\n", GET_WEIGHT(ch));
+    if(GET_ALIGNMENT(ch) != PFDEF_ALIGNMENT)
+      fbprintf(fl, "Alin: %d\n", GET_ALIGNMENT(ch));
+    fbprintf(fl, "Id  : %d\n", GET_IDNUM(ch));
+    if(PLR_FLAGS(ch) != PFDEF_PLRFLAGS) {
+      fbprintf(fl, "Act : %u %u %u %u\n", PLR_FLAGS(ch)[0], 
+		  PLR_FLAGS(ch)[1], PLR_FLAGS(ch)[2], PLR_FLAGS(ch)[3]);
+	}
+	if(AFF_FLAGS(ch) != PFDEF_AFFFLAGS) {
+      fbprintf(fl, "Aff : %u %u %u %u\n", AFF_FLAGS(ch)[0], 
+		  AFF_FLAGS(ch)[1], AFF_FLAGS(ch)[2], AFF_FLAGS(ch)[3]);
+    }
+    if(GET_SAVE(ch, 0) != PFDEF_SAVETHROW)
+      fbprintf(fl, "Thr1: %d\n", GET_SAVE(ch, 0));
+    if(GET_SAVE(ch, 1) != PFDEF_SAVETHROW)
+      fbprintf(fl, "Thr2: %d\n", GET_SAVE(ch, 1));
+    if(GET_SAVE(ch, 2) != PFDEF_SAVETHROW)
+      fbprintf(fl, "Thr3: %d\n", GET_SAVE(ch, 2));
+    if(GET_SAVE(ch, 3) != PFDEF_SAVETHROW)
+      fbprintf(fl, "Thr4: %d\n", GET_SAVE(ch, 3));
+    if(GET_SAVE(ch, 4) != PFDEF_SAVETHROW)
+      fbprintf(fl, "Thr5: %d\n", GET_SAVE(ch, 4));
+    if(GET_LEVEL(ch) < LVL_IMMORT) {
+      fbprintf(fl, "Skil:\n");
+      for(i = 1; i <= MAX_SKILLS; i++)
+	if(GET_SKILL(ch, i)) fbprintf(fl, "%d %d\n", i, GET_SKILL(ch, i));
+      fbprintf(fl, "0 0\n");
+    }
+    if(GET_WIMP_LEV(ch) != PFDEF_WIMPLEV)
+      fbprintf(fl, "Wimp: %d\n", GET_WIMP_LEV(ch));
+    if(GET_FREEZE_LEV(ch) != PFDEF_FREEZELEV)
+      fbprintf(fl, "Frez: %d\n", GET_FREEZE_LEV(ch));
+    if(GET_INVIS_LEV(ch) != PFDEF_INVISLEV)
+      fbprintf(fl, "Invs: %d\n", GET_INVIS_LEV(ch));
+    if(GET_LOADROOM(ch) != PFDEF_LOADROOM)
+      fbprintf(fl, "Room: %d\n", GET_LOADROOM(ch));
+    if(PRF_FLAGS(ch) != PFDEF_PREFFLAGS) {
+      fbprintf(fl, "Pref: %d %d %d %d\n", PRF_FLAGS(ch)[0], 
+		  PRF_FLAGS(ch)[1], PRF_FLAGS(ch)[2], PRF_FLAGS(ch)[3]);
+    }
+    if(GET_BAD_PWS(ch) != PFDEF_BADPWS)
+      fbprintf(fl, "Badp: %d\n", GET_BAD_PWS(ch));
+    if(GET_COND(ch, FULL) != PFDEF_HUNGER && GET_LEVEL(ch) < LVL_IMMORT)
+      fbprintf(fl, "Hung: %d\n", GET_COND(ch, FULL));
+    if(GET_COND(ch, THIRST) != PFDEF_THIRST && GET_LEVEL(ch) < LVL_IMMORT)
+      fbprintf(fl, "Thir: %d\n", GET_COND(ch, THIRST));
+    if(GET_COND(ch, DRUNK) != PFDEF_DRUNK && GET_LEVEL(ch) < LVL_IMMORT)
+      fbprintf(fl, "Drnk: %d\n", GET_COND(ch, DRUNK));
+    if(GET_PRACTICES(ch) != PFDEF_PRACTICES)
+      fbprintf(fl, "Lern: %d\n", GET_PRACTICES(ch));
+    if(GET_STR(ch) != PFDEF_STR || GET_ADD(ch) != PFDEF_STRADD)
+      fbprintf(fl, "Str : %d/%d\n", GET_STR(ch), GET_ADD(ch));
+    if(GET_INT(ch) != PFDEF_INT) fbprintf(fl, "Int : %d\n", GET_INT(ch));
+    if(GET_WIS(ch) != PFDEF_WIS) fbprintf(fl, "Wis : %d\n", GET_WIS(ch));
+    if(GET_DEX(ch) != PFDEF_DEX) fbprintf(fl, "Dex : %d\n", GET_DEX(ch));
+    if(GET_CON(ch) != PFDEF_CON) fbprintf(fl, "Con : %d\n", GET_CON(ch));
+    if(GET_CHA(ch) != PFDEF_CHA) fbprintf(fl, "Cha : %d\n", GET_CHA(ch));
+    if(GET_HIT(ch) != PFDEF_HIT || GET_MAX_HIT(ch) != PFDEF_MAXHIT)
+      fbprintf(fl, "Hit : %d/%d\n", GET_HIT(ch), GET_MAX_HIT(ch));
+    if(GET_MANA(ch) != PFDEF_MANA || GET_MAX_MANA(ch) != PFDEF_MAXMANA)
+      fbprintf(fl, "Mana: %d/%d\n", GET_MANA(ch), GET_MAX_MANA(ch));
+    if(GET_MOVE(ch) != PFDEF_MOVE || GET_MAX_MOVE(ch) != PFDEF_MAXMOVE)
+      fbprintf(fl, "Move: %d/%d\n", GET_MOVE(ch), GET_MAX_MOVE(ch));
+    if(GET_AC(ch) != PFDEF_AC) fbprintf(fl, "Ac  : %d\n", GET_AC(ch));
+    if(GET_GOLD(ch) != PFDEF_GOLD) fbprintf(fl, "Gold: %d\n", GET_GOLD(ch));
+    if(GET_BANK_GOLD(ch) != PFDEF_BANK)
+      fbprintf(fl, "Bank: %d\n", GET_BANK_GOLD(ch));
+    if(GET_EXP(ch) != PFDEF_EXP) fbprintf(fl, "Exp : %d\n", GET_EXP(ch));
+    if(GET_HITROLL(ch) != PFDEF_HITROLL)
+      fbprintf(fl, "Hrol: %d\n", GET_HITROLL(ch));
+    if(GET_DAMROLL(ch)) fbprintf(fl, "Drol: %d\n", GET_DAMROLL(ch));
+    /* affected_type */
+    if(tmp_aff[0].type > 0) {
+      fbprintf(fl, "Affs:\n");
+      for(i = 0; i < MAX_AFFECT; i++) {
+	aff = &tmp_aff[i];
+	if(aff->type)
+	  fbprintf(fl, "%d %d %d %d %d\n", aff->type, aff->duration,
+	    aff->modifier, aff->location, (int)aff->bitvector);
+      }
+      fbprintf(fl, "0 0 0 0 0\n");
     }
+    fbclose(fl);
+    /* more char_to_store code to restore affects */
+    /* add spell and eq affections back in now */
+    for(i = 0; i < MAX_AFFECT; i++)
+      if(tmp_aff[i].type) affect_to_char(ch, &tmp_aff[i]);
+    for(i = 0; i < NUM_WEARS; i++)
+      if (char_eq[i]) equip_char(ch, char_eq[i], i);
+    /* end char_to_store code */
+    if((id = get_ptable_by_name(GET_NAME(ch))) < 0) return;
+    /* update the player in the player index */
+    if(player_table[id].level != GET_LEVEL(ch)) {
+      save_index = TRUE;
+      player_table[id].level = GET_LEVEL(ch);
+    }
+    if(player_table[id].last != ch->player.time.logon) {
+      save_index = TRUE;
+      player_table[id].last = ch->player.time.logon;
+    }
+    i = player_table[id].flags;
+    if(PLR_FLAGGED(ch, PLR_DELETED))
+      SET_BIT(player_table[id].flags, PINDEX_DELETED);
+    else REMOVE_BIT(player_table[id].flags, PINDEX_DELETED);
+    if(PLR_FLAGGED(ch, PLR_NODELETE) || PLR_FLAGGED(ch, PLR_CRYO))
+      SET_BIT(player_table[id].flags, PINDEX_NODELETE);
+    else REMOVE_BIT(player_table[id].flags, PINDEX_NODELETE);
+    if(player_table[id].flags != i || save_index) save_player_index();
   }
-/*   affect_total(ch); unnecessary, I think !?! */
-}				/* Char to store */
-
-
+}
 
 void save_etext(struct char_data *ch)
 {
@@ -2673,6 +2911,8 @@ void free_char(struct char_data *ch)
       free(ch->player_specials->poofin);
     if (ch->player_specials->poofout)
       free(ch->player_specials->poofout);
+    if (ch->player_specials->host)
+      free(ch->player_specials->host);
     free(ch->player_specials);
     if (IS_NPC(ch))
       log("SYSERR: Mob %s (#%d) had player_specials allocated!", GET_NAME(ch), GET_MOB_VNUM(ch));
@@ -2882,7 +3122,7 @@ void clear_object(struct obj_data *obj)
  */
 void init_char(struct char_data *ch)
 {
-  int i;
+  int i, taeller;
 
   /* create a player_special structure */
   if (ch->player_specials == NULL)
@@ -2945,7 +3185,8 @@ void init_char(struct char_data *ch)
       SET_SKILL(ch, i, 100);
   }
 
-  AFF_FLAGS(ch) = 0;
+  for(taeller=0; taeller < AF_ARRAY_MAX; taeller++)
+    AFF_FLAGS(ch)[taeller] = 0;
 
   for (i = 0; i < 5; i++)
     GET_SAVE(ch, i) = 0;
@@ -3071,7 +3312,7 @@ zone_rnum real_zone(zone_vnum vnum)
 int check_object(struct obj_data *obj)
 {
   char objname[MAX_INPUT_LENGTH + 32];
-  int error = FALSE;
+  int error = FALSE, y;
 
   if (GET_OBJ_WEIGHT(obj) < 0 && (error = TRUE))
     log("SYSERR: Object #%d (%s) has negative weight (%d).",
@@ -3082,9 +3323,12 @@ int check_object(struct obj_data *obj)
 	GET_OBJ_VNUM(obj), obj->short_description, GET_OBJ_RENT(obj));
 
   snprintf(objname, sizeof(objname), "Object #%d (%s)", GET_OBJ_VNUM(obj), obj->short_description);
-  error |= check_bitvector_names(GET_OBJ_WEAR(obj), wear_bits_count, objname, "object wear");
-  error |= check_bitvector_names(GET_OBJ_EXTRA(obj), extra_bits_count, objname, "object extra");
-  error |= check_bitvector_names(GET_OBJ_AFFECT(obj), affected_bits_count, objname, "object affect");
+  
+  for(y = 0; y < TW_ARRAY_MAX; y++) {
+    error |= check_bitvector_names(GET_OBJ_WEAR(obj)[y], wear_bits_count, objname, "object wear");
+    error |= check_bitvector_names(GET_OBJ_EXTRA(obj)[y], extra_bits_count, objname, "object extra");
+    error |= check_bitvector_names(GET_OBJ_AFFECT(obj)[y], affected_bits_count, objname, "object affect");
+  }
 
   switch (GET_OBJ_TYPE(obj)) {
   case ITEM_DRINKCON:
@@ -3123,6 +3367,128 @@ int check_object(struct obj_data *obj)
 
   return (error);
 }
+
+
+/* new functions used by ascii pfiles */
+
+/* Separate a 4-character id tag from the data it precedes */
+void tag_argument(char *argument, char *tag)
+{
+  char *tmp = argument, *ttag = tag, *wrt = argument;
+  int i;
+
+  for(i = 0; i < 4; i++)
+    *(ttag++) = *(tmp++);
+  *ttag = '\0';
+  
+  while(*tmp == ':' || *tmp == ' ')
+    tmp++;
+
+  while(*tmp)
+    *(wrt++) = *(tmp++);
+  *wrt = '\0';
+}
+
+
+/* This function necessary to save a seperate ascii player index */
+void save_player_index(void)
+{
+  int i;
+  char bits[64];
+  FBFILE *index_file;
+
+  if(!(index_file = fbopen(PLR_INDEX_FILE, FB_WRITE))) {
+    log("SYSERR:  Could not write player index file");
+    return;
+  }
+
+  for(i = 0; i <= top_of_p_table; i++)
+    if(*player_table[i].name) {
+      sprintbits(player_table[i].flags, bits);
+      fbprintf(index_file, "%d %s %d %s %d\n", player_table[i].id,
+	player_table[i].name, player_table[i].level, *bits ? bits : "0",
+  player_table[i].last);
+    }
+  fbprintf(index_file, "~\n");
+
+  fbclose(index_file);
+}
+
+
+/* This is a general purpose function originally from obuild OLC,
+   and there is probably a similar function in Oasis.  Feel free to
+   remove this and use another
+*/
+/*thanks to Luis Carvalho for sending this my way..it's probably a
+  lot shorter than the one I would have made :)  */
+void sprintbits(long vektor,char *outstring)
+{
+  int i;
+  char flags[53]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+  strcpy(outstring,"");
+  for (i=0;i<32;i++)
+  {
+    if (vektor & 1) {
+      *outstring=flags[i];
+      outstring++;
+    };
+    vektor>>=1;
+  };
+  *outstring=0;
+};
+
+/* remove_player removes all files associated with a player who is
+   self-deleted, deleted by an immortal, or deleted by the auto-wipe
+   system (if enabled).  If you add more character files, you'll want
+   to put a remover here.
+*/ 
+void remove_player(int pfilepos)
+{
+  char pfile_name[128]/*, rent_name[128]*/;
+
+  if(!*player_table[pfilepos].name)
+    return;
+
+  unlink(pfile_name);
+
+  /* Unlink any other player-owned files here if you have them  */
+
+  log("PCLEAN: %s Lev: %d Last: %s",
+	  player_table[pfilepos].name, player_table[pfilepos].level,
+    asctime(localtime(&player_table[pfilepos].last)));
+  player_table[pfilepos].name[0] = '\0';
+  save_player_index();
+}
+
+
+void clean_pfiles(void)
+{
+  int i, ci, timeout;
+
+  for(i = 0; i <= top_of_p_table; i++) {
+    if(IS_SET(player_table[i].flags, PINDEX_NODELETE))
+      continue;
+    timeout = -1;
+    for(ci = 0; ci == 0 || (pclean_criteria[ci].level > 
+      pclean_criteria[ci - 1].level); ci++) {
+      if((pclean_criteria[ci].level == -1 && IS_SET(player_table[i].flags,
+        PINDEX_DELETED)) || player_table[i].level <=
+        pclean_criteria[ci].level) {
+          timeout = pclean_criteria[ci].days;
+          break;
+      }
+    }
+    if(timeout >= 0) {
+      timeout *= SECS_PER_REAL_DAY;
+      if((time(0) - player_table[i].last) > timeout)
+        remove_player(i);
+    }
+  }  
+}
+
+/* end of ascii pfile added functions */
+
 
 int check_object_spell_number(struct obj_data *obj, int val)
 {
diff -puN ./src/db.h ./src128bit/db.h
--- ./src/db.h	Wed Aug 14 19:36:08 2002
+++ ./src128bit/db.h	Wed Aug  7 13:56:06 2002
@@ -101,6 +101,21 @@
 #define HCONTROL_FILE	LIB_ETC"hcontrol"  /* for the house system	*/
 #define TIME_FILE	LIB_ETC"time"	   /* for calendar system	*/
 
+/* ascii pfiles file defines */
+#define PLR_PREFIX	"pfiles"
+#define PLR_INDEX_FILE	"pfiles"SLASH"plr_index"
+
+/* change these if you want to put all files in the same directory (or if
+   you just like big file names
+*/
+#define PLR_SUFFIX	""
+
+/* new bitvector data for use in player_index_element */
+#define PINDEX_DELETED		(1 << 0)	/* deleted player	*/
+#define PINDEX_NODELETE		(1 << 1)	/* protected player	*/
+#define PINDEX_SELFDELETE	(1 << 2)	/* player is selfdeleting*/
+
+
 /* public procedures in db.c */
 void	boot_db(void);
 void	destroy_db(void);
@@ -120,9 +135,7 @@ room_rnum real_room(room_vnum vnum);
 mob_rnum real_mobile(mob_vnum vnum);
 obj_rnum real_object(obj_vnum vnum);
 
-void	char_to_store(struct char_data *ch, struct char_file_u *st);
-void	store_to_char(struct char_file_u *st, struct char_data *ch);
-int	load_char(const char *name, struct char_file_u *char_element);
+int	load_char(char *name, struct char_data *ch);
 void	save_char(struct char_data *ch);
 void	init_char(struct char_data *ch);
 struct char_data* create_char(void);
@@ -131,6 +144,8 @@ int	vnum_mobile(char *searchname, struct
 void	clear_char(struct char_data *ch);
 void	reset_char(struct char_data *ch);
 void	free_char(struct char_data *ch);
+void	save_player_index(void);
+long  get_ptable_by_name(const char *name);
 
 struct obj_data *create_obj(void);
 void	clear_object(struct obj_data *obj);
@@ -205,10 +220,16 @@ struct reset_q_type {
 };
 
 
-
+/* Added level, flags, and last, primarily for pfile autocleaning.  You
+   can also use them to keep online statistics, and can add race, class,
+   etc if you like.
+*/
 struct player_index_element {
    char	*name;
    long id;
+   int level;
+   int flags;
+   time_t last;
 };
 
 
diff -puN ./src/dg_olc.c ./src128bit/dg_olc.c
--- ./src/dg_olc.c	Wed Aug 14 19:36:08 2002
+++ ./src128bit/dg_olc.c	Wed Aug  7 13:56:06 2002
@@ -377,7 +377,7 @@ void trigedit_parse(struct descriptor_da
 /*
 ** print out the letter codes pertaining to the bits set in 'data'
 */
-void sprintbits(int data, char *dest)
+void sprintbitz(int data, char *dest)
 {
   int i;
   char *p = dest;
@@ -594,7 +594,7 @@ void trigedit_save(struct descriptor_dat
         fclose(trig_file);
         return;
       }
-      sprintbits(GET_TRIG_TYPE(trig), bitBuf);
+      sprintbitz(GET_TRIG_TYPE(trig), bitBuf);
       fprintf(trig_file,      "%s%c\n"
                               "%d %s %d\n"
                               "%s%c\n",
diff -puN ./src/dg_scripts.c ./src128bit/dg_scripts.c
--- ./src/dg_scripts.c	Wed Aug 14 19:36:08 2002
+++ ./src128bit/dg_scripts.c	Mon Aug 12 13:26:44 2002
@@ -1543,9 +1543,9 @@ void find_replacement(void *go, struct s
       else if (!str_cmp(field, "is_killer")) {
         if (subfield && *subfield) {
           if (!str_cmp("on", subfield))
-            SET_BIT(PLR_FLAGS(c), PLR_KILLER);
+            SET_BIT_AR(PLR_FLAGS(c), PLR_KILLER);
           else if (!str_cmp("off", subfield))
-            REMOVE_BIT(PLR_FLAGS(c), PLR_KILLER);
+            REMOVE_BIT_AR(PLR_FLAGS(c), PLR_KILLER);
         }
         if (PLR_FLAGGED(c, PLR_KILLER))
           strcpy(str, "1");
@@ -1556,9 +1556,9 @@ void find_replacement(void *go, struct s
       else if (!str_cmp(field, "is_thief")) {
         if (subfield && *subfield) {
           if (!str_cmp("on", subfield))
-            SET_BIT(PLR_FLAGS(c), PLR_THIEF);
+            SET_BIT_AR(PLR_FLAGS(c), PLR_THIEF);
           else if (!str_cmp("off", subfield))
-            REMOVE_BIT(PLR_FLAGS(c), PLR_THIEF);
+            REMOVE_BIT_AR(PLR_FLAGS(c), PLR_THIEF);
         }
         if (PLR_FLAGGED(c, PLR_THIEF))
           strcpy(str, "1");
diff -puN ./src/diskio.c ./src128bit/diskio.c
--- ./src/diskio.c	Thu Jan  1 00:00:00 1970
+++ ./src128bit/diskio.c	Wed Aug 14 11:40:42 2002
@@ -0,0 +1,340 @@
+/*
+	diskio.c	Fast file buffering
+
+	(C) Copyright 1998 by Brian Boyle
+
+	Version 1.3
+*/
+
+#include "conf.h"
+#include "sysdep.h"
+
+#include <sys/stat.h>
+
+#include "diskio.h"
+
+
+int fbgetline(FBFILE *fbfl, char *line)
+{
+  char *r = fbfl->ptr, *w = line;
+
+  if(!fbfl || !line || !*fbfl->ptr)
+    return FALSE;
+
+  for(; *r && *r != '\n' && r <= fbfl->buf + fbfl->size; r++)
+    *(w++) = *r;
+
+  while(*r == '\r' || *r == '\n')
+    r++;
+
+  *w = '\0';
+
+  if(r > fbfl->buf + fbfl->size)
+    return FALSE;
+  else {
+    fbfl->ptr = r;
+    return TRUE;
+  }
+}
+
+
+int find_string_size(char *str)
+{
+  int i;
+  char *p;
+
+  if(!str || !*str || *str == '~')
+    return 0;
+
+  for(i = 1, p = str; *p; i++) {
+    switch(*p) {
+    case '\r':
+      i++;
+      if(*(++p) == '\n')
+	p++;
+      break;
+    case '\n':
+      i++;
+      if(*(++p) == '\r') {
+        *(p - 1) = '\r';
+	*(p++) = '\n';
+      } else
+	p++;
+      break;
+    case '~':
+      if(*(p - 1) == '\r' || *(p - 1) == '\n' ||
+	*(p + 1) == '\r' || *(p + 1) == '\n' || *(p + 1) == '\0')
+	return i;
+      else
+	p++;
+      break;
+    default:
+      p++;
+    }
+  }
+  return i;
+}
+
+
+char *fbgetstring(FBFILE *fl)
+{
+  int size;
+  char *str, *r, *w;
+
+  if(!fl || !*fl->ptr)
+    return NULL;
+
+  if(!(size = find_string_size(fl->ptr)))
+    return NULL;
+
+  str = (char *)malloc(size + 1);
+  *str = '\0';
+  r = fl->ptr;
+  w = str;
+
+  for( ; *r; r++, w++) {
+    switch(*r) {
+    case '\r':
+      *(w++) = '\r';
+      *w = '\n';
+      if(*(r + 1) == '\n')
+	r++;
+      break;
+    case '\n':
+      *(w++) = '\r';
+      *w = '\n';
+      break;
+    case '~':
+      if(*(r - 1) == '\r' || *(r - 1) == '\n' ||
+	*(r + 1) == '\r' || *(r + 1) == '\n' || *(r + 1) == '\0') {
+	*w = '\0';
+	for(r++; *r == '\r' || *r == '\n'; r++);
+	fl->ptr = r;
+	return str;
+      } else
+      *w = *r;
+      break;
+    case '\0':
+      *w = '\0';
+      fl->ptr = r;
+      return str;
+    default:
+      *w = *r;
+    }
+  }
+  fl->ptr = r;
+  return str;
+}
+
+
+FBFILE *fbopen_for_read(char *fname)
+{
+  int err;
+  FILE *fl;
+  struct stat sb;
+  FBFILE *fbfl;
+
+  if(!(fbfl = (FBFILE *)malloc(sizeof(FBFILE))))
+    return NULL;
+
+  if(!(fl = fopen(fname, "r"))) {
+    free(fbfl);
+    return NULL;
+  }
+
+  err = fstat(fileno(fl), &sb);
+  if(err < 0 || sb.st_size <= 0) {
+    free(fbfl);
+    fclose(fl);
+    return NULL;
+  }
+
+  fbfl->size = sb.st_size;
+  if(!(fbfl->buf = malloc(fbfl->size))) {
+    free(fbfl);
+    return NULL;
+  }
+  if(!(fbfl->name = malloc(strlen(fname) + 1))) {
+    free(fbfl->buf);
+    free(fbfl);
+    return NULL;
+  }
+  fbfl->ptr = fbfl->buf;
+  fbfl->flags = FB_READ;
+  strcpy(fbfl->name, fname);
+  fread(fbfl->buf, sizeof(char), fbfl->size, fl);
+  fclose(fl);
+
+  return fbfl;
+}
+
+
+FBFILE *fbopen_for_write(char *fname, int mode)
+{
+  FBFILE *fbfl;
+
+  if(!(fbfl = (FBFILE *)malloc(sizeof(FBFILE))))
+    return NULL;
+
+  if(!(fbfl->buf = malloc(FB_STARTSIZE))) {
+    free(fbfl);
+    return NULL;
+  }
+  if(!(fbfl->name = malloc(strlen(fname) + 1))) {
+    free(fbfl->buf);
+    free(fbfl);
+    return NULL;
+  }
+  strcpy(fbfl->name, fname);
+  fbfl->ptr = fbfl->buf;
+  fbfl->size = FB_STARTSIZE;
+  fbfl->flags = mode;
+
+  return fbfl;
+}
+
+
+FBFILE *fbopen(char *fname, int mode)
+{
+  if(!fname || !*fname || !mode)
+    return NULL;
+
+  if(IS_SET(mode, FB_READ))
+    return fbopen_for_read(fname);
+  else if(IS_SET(mode, FB_WRITE) || IS_SET(mode, FB_APPEND))
+    return fbopen_for_write(fname, mode);
+  else
+    return NULL;
+}
+
+
+int fbclose_for_read(FBFILE *fbfl)
+{
+  if(!fbfl)
+    return 0;
+
+  if(fbfl->buf)
+    free(fbfl->buf);
+  if(fbfl->name)
+    free(fbfl->name);
+  free(fbfl);
+  return 1;
+}
+
+
+int fbclose_for_write(FBFILE *fbfl)
+{
+  char *arg, *tname;
+  int len, bytes_written;
+  FILE *fl;
+
+  if(!fbfl || !fbfl->name || fbfl->ptr == fbfl->buf)
+    return 0;
+
+  if(IS_SET(fbfl->flags, FB_APPEND))
+    arg = "wa";
+  else
+    arg = "w";
+
+  if(!(tname = malloc(strlen(fbfl->name) + 6)))
+    return 0;
+
+  len = strlen(fbfl->buf);
+  if(!len)
+    return 0;
+  sprintf(tname, "%s.tmp", fbfl->name);
+
+  if(!(fl = fopen(tname, arg))) {
+    free(tname);
+    return 0;
+  }
+
+  if((bytes_written = fwrite(fbfl->buf, sizeof(char), len, fl)) < len) {
+    fclose(fl);
+    remove(tname);
+    free(tname);
+    return 0;
+  }
+
+  fclose(fl);
+  remove(fbfl->name);
+  rename(tname, fbfl->name);
+  free(tname);
+  free(fbfl->name);
+  free(fbfl->buf);
+  free(fbfl);
+  return bytes_written;
+}
+
+
+int fbclose(FBFILE *fbfl)
+{
+  if(!fbfl)
+    return 0;
+
+  if(IS_SET(fbfl->flags, FB_READ))
+    return fbclose_for_read(fbfl);
+  else if(IS_SET(fbfl->flags, FB_WRITE | FB_APPEND))
+    return fbclose_for_write(fbfl);
+  else
+    return 0;
+}
+
+
+int fbprintf(FBFILE *fbfl, const char *format, ...)
+{
+  int bytes_written = 0, length = 0;
+  va_list args;
+
+  if(fbfl->ptr - fbfl->buf > (FB_STARTSIZE * 3) / 4) {
+    length = fbfl->ptr - fbfl->buf;
+    if(!(fbfl->buf = realloc(fbfl->buf, fbfl->size + FB_STARTSIZE)))
+      return 0;
+    fbfl->ptr = fbfl->buf + length;
+    fbfl->size += FB_STARTSIZE;
+  }
+
+  va_start(args, format);
+  bytes_written = vsprintf(fbfl->ptr, format, args);
+  va_end(args);
+
+  fbfl->ptr += bytes_written;
+  return bytes_written;
+}
+
+
+void fbrewind(FBFILE *fbfl)
+{
+  fbfl->ptr = fbfl->buf;
+}
+
+
+int fbcat(char *fromfilename, FBFILE *tofile)
+{
+  struct stat sb;
+  FILE *fromfile;
+  char *in_buf = 0;
+  int errnum = 0, length = 0;
+
+  if(!fromfilename || !*fromfilename || !tofile)
+    return 0;
+
+  if(!(fromfile = fopen(fromfilename, "r+b")))
+    return 0;
+
+  errnum = fstat(fileno(fromfile), &sb);
+  if(errnum < 0 || sb.st_size <= 0)
+    return 0;
+
+  length = tofile->ptr - tofile->buf;
+  tofile->buf = realloc(tofile->buf, tofile->size + sb.st_size);
+  tofile->ptr = tofile->buf + length;
+  tofile->size += sb.st_size;
+  in_buf = malloc(sb.st_size + 1);
+  in_buf[0] = 0;
+  errnum = fread(in_buf, sb.st_size, 1, fromfile);
+  fbprintf(tofile, "%s", in_buf);
+  fclose(fromfile);
+  free(in_buf);
+  return 1;
+}
diff -puN ./src/diskio.h ./src128bit/diskio.h
--- ./src/diskio.h	Thu Jan  1 00:00:00 1970
+++ ./src128bit/diskio.h	Wed Aug 14 11:45:58 2002
@@ -0,0 +1,45 @@
+/*
+	diskio.h	Fast file buffering
+
+	Version 1.2b	This is beta software.  Use at your own risk.
+*/
+
+#ifndef _DISKIO_H_
+#define _DISKIO_H_
+
+#define FB_READ		(1 << 0)	/* read from disk	*/
+#define FB_WRITE	(1 << 1)	/* write to disk	*/
+#define FB_APPEND	(1 << 2)	/* write with append	*/
+
+#define FB_STARTSIZE	4192	/* 4k starting buffer for writes */
+
+#ifndef IS_SET
+#define IS_SET(flag, bits)	((flag) & (bits))
+#endif
+
+#ifndef TRUE
+#define TRUE	1
+#endif
+
+#ifndef FALSE
+#define FALSE	0
+#endif
+
+typedef struct {
+  char *buf;		/* start of buffer			*/
+  char *ptr;		/* current location pointer		*/
+  int size;		/* size in bytes of buffer		*/
+  int flags;		/* read/write/append, future expansion	*/
+  char *name;		/* filename (for delayed writing)	*/
+} FBFILE;
+
+void	tag_argument(char *argument, char *tag);
+int	fbgetline(FBFILE *fbfl, char *line);
+FBFILE	*fbopen(char *fname, int mode);
+int	fbclose(FBFILE *fbfl);
+int	fbprintf(FBFILE *fbfl, const char *format, ...);
+void	fbrewind(FBFILE *fbfl);
+int	fbcat(char *fromfilename, FBFILE *tofile);
+char	*fbgetstring(FBFILE *fl);
+
+#endif
Common subdirectories: ./src/doc and ./src128bit/doc
diff -puN ./src/fight.c ./src128bit/fight.c
--- ./src/fight.c	Wed Aug 14 19:36:10 2002
+++ ./src128bit/fight.c	Mon Aug 12 12:23:38 2002
@@ -90,7 +90,8 @@ void appear(struct char_data *ch)
   if (affected_by_spell(ch, SPELL_INVISIBLE))
     affect_from_char(ch, SPELL_INVISIBLE);
 
-  REMOVE_BIT(AFF_FLAGS(ch), AFF_INVISIBLE | AFF_HIDE);
+  REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_INVISIBLE);
+  REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_HIDE);
 
   if (GET_LEVEL(ch) < LVL_IMMORT)
     act("$n slowly fades into existence.", FALSE, ch, 0, 0, TO_ROOM);
@@ -220,7 +221,7 @@ void check_killer(struct char_data *ch, 
   if (PLR_FLAGGED(ch, PLR_KILLER) || IS_NPC(ch) || IS_NPC(vict) || ch == vict)
     return;
 
-  SET_BIT(PLR_FLAGS(ch), PLR_KILLER);
+  SET_BIT_AR(PLR_FLAGS(ch), PLR_KILLER);
   send_to_char(ch, "If you want to be a PLAYER KILLER, so be it...\r\n");
   mudlog(BRF, LVL_IMMORT, TRUE, "PC Killer bit set on %s for initiating attack on %s at %s.",
 	    GET_NAME(ch), GET_NAME(vict), world[IN_ROOM(vict)].name);
@@ -275,7 +276,7 @@ void make_corpse(struct char_data *ch)
   char buf2[MAX_NAME_LENGTH + 64];
   struct obj_data *corpse, *o;
   struct obj_data *money;
-  int i;
+  int i, x, y;
 
   corpse = create_obj();
 
@@ -290,8 +291,14 @@ void make_corpse(struct char_data *ch)
   corpse->short_description = strdup(buf2);
 
   GET_OBJ_TYPE(corpse) = ITEM_CONTAINER;
-  GET_OBJ_WEAR(corpse) = ITEM_WEAR_TAKE;
-  GET_OBJ_EXTRA(corpse) = ITEM_NODONATE;
+  for(x = y = 0; x < EF_ARRAY_MAX || y < TW_ARRAY_MAX; x++, y++) {
+     if (x < EF_ARRAY_MAX)
+        GET_OBJ_EXTRA_AR(corpse, x) = 0;
+     if (y < TW_ARRAY_MAX)
+        corpse->obj_flags.wear_flags[y] = 0;
+  }
+  SET_BIT_AR(GET_OBJ_WEAR(corpse), ITEM_WEAR_TAKE);
+  SET_BIT_AR(GET_OBJ_EXTRA(corpse), ITEM_NODONATE);
   GET_OBJ_VAL(corpse, 0) = 0;	/* You can't store stuff in a corpse */
   GET_OBJ_VAL(corpse, 3) = 1;	/* corpse identifier */
   GET_OBJ_WEIGHT(corpse) = GET_WEIGHT(ch) + IS_CARRYING_W(ch);
@@ -389,8 +396,10 @@ void raw_kill(struct char_data * ch, str
 void die(struct char_data * ch, struct char_data * killer)
 {
   gain_exp(ch, -(GET_EXP(ch) / 2));
-  if (!IS_NPC(ch))
-    REMOVE_BIT(PLR_FLAGS(ch), PLR_KILLER | PLR_THIEF);
+  if (!IS_NPC(ch)) {
+    REMOVE_BIT_AR(PLR_FLAGS(ch), PLR_KILLER);
+    REMOVE_BIT_AR(PLR_FLAGS(ch), PLR_KILLER);
+  }
   raw_kill(ch, killer);
 }
 
diff -puN ./src/genmob.c ./src128bit/genmob.c
--- ./src/genmob.c	Wed Aug 14 19:36:10 2002
+++ ./src128bit/genmob.c	Mon Aug 12 12:59:12 2002
@@ -355,66 +355,63 @@ int write_mobile_espec(mob_vnum mvnum, s
   return TRUE;
 }
 
-
 /*
  * NOTE: This clobbers some of the global variable strings. Do not
  *	save anything in them around calls to this function.
  *
  *	buf1, buf2
  */
-int write_mobile_record(mob_vnum mvnum, struct char_data *mob, FILE *fd)
-{
-
-char buf1[MAX_STRING_LENGTH];
-char buf2[MAX_STRING_LENGTH];
-
-  char ldesc[MAX_STRING_LENGTH], ddesc[MAX_STRING_LENGTH];
-
-  ldesc[MAX_STRING_LENGTH - 1] = '\0';
-  ddesc[MAX_STRING_LENGTH - 1] = '\0';
-  strip_cr(strncpy(ldesc, GET_LDESC(mob), MAX_STRING_LENGTH - 1));
-  strip_cr(strncpy(ddesc, GET_DDESC(mob), MAX_STRING_LENGTH - 1));
-
-  fprintf(fd,	"#%d\n"
-		"%s%c\n"
-		"%s%c\n"
-		"%s%c\n"
-		"%s%c\n",
-	mvnum,
-	GET_ALIAS(mob), STRING_TERMINATOR,
-	GET_SDESC(mob), STRING_TERMINATOR,
-	ldesc, STRING_TERMINATOR,
-	ddesc, STRING_TERMINATOR
-  );
-
-  sprintascii(buf1, MOB_FLAGS(mob));
-  sprintascii(buf2, AFF_FLAGS(mob));
-
-  fprintf(fd,	"%s %s %d E\n"
-		"%d %d %d %dd%d+%d %dd%d+%d\n",
-		buf1, buf2, GET_ALIGNMENT(mob),
-		GET_LEVEL(mob), 20 - GET_HITROLL(mob), GET_AC(mob) / 10, GET_HIT(mob),
-		GET_MANA(mob), GET_MOVE(mob), GET_NDD(mob), GET_SDD(mob),
-		GET_DAMROLL(mob)
-  );
-  fprintf(fd, 	"%d %d\n"
-		"%d %d %d\n",
-		GET_GOLD(mob), GET_EXP(mob),
-		GET_POS(mob), GET_DEFAULT_POS(mob), GET_SEX(mob)
-  );
-
-  if (write_mobile_espec(mvnum, mob, fd) < 0)
-    log("SYSERR: GenOLC: Error writing E-specs for mobile #%d.", mvnum);
-
-  script_save_to_disk(fd, mob, MOB_TRIGGER);
-
-#if CONFIG_GENOLC_MOBPROG
-  if (write_mobile_mobprog(mvnum, mob, fd) < 0)
-    log("SYSERR: GenOLC: Error writing MobProgs for mobile #%d.", mvnum);
-#endif
 
-  return TRUE;
-}
+int write_mobile_record(mob_vnum mvnum, struct char_data *mob, FILE *fd)
+{
+  char ldesc[MAX_STRING_LENGTH], ddesc[MAX_STRING_LENGTH];
+
+  ldesc[MAX_STRING_LENGTH - 1] = '\0';
+  ddesc[MAX_STRING_LENGTH - 1] = '\0';
+  strip_cr(strncpy(ldesc, GET_LDESC(mob), MAX_STRING_LENGTH - 1));
+  strip_cr(strncpy(ddesc, GET_DDESC(mob), MAX_STRING_LENGTH - 1));
+
+  fprintf(fd,	"#%d\n"
+		"%s%c\n"
+		"%s%c\n"
+		"%s%c\n"
+		"%s%c\n",
+	mvnum,
+	GET_ALIAS(mob), STRING_TERMINATOR,
+	GET_SDESC(mob), STRING_TERMINATOR,
+	ldesc, STRING_TERMINATOR,
+	ddesc, STRING_TERMINATOR
+  );
+
+  fprintf(fd,	"%d %d %d %d %d %d %d %d %d E\n"
+		"%d %d %d %dd%d+%d %dd%d+%d\n",
+		MOB_FLAGS(mob)[0], MOB_FLAGS(mob)[1],
+		MOB_FLAGS(mob)[2], MOB_FLAGS(mob)[3],
+		AFF_FLAGS(mob)[0], AFF_FLAGS(mob)[1],
+		AFF_FLAGS(mob)[2], AFF_FLAGS(mob)[3],
+        GET_ALIGNMENT(mob),
+		GET_LEVEL(mob), 20 - GET_HITROLL(mob), GET_AC(mob) / 10, GET_HIT(mob),
+		GET_MANA(mob), GET_MOVE(mob), GET_NDD(mob), GET_SDD(mob),
+		GET_DAMROLL(mob)
+  );
+  fprintf(fd, 	"%d %d\n"
+		"%d %d %d\n",
+		GET_GOLD(mob), GET_EXP(mob),
+		GET_POS(mob), GET_DEFAULT_POS(mob), GET_SEX(mob)
+  );
+
+  if (write_mobile_espec(mvnum, mob, fd) < 0)
+    log("SYSERR: GenOLC: Error writing E-specs for mobile #%d.", mvnum);
+
+  script_save_to_disk(fd, mob, MOB_TRIGGER);
+
+#if CONFIG_GENOLC_MOBPROG
+  if (write_mobile_mobprog(mvnum, mob, fd) < 0)
+    log("SYSERR: GenOLC: Error writing MobProgs for mobile #%d.", mvnum);
+#endif
+
+  return TRUE;
+}
 
 void check_mobile_strings(struct char_data *mob)
 {
diff -puN ./src/genobj.c ./src128bit/genobj.c
--- ./src/genobj.c	Wed Aug 14 19:36:10 2002
+++ ./src128bit/genobj.c	Mon Aug 12 13:02:32 2002
@@ -210,112 +210,109 @@ int index_object(struct obj_data *obj, o
  *
  *	buf, buf1, buf2, arg
  */
-int save_objects(zone_rnum zone_num)
-{
-char        buf[MAX_STRING_LENGTH];
-char        buf1[MAX_STRING_LENGTH];
-char        buf2[MAX_STRING_LENGTH];
-
-  int counter, counter2, realcounter;
-  FILE *fp;
-  struct obj_data *obj;
-  struct extra_descr_data *ex_desc;
-
-  if (zone_num == NOTHING || zone_num > top_of_zone_table) {
-    log("SYSERR: GenOLC: save_objects: Invalid real zone number %d. (0-%d)", zone_num, top_of_zone_table);
-    return FALSE;
-  }
-
-  sprintf(buf, "%s/%d.new", OBJ_PREFIX, zone_table[zone_num].number);
-  if (!(fp = fopen(buf, "w+"))) {
-    mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: OLC: Cannot open objects file!");
-    return FALSE;
-  }
-  /*
-   * Start running through all objects in this zone.
-   */
-  for (counter = genolc_zone_bottom(zone_num); counter <= zone_table[zone_num].top; counter++) {
-    if ((realcounter = real_object(counter)) != NOTHING) {
-      if ((obj = &obj_proto[realcounter])->action_description) {
-        buf1[MAX_STRING_LENGTH - 1] = '\0';
-	strncpy(buf1, obj->action_description, MAX_STRING_LENGTH - 1);
-	strip_cr(buf1);
-      } else
-	*buf1 = '\0';
-
-      fprintf(fp,
-	      "#%d\n"
-	      "%s~\n"
-	      "%s~\n"
-	      "%s~\n"
-	      "%s~\n",
-
-	      GET_OBJ_VNUM(obj),
-	      (obj->name && *obj->name) ? obj->name : "undefined",
-	      (obj->short_description && *obj->short_description) ? obj->short_description : "undefined",
-	      (obj->description && *obj->description) ?	obj->description : "undefined",
-	      buf1);
-
-      sprintascii(buf1, GET_OBJ_EXTRA(obj));
-      sprintascii(buf2, GET_OBJ_WEAR(obj));
-
-      fprintf(fp,
-	      "%d %s %s %ld\n"
-	      "%d %d %d %d\n"
-	      "%d %d %d %d\n",
-
-	      GET_OBJ_TYPE(obj), buf1, buf2, GET_OBJ_PERM(obj),
-	      GET_OBJ_VAL(obj, 0), GET_OBJ_VAL(obj, 1), GET_OBJ_VAL(obj, 2), GET_OBJ_VAL(obj, 3),
-	      GET_OBJ_WEIGHT(obj), GET_OBJ_COST(obj), GET_OBJ_RENT(obj), GET_OBJ_LEVEL(obj)
-      );
-
-      /*
-       * Do we have script(s) attached ? 
-       */
-      script_save_to_disk(fp, obj, OBJ_TRIGGER);
-      
-      /*
-       * Do we have extra descriptions? 
-       */
-      if (obj->ex_description) {	/* Yes, save them too. */
-	for (ex_desc = obj->ex_description; ex_desc; ex_desc = ex_desc->next) {
-	  /*
-	   * Sanity check to prevent nasty protection faults.
-	   */
-	  if (!ex_desc->keyword || !ex_desc->description || !*ex_desc->keyword || !*ex_desc->description) {
-	    mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: OLC: oedit_save_to_disk: Corrupt ex_desc!");
-	    continue;
-	  }
-          buf1[MAX_STRING_LENGTH - 1] = '\0';
-	  strncpy(buf1, ex_desc->description, MAX_STRING_LENGTH - 1);
-	  strip_cr(buf1);
-	  fprintf(fp, "E\n"
-		  "%s~\n"
-		  "%s~\n", ex_desc->keyword, buf1);
-	}
-      }
-      /*
-       * Do we have affects? 
-       */
-      for (counter2 = 0; counter2 < MAX_OBJ_AFFECT; counter2++)
-	if (obj->affected[counter2].modifier)
-	  fprintf(fp, "A\n"
-		  "%d %d\n", obj->affected[counter2].location,
-		  obj->affected[counter2].modifier);
-    }
-  }
-
-  /*
-   * Write the final line, close the file.
-   */
-  fprintf(fp, "$~\n");
-  fclose(fp);
-  sprintf(buf2, "%s/%d.obj", OBJ_PREFIX, zone_table[zone_num].number);
-  remove(buf2);
-  rename(buf, buf2);
-
-  remove_from_save_list(zone_table[zone_num].number, SL_OBJ);
-  return TRUE;
+int save_objects(zone_rnum zone_num)
+{
+  char buf[MAX_STRING_LENGTH], buf1[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH];
+  int counter, counter2, realcounter;
+  FILE *fp;
+  struct obj_data *obj;
+  struct extra_descr_data *ex_desc;
+
+  if (zone_num == NOTHING || zone_num > top_of_zone_table) {
+    log("SYSERR: GenOLC: save_objects: Invalid real zone number %d. (0-%d)", zone_num, top_of_zone_table);
+    return FALSE;
+  }
+
+  sprintf(buf, "%s/%d.new", OBJ_PREFIX, zone_table[zone_num].number);
+  if (!(fp = fopen(buf, "w+"))) {
+    mudlog(CMP, LVL_GOD, FALSE, "SYSERR: OLC: Cannot open objects file!");
+    return FALSE;
+  }
+  /*
+   * Start running through all objects in this zone.
+   */
+  for (counter = genolc_zone_bottom(zone_num); counter <= zone_table[zone_num].top; counter++) {
+    if ((realcounter = real_object(counter)) != NOTHING) {
+      if ((obj = &obj_proto[realcounter])->action_description) {
+        buf1[MAX_STRING_LENGTH - 1] = '\0';
+	strncpy(buf1, obj->action_description, MAX_STRING_LENGTH - 1);
+	strip_cr(buf1);
+      } else
+	*buf1 = '\0';
+
+      fprintf(fp,
+	      "#%d\n"
+	      "%s~\n"
+	      "%s~\n"
+	      "%s~\n"
+	      "%s~\n",
+
+	      GET_OBJ_VNUM(obj),
+	      (obj->name && *obj->name) ? obj->name : "undefined",
+	      (obj->short_description && *obj->short_description) ? obj->short_description : "undefined",
+	      (obj->description && *obj->description) ?	obj->description : "undefined",
+	      buf1);
+
+      fprintf(fp,
+	      "%d %d %d %d %d %d %d %d %d %d %d %d %d\n"
+	      "%d %d %d %d\n"
+	      "%d %d %d %d\n",
+
+	      GET_OBJ_TYPE(obj), 
+		  GET_OBJ_EXTRA(obj)[0], GET_OBJ_EXTRA(obj)[1],
+		  GET_OBJ_EXTRA(obj)[2], GET_OBJ_EXTRA(obj)[3],
+		  GET_OBJ_WEAR(obj)[0], GET_OBJ_WEAR(obj)[1],
+		  GET_OBJ_WEAR(obj)[2], GET_OBJ_WEAR(obj)[3],
+		  GET_OBJ_PERM(obj)[0], GET_OBJ_PERM(obj)[1],
+		  GET_OBJ_PERM(obj)[2], GET_OBJ_PERM(obj)[3],
+	      GET_OBJ_VAL(obj, 0), GET_OBJ_VAL(obj, 1), GET_OBJ_VAL(obj, 2), GET_OBJ_VAL(obj, 3),
+	      GET_OBJ_WEIGHT(obj), GET_OBJ_COST(obj), GET_OBJ_RENT(obj), GET_OBJ_LEVEL(obj)
+      );
+
+        script_save_to_disk(fp, obj, OBJ_TRIGGER);
+
+      /*
+       * Do we have extra descriptions? 
+       */
+      if (obj->ex_description) {	/* Yes, save them too. */
+	for (ex_desc = obj->ex_description; ex_desc; ex_desc = ex_desc->next) {
+	  /*
+	   * Sanity check to prevent nasty protection faults.
+	   */
+	  if (!ex_desc->keyword || !ex_desc->description || !*ex_desc->keyword || !*ex_desc->description) {
+	    mudlog(CMP, LVL_GOD, FALSE, "SYSERR: OLC: oedit_save_to_disk: Corrupt ex_desc!");
+		continue;
+	  }
+          buf1[MAX_STRING_LENGTH - 1] = '\0';
+	  strncpy(buf1, ex_desc->description, MAX_STRING_LENGTH - 1);
+	  strip_cr(buf1);
+	  fprintf(fp, "E\n"
+		  "%s~\n"
+		  "%s~\n", ex_desc->keyword, buf1);
+	}
+      }
+      /*
+       * Do we have affects? 
+       */
+      for (counter2 = 0; counter2 < MAX_OBJ_AFFECT; counter2++)
+	if (obj->affected[counter2].modifier)
+	  fprintf(fp, "A\n"
+		  "%d %d\n", obj->affected[counter2].location,
+		  obj->affected[counter2].modifier);
+	}
+  }
+  
+  /*
+   * Write the final line, close the file.
+   */
+  fprintf(fp, "$~\n");
+  fclose(fp);
+  sprintf(buf2, "%s/%d.obj", OBJ_PREFIX, zone_table[zone_num].number);
+  remove(buf2);
+  rename(buf, buf2);
+
+  remove_from_save_list(zone_table[zone_num].number, SL_OBJ);
+  return TRUE;
 }
 
 /*
diff -puN ./src/genwld.c ./src128bit/genwld.c
--- ./src/genwld.c	Wed Aug 14 19:36:10 2002
+++ ./src128bit/genwld.c	Mon Aug 12 13:04:30 2002
@@ -251,130 +251,116 @@ int delete_room(room_rnum rnum)
 }
 
 
-int save_rooms(zone_rnum rzone)
-{
-  int i;
-  struct room_data *room;
-  FILE *sf;
-  char buf[MAX_STRING_LENGTH];
-  char buf1[MAX_STRING_LENGTH];
-  char buf2[MAX_STRING_LENGTH];
-
-  if (rzone == NOWHERE || rzone > top_of_zone_table) {
-    log("SYSERR: GenOLC: save_rooms: Invalid zone number %d passed! (0-%d)", rzone, top_of_zone_table);
-    return FALSE;
-  }
-
-  log("GenOLC: save_rooms: Saving rooms in zone #%d (%d-%d).",
-	zone_table[rzone].number, genolc_zone_bottom(rzone), zone_table[rzone].top);
-
-  sprintf(buf, "%s/%d.new", WLD_PREFIX, zone_table[rzone].number);
-  if (!(sf = fopen(buf, "w"))) {
-    perror("SYSERR: save_rooms");
-    return FALSE;
-  }
-
-  for (i = genolc_zone_bottom(rzone); i <= zone_table[rzone].top; i++) {
-    int rnum;
-
-    if ((rnum = real_room(i)) != NOWHERE) {
-      int j;
-
-      room = (world + rnum);
-
-      /*
-       * Copy the description and strip off trailing newlines.
-       */
-      strcpy(buf, room->description ? room->description : "Empty room.");
-      strip_cr(buf);
-
-      /*
-       * Save the numeric and string section of the file.
-       */
-      sprintascii(buf2, room->room_flags);
-      fprintf(sf, 	"#%d\n"
-			"%s%c\n"
-			"%s%c\n"
-			"%d %s %d\n",
-		room->number,
-		room->name ? room->name : "Untitled", STRING_TERMINATOR,
-		buf, STRING_TERMINATOR,
-		zone_table[room->zone].number, buf2, room->sector_type
-      );
-
-      /*
-       * Now you write out the exits for the room.
-       */
-      for (j = 0; j < NUM_OF_DIRS; j++) {
-	if (R_EXIT(room, j)) {
-	  int dflag;
-	  if (R_EXIT(room, j)->general_description) {
-	    strcpy(buf, R_EXIT(room, j)->general_description);
-	    strip_cr(buf);
-	  } else
-	    *buf = '\0';
-
-	  /*
-	   * Figure out door flag.
-	   */
-	  if (IS_SET(R_EXIT(room, j)->exit_info, EX_ISDOOR)) {
-	    if (IS_SET(R_EXIT(room, j)->exit_info, EX_PICKPROOF))
-	      dflag = 2;
-	    else
-	      dflag = 1;
-	  } else
-	    dflag = 0;
-
-	  if (R_EXIT(room, j)->keyword)
-	    strcpy(buf1, R_EXIT(room, j)->keyword);
-	  else
-	    *buf1 = '\0';
-
-	  /*
-	   * Now write the exit to the file.
-	   */
-	  fprintf(sf,	"D%d\n"
-			"%s~\n"
-			"%s~\n"
-			"%d %d %d\n", j, buf, buf1, dflag,
-		R_EXIT(room, j)->key, R_EXIT(room, j)->to_room != -1 ?
-		world[R_EXIT(room, j)->to_room].number : -1);
-
-	}
-      }
-
-      if (room->ex_description) {
-        struct extra_descr_data *xdesc;
-
-	for (xdesc = room->ex_description; xdesc; xdesc = xdesc->next) {
-	  strcpy(buf, xdesc->description);
-	  strip_cr(buf);
-	  fprintf(sf,	"E\n"
-			"%s~\n"
-			"%s~\n", xdesc->keyword, buf);
-	}
-      }
-      fprintf(sf, "S\n");
-      script_save_to_disk(sf, room, WLD_TRIGGER);
-    }
-  }
-
-  /*
-   * Write the final line and close it.
-   */
-  fprintf(sf, "$~\n");
-  fclose(sf);
-
-  /* New file we just made. */
-  sprintf(buf, "%s/%d.new", WLD_PREFIX, zone_table[rzone].number);
-  /* Old file we're replacing. */
-  sprintf(buf2, "%s/%d.wld", WLD_PREFIX, zone_table[rzone].number);
-
-  remove(buf2);
-  rename(buf, buf2);
-
-  remove_from_save_list(zone_table[rzone].number, SL_WLD);
-  return TRUE;
+int save_rooms(zone_rnum rzone)
+{
+  char buf[MAX_STRING_LENGTH], buf1[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH];
+  int i;
+  struct room_data *room;
+  FILE *sf;
+
+  if (rzone == NOWHERE || rzone > top_of_zone_table) {
+    log("SYSERR: GenOLC: save_rooms: Invalid zone number %d passed! (0-%d)", rzone, top_of_zone_table);
+    return FALSE;
+  }
+
+  log("GenOLC: save_rooms: Saving rooms in zone #%d (%d-%d).",
+	zone_table[rzone].number, genolc_zone_bottom(rzone), zone_table[rzone].top);
+
+  sprintf(buf, "%s/%d.new", WLD_PREFIX, zone_table[rzone].number);
+  if (!(sf = fopen(buf, "w"))) {
+    perror("SYSERR: save_rooms");
+    return FALSE;
+  }
+
+  for (i = genolc_zone_bottom(rzone); i <= zone_table[rzone].top; i++) {
+    int rnum;
+
+    if ((rnum = real_room(i)) != NOWHERE) {
+      int j;
+
+      room = (world + rnum);
+
+      /*
+       * Copy the description and strip off trailing newlines.
+       */
+      strcpy(buf, room->description ? room->description : "Empty room.");
+      strip_cr(buf);
+
+      /*
+       * Save the numeric and string section of the file.
+       */
+      fprintf(sf, 	"#%d\n"
+			"%s%c\n"
+			"%s%c\n"
+			"%d %d %d %d %d %d\n",
+		room->number,
+		room->name ? room->name : "Untitled", STRING_TERMINATOR,
+		buf, STRING_TERMINATOR,
+		zone_table[room->zone].number, room->room_flags[0], room->room_flags[1], room->room_flags[2], 
+		  room->room_flags[3], room->sector_type 
+      );
+
+      /*
+       * Now you write out the exits for the room.
+       */
+      for (j = 0; j < NUM_OF_DIRS; j++) {
+	if (R_EXIT(room, j)) {
+	  if (R_EXIT(room, j)->general_description) {
+	    strcpy(buf, R_EXIT(room, j)->general_description);
+	    strip_cr(buf);
+	  } else
+	    *buf = '\0';
+
+	  if (R_EXIT(room, j)->keyword)
+	    strcpy(buf1, R_EXIT(room, j)->keyword);
+	  else
+	    *buf1 = '\0';
+
+	  /*
+	   * Now write the exit to the file.
+	   */
+	  fprintf(sf,	"D%d\n"
+			"%s~\n"
+			"%s~\n"
+         "%d %d %d\n", j, buf, buf1, R_EXIT(room, j)->exit_info,
+		R_EXIT(room, j)->key, R_EXIT(room, j)->to_room != -1 ?
+		world[R_EXIT(room, j)->to_room].number : -1);
+
+	}
+      }
+
+      if (room->ex_description) {
+        struct extra_descr_data *xdesc;
+
+	for (xdesc = room->ex_description; xdesc; xdesc = xdesc->next) {
+	  strcpy(buf, xdesc->description);
+	  strip_cr(buf);
+	  fprintf(sf,	"E\n"
+			"%s~\n"
+			"%s~\n", xdesc->keyword, buf);
+	}
+      }
+      fprintf(sf, "S\n");
+      script_save_to_disk(sf, room, WLD_TRIGGER);
+    }
+  }
+
+  /*
+   * Write the final line and close it.
+   */
+  fprintf(sf, "$~\n");
+  fclose(sf);
+
+  /* New file we just made. */
+  sprintf(buf, "%s/%d.new", WLD_PREFIX, zone_table[rzone].number);
+  /* Old file we're replacing. */
+  sprintf(buf2, "%s/%d.wld", WLD_PREFIX, zone_table[rzone].number);
+
+  remove(buf2);
+  rename(buf, buf2);
+
+  remove_from_save_list(zone_table[rzone].number, SL_WLD);
+  return TRUE;
 }
 
 int copy_room(struct room_data *to, struct room_data *from)
diff -puN ./src/graph.c ./src128bit/graph.c
--- ./src/graph.c	Wed Aug 14 19:34:12 2002
+++ ./src128bit/graph.c	Mon Aug 12 12:02:06 2002
@@ -46,9 +46,9 @@ struct bfs_queue_struct {
 static struct bfs_queue_struct *queue_head = 0, *queue_tail = 0;
 
 /* Utility macros */
-#define MARK(room)	(SET_BIT(ROOM_FLAGS(room), ROOM_BFS_MARK))
-#define UNMARK(room)	(REMOVE_BIT(ROOM_FLAGS(room), ROOM_BFS_MARK))
-#define IS_MARKED(room)	(ROOM_FLAGGED(room, ROOM_BFS_MARK))
+#define MARK(room) (SET_BIT_AR(ROOM_FLAGS(room), ROOM_BFS_MARK))
+#define UNMARK(room) (REMOVE_BIT_AR(ROOM_FLAGS(room), ROOM_BFS_MARK))
+#define IS_MARKED(room) (IS_SET_AR(ROOM_FLAGS(room), ROOM_BFS_MARK))
 #define TOROOM(x, y)	(world[(x)].dir_option[(y)]->to_room)
 #define IS_CLOSED(x, y)	(EXIT_FLAGGED(world[(x)].dir_option[(y)], EX_CLOSED))
 
diff -puN ./src/handler.c ./src128bit/handler.c
--- ./src/handler.c	Wed Aug 14 19:36:10 2002
+++ ./src128bit/handler.c	Mon Aug 12 12:26:40 2002
@@ -52,7 +52,7 @@ char *fname(const char *namelist)
   return (holder);
 }
 
-
+/*
 int isname(const char *str, const char *namelist)
 {
   const char *curname, *curstr;
@@ -73,135 +73,173 @@ int isname(const char *str, const char *
 	break;
     }
 
-    /* skip to next name */
 
     for (; isalpha(*curname); curname++);
     if (!*curname)
       return (0);
-    curname++;			/* first char of new name */
+    curname++;			
   }
 }
+*/
 
+#define WHITESPACE " \t"
 
-
-void affect_modify(struct char_data *ch, byte loc, sbyte mod, 
-                   bitvector_t bitv, bool add)
-{
-  if (add)
-    SET_BIT(AFF_FLAGS(ch), bitv);
-  else {
-    REMOVE_BIT(AFF_FLAGS(ch), bitv);
-    mod = -mod;
-  }
-
-  switch (loc) {
-  case APPLY_NONE:
-    break;
-
-  case APPLY_STR:
-    GET_STR(ch) += mod;
-    break;
-  case APPLY_DEX:
-    GET_DEX(ch) += mod;
-    break;
-  case APPLY_INT:
-    GET_INT(ch) += mod;
-    break;
-  case APPLY_WIS:
-    GET_WIS(ch) += mod;
-    break;
-  case APPLY_CON:
-    GET_CON(ch) += mod;
-    break;
-  case APPLY_CHA:
-    GET_CHA(ch) += mod;
-    break;
-
-  case APPLY_CLASS:
-    /* ??? GET_CLASS(ch) += mod; */
-    break;
-
-  /*
-   * My personal thoughts on these two would be to set the person to the
-   * value of the apply.  That way you won't have to worry about people
-   * making +1 level things to be imp (you restrict anything that gives
-   * immortal level of course).  It also makes more sense to set someone
-   * to a class rather than adding to the class number. -gg
-   */
-
-  case APPLY_LEVEL:
-    /* ??? GET_LEVEL(ch) += mod; */
-    break;
-
-  case APPLY_AGE:
-    ch->player.time.birth -= (mod * SECS_PER_MUD_YEAR);
-    break;
-
-  case APPLY_CHAR_WEIGHT:
-    GET_WEIGHT(ch) += mod;
-    break;
-
-  case APPLY_CHAR_HEIGHT:
-    GET_HEIGHT(ch) += mod;
-    break;
-
-  case APPLY_MANA:
-    GET_MAX_MANA(ch) += mod;
-    break;
-
-  case APPLY_HIT:
-    GET_MAX_HIT(ch) += mod;
-    break;
-
-  case APPLY_MOVE:
-    GET_MAX_MOVE(ch) += mod;
-    break;
-
-  case APPLY_GOLD:
-    break;
-
-  case APPLY_EXP:
-    break;
-
-  case APPLY_AC:
-    GET_AC(ch) += mod;
-    break;
-
-  case APPLY_HITROLL:
-    GET_HITROLL(ch) += mod;
-    break;
-
-  case APPLY_DAMROLL:
-    GET_DAMROLL(ch) += mod;
-    break;
-
-  case APPLY_SAVING_PARA:
-    GET_SAVE(ch, SAVING_PARA) += mod;
-    break;
-
-  case APPLY_SAVING_ROD:
-    GET_SAVE(ch, SAVING_ROD) += mod;
-    break;
-
-  case APPLY_SAVING_PETRI:
-    GET_SAVE(ch, SAVING_PETRI) += mod;
-    break;
-
-  case APPLY_SAVING_BREATH:
-    GET_SAVE(ch, SAVING_BREATH) += mod;
-    break;
-
-  case APPLY_SAVING_SPELL:
-    GET_SAVE(ch, SAVING_SPELL) += mod;
-    break;
-
-  default:
-    log("SYSERR: Unknown apply adjust %d attempt (%s, affect_modify).", loc, __FILE__);
-    break;
-
-  } /* switch */
-}
-
+  int isname(const char *str, const char *namelist)
+  {
+    char *newlist;
+    char *curtok;
+
+    newlist = strdup(namelist); /* make a copy since strtok 'modifies' strings */
+
+    for(curtok = strtok(newlist, WHITESPACE); curtok; curtok = strtok(NULL, WHITESPACE))
+       if(curtok && is_abbrev(str, curtok))
+       {
+          free(newlist);
+          return 1;
+       }
+    free(newlist);
+    return 0;
+  }
+
+
+void aff_apply_modify(struct char_data *ch, byte loc, sbyte mod, char *msg)
+{
+  int maxabil;
+
+  maxabil = (IS_NPC(ch) ? 25 : 18); /* Not used, but why remove it ? */
+
+  switch (loc) {
+  case APPLY_NONE:
+    break;
+
+  case APPLY_STR:
+    GET_STR(ch) += mod;
+    break;
+  case APPLY_DEX:
+    GET_DEX(ch) += mod;
+    break;
+  case APPLY_INT:
+    GET_INT(ch) += mod;
+    break;
+  case APPLY_WIS:
+    GET_WIS(ch) += mod;
+    break;
+  case APPLY_CON:
+    GET_CON(ch) += mod;
+    break;
+  case APPLY_CHA:
+    GET_CHA(ch) += mod;
+    break;
+
+  case APPLY_CLASS:
+    /* ??? GET_CLASS(ch) += mod; */
+    break;
+ 
+  case APPLY_LEVEL:
+    /* ??? GET_LEVEL(ch) += mod; */
+    break;
+
+  case APPLY_AGE:
+    ch->player.time.birth -= (mod * SECS_PER_MUD_YEAR);
+    break;
+
+  case APPLY_CHAR_WEIGHT:
+    GET_WEIGHT(ch) += mod;
+    break;
+
+  case APPLY_CHAR_HEIGHT:
+    GET_HEIGHT(ch) += mod;
+    break;
+
+  case APPLY_MANA:
+    GET_MAX_MANA(ch) += mod;
+    break;
+
+  case APPLY_HIT:
+    GET_MAX_HIT(ch) += mod;
+    break;
+
+  case APPLY_MOVE:
+    GET_MAX_MOVE(ch) += mod;
+    break;
+
+  case APPLY_GOLD:
+    break;
+
+  case APPLY_EXP:
+    break;
+ 
+  case APPLY_AC:
+    GET_AC(ch) += mod;
+    break;
+
+  case APPLY_HITROLL:
+    GET_HITROLL(ch) += mod;
+    break;
+
+  case APPLY_DAMROLL:
+    GET_DAMROLL(ch) += mod;
+    break;
+ 
+  case APPLY_SAVING_PARA:
+    GET_SAVE(ch, SAVING_PARA) += mod;
+    break;
+ 
+  case APPLY_SAVING_ROD:
+    GET_SAVE(ch, SAVING_ROD) += mod;
+    break;
+ 
+  case APPLY_SAVING_PETRI:
+    GET_SAVE(ch, SAVING_PETRI) += mod;
+    break;
+ 
+  case APPLY_SAVING_BREATH:
+    GET_SAVE(ch, SAVING_BREATH) += mod;
+    break;
+
+  case APPLY_SAVING_SPELL:
+    GET_SAVE(ch, SAVING_SPELL) += mod;
+    break;
+
+  default:
+    log("SYSERR: Unknown apply adjust attempt (handler.c, %s).", msg);
+    break;
+
+  } /* switch */
+}
+ 
+
+void affect_modify(struct char_data * ch, byte loc, sbyte mod, long bitv, bool add)
+{
+  if (add) {
+    SET_BIT_AR(AFF_FLAGS(ch), bitv);
+  } else {
+    REMOVE_BIT_AR(AFF_FLAGS(ch), bitv);
+    mod = -mod;
+  }
+
+  aff_apply_modify(ch, loc, mod, "affect_modify");
+}
+
+void affect_modify_ar(struct char_data * ch, byte loc, sbyte mod, int bitv[], bool add)
+{
+  int i , j;
+
+  if (add) {
+    for(i = 0; i < AF_ARRAY_MAX; i++)
+      for(j = 0; j < 32; j++)
+        if(IS_SET_AR(bitv, (i*32)+j))
+          SET_BIT_AR(AFF_FLAGS(ch), (i*32)+j);
+  } else {
+    for(i = 0; i < AF_ARRAY_MAX; i++)
+      for(j = 0; j < 32; j++)
+        if(IS_SET_AR(bitv, (i*32)+j))
+          REMOVE_BIT_AR(AFF_FLAGS(ch), (i*32)+j);
+    mod = -mod;
+  }
+
+  aff_apply_modify(ch, loc, mod, "affect_modify_ar");
+}
 
 
 /* This updates a character by subtracting everything he is affected by */
@@ -214,7 +252,7 @@ void affect_total(struct char_data *ch)
   for (i = 0; i < NUM_WEARS; i++) {
     if (GET_EQ(ch, i))
       for (j = 0; j < MAX_OBJ_AFFECT; j++)
-	affect_modify(ch, GET_EQ(ch, i)->affected[j].location,
+	affect_modify_ar(ch, GET_EQ(ch, i)->affected[j].location,
 		      GET_EQ(ch, i)->affected[j].modifier,
 		      GET_OBJ_AFFECT(GET_EQ(ch, i)), FALSE);
   }
@@ -228,7 +266,7 @@ void affect_total(struct char_data *ch)
   for (i = 0; i < NUM_WEARS; i++) {
     if (GET_EQ(ch, i))
       for (j = 0; j < MAX_OBJ_AFFECT; j++)
-	affect_modify(ch, GET_EQ(ch, i)->affected[j].location,
+	affect_modify_ar(ch, GET_EQ(ch, i)->affected[j].location,
 		      GET_EQ(ch, i)->affected[j].modifier,
 		      GET_OBJ_AFFECT(GET_EQ(ch, i)), TRUE);
   }
@@ -424,7 +462,7 @@ void obj_to_char(struct obj_data *object
 
     /* set flag for crash-save system, but not on mobs! */
     if (!IS_NPC(ch))
-      SET_BIT(PLR_FLAGS(ch), PLR_CRASH);
+      SET_BIT_AR(PLR_FLAGS(ch), PLR_CRASH);
   } else
     log("SYSERR: NULL obj (%p) or char (%p) passed to obj_to_char.", object, ch);
 }
@@ -443,7 +481,7 @@ void obj_from_char(struct obj_data *obje
 
   /* set flag for crash-save system, but not on mobs! */
   if (!IS_NPC(object->carried_by))
-    SET_BIT(PLR_FLAGS(object->carried_by), PLR_CRASH);
+    SET_BIT_AR(PLR_FLAGS(object->carried_by), PLR_CRASH);
 
   IS_CARRYING_W(object->carried_by) -= GET_OBJ_WEIGHT(object);
   IS_CARRYING_N(object->carried_by)--;
@@ -541,7 +579,7 @@ void equip_char(struct char_data *ch, st
     log("SYSERR: IN_ROOM(ch) = NOWHERE when equipping char %s.", GET_NAME(ch));
 
   for (j = 0; j < MAX_OBJ_AFFECT; j++)
-    affect_modify(ch, obj->affected[j].location,
+    affect_modify_ar(ch, obj->affected[j].location,
 		  obj->affected[j].modifier,
 		  GET_OBJ_AFFECT(obj), TRUE);
 
@@ -577,7 +615,7 @@ struct obj_data *unequip_char(struct cha
   GET_EQ(ch, pos) = NULL;
 
   for (j = 0; j < MAX_OBJ_AFFECT; j++)
-    affect_modify(ch, obj->affected[j].location,
+    affect_modify_ar(ch, obj->affected[j].location,
 		  obj->affected[j].modifier,
 		  GET_OBJ_AFFECT(obj), FALSE);
 
@@ -689,7 +727,7 @@ void obj_to_room(struct obj_data *object
     IN_ROOM(object) = room;
     object->carried_by = NULL;
     if (ROOM_FLAGGED(room, ROOM_HOUSE))
-      SET_BIT(ROOM_FLAGS(room), ROOM_HOUSE_CRASH);
+      SET_BIT_AR(ROOM_FLAGS(room), ROOM_HOUSE_CRASH);
   }
 }
 
@@ -708,7 +746,7 @@ void obj_from_room(struct obj_data *obje
   REMOVE_FROM_LIST(object, world[IN_ROOM(object)].contents, next_content);
 
   if (ROOM_FLAGGED(IN_ROOM(object), ROOM_HOUSE))
-    SET_BIT(ROOM_FLAGS(IN_ROOM(object)), ROOM_HOUSE_CRASH);
+    SET_BIT_AR(ROOM_FLAGS(IN_ROOM(object)), ROOM_HOUSE_CRASH);
   IN_ROOM(object) = NOWHERE;
   object->next_content = NULL;
 }
@@ -971,9 +1009,9 @@ void extract_char_final(struct char_data
 void extract_char(struct char_data *ch)
 {
   if (IS_NPC(ch))
-    SET_BIT(MOB_FLAGS(ch), MOB_NOTDEADYET);
+    SET_BIT_AR(MOB_FLAGS(ch), MOB_NOTDEADYET);
   else
-    SET_BIT(PLR_FLAGS(ch), PLR_NOTDEADYET);
+    SET_BIT_AR(PLR_FLAGS(ch), PLR_NOTDEADYET);
 
   extractions_pending++;
 }
@@ -1000,9 +1038,9 @@ void extract_pending_chars(void)
     next_vict = vict->next;
 
     if (MOB_FLAGGED(vict, MOB_NOTDEADYET))
-      REMOVE_BIT(MOB_FLAGS(vict), MOB_NOTDEADYET);
+      REMOVE_BIT_AR(MOB_FLAGS(vict), MOB_NOTDEADYET);
     else if (PLR_FLAGGED(vict, PLR_NOTDEADYET))
-      REMOVE_BIT(PLR_FLAGS(vict), PLR_NOTDEADYET);
+      REMOVE_BIT_AR(PLR_FLAGS(vict), PLR_NOTDEADYET);
     else {
       /* Last non-free'd character to continue chain from. */
       prev_vict = vict;
@@ -1269,6 +1307,7 @@ struct obj_data *create_money(int amount
 {
   struct obj_data *obj;
   struct extra_descr_data *new_descr;
+  int y;
   char buf[200];
 
   if (amount <= 0) {
@@ -1309,7 +1348,9 @@ struct obj_data *create_money(int amount
   obj->ex_description = new_descr;
 
   GET_OBJ_TYPE(obj) = ITEM_MONEY;
-  GET_OBJ_WEAR(obj) = ITEM_WEAR_TAKE;
+  for(y = 0; y < TW_ARRAY_MAX; y++)
+    obj->obj_flags.wear_flags[y] = 0;
+  SET_BIT_AR(GET_OBJ_WEAR(obj), ITEM_WEAR_TAKE);
   GET_OBJ_VAL(obj, 0) = amount;
   GET_OBJ_COST(obj) = amount;
   obj->item_number = NOTHING;
diff -puN ./src/handler.h ./src128bit/handler.h
--- ./src/handler.h	Fri Jun 21 23:23:50 2002
+++ ./src128bit/handler.h	Mon Aug 12 12:02:06 2002
@@ -10,7 +10,7 @@
 
 /* handling the affected-structures */
 void	affect_total(struct char_data *ch);
-void	affect_modify(struct char_data *ch, byte loc, sbyte mod, bitvector_t bitv, bool add);
+void	affect_modify(struct char_data * ch, byte loc, sbyte mod, long bitv, bool add);
 void	affect_to_char(struct char_data *ch, struct affected_type *af);
 void	affect_remove(struct char_data *ch, struct affected_type *af);
 void	affect_from_char(struct char_data *ch, int type);
diff -puN ./src/house.c ./src128bit/house.c
--- ./src/house.c	Thu May  2 03:13:32 2002
+++ ./src128bit/house.c	Mon Aug 12 12:02:06 2002
@@ -143,7 +143,7 @@ void House_crashsave(room_vnum vnum)
   }
   fclose(fp);
   House_restore_weight(world[rnum].contents);
-  REMOVE_BIT(ROOM_FLAGS(rnum), ROOM_HOUSE_CRASH);
+  REMOVE_BIT_AR(ROOM_FLAGS(rnum), ROOM_HOUSE_CRASH);
 }
 
 
@@ -276,8 +276,9 @@ void House_boot(void)
 
     house_control[num_of_houses++] = temp_house;
 
-    SET_BIT(ROOM_FLAGS(real_house), ROOM_HOUSE | ROOM_PRIVATE);
-    SET_BIT(ROOM_FLAGS(real_atrium), ROOM_ATRIUM);
+    SET_BIT_AR(ROOM_FLAGS(real_house), ROOM_HOUSE);
+	SET_BIT_AR(ROOM_FLAGS(real_house), ROOM_PRIVATE);
+    SET_BIT_AR(ROOM_FLAGS(real_atrium), ROOM_ATRIUM);
     House_load(temp_house.vnum);
   }
 
@@ -415,8 +416,9 @@ void hcontrol_build_house(struct char_da
 
   house_control[num_of_houses++] = temp_house;
 
-  SET_BIT(ROOM_FLAGS(real_house), ROOM_HOUSE | ROOM_PRIVATE);
-  SET_BIT(ROOM_FLAGS(real_atrium), ROOM_ATRIUM);
+  SET_BIT_AR(ROOM_FLAGS(real_house), ROOM_HOUSE); 
+  SET_BIT_AR(ROOM_FLAGS(real_house), ROOM_PRIVATE);
+  SET_BIT_AR(ROOM_FLAGS(real_atrium), ROOM_ATRIUM);
   House_crashsave(virt_house);
 
   send_to_char(ch, "House built.  Mazel tov!\r\n");
@@ -441,13 +443,16 @@ void hcontrol_destroy_house(struct char_
   if ((real_atrium = real_room(house_control[i].atrium)) == NOWHERE)
     log("SYSERR: House %d had invalid atrium %d!", atoi(arg), house_control[i].atrium);
   else
-    REMOVE_BIT(ROOM_FLAGS(real_atrium), ROOM_ATRIUM);
+    REMOVE_BIT_AR(ROOM_FLAGS(real_atrium), ROOM_ATRIUM);
 
   if ((real_house = real_room(house_control[i].vnum)) == NOWHERE)
     log("SYSERR: House %d had invalid vnum %d!", atoi(arg), house_control[i].vnum);
-  else
-    REMOVE_BIT(ROOM_FLAGS(real_house), ROOM_HOUSE | ROOM_PRIVATE | ROOM_HOUSE_CRASH);
-
+  else {
+    REMOVE_BIT_AR(ROOM_FLAGS(real_house), ROOM_HOUSE);
+	REMOVE_BIT_AR(ROOM_FLAGS(real_house), ROOM_PRIVATE);
+	REMOVE_BIT_AR(ROOM_FLAGS(real_house), ROOM_HOUSE_CRASH);
+  }
+  
   House_delete_file(house_control[i].vnum);
 
   for (j = i; j < num_of_houses - 1; j++)
@@ -465,7 +470,7 @@ void hcontrol_destroy_house(struct char_
    */
   for (i = 0; i < num_of_houses; i++)
     if ((real_atrium = real_room(house_control[i].atrium)) != NOWHERE)
-      SET_BIT(ROOM_FLAGS(real_atrium), ROOM_ATRIUM);
+      SET_BIT_AR(ROOM_FLAGS(real_atrium), ROOM_ATRIUM);
 }
 
 
diff -puN ./src/interpreter.c ./src128bit/interpreter.c
--- ./src/interpreter.c	Wed Aug 14 19:36:10 2002
+++ ./src128bit/interpreter.c	Mon Aug 12 12:02:06 2002
@@ -44,6 +44,7 @@ extern int top_of_p_table;
 extern int circle_restrict;
 extern int no_specials;
 extern int max_bad_pws;
+extern int selfdelete_fastwipe;
 
 /* external functions */
 void echo_on(struct descriptor_data *d);
@@ -56,6 +57,7 @@ int Valid_Name(char *newname);
 void read_aliases(struct char_data *ch);
 void delete_aliases(const char *charname);
 void read_saved_vars(struct char_data *ch);
+void remove_player(int pfilepos);
 
 /* local functions */
 int perform_dupe_check(struct descriptor_data *d);
@@ -193,6 +195,8 @@ ACMD(do_wiznet);
 ACMD(do_wizutil);
 ACMD(do_write);
 ACMD(do_zreset);
+ACMD(do_players);
+ACMD(do_restoreall);
 
 /* DG Script ACMD's */
 ACMD(do_attach);
@@ -438,6 +442,7 @@ cpp_extern const struct command_info cmd
   { "punch"    , POS_RESTING , do_action   , 0, 0 },
   { "purr"     , POS_RESTING , do_action   , 0, 0 },
   { "purge"    , POS_DEAD    , do_purge    , LVL_GOD, 0 },
+  { "players"  , POS_DEAD    , do_players  , LVL_IMPL, 0 },
 
   { "quaff"    , POS_RESTING , do_use      , 0, SCMD_QUAFF },
   { "qecho"    , POS_DEAD    , do_qcomm    , LVL_IMMORT, SCMD_QECHO },
@@ -463,6 +468,7 @@ cpp_extern const struct command_info cmd
   { "roll"     , POS_RESTING , do_action   , 0, 0 },
   { "roomflags", POS_DEAD    , do_gen_tog  , LVL_IMMORT, SCMD_ROOMFLAGS },
   { "ruffle"   , POS_STANDING, do_action   , 0, 0 },
+  { "restoreall", POS_DEAD   , do_restoreall, LVL_GRGOD, 0 },
 
   { "say"      , POS_RESTING , do_say      , 0, 0 },
   { "'"        , POS_RESTING , do_say      , 0, 0 },
@@ -648,7 +654,7 @@ void command_interpreter(struct char_dat
   char *line;
   char arg[MAX_INPUT_LENGTH];
 
-  REMOVE_BIT(AFF_FLAGS(ch), AFF_HIDE);
+  REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_HIDE);
 
   /* just drop to next line for hitting CR */
   skip_spaces(&argument);
@@ -1323,8 +1329,9 @@ int perform_dupe_check(struct descriptor
   d->character->desc = d;
   d->original = NULL;
   d->character->char_specials.timer = 0;
-  REMOVE_BIT(PLR_FLAGS(d->character), PLR_MAILING | PLR_WRITING);
-  REMOVE_BIT(AFF_FLAGS(d->character), AFF_GROUP);
+  REMOVE_BIT_AR(PLR_FLAGS(d->character), PLR_MAILING);
+  REMOVE_BIT_AR(PLR_FLAGS(d->character), PLR_WRITING);
+  REMOVE_BIT_AR(AFF_FLAGS(d->character), AFF_GROUP);
   STATE(d) = CON_PLAYING;
 
   switch (mode) {
@@ -1396,7 +1403,6 @@ void nanny(struct descriptor_data *d, ch
       STATE(d) = CON_CLOSE;
     else {
       char buf[MAX_INPUT_LENGTH], tmp_name[MAX_INPUT_LENGTH];
-      struct char_file_u tmp_store;
 
       if ((_parse_name(arg, tmp_name)) || strlen(tmp_name) < 2 ||
 	  strlen(tmp_name) > MAX_NAME_LENGTH || !Valid_Name(tmp_name) ||
@@ -1404,11 +1410,18 @@ void nanny(struct descriptor_data *d, ch
 	write_to_output(d, "Invalid name, please try another.\r\nName: ");
 	return;
       }
-      if ((player_i = load_char(tmp_name, &tmp_store)) > -1) {
-	store_to_char(&tmp_store, d->character);
+      if ((player_i = load_char(tmp_name, d->character)) > -1) {
 	GET_PFILEPOS(d->character) = player_i;
 
 	if (PLR_FLAGGED(d->character, PLR_DELETED)) {
+
+	  /* make sure old files are removed so the new player doesn't get
+	     the deleted player's equipment (this should probably be a
+	     stock behavior)
+	  */
+	  if((player_i = get_ptable_by_name(tmp_name)) >= 0)
+	    remove_player(player_i);
+
 	  /* We get a false positive from the original deleted character. */
 	  free_char(d->character);
 	  /* Check for multiple creations... */
@@ -1427,9 +1440,10 @@ void nanny(struct descriptor_data *d, ch
 	  STATE(d) = CON_NAME_CNFRM;
 	} else {
 	  /* undo it just in case they are set */
-	  REMOVE_BIT(PLR_FLAGS(d->character),
-		     PLR_WRITING | PLR_MAILING | PLR_CRYO);
-	  REMOVE_BIT(AFF_FLAGS(d->character), AFF_GROUP);
+	  REMOVE_BIT_AR(PLR_FLAGS(d->character), PLR_WRITING); 
+	  REMOVE_BIT_AR(PLR_FLAGS(d->character), PLR_MAILING); 
+	  REMOVE_BIT_AR(PLR_FLAGS(d->character), PLR_CRYO); 
+	  REMOVE_BIT_AR(AFF_FLAGS(d->character), AFF_GROUP);
 	  write_to_output(d, "Password: ");
 	  echo_off(d);
 	  d->idle_tics = 0;
@@ -1625,6 +1639,7 @@ void nanny(struct descriptor_data *d, ch
     /* Now GET_NAME() will work properly. */
     init_char(d->character);
     save_char(d->character);
+    save_player_index();
     write_to_output(d, "%s\r\n*** PRESS RETURN: ", motd);
     STATE(d) = CON_RMOTD;
 
@@ -1784,10 +1799,18 @@ void nanny(struct descriptor_data *d, ch
 	return;
       }
       if (GET_LEVEL(d->character) < LVL_GRGOD)
-	SET_BIT(PLR_FLAGS(d->character), PLR_DELETED);
+	SET_BIT_AR(PLR_FLAGS(d->character), PLR_DELETED);
       save_char(d->character);
       Crash_delete_file(GET_NAME(d->character));
       delete_aliases(GET_NAME(d->character));
+      /* If the selfdelete_fastwipe flag is set (in config.c), remove all
+         the player's immediately
+      */
+      if(selfdelete_fastwipe)
+	if((player_i = get_ptable_by_name(GET_NAME(d->character))) >= 0) {
+	  SET_BIT(player_table[player_i].flags, PINDEX_SELFDELETE);
+	  remove_player(player_i);
+	}
       write_to_output(d, "Character '%s' deleted