diff -urN origsrc/Makefile src/Makefile
--- origsrc/Makefile	Fri Oct  6 12:46:20 2000
+++ src/Makefile	Fri Oct  6 12:51:46 2000
@@ -29,14 +29,14 @@
 	boards.o castle.o class.o comm.o config.o constants.o db.o fight.o \
 	graph.o handler.o house.o interpreter.o limits.o magic.o mail.o \
 	mobact.o modify.o objsave.o olc.o random.o shop.o spec_assign.o \
-	spec_procs.o spell_parser.o spells.o utils.o weather.o
+    spec_procs.o spell_parser.o spells.o utils.o weather.o color.o
 
 CXREF_FILES = act.comm.c act.informative.c act.item.c act.movement.c \
 	act.offensive.c act.other.c act.social.c act.wizard.c alias.c ban.c \
 	boards.c castle.c class.c comm.c config.c constants.c db.c fight.c \
 	graph.c handler.c house.c interpreter.c limits.c magic.c mail.c \
 	mobact.c modify.c objsave.c olc.c random.c shop.c spec_assign.c\
-	spec_procs.c spell_parser.c spells.c utils.c weather.c
+    spec_procs.c spell_parser.c spells.c utils.c weather.c color.c
 
 default: all
 
@@ -200,3 +200,6 @@
 weather.o: weather.c conf.h sysdep.h structs.h utils.h comm.h handler.h \
   interpreter.h db.h
 	$(CC) -c $(CFLAGS) weather.c
+color.o: color.c screen.h conf.h sysdep.h structs.h utils.h comm.h \
+ interpreter.h handler.h db.h
+	$(CC) -c $(CFLAGS) color.c
diff -urN origsrc/Makefile.in src/Makefile.in
--- origsrc/Makefile.in	Fri Oct  6 12:46:20 2000
+++ src/Makefile.in	Fri Oct  6 12:50:56 2000
@@ -28,14 +28,14 @@
 	boards.o castle.o class.o comm.o config.o constants.o db.o fight.o \
 	graph.o handler.o house.o interpreter.o limits.o magic.o mail.o \
 	mobact.o modify.o objsave.o olc.o random.o shop.o spec_assign.o \
-	spec_procs.o spell_parser.o spells.o utils.o weather.o
+    spec_procs.o spell_parser.o spells.o utils.o weather.o color.o
 
 CXREF_FILES = act.comm.c act.informative.c act.item.c act.movement.c \
 	act.offensive.c act.other.c act.social.c act.wizard.c alias.c ban.c \
 	boards.c castle.c class.c comm.c config.c constants.c db.c fight.c \
 	graph.c handler.c house.c interpreter.c limits.c magic.c mail.c \
 	mobact.c modify.c objsave.c olc.c random.c shop.c spec_assign.c\
-	spec_procs.c spell_parser.c spells.c utils.c weather.c
+    spec_procs.c spell_parser.c spells.c utils.c weather.c color.c
 
 default: all
 
@@ -199,3 +199,6 @@
 weather.o: weather.c conf.h sysdep.h structs.h utils.h comm.h handler.h \
   interpreter.h db.h
 	$(CC) -c $(CFLAGS) weather.c
