Code for Rom2.4b4: do_glance command v1.1 by Kracus Based on ROM Version 2.4 beta (c)1993-96 Russ Taylor Based on Merc 2.1 code by Hatchet, Furey, and Kahn Original DikiMud by: Hans Staerfeldt, Katja Nyboe, Tom Madsen, Micheal Seifert, Sebastian Hammer This code allows the player to see the mobs approximate health, while allowing immortals to see more info on the mob such as what affects, act, offensive flags it has... Remember this code has affects2 in it so if you don't have affects2 just take out those parts out in the immortal part of do_glance. Kracus- add this to act_info.c // Glance by Kracus 1999 void do_glance( CHAR_DATA *ch, char *argument ) { char buf[MAX_INPUT_LENGTH]; char arg[MAX_INPUT_LENGTH]; CHAR_DATA *victim; one_argument( argument, arg ); if (IS_NPC(ch)) return; if ( arg[0] == '\0' ) { send_to_char( "Glance at whom?\n\r", ch ); return; } if ( ( victim = get_char_room( ch, arg ) ) == NULL ) { send_to_char( "They're not here.\n\r", ch ); return; } if (IS_IMMORTAL(victim)) { send_to_char( "You are unable to determine their state of health.\n\r", ch ); return; } if (!IS_NPC(ch) && !IS_IMMORTAL(ch)) { if(victim->hit >= (victim->max_hit - (victim->max_hit *10/100))) { sprintf(buf,"{YGlancing at %s, they seem to be in good health. [{r100{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else if((victim->hit < (victim->max_hit - (victim->max_hit *10/100))) && (victim->hit >= (victim->max_hit - (victim->max_hit *20/100)))) { sprintf(buf,"{YGlancing at %s, they look to be in moderate health. [{r90{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else if((victim->hit < (victim->max_hit - (victim->max_hit *20/100))) && (victim->hit >= (victim->max_hit - (victim->max_hit *30/100)))) { sprintf(buf,"{YGlancing at %s, they look to be slightly injured. [{r80{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else if((victim->hit < (victim->max_hit - (victim->max_hit *30/100))) && (victim->hit >= (victim->max_hit - (victim->max_hit *40/100)))) { sprintf(buf,"{YGlancing at %s, they look to be slightly bleeding. [{r70{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else if((victim->hit < (victim->max_hit - (victim->max_hit *40/100))) && (victim->hit >= (victim->max_hit - (victim->max_hit *50/100)))) { sprintf(buf,"{YGlancing at %s, they look to be injured and bleeding. [{r60{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else if((victim->hit < (victim->max_hit - (victim->max_hit *50/100))) && (victim->hit >= (victim->max_hit - (victim->max_hit *60/100)))) { sprintf(buf,"{YGlancing at %s, they look to be seriously injured. [{r50{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else if((victim->hit < (victim->max_hit - (victim->max_hit *60/100))) && (victim->hit >= (victim->max_hit - (victim->max_hit *70/100)))) { sprintf(buf,"{YGlancing at %s, they look to be seriously bleeding. [{r40{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else if((victim->hit < (victim->max_hit - (victim->max_hit *70/100))) && (victim->hit >= (victim->max_hit - (victim->max_hit *80/100)))) { sprintf(buf,"{YGlancing at %s, they look to be critically injured. [{r30{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else if((victim->hit < (victim->max_hit - (victim->max_hit *80/100))) && (victim->hit >= (victim->max_hit - (victim->max_hit *90/100)))) { sprintf(buf,"{YGlancing at %s, they look to be critically bleeding. [{r20{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else if((victim->hit < (victim->max_hit - (victim->max_hit *90/100))) && (victim->hit >= (victim->max_hit - (victim->max_hit *95/100)))) { sprintf(buf,"{YGlancing at %s, they look to be almost near death. [{r10{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else if((victim->hit < (victim->max_hit - (victim->max_hit *95/100))) && (victim->hit >= 1)) { sprintf(buf,"{YGlancing at %s, they look to be on the brink of death. [{r5{Y]{x\n\r", victim->name); send_to_char(buf,ch); return; } else { sprintf(buf,"{YGlancing at %s, you can't seem to determine their health.{x\n\r", victim->name); send_to_char(buf,ch); return; } } else if (!IS_NPC(ch) && IS_IMMORTAL(ch)) { sprintf(buf, "{r[{YVnum %d{r]{Y$N {rhas %d/%dhp %d/%dmn %d/%dmv.{x\n\r{rLevel: %d{x\n\r{rAlign: %d{x\n\r{rDamroll: %d{x\n\r{rHitroll: %d{x\n\r", IS_NPC(victim) ? victim->pIndexData->vnum : 0, victim->hit, victim->max_hit, victim->mana, victim->max_mana, victim->move, victim->max_move, victim->level, victim->alignment, GET_HITROLL(victim), GET_DAMROLL(victim)); act( buf, ch, NULL, victim, TO_CHAR ); sprintf(buf, "{rAct: %s{x\n\r",act_bit_name(victim->act)); send_to_char(buf,ch); if (victim->comm) { sprintf(buf,"{rComm: %s{x\n\r",comm_bit_name(victim->comm)); send_to_char(buf,ch); } if (IS_NPC(victim) && victim->off_flags) { sprintf(buf, "{rOffense: %s{x\n\r",off_bit_name(victim->off_flags)); send_to_char(buf,ch); } if (victim->imm_flags) { sprintf(buf, "{rImmune: %s{x\n\r",imm_bit_name(victim->imm_flags)); send_to_char(buf,ch); } if (victim->res_flags) { sprintf(buf, "{rResist: %s{x\n\r", imm_bit_name(victim->res_flags)); send_to_char(buf,ch); } if (victim->vuln_flags) { sprintf(buf, "{rVulnerable: %s{x\n\r", imm_bit_name(victim->vuln_flags)); send_to_char(buf,ch); } if (victim->affected_by) { sprintf(buf, "{rAffected by %s{x\n\r", affect_bit_name(victim->affected_by)); send_to_char(buf,ch); } // Kracus- if you dont have affects2 take this out if (victim->affected2_by) { sprintf(buf, "{rAlso affected by %s{x\n\r", affect2_bit_name(victim->affected2_by)); send_to_char(buf,ch); } // End of affects2 code return; } else { sprintf(buf,"{YGlancing at %s, you can't seem to determine their health.{x\n\r", victim->name); send_to_char(buf,ch); return; } } Kracus- add this to interp.c { "glance", do_glance, POS_RESTING, 0, LOG_NORMAL, 1 }, Kracus- add this to interp.h DECLARE_DO_FUN( do_glance );