From: zain dirkbane <zain_dirkbane@hotmail.com>

Ok.. from the top. I have chose to use this code as it is easy..
look for the following lines and add the part after..

+ = ADD THIS LINE

merc.h - in the connected state for a channel...
------
#define CON_BREAK_CONNECT               15
+#define CON_ANSI                        16

and right under that there is Descriptor (channel) structure, look for 
this line:
    char *              showstr_point;
+    bool                ansi;

comm.c - under New_descriptor analogue
look for:
    dcon.connected      = CON_GET_NAME;
and change it to:
    dcon.connected      = CON_ANSI;

further down there is another just like that under Cons a new 
descriptor, change
    dcon.connected      = CON_GET_NAME;
to
    dcon.connected      = CON_ANSI;

under SEND TO GREETING, take all this out:
    /*
     * Send the greeting.
     */
-    {
-        extern char * help_greeting;
-        if ( help_greeting[0] == '.' )
-            write_to_buffer( dnew, help_greeting+1, 0 );
-        else
-            write_to_buffer( dnew, help_greeting  , 0 );
-    }
-
    return;
}
#endif
and add this:
    /*
     * Send the greeting.
     */

    write_to_buffer( dnew, "\n\rDo you want ANSI color? [Y/N] ", 0 );
    return;
}
#endif

under the NANNY function (void nanny)

add a new case:
    default:
        bug( "Nanny: bad d->connected %d.", d->connected );
        close_socket( d );
        return;

+    case CON_ANSI:
+        if ( argument[0] == '\0' || UPPER(argument[0]) == 'Y' )
+        {
+            d->ansi = TRUE;
+            send_to_desc("\n\r{RAnsi enabled!{x\n\r",d);
+            d->connected = CON_GET_NAME;
+            {
+                extern char * help_greeting;
+                if ( help_greeting[0] == '.' )
+                  send_to_desc( help_greeting+1, d );
+                else
+                  send_to_desc( help_greeting , d );
+            }
+            break;
+        }
+
+        if (UPPER(argument[0]) == 'N')
+        {
+            d->ansi = FALSE;
+            send_to_desc("\n\rAnsi disabled!\n\r",d);
+            d->connected = CON_GET_NAME;
+            {
+                extern char * help_greeting;
+                if ( help_greeting[0] == '.' )
+                  send_to_desc( help_greeting+1, d );
+                else
+                  send_to_desc( help_greeting , d );
+            }
+            break;
+        }
+        else
+        {
+            send_to_desc("Do you want ANSI color? [Y/N] ",d);
+            return;
+        }

    case CON_GET_NAME:
        if ( argument[0] == '\0' )

further down, look for:
        wiznet(log_buf,NULL,NULL,WIZ_SITES,0,get_trust(ch));

+        if (ch->desc->ansi)
+          SET_BIT(ch->act, PLR_COLOUR);
+        else REMOVE_BIT(ch->act, PLR_COLOUR);

        if ( IS_IMMORTAL(ch) )

further down:
        ch->pcdata->learned[*weapon_table[weapon].gsn] = 40;
        write_to_buffer(d,"\n\r",2);
+        if (ch->desc->ansi)
+          SET_BIT(ch->act, PLR_COLOUR);
+        else REMOVE_BIT(ch->act, PLR_COLOUR);
        do_help(ch,"motd");
        d->connected = CON_READ_MOTD;

and that should be it.

Have fun

Zain Dirkbane, IMP and Coder of The Nocturnal Paradox Mud