+color.o: color.c screen.h conf.h sysdep.h structs.h utils.h comm.h \
+ interpreter.h handler.h db.h
+	$(CC) -c $(CFLAGS) color.c
diff -urN origsrc/color.c src/color.c
--- origsrc/color.c	Wed Dec 31 16:00:00 1969
+++ src/color.c	Fri Oct  6 12:52:16 2000
@@ -0,0 +1,244 @@
+/****************************************************************************
+*                                                                           *
+* BetterColour, A CircleMud Component                                       *
+*                                                                           *
+* By D. Tyler Barnes (tyler.barnes@crcn.net)                                *
+*                                                                           *
+****************************************************************************/
+
+#include "screen.h"
+#include "conf.h"
+#include "sysdep.h"
+#include "structs.h"
+#include "utils.h"
+#include "comm.h"
+#include "interpreter.h"
+#include "handler.h"
+#include "db.h"
+
+/* Local Functions */
+ubyte text_to_color(char *ctext);
+char *color_to_text(ubyte colnum);
+void color_defaults(struct char_data *ch);
+void process_color(char *cstr, struct char_data *ch);
+bool strip_color(char *instr);
+ACMD(do_cscheme);
+
+/* Local Defines */
+
+#define valid_codes  "0123456789abcdefghu"
+
+/****************** Alternate code scheme *********************************
+
+#define valid_codes  "nrgybmcwifNRGYBMCWu"
+
+If you want to use these codes, you'll have to modify cscheme accordingly!
+
+**************************************************************************/
+
+/* WARNING: For now, pass only buffers of length MAX_STRING_LENGTH to
+            process_color. Buffer overflows are still possible. Will be
+            fixed.                                                        */
+
+void process_color(char *cstr, struct char_data *ch) {
+
+    int readchar, writechar = 0, origlen, i;
+    char outbuf[MAX_STRING_LENGTH];
+
+    if (!strstr(cstr, "|") || ch == NULL)
+        return;
+
+    if (IS_NPC(ch) || !PRF_FLAGGED(ch, PRF_COLOR_2))
+        strip_color(cstr);
+    else {
+
+        origlen = strlen(cstr);
+
+        for (readchar = 0; readchar < origlen; readchar++) {
+
+            if (cstr[readchar] == '|' && readchar < origlen) {
+                outbuf[writechar] = '\0';
+
+                if (strchr(valid_codes, cstr[readchar+1])) {
+                    readchar++;
+                    for(i = 0; i < strlen(valid_codes) && valid_codes[i] != cstr[readchar]; i++);
+
+                    if (i == 0)
+                        strcat(outbuf, KNRM);
+                    else if (GET_COL(ch, i - 1) != 255)
+                        sprintf(outbuf, "%s\x1B[%dm", outbuf, GET_COL(ch, i - 1));
+                   
+                } else
+                    strcat(outbuf, "|");
+
+                writechar = strlen(outbuf);
+
+            } else {
+                outbuf[writechar] = cstr[readchar];
+                writechar++;
+            }
+
+        }
+        outbuf[writechar] = '\0';
+
+        if (writechar+4 <= MAX_STRING_LENGTH)
+            strcat(outbuf, CCNRM(ch, C_CMP));
+
+        strcpy(cstr, outbuf);
+
+    }
+}
+
+/* Strips color codes from a string. Returns true if string contained color*
+ * codes, else false                                                       */
+bool strip_color(char *instr) {
+
+    char outbuf[MAX_STRING_LENGTH];
+    int readchar, writechar = 0;
+    bool retval = FALSE;
+
+    if (!strstr(instr, "|"))
+        return(retval);
+
+    for (readchar = 0; readchar < strlen(instr); readchar++) {
+
+        if (instr[readchar] == '|' && readchar+1 <= MAX_STRING_LENGTH &&
+          strchr(valid_codes, instr[readchar+1])) {
+                readchar++;
+                retval = TRUE;
+        } else {
+            outbuf[writechar] = instr[readchar];
+            writechar++;
+        }
+    }
+    outbuf[writechar] = '\0';
+    strcpy(instr, outbuf);
+    return(retval);
+}
+
+void color_defaults(struct char_data *ch) {
+
+    if (IS_NPC(ch))
+        return;
+    else
+        strcpy(COL_DATA(ch), "\x1F\x20\x21\x22\x23\x24\x25\x01\xFF\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x04");
+
+}
+
+ACMD(do_cscheme) {
+
+    uint cnum, x;
+
+    two_arguments(argument, buf, buf2);
+
+    if (IS_NPC(ch))
+        send_to_char("Mobiles can not modify their color schemes.\r\n", ch);
+    else if (!*buf2 && is_abbrev(buf, "defaults")) {
+        color_defaults(ch);
+        send_to_char("You have reverted to the default color scheme.\r\n", ch);
+    } else if (strlen(buf) > 1)
+        send_to_char("Invalid cscheme syntax.\r\n", ch);
+    else if (buf[0] == '0')
+        send_to_char("You can not modify that color code.\r\n", ch);
+    else if (!strstr(valid_codes, buf))
+        send_to_char("That isn't a valid color code.\r\n", ch);
+    else if (!*buf2) {
+        sprintf(buf2,   "Code 0 (normal)    : |0Not Changeable!\r\n");
+        sprintf(buf2, "%sCode 1 (red)       : |1%s|0\r\n", buf2, color_to_text(GET_COL(ch, 0)));
+        sprintf(buf2, "%sCode 2 (green)     : |2%s|0\r\n", buf2, color_to_text(GET_COL(ch, 1)));
+        sprintf(buf2, "%sCode 3 (yellow)    : |3%s|0\r\n", buf2, color_to_text(GET_COL(ch, 2)));
+        sprintf(buf2, "%sCode 4 (blue)      : |4%s|0\r\n", buf2, color_to_text(GET_COL(ch, 3)));
+        sprintf(buf2, "%sCode 5 (magenta)   : |5%s|0\r\n", buf2, color_to_text(GET_COL(ch, 4)));
+        sprintf(buf2, "%sCode 6 (cyan)      : |6%s|0\r\n", buf2, color_to_text(GET_COL(ch, 5)));
+        sprintf(buf2, "%sCode 7 (white)     : |7%s|0\r\n", buf2, color_to_text(GET_COL(ch, 6)));
+        sprintf(buf2, "%sCode 8 (intense)   : |8%s|0\r\n", buf2, color_to_text(GET_COL(ch, 7)));
+        sprintf(buf2, "%sCode 9 (flashing)  : |9%s|0\r\n", buf2, color_to_text(GET_COL(ch, 8)));
+        sprintf(buf2, "%sCode a (bblack)    : |a%s|0\r\n", buf2, color_to_text(GET_COL(ch, 9)));
+        sprintf(buf2, "%sCode b (bred)      : |b%s|0\r\n", buf2, color_to_text(GET_COL(ch, 10)));
+        sprintf(buf2, "%sCode c (bgreen)    : |c%s|0\r\n", buf2, color_to_text(GET_COL(ch, 11)));
+        sprintf(buf2, "%sCode d (byellow)   : |d%s|0\r\n", buf2, color_to_text(GET_COL(ch, 12)));
+        sprintf(buf2, "%sCode e (bblue)     : |e%s|0\r\n", buf2, color_to_text(GET_COL(ch, 13)));
+        sprintf(buf2, "%sCode f (bmagenta)  : |f%s|0\r\n", buf2, color_to_text(GET_COL(ch, 14)));
+        sprintf(buf2, "%sCode g (bcyan)     : |g%s|0\r\n", buf2, color_to_text(GET_COL(ch, 15)));
+        sprintf(buf2, "%sCode h (bwhite)    : |h%s|0\r\n", buf2, color_to_text(GET_COL(ch, 16)));
+        sprintf(buf2, "%sCode u (underlined): |u%s|0\r\n", buf2, color_to_text(GET_COL(ch, 17)));
+        send_to_char(buf2, ch);
+    } else {
+        cnum = text_to_color(buf2);
+        for(x = 0; x < strlen(valid_codes) && valid_codes[x] != buf[0]; x++);
+        GET_COL(ch, x - 1) = cnum;
+        send_to_char(OK, ch);
+    }
+}
+
+ubyte text_to_color(char *ctext) {
+
+        if (is_abbrev(ctext, "red"))
+            return(31);
+        else if (is_abbrev(ctext, "green"))
+            return(32);
+        else if (is_abbrev(ctext, "yellow"))
+            return(33);
+        else if (is_abbrev(ctext, "blue"))
+            return(34);
+        else if (is_abbrev(ctext, "magenta"))
+            return(35);
+        else if (is_abbrev(ctext, "cyan"))
+            return(36);
+        else if (is_abbrev(ctext, "white"))
+            return(37);
+        else if (is_abbrev(ctext, "intense"))
+            return(1);
+        else if (is_abbrev(ctext, "flashing"))
+            return(5);
+        else if (is_abbrev(ctext, "bblack"))
+            return(40);
+        else if (is_abbrev(ctext, "bred"))
+            return(41);
+        else if (is_abbrev(ctext, "bgreen"))
+            return(42);
+        else if (is_abbrev(ctext, "byellow"))
+            return(43);
+        else if (is_abbrev(ctext, "bblue"))
+            return(44);
+        else if (is_abbrev(ctext, "bmagenta"))
+            return(45);
+        else if (is_abbrev(ctext, "bcyan"))
+            return(46);
+        else if (is_abbrev(ctext, "bwhite"))
+            return(47);
+        else if (is_abbrev(ctext, "normal"))
+            return(0);
+        else if (is_abbrev(ctext, "underlined"))
+            return(4);
+        else
+            return(255); /* code for 'off' */
+
+}
+
+char *color_to_text(ubyte colnum) {
+
+        switch(colnum) {
+            case 0: return("normal");
+            case 1: return("intense");
+            case 4: return("underlined");
+            case 5: return("flashing");
+            case 31: return("red");
+            case 32: return("green");
+            case 33: return("yellow");
+            case 34: return("blue");
+            case 35: return("magenta");
+            case 36: return("cyan");
+            case 37: return("white");
+            case 40: return("bblack");
+            case 41: return("bred");
+            case 42: return("bgreen");
+            case 43: return("byellow");
+            case 44: return("bblue");
+            case 45: return("bmagenta");
+            case 46: return("bcyan");
+            case 47: return("bwhite");
+            case 255: return("off");
+        }
+        return("invalid");
+}
diff -urN origsrc/comm.c src/comm.c
--- origsrc/comm.c	Fri Oct  6 12:46:20 2000
+++ src/comm.c	Fri Oct  6 13:06:38 2000
@@ -144,6 +144,7 @@
 #endif
 
 /* extern fcnts */
