************************************************************** * This snippet was made by Erinyes for the Running mud at * * mud.twain.dk:4000. If you have any questions you can * * contact me in the mud, or at mail (admin@twain.dk) * * If you decide to use this code or parts of it, please put * * a note in your credit. And Email a link to the Mud. Thx. * ************************************************************** The prompt includes HP Max-HP Mana Max-Mana Move Max-Move Exp TNL Gold Align Fighting/Enemy and everybody#s favorit COLORS. I use the circle 3.1 and it worked out perfect :) Im still working on it, so if you find errors plz email me. (admin@twain.dk) By the way, this is my first official snippet so bare over with me :) in Structs.h find /* flags: used by char_data.player_specials.pref */ and add, as next in list (change the numbers to the next in the list: #define PRF_DISPMAX 28 /* Display Max status in prompt */ #define PRF_DISPHMAX 29 /* Display Max HP in prompt */ #define PRF_DISPMMAX 30 /* Display Max Mana in prompt */ #define PRF_DISPVMAX 31 /* Display Max Move in prompt */ #define PRF_DISPEXP 32 /* Display EXP in prompt */ #define PRF_DISPGOLD 33 /* Display Gold in prompt */ #define PRF_DISPTNL 34 /* Display TNL in prompt */ #define PRF_DISPALIGN 35 /* Display Alignment in prompt */ #define PRF_DISPMOB 36 /* Display Mob/Fighting in Prompt */ *now close that file and open act.other.c *find ACMD(do_display) not the one in the header, but the next one :P *and replace it with this: ACMD(do_display) { size_t i; if (IS_NPC(ch)) { send_to_char(ch, "Mosters don't need displays. Go away.\r\n"); return; } skip_spaces(&argument); if (!*argument) { send_to_char(ch, " Prompt Usage\r\n"); send_to_char(ch, " h) Hit Points H) Max Hit Points\r\n"); send_to_char(ch, " m) Mana Points M) Max Mana Points\r\n"); send_to_char(ch, " v) Move Points V) Max Move Points\r\n"); send_to_char(ch, " e) Experience E) XP to next level\r\n"); send_to_char(ch, " g) Gold M) Alignment\r\n"); send_to_char(ch, " x) Fighting/Mob-prompt, shows the status of your opponent. \r\n\r\n"); send_to_char(ch, " You can also use the strings: max, auto, all, on, off\r\n"); send_to_char(ch, " Usage EX.: display hHEg <-- will display Hit HP MaxHP TNL GOLD\r\n"); send_to_char(ch, " Usage EX.: display all <-- will display everything in the list.\r\n"); return; } if (!str_cmp(argument, "auto")) { TOGGLE_BIT_AR(PRF_FLAGS(ch), PRF_DISPAUTO); send_to_char(ch, "Auto prompt %sabled.\r\n", PRF_FLAGGED(ch, PRF_DISPAUTO) ? "en" : "dis"); return; } 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_DISPHMAX); SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMMAX); SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPVMAX); SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPEXP); SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPGOLD); SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPTNL); SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPALIGN); SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOB); 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_DISPHMAX); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMMAX); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPVMAX); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPEXP); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPGOLD); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPTNL); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPALIGN); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOB); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE); } else { REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPHMAX); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMMAX); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPVMAX); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPEXP); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPGOLD); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPTNL); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPALIGN); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOB); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE); for (i = 0; i < strlen(argument); i++) { switch (argument[i]) { case 'h': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP); break; case 'H': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPHMAX); break; case 'm': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA); break; case 'M': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMMAX); break; case 'v': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE); break; case 'V': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPVMAX); break; case 'e': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPEXP); break; case 'g': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPGOLD); break; case 'E': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPTNL); break; case 'a': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPALIGN); break; case 'x': SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOB); break; default: send_to_char(ch, " Prompt Usage\r\n"); send_to_char(ch, " h) Hit Points H) Max Hit Points\r\n"); send_to_char(ch, " m) Mana Points M) Max Mana Points\r\n"); send_to_char(ch, " v) Move Points V) Max Move Points\r\n"); send_to_char(ch, " e) Experience E) XP to next level\r\n"); send_to_char(ch, " g) Gold M) Alignment\r\n"); send_to_char(ch, " x) Fighting/Mob-prompt, shows the status of your opponent. \r\n\r\n"); send_to_char(ch, " You can also use the strings: max, auto, all, on, off\r\n"); send_to_char(ch, " Usage EX.: display hHEg <-- will display Hit HP MaxHP TNL GOLD\r\n"); send_to_char(ch, " Usage EX.: display all <-- will display everything in the list.\r\n"); return; } } } send_to_char(ch, "%s", OK); } *now close that file and open comm.c *find char *make_prompt(struct descriptor_data *d) and replace it with * the code below char *make_prompt(struct descriptor_data *d) { static char prompt[MAX_PROMPT_LENGTH]; int percent; /* Note, prompt is truncated at MAX_PROMPT_LENGTH chars (structs.h) */ if (d->showstr_count) { snprintf(prompt, sizeof(prompt), "\r\n[ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (%d/%d) ]", d->showstr_page, d->showstr_count); } else if (d->str) strcpy(prompt, "] "); else if (STATE(d) == CON_PLAYING && !IS_NPC(d->character)) { if (PRF_FLAGGED(d->character, PRF_BUILDWALK)) strcpy(prompt, "< BuildWalking Mode ACTIVE! > "); else { int count; size_t len = 0; *prompt = '\0'; if (GET_INVIS_LEV(d->character) && len < sizeof(prompt)) { count = snprintf(prompt + len, sizeof(prompt) - len, "i%d ", GET_INVIS_LEV(d->character)); if (count >= 0) len += count; } if (PRF_FLAGGED(d->character, PRF_AFK) && len < sizeof(prompt)) { count = snprintf(prompt + len, sizeof(prompt) - len, "[%sAFK%s] ", CCRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); if (count >= 0) len += count; } if (PRF_FLAGGED(d->character, PRF_DISPHP) && len < sizeof(prompt)) { if (GET_MAX_HIT(d->character) > 0) percent = (100 * GET_HIT(d->character)) / GET_MAX_HIT(d->character); else percent = -1; if (percent >= 90) { count = snprintf(prompt + len, sizeof(prompt) - len, "%s%dh", CCWHT(d->character, C_NRM), GET_HIT(d->character)); } else if (percent >= 66) { count = snprintf(prompt + len, sizeof(prompt) - len, "%s%dh", CCGRN(d->character, C_NRM), GET_HIT(d->character)); } else if (percent >= 33) { count = snprintf(prompt + len, sizeof(prompt) - len, "%s%dh", CCYEL(d->character, C_NRM), GET_HIT(d->character)); } else if (percent >= 15) { count = snprintf(prompt + len, sizeof(prompt) - len, "%s%dh", CCRED(d->character, C_NRM), GET_HIT(d->character)); } else { count = snprintf(prompt + len, sizeof(prompt) - len, "%s%dh", CCRED(d->character, C_NRM), GET_HIT(d->character)); } if (count >= 0) len += count; } if (PRF_FLAGGED(d->character, PRF_DISPHMAX) && len < sizeof(prompt)) { count = snprintf(prompt + len, sizeof(prompt) - len, "(%dH)", GET_MAX_HIT(d->character)); if (count >= 0) len += count; } if (PRF_FLAGGED(d->character, PRF_DISPMANA) && len < sizeof(prompt)) { if (GET_MAX_MANA(d->character) > 0) percent = (100 * GET_MANA(d->character)) / GET_MAX_MANA(d->character); else percent = -1; if (percent >= 90) { count = snprintf(prompt + len, sizeof(prompt) - len, " %s%dm", CCWHT(d->character, C_NRM), GET_MANA(d->character)); } else if (percent >= 66) { count = snprintf(prompt + len, sizeof(prompt) - len, " %s%dm", CCGRN(d->character, C_NRM), GET_MANA(d->character)); } else if (percent >= 33) { count = snprintf(prompt + len, sizeof(prompt) - len, " %s%dm", CCYEL(d->character, C_NRM), GET_MANA(d->character)); } else if (percent >= 15) { count = snprintf(prompt + len, sizeof(prompt) - len, " %s%dm", CCRED(d->character, C_NRM), GET_MANA(d->character)); } else { count = snprintf(prompt + len, sizeof(prompt) - len, " %s%dm", CCRED(d->character, C_NRM), GET_MANA(d->character)); } if (count >= 0) len += count; } if (PRF_FLAGGED(d->character, PRF_DISPMMAX) && len < sizeof(prompt)) { count = snprintf(prompt + len, sizeof(prompt) - len, "(%dM)", GET_MAX_MANA(d->character)); if (count >= 0) len += count; } if (PRF_FLAGGED(d->character, PRF_DISPMOVE) && len < sizeof(prompt)) { if (GET_MAX_MOVE(d->character) > 0) percent = (100 * GET_MOVE(d->character)) / GET_MAX_MOVE(d->character); else percent = -1; if (percent >= 90) { count = snprintf(prompt + len, sizeof(prompt) - len, " %s%dv", CCWHT(d->character, C_NRM), GET_MOVE(d->character)); } else if (percent >= 66) { count = snprintf(prompt + len, sizeof(prompt) - len, " %s%dv", CCGRN(d->character, C_NRM), GET_MOVE(d->character)); } else if (percent >= 33) { count = snprintf(prompt + len, sizeof(prompt) - len, " %s%dv", CCYEL(d->character, C_NRM), GET_MOVE(d->character)); } else if (percent >= 15) { count = snprintf(prompt + len, sizeof(prompt) - len, " %s%dv", CCRED(d->character, C_NRM), GET_MOVE(d->character)); } else { count = snprintf(prompt + len, sizeof(prompt) - len, " %s%dv", CCRED(d->character, C_NRM), GET_MOVE(d->character)); } if (count >= 0) len += count; } if (PRF_FLAGGED(d->character, PRF_DISPVMAX) && len < sizeof(prompt)) { count = snprintf(prompt + len, sizeof(prompt) - len, "(%dV)", GET_MAX_MOVE(d->character)); if (count >= 0) len += count; } if (PRF_FLAGGED(d->character, PRF_DISPEXP) && len < sizeof(prompt)) { count = snprintf(prompt + len, sizeof(prompt) - len, " %sXP:%d", CCWHT(d->character, C_NRM), GET_EXP(d->character)); if (count >= 0) len += count; } if (PRF_FLAGGED(d->character, PRF_DISPGOLD) && len < sizeof(prompt)) { count = snprintf(prompt + len, sizeof(prompt) - len, " %sGold:%d", CCYEL(d->character, C_NRM), GET_GOLD(d->character)); if (count >= 0) len += count; } if (GET_LEVEL(d->character) <= LVL_IMMORT) { if (PRF_FLAGGED(d->character, PRF_DISPTNL) && len < sizeof(prompt)) { count = snprintf(prompt + len, sizeof(prompt) - len, " %sTNL:%d", CCCYN(d->character, C_NRM), level_exp(GET_CLASS(d->character), GET_LEVEL(d->character) + 1) - GET_EXP(d->character)); if (count >= 0) len += count; }} if (PRF_FLAGGED(d->character, PRF_DISPALIGN) && len < sizeof(prompt)) { count = snprintf(prompt + len, sizeof(prompt) - len, " %sAlign:%d", CCNRM(d->character, C_NRM), GET_ALIGNMENT(d->character)); if (count >= 0) len += count; } /* Fighting Prompt */ if (PRF_FLAGGED(d->character, PRF_DISPMOB) && len < sizeof(prompt)) { if (FIGHTING(d->character)) { if (GET_MAX_HIT(FIGHTING(d->character)) > 0) percent = (100 * GET_HIT(FIGHTING(d->character))) / GET_MAX_HIT(FIGHTING(d->character)); else percent = -1; sprintf(prompt + strlen(prompt), "(%d%%) ", (int)(GET_HIT(FIGHTING(d->character))*100)/GET_MAX_HIT(FIGHTING(d->character))); if (percent >= 100) sprintf(prompt + strlen(prompt), "\x1B[0;32mExcellent condition\x1B[0;0m "); else if (percent >= 90) sprintf(prompt + strlen(prompt), "\x1B[0;32mA few scratches\x1B[0;0m "); else if (percent >= 75) sprintf(prompt + strlen(prompt), "\x1B[0;32mSmall wounds and bruises\x1B[0;0m "); else if (percent >= 50) sprintf(prompt + strlen(prompt), "\x1B[0;0mQuite a few wounds\x1B[0;0m "); else if (percent >= 30) sprintf(prompt + strlen(prompt), "\x1B[0;0mBig nasty wounds and scratches\x1B[0;0m "); else if (percent >= 15) sprintf(prompt + strlen(prompt), "\x1B[1;31mPretty hurt\x1B[0;0m "); else if (percent >= 0) sprintf(prompt + strlen(prompt), "\x1B[1;31mAwful condition\x1B[0;0m "); else sprintf(prompt + strlen(prompt), "\x1B[1;31mBleeding awfully from big wounds\x1B[0;0m "); } else { count = snprintf(prompt + len, sizeof(prompt) - len, " %sMob: %sN/A", CCNRM(d->character, C_NRM), CCRED(d->character, C_NRM)); }} /* strncat */ if (len < sizeof(prompt)) strncat(prompt, " \x1B[0;0m> ", sizeof(prompt) + len - 1); /* strncat: OK */ } } else if (STATE(d) == CON_PLAYING && IS_NPC(d->character)) snprintf(prompt, sizeof(prompt), " %s%s> ", CCNRM(d->character, C_NRM), GET_NAME(d->character)); else *prompt = '\0'; return (prompt); } Well now you're done and ready to compile. Enjoy....Erinyes