From RuineR@netins.net Thu Apr 2 15:33:56 1998 Hello all, thought I would post another thing for all you newbie coders out there to add. Or perhaps if you veterans want to use it, go right ahead. It's a command called immtitle that will let your imms change what's shown in the who screen, like right now, here's what my mud looks like. (Lots of players.) haha. If you like it, send me some mail. Also, there is lots of room here for changes and preferences based on your mud, so please don't e-mail me complaining to me that something doesn't look right on YOUR mud because you copied this exactly word for word, and didn't care to customize it to YOUR mud. [ ---NiN-- ] [None] RuineR.com [ +NiN+ ] [--{===DARK===}--] [None] Shaozin.are [ +NiN+ ] ^^^^^^^^^^^^^^^^ That's the immtitle, pretty nifty. I'll also include the part I use for centering it, just in case you want the who screen to look all even and neat. First of all, you need to have some sort of function that counts the number of characters in a string (without the color codes). It goes something like this: int colorstrlen(char *argument) { char *str; int strlength; if (argument == NULL || argument[0] == '\0') return 0; strlength = 0; str = argument; while (*str != '\0') { if ( *str != '&' ) <-- (Replace the & with whatever the color { for your mud is.) str++; strlength++; continue; } if (*(++str) == '&') <-- (Again, replace with your color code) strlength++; str++; } return strlength; } Doesn't really matter where this function is. I have it in act_wiz.c just because that's where most of my immtitle stuff was. Up to you. /* act.wiz.c */ void do_immtitle(CHAR_DATA *ch, char *argument) { if (argument[0] == '\0') { ch->immtitle = NULL; send_to_char("Immtitle cleared.\n\r", ch); return; } if (colorstrlen(argument) > 16) <-- (On my mud it's set to 16, because on my who screen, I want the brackets exactly 16 spaces apart to keep it all even Change to fit your needs.) { send_to_char("Immtitle must be 16 (or under) characters long.\n\r", ch); return; } ch->immtitle = str_dup(argument); send_to_char("Immtitle set.\n\r", ch); } /* act.info.c */ In the do_who function, declare: char buf3[MAX_STRING_LENGTH]; int half, sechalf; Find these lines: case MAX_LEVEL - 7 : class = "ANG"; break; case MAX_LEVEL - 8 : class = "AVA"; break; } } Add after them: if (wch->level >= LVL_IMMORTAL && wch->immtitle != NULL) { if (strlen_color(wch->immtitle) == 16) sprintf(buf3, "[%s]", wch->immtitle); else if (strlen_color(wch->immtitle) == 15) sprintf(buf3, "[%s ]", wch->immtitle); else { half = ((16 - strlen_color(wch->immtitle)) / 2); sechalf = (16 - (half + strlen_color(wch->immtitle))); sprintf(buf3, "[%*c%s%*c]", half, ' ', wch->immtitle, sechalf, ' '); } } else sprintf( buf3, "[%3d %8s %s]", wch->level, wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name : " ", class); Then find the lines: /* * Format it up */ This is where you'll have to do some changing, simply remove all race/class/level stuff, and instead of having something like: sprintf(buf, "[%2d %s %s] %s"...) You'd remove everything within the brackets, including the brackets, and make it: sprintf(buf, "%s %s", buf3, wch->name...); Then also remove the first 3 declarations for wch->race, wch->level, and class. This is all being handled up top now. /* interp.c */ Add somewhere, (preferably after the immtalk declaration): { "immtitle", do_immtitle, POS_DEAD, IM, LOG_NORMAL, 1 }, /* interp.h */ Add: DECLARE_DO_FUN(do_immtitle) /* save.c */ Find the line: fprintf( fp, "Desc %s~\n", ch->description ); Add after: if (ch->immtitle != NULL) fprintf( fp, "Immtitle %s~\n", ch->immtitle); Find the line: KEY( "Invi", ch->invis_level, fread_number( fp ) ); Add after: KEY( "Immtitle", ch->immtitle, fread_string( fp ) ); That should do it. // RuineR // ruiner@mail.org