+void process_color(char *cstr, struct char_data *ch);
 void reboot_wizlists(void);
 void boot_world(void);
 void affect_update(void);	/* In spells.c */
@@ -1026,13 +1027,17 @@
 }
 
 /* Add a new string to a player's output queue */
-void write_to_output(const char *txt, struct descriptor_data *t)
+void write_to_output(const char *txtin, struct descriptor_data *t)
 {
   int size;
+  char txt[MAX_STRING_LENGTH];
 
   /* if we're in the overflow state already, ignore this new output */
   if (t->bufptr < 0)
     return;
+
+  strcpy(txt, txtin);
+  process_color(txt, t->character);
 
   size = strlen(txt);
 
diff -urN origsrc/comm.h src/comm.h
--- origsrc/comm.h	Fri Oct  6 12:46:20 2000
+++ src/comm.h	Fri Oct  6 13:06:50 2000
@@ -33,7 +33,7 @@
 /* I/O functions */
 int	write_to_descriptor(socket_t desc, const char *txt);
 void	write_to_q(const char *txt, struct txt_q *queue, int aliased);
-void	write_to_output(const char *txt, struct descriptor_data *d);
+void    write_to_output(const char *txtin, struct descriptor_data *d);
 void	page_string(struct descriptor_data *d, char *str, int keep_internal);
 void	string_add(struct descriptor_data *d, char *str);
 void	string_write(struct descriptor_data *d, char **txt, size_t len, long mailto, void *data);
diff -urN origsrc/db.c src/db.c
--- origsrc/db.c	Fri Oct  6 12:46:20 2000
+++ src/db.c	Fri Oct  6 13:10:56 2000
@@ -124,6 +124,7 @@
 long get_ptable_by_name(char *name);
 
 /* external functions */
+void color_defaults(struct char_data *ch);
 struct time_info_data *mud_time_passed(time_t t2, time_t t1);
 void free_alias(struct alias_data *a);
 void load_messages(void);
@@ -2555,6 +2556,8 @@
 
   for (i = 0; i < 3; i++)
     GET_COND(ch, i) = (GET_LEVEL(ch) == LVL_IMPL ? -1 : 24);
+
+  color_defaults(ch);
 
   GET_LOADROOM(ch) = NOWHERE;
 }
diff -urN origsrc/interpreter.c src/interpreter.c
--- origsrc/interpreter.c	Fri Oct  6 12:46:20 2000
+++ src/interpreter.c	Fri Oct  6 13:03:36 2000
@@ -79,6 +79,7 @@
 ACMD(do_commands);
 ACMD(do_consider);
 ACMD(do_credits);
+ACMD(do_cscheme);
 ACMD(do_date);
 ACMD(do_dc);
 ACMD(do_diagnose);
@@ -260,6 +261,7 @@
   { "credits"  , POS_DEAD    , do_gen_ps   , 0, SCMD_CREDITS },
   { "cringe"   , POS_RESTING , do_action   , 0, 0 },
   { "cry"      , POS_RESTING , do_action   , 0, 0 },
+  { "cscheme"  , POS_SLEEPING, do_cscheme  , 0, 0 },
   { "cuddle"   , POS_RESTING , do_action   , 0, 0 },
   { "curse"    , POS_RESTING , do_action   , 0, 0 },
   { "curtsey"  , POS_STANDING, do_action   , 0, 0 },
diff -urN origsrc/structs.h src/structs.h
--- origsrc/structs.h	Fri Oct  6 12:46:20 2000
+++ src/structs.h	Fri Oct  6 12:59:14 2000
@@ -789,6 +789,7 @@
    long /*bitvector_t*/	pref;	/* preference flags for PC's.		*/
    ubyte bad_pws;		/* number of bad password attemps	*/
    sbyte conditions[3];         /* Drunk, full, thirsty			*/
+   ubyte cscheme[19];   /* Color scheme data */
 
    /* spares below for future expansion.  You can change the names from
       'sparen' to something meaningful, but don't change the order.  */
diff -urN origsrc/temp src/temp
--- origsrc/temp	Wed Dec 31 16:00:00 1969
+++ src/temp	Fri Oct  6 12:49:58 2000
@@ -0,0 +1,2 @@
+color.o: color.c screen.h conf.h sysdep.h structs.h utils.h comm.h \
+ interpreter.h handler.h db.h
diff -urN origsrc/utils.h src/utils.h
--- origsrc/utils.h	Fri Oct  6 12:46:20 2000
+++ src/utils.h	Fri Oct  6 12:53:58 2000
@@ -504,3 +504,8 @@
 #define CRYPT(a,b) ((char *) crypt((a),(b)))
 #endif
 
+/* Defines for BETTERCOLOUR ************************************************/
+
+#define GET_COL(ch, i)       CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.cscheme[(i)]))
+#define COL_DATA(ch)         CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.cscheme))
+/***************************************************************************/
