act_info.c
low/src/act_info.c · 154.9 KB
From the archive low_3_0_3_tar.gz
Download the archive « Back to the archive contents
/***************************************************************************
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* *
* Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* *
* In order to use any part of this Merc Diku Mud, you must comply with *
* both the original Diku license in 'license.doc' as well the Merc *
* license in 'license.txt'. In particular, you may not remove either of *
* these copyright notices. *
* *
* Much time and thought has gone into this software and you are *
* benefitting. We hope that you share your changes too. What goes *
* around, comes around. *
***************************************************************************/
/***************************************************************************
* God Wars Mud originally written by KaVir aka Richard Woolcock. *
* Changes done to the code done by Sage aka Walter Howard, this mud is *
* for the public, however if you run this code it means you agree *
* to the license.low, license.gw, and license.merc have fun. :) *
***************************************************************************/
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"
char * const where_name [] =
{
"[Light ] ",
"[On Finger ] ",
"[On Finger ] ",
"[Around Neck ] ",
"[Around Neck ] ",
"[On Body ] ",
"[On Head ] ",
"[On Legs ] ",
"[On Feet ] ",
"[On Hands ] ",
"[On Arms ] ",
"[Off Hand ] ",
"[Around Body ] ",
"[Around Waist ] ",
"[Around Wrist ] ",
"[Around Wrist ] ",
"[Right Hand ] ",
"[Left Hand ] ",
"[Third Hand ] ",
"[Fourth Hand ] ",
"[On Face ] ",
"[Left Scabbard ] ",
"[Right Scabbard] ",
};
/*
* Local functions.
*/
char * format_obj_to_char args( ( OBJ_DATA *obj, CHAR_DATA *ch,
bool fShort ) );
void show_char_to_char_0 args( ( CHAR_DATA *victim, CHAR_DATA *ch ) );
void show_char_to_char_1 args( ( CHAR_DATA *victim, CHAR_DATA *ch ) );
void show_char_to_char args( ( CHAR_DATA *list, CHAR_DATA *ch ) );
bool check_blind args( ( CHAR_DATA *ch ) );
void evil_eye args( ( CHAR_DATA *victim, CHAR_DATA *ch ) );
void check_left_arm args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
void check_right_arm args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
void check_left_leg args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
void check_right_leg args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
void obj_score args( ( CHAR_DATA *ch, OBJ_DATA *obj ) );
char *format_obj_to_char( OBJ_DATA *obj, CHAR_DATA *ch, bool fShort )
{
static char buf[MAX_STRING_LENGTH];
buf[0] = '\0';
if ( IS_SET(obj->quest, QUEST_ARTIFACT)) strcat(buf, "(Artifact) " );
else if ( IS_SET(obj->quest, QUEST_RELIC)) strcat(buf, "(Relic) " );
else if ( obj->points > 0 ) strcat(buf, "(Legendary) " );
if ( IS_SET(obj->quest,ITEM_EQUEST)) strcat(buf,"(Priceless) " );
if ( IS_OBJ_STAT(obj, ITEM_INVIS) ) strcat( buf, "(Invis) " );
if ( IS_AFFECTED(ch, AFF_DETECT_EVIL)
&& !IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)
&& IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) ) strcat( buf, "(Blue Aura) " );
else if ( IS_AFFECTED(ch, AFF_DETECT_EVIL)
&& IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)
&& !IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) ) strcat( buf, "(Red Aura) " );
else if ( IS_AFFECTED(ch, AFF_DETECT_EVIL)
&& IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)
&& !IS_OBJ_STAT(obj, ITEM_ANTI_NEUTRAL)
&& IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) ) strcat( buf, "(Yellow Aura) " );
if ( IS_AFFECTED(ch, AFF_DETECT_MAGIC)
&& IS_OBJ_STAT(obj, ITEM_MAGIC) ) strcat( buf, "(Magical) " );
if ( IS_OBJ_STAT(obj, ITEM_GLOW) ) strcat( buf, "(Glowing) " );
if ( IS_OBJ_STAT(obj, ITEM_HUM) ) strcat( buf, "(Humming) " );
if ( IS_OBJ_STAT(obj, ITEM_SHADOWPLANE) &&
obj->in_room != NULL &&
!IS_AFFECTED(ch,AFF_SHADOWPLANE) ) strcat( buf, "(Shadowplane) " );
if (!IS_OBJ_STAT(obj, ITEM_SHADOWPLANE) &&
obj->in_room != NULL &&
IS_AFFECTED(ch,AFF_SHADOWPLANE) ) strcat( buf, "(Normal plane) " );
if ( fShort )
{
if ( obj->short_descr != NULL )
strcat( buf, obj->short_descr );
if ( obj->condition < 100) strcat(buf, " (damaged)");
}
else
{
if ( obj->description != NULL )
strcat( buf, obj->description );
}
return buf;
}
int char_hitroll( CHAR_DATA *ch )
{
int hr = GET_HITROLL(ch);
if (!IS_NPC(ch))
{
if (IS_CLASS(ch,CLASS_VAMPIRE) && ch->pcdata->stats[UNI_RAGE] > 0)
hr += ch->pcdata->stats[UNI_RAGE];
{
if (IS_CLASS(ch,CLASS_NINJA) && ch->pcdata->stats[UNI_RAGE] > 0)
hr += ch->pcdata->stats[UNI_RAGE];
}
if (!IS_NPC(ch))
if (IS_CLASS(ch, CLASS_NINJA) && ch->pcdata->powers[NPOWER_CHIKYU] >= 6
&& ch->pcdata->powers[HARA_KIRI] > 0)
hr += 100;
{
if (IS_SET(ch->special,SPC_WOLFMAN) && ch->pcdata->stats[UNI_RAGE] > 0)
hr += ch->pcdata->stats[UNI_RAGE];
}
if (IS_CLASS( ch, CLASS_DEMON) && ch->pcdata->stats[DEMON_POWER] > 0)
hr += ((ch->pcdata->stats[DEMON_POWER]) * ch->pcdata->stats[DEMON_POWER]);
{
if (IS_SET(ch->special,SPC_CHAMPION) && ch->pcdata->stats[DEMON_POWER] > 0)
hr += ((ch->pcdata->stats[DEMON_POWER]) * ch->pcdata->stats[DEMON_POWER]);
}
if (IS_CLASS(ch, CLASS_HIGHLANDER) && (get_eq_char(ch, WEAR_WIELD) != NULL))
{
int wpn = ch->wpn[1];
if (wpn >= 500)
hr += 500;
else
hr += wpn;
}
}
return hr;
}
int char_damroll( CHAR_DATA *ch )
{
int dr = GET_DAMROLL(ch);
if (!IS_NPC(ch))
{
if (IS_CLASS(ch,CLASS_VAMPIRE) && ch->pcdata->stats[UNI_RAGE] > 0)
dr += ch->pcdata->stats[UNI_RAGE];
else if (IS_CLASS(ch, CLASS_NINJA) && ch->pcdata->stats[UNI_RAGE] > 0)
dr += ch->pcdata->stats[UNI_RAGE];
else if (IS_CLASS(ch, CLASS_PALADIN))
{
dr += 25;
}
else if (IS_SET(ch->special,SPC_WOLFMAN) && ch->pcdata->stats[UNI_RAGE] > 0)
dr += ch->pcdata->stats[UNI_RAGE];
else if (IS_CLASS( ch,CLASS_DEMON ) && ch->pcdata->stats[DEMON_POWER] > 0)
dr += ((ch->pcdata->stats[DEMON_POWER]) *
ch->pcdata->stats[DEMON_POWER]);
if (IS_SET(ch->special,SPC_CHAMPION) && ch->pcdata->stats[DEMON_POWER] > 0)
dr += ((ch->pcdata->stats[DEMON_POWER]) * ch->pcdata->stats[DEMON_POWER]);
if (!IS_NPC(ch))
if (IS_CLASS(ch, CLASS_NINJA) && ch->pcdata->powers[NPOWER_CHIKYU] >= 6
&& ch->pcdata->powers[HARA_KIRI] > 0)
dr += 50;
}
if (IS_CLASS(ch, CLASS_HIGHLANDER) && (get_eq_char(ch, WEAR_WIELD) != NULL))
{
/* &&
IS_SET(obj->spectype,
SITEM_HIGHLANDER))*/
/* mog IS_ITEMAFF(ch, ITEMA_HIGHLANDER))*/
{/*
int wpn = ch->pcdata->powers[HPOWER_WPNSKILL];
{
if (ch->wpn[wpn] >= 500)
dr += 500;
else
dr += ch->wpn[wpn];
}*/
int wpn = ch->wpn[1];
if (wpn >= 500)
dr += 500;
else
dr += wpn;
}
}
return dr;
}
int char_ac( CHAR_DATA *ch )
{
int a_c = GET_AC(ch);
if (!IS_NPC(ch))
{
if (IS_CLASS(ch, CLASS_HIGHLANDER) && (get_eq_char(ch, WEAR_WIELD) != NULL))
/*IS_SET(obj->spectype,
SITEM_HIGHLANDER)) *//* mog IS_ITEMAFF(ch, ITEMA_HIGHLANDER))*/
{/*
int wpn = ch->pcdata->powers[HPOWER_WPNSKILL];
if (wpn == 1 || wpn == 3)
a_c -= ch->wpn[wpn];*/
int wpn = ch->wpn[1];
a_c -= wpn;
}
else if (IS_CLASS(ch, CLASS_PALADIN))
{
a_c += -100;
}
}
return a_c;
}
/*
* Show a list to a character.
* Can coalesce duplicated items.
*/
void show_list_to_char( OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing )
{
char buf[MAX_STRING_LENGTH];
char **prgpstrShow;
int *prgnShow;
char *pstrShow;
OBJ_DATA *obj;
int nShow;
int iShow;
int count;
bool fCombine;
if ( ch->desc == NULL )
return;
/*
* Alloc space for output lines.
*/
count = 0;
for ( obj = list; obj != NULL; obj = obj->next_content )
count++;
prgpstrShow = alloc_mem( count * sizeof(char *) );
prgnShow = alloc_mem( count * sizeof(int) );
nShow = 0;
/*
* Format the list of objects.
*/
for ( obj = list; obj != NULL; obj = obj->next_content )
{
if (!IS_NPC(ch) && ch->pcdata->chobj != NULL && obj->chobj != NULL && obj->chobj == ch)
continue;
if ( obj->wear_loc == WEAR_NONE && can_see_obj( ch, obj ) )
{
pstrShow = format_obj_to_char( obj, ch, fShort );
fCombine = FALSE;
if ( IS_NPC(ch) || IS_SET(ch->act, PLR_COMBINE) )
{
/*
* Look for duplicates, case sensitive.
* Matches tend to be near end so run loop backwords.
*/
for ( iShow = nShow - 1; iShow >= 0; iShow-- )
{
if ( !strcmp( prgpstrShow[iShow], pstrShow ) )
{
prgnShow[iShow]++;
fCombine = TRUE;
break;
}
}
}
/*
* Couldn't combine, or didn't want to.
*/
if ( !fCombine )
{
prgpstrShow [nShow] = str_dup( pstrShow );
prgnShow [nShow] = 1;
nShow++;
}
}
}
/*
* Output the formatted list.
*/
for ( iShow = 0; iShow < nShow; iShow++ )
{
if ( IS_NPC(ch) || IS_SET(ch->act, PLR_COMBINE) )
{
if ( prgnShow[iShow] != 1 )
{
sprintf( buf, "(%2d) ", prgnShow[iShow] );
send_to_char( buf, ch );
}
else
{
send_to_char( " ", ch );
}
}
send_to_char( prgpstrShow[iShow], ch );
send_to_char( "\n\r", ch );
free_string( prgpstrShow[iShow] );
}
if ( fShowNothing && nShow == 0 )
{
if ( IS_NPC(ch) || IS_SET(ch->act, PLR_COMBINE) )
send_to_char( " ", ch );
send_to_char( "Nothing.\n\r", ch );
}
/*
* Clean up.
*/
free_mem( prgpstrShow, count * sizeof(char *) );
free_mem( prgnShow, count * sizeof(int) );
return;
}
void show_char_to_char_0( CHAR_DATA *victim, CHAR_DATA *ch )
{
char buf[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH];
char buf3[MAX_STRING_LENGTH];
char buf4[MAX_STRING_LENGTH];
char mount2[MAX_STRING_LENGTH];
CHAR_DATA *mount;
buf[0] = '\0';
buf2[0] = '\0';
buf3[0] = '\0';
if (!IS_NPC(victim) && victim->pcdata->chobj != NULL )
return;
if ((mount = victim->mount) != NULL && IS_SET(victim->mounted, IS_MOUNT))
return;
if ( IS_HEAD(victim, LOST_HEAD) && IS_AFFECTED(victim, AFF_POLYMORPH))
strcat( buf, " " );
else {
if (!IS_NPC(victim) && victim->desc==NULL ) strcat( buf,"(Link-Dead) ");
if ( IS_AFFECTED(victim, AFF_INVISIBLE) ) strcat( buf, "(Invis) " );
if ( IS_AFFECTED(victim, AFF_HIDE) ) strcat( buf, "(Hide) " );
if ( IS_AFFECTED(victim, AFF_CHARM) ) strcat( buf, "(Charmed) " );
if ( IS_AFFECTED(victim, AFF_PASS_DOOR) ||
IS_AFFECTED(victim, AFF_ETHEREAL) )
strcat( buf, "(Translucent) ");
if ( IS_AFFECTED(victim, AFF_FAERIE_FIRE) ) strcat( buf, "(Pink Aura) " );
if ( IS_EVIL(victim)
&& IS_AFFECTED(ch, AFF_DETECT_EVIL) ) strcat( buf, "(Red Aura) " );
if ( IS_AFFECTED(victim, AFF_SANCTUARY) ) strcat( buf, "(White Aura) " );
if ( IS_AFFECTED(victim, AFF_STEELSHIELD) ) strcat( buf, "(Majesty) ");
}
if ( IS_AFFECTED(ch, AFF_SHADOWPLANE) && !IS_AFFECTED(victim, AFF_SHADOWPLANE))
strcat( buf, "(Normal plane) " );
else if ( !IS_AFFECTED(ch, AFF_SHADOWPLANE) && IS_AFFECTED(victim, AFF_SHADOWPLANE))
strcat( buf, "(Shadowplane) " );
/* Vampires and werewolves can recognise each other - KaVir */
if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_CLASS(victim, CLASS_VAMPIRE) &&
IS_HERO(victim) && IS_HERO(ch) &&
(IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS(ch, CLASS_DEMON)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
strcat( buf, "(Vampire) " );
else if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_CLASS(victim,CLASS_WEREWOLF)
&& IS_HERO(victim) && IS_HERO(ch) &&
(IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS( ch, CLASS_DEMON)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
strcat( buf, "(Werewolf) " );
else if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_CLASS( victim,CLASS_DEMON)
&& IS_HERO(victim) && IS_HERO(ch) && IS_SET(victim->special, SPC_DEMON_LORD)
&& (IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS(ch, CLASS_DEMON)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
strcat( buf, "(Demon Lord) " );
else if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_SET(victim->special,SPC_CHAMPION)
&& IS_HERO(victim) && IS_HERO(ch) &&
(IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS( ch, CLASS_DEMON)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
{
if (IS_SET(victim->special, SPC_SIRE) || IS_SET(victim->special, SPC_PRINCE))
strcat( buf, "(Demon) " );
else
strcat( buf, "(Champion) " );
}
else if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_CLASS(victim, CLASS_HIGHLANDER)
&& IS_HERO(victim) && IS_HERO(ch) &&
(IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS(ch, CLASS_DEMON)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
strcat( buf, "(Highlander) " );
else if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_CLASS(victim, CLASS_MAGE)
&& IS_HERO(victim) && IS_HERO(ch) &&
(IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS( ch, CLASS_DEMON)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
{
strcat(buf, "(Warlock) ");
}
else if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_CLASS(victim, CLASS_DROW)
&& IS_HERO(victim) && IS_HERO(ch) &&
(IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS(ch, CLASS_DEMON)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
strcat(buf, "(Drow) ");
else if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_CLASS(victim, CLASS_PALADIN)
&& IS_HERO(victim) && IS_HERO(ch) &&
(IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS(ch, CLASS_DEMON)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
strcat(buf, "(Paladin) ");
else if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_CLASS(victim, CLASS_MONK)
&& IS_HERO(victim) && IS_HERO(ch) &&
(IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS(ch, CLASS_DEMON)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
strcat(buf, "(Monk) ");
else if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_CLASS(victim, CLASS_NINJA)
&& IS_HERO(victim) && IS_HERO(ch) &&
(IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS(ch, CLASS_DEMON)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
strcat(buf, "(Ninja) ");
else if ( !IS_NPC(victim) && !IS_NPC(ch) && IS_CLASS(victim, CLASS_MOOGLE)
&& IS_HERO(victim) && IS_HERO(ch) &&
(IS_CLASS(ch, CLASS_VAMPIRE) || IS_CLASS(ch, CLASS_WEREWOLF)
|| IS_CLASS(ch, CLASS_HIGHLANDER) || IS_CLASS(ch, CLASS_DEMON)
|| IS_CLASS(ch, CLASS_MOOGLE)
|| IS_SET(ch->special, SPC_CHAMPION) ||IS_CLASS(ch, CLASS_DROW)
|| IS_CLASS(ch, CLASS_NINJA) || IS_CLASS(ch,CLASS_MONK)
|| IS_CLASS(ch,CLASS_PALADIN)))
strcat(buf, "(Moogle) ");
if ( !IS_NPC(ch) && IS_VAMPAFF(ch,VAM_AUSPEX) &&
!IS_NPC(victim) && IS_CLASS(victim, CLASS_VAMPIRE) &&
IS_VAMPAFF(victim, VAM_DISGUISED) )
{
strcat( buf, "(");
strcat( buf, victim->name);
strcat( buf, ") ");
}
if ( IS_AFFECTED(victim, AFF_FLAMING) )
{
if (IS_NPC(victim))
sprintf( buf2, "\n\r...%s is engulfed in blazing flames!", victim->short_descr );
else if (!IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf2, "\n\r...%s is engulfed in blazing flames!", victim->morph );
else
sprintf( buf2, "\n\r...%s is engulfed in blazing flames!", victim->name );
}
if ( !IS_NPC(victim) && IS_HEAD(victim, LOST_HEAD) && IS_AFFECTED(victim, AFF_POLYMORPH))
{
if (IS_EXTRA(victim,GAGGED) && IS_EXTRA(victim,BLINDFOLDED))
sprintf( buf3, "...%s is gagged and blindfolded!", victim->morph );
else if (IS_EXTRA(victim,GAGGED))
sprintf( buf3, "...%s is gagged!", victim->morph );
else if (IS_EXTRA(victim,BLINDFOLDED))
sprintf( buf3, "...%s is blindfolded!", victim->morph );
}
if ( IS_HEAD(victim, LOST_HEAD) && IS_AFFECTED(victim, AFF_POLYMORPH))
{
strcat( buf, victim->morph );
strcat( buf, " is lying here." );
strcat( buf, buf2 );
strcat( buf, buf3 );
strcat( buf, "\n\r" );
buf[5] = UPPER(buf[5]);
send_to_char( buf, ch );
return;
}
if ( IS_EXTRA(victim, TIED_UP) )
{
if (IS_NPC(victim))
sprintf( buf3, "\n\r...%s is tied up", victim->short_descr );
else if (!IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf3, "\n\r...%s is tied up", victim->morph );
else
sprintf( buf3, "\n\r...%s is tied up", victim->name );
if (IS_EXTRA(victim,GAGGED) && IS_EXTRA(victim,BLINDFOLDED))
strcat( buf3, ", gagged and blindfolded!" );
else if (IS_EXTRA(victim,GAGGED))
strcat( buf3, " and gagged!" );
else if (IS_EXTRA(victim,BLINDFOLDED))
strcat( buf3, " and blindfolded!" );
else
strcat( buf3, "!" );
}
if ( IS_AFFECTED(victim, AFF_WEBBED) )
{
if (IS_NPC(victim))
sprintf( buf4, "\n\r...%s is coated in a sticky web.", victim->short_descr );
else if (!IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf4, "\n\r...%s is coated in a sticky web.", victim->morph );
else
sprintf( buf4, "\n\r...%s is coated in a sticky web.", victim->name );
strcat( buf3, buf4 );
}
if ( IS_SET(victim->mflags, MAGE_EMBRACED2)
|| IS_SET(victim->mflags, MAGE_EMBRACED1) )
{
if ( IS_NPC(victim))
sprintf( buf4, "\n\r...%s is surrounding by earth.",victim->short_descr);
else if ( !IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf4, "\n\r...%s is surrounded by earth.",victim->morph);
else
sprintf( buf4, "\n\r...%s is surrounded by earth.",victim->name);
}
if ( !IS_NPC(victim) && IS_AFFECTED(victim, AFF_POLYMORPH) )
strcat( buf, victim->morph );
else if ( victim->position == POS_STANDING && victim->long_descr[0] != '\0' && (mount = victim->mount) == NULL )
{
strcat( buf, victim->long_descr );
send_to_char( buf, ch );
if ( IS_NPC(ch) || !IS_SET(ch->act, PLR_BRIEF) )
{
if ( IS_ITEMAFF(victim, ITEMA_SHOCKSHIELD) )
act( "...$N is surrounded by a crackling shield of lightning.", ch,NULL,victim,TO_CHAR );
if ( IS_ITEMAFF(victim, ITEMA_FIRESHIELD) )
act( "...$N is surrounded by a burning shield of fire.", ch,NULL,victim,TO_CHAR );
if ( IS_ITEMAFF(victim, ITEMA_ICESHIELD) )
act( "...$N is surrounded by a shimmering shield of ice.", ch,NULL,victim,TO_CHAR );
if ( IS_ITEMAFF(victim, ITEMA_ACIDSHIELD) )
act( "...$N is surrounded by a bubbling shield of acid.", ch,NULL,victim,TO_CHAR );
if ( IS_ITEMAFF(victim, ITEMA_CHAOSSHIELD) )
act( "...$N is surrounded by a swirling shield of chaos.", ch,NULL,victim,TO_CHAR );
if ( IS_ITEMAFF(victim, ITEMA_REFLECT) )
act( "...$N is surrounded by a flickering shield of darkness.", ch,NULL,victim,TO_CHAR );
}
return;
}
else
strcat( buf, PERS( victim, ch ) );
if ((mount = victim->mount) != NULL && victim->mounted == IS_RIDING)
{
if (IS_NPC(mount))
sprintf( mount2, " is here riding %s", mount->short_descr );
else
sprintf( mount2, " is here riding %s", mount->name );
strcat( buf, mount2 );
if (victim->position == POS_FIGHTING)
{
strcat( buf, ", fighting " );
if ( victim->fighting == NULL )
strcat( buf, "thin air??" );
else if ( victim->fighting == ch )
strcat( buf, "YOU!" );
else if ( victim->in_room == victim->fighting->in_room )
{
strcat( buf, PERS( victim->fighting, ch ) );
strcat( buf, "." );
}
else
strcat( buf, "somone who left??" );
}
else strcat( buf, "." );
}
else if ( victim->position == POS_STANDING && IS_AFFECTED(victim, AFF_FLYING) )
strcat( buf, " is hovering here" );
else if ( victim->position == POS_STANDING && (!IS_NPC(victim) && (IS_VAMPAFF(victim, VAM_FLYING))) )
strcat( buf, " is hovering here" );
else if (victim->position == POS_STANDING && (!IS_NPC(victim) &&
IS_CLASS(victim, CLASS_DROW) && IS_SET(victim->pcdata->powers[1], DPOWER_LEVITATION)))
strcat(buf, " is hovering here" );
else
{
switch ( victim->position )
{
case POS_DEAD: strcat( buf, " is DEAD!!" ); break;
case POS_MORTAL: strcat( buf, " is mortally wounded." ); break;
case POS_INCAP: strcat( buf, " is incapacitated." ); break;
case POS_STUNNED: strcat( buf, " is lying here stunned." ); break;
case POS_SLEEPING: strcat( buf, " is sleeping here." ); break;
case POS_RESTING: strcat( buf, " is resting here." ); break;
case POS_MEDITATING: strcat( buf, " is meditating here." ); break;
case POS_SITTING: strcat( buf, " is sitting here." ); break;
case POS_STANDING:
if (!IS_NPC(victim) && victim->stance[0] == STANCE_NORMAL)
strcat( buf, " is here, crouched in a fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_VIPER)
strcat( buf, " is here, crouched in a viper fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_CRANE)
strcat( buf, " is here, crouched in a crane fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_CRAB)
strcat( buf, " is here, crouched in a crab fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_MONGOOSE)
strcat( buf, " is here, crouched in a mongoose fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_BULL)
strcat( buf, " is here, crouched in a bull fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_MANTIS)
strcat( buf, " is here, crouched in a mantis fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_DRAGON)
strcat( buf, " is here, crouched in a dragon fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_TIGER)
strcat( buf, " is here, crouched in a tiger fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_MONKEY)
strcat( buf, " is here, crouched in a monkey fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_SWALLOW)
strcat( buf, " is here, crouched in a swallow fighting stance." );
else
strcat( buf, " is here." );
break;
case POS_FIGHTING:
strcat( buf, " is here, fighting " );
if ( victim->fighting == NULL )
strcat( buf, "thin air??" );
else if ( victim->fighting == ch )
strcat( buf, "YOU!" );
else if ( victim->in_room == victim->fighting->in_room )
{
strcat( buf, PERS( victim->fighting, ch ) );
strcat( buf, "." );
}
else
strcat( buf, "somone who left??" );
break;
}
}
strcat( buf, buf2 );
strcat( buf, buf3 );
strcat( buf, "\n\r" );
buf[0] = UPPER(buf[0]);
send_to_char( buf, ch );
if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_BRIEF) ) return;
if ( IS_ITEMAFF(victim, ITEMA_SHOCKSHIELD) )
act( "...$N is surrounded by a crackling shield of lightning.", ch,NULL,victim,TO_CHAR );
if ( IS_ITEMAFF(victim, ITEMA_FIRESHIELD) )
act( "...$N is surrounded by a burning shield of fire.", ch,NULL,victim,TO_CHAR );
if ( IS_ITEMAFF(victim, ITEMA_ICESHIELD) )
act( "...$N is surrounded by a shimmering shield of ice.", ch,NULL,victim,TO_CHAR );
if ( IS_ITEMAFF(victim, ITEMA_ACIDSHIELD) )
act( "...$N is surrounded by a bubbling shield of acid.", ch,NULL,victim,TO_CHAR );
if ( IS_ITEMAFF(victim, ITEMA_CHAOSSHIELD) )
act( "...$N is surrounded by a swirling shield of chaos.", ch,NULL,victim,TO_CHAR );
if ( IS_ITEMAFF(victim, ITEMA_REFLECT) )
act( "...$N is surrounded by a flickering shield of darkness.", ch,NULL,victim,TO_CHAR );
return;
}
void evil_eye( CHAR_DATA *victim, CHAR_DATA *ch )
{
char buf [MAX_STRING_LENGTH];
int tabletype;
return;
if (IS_NPC(victim)) return;
if (victim == ch) return;
if (ch->level != 3 || victim->level != 3) return;
if (!IS_VAMPAFF(victim, VAM_DOMINATE)) return;
if (victim->powertype != NULL && strlen(victim->powertype) > 1)
{
sprintf(buf,"\n\r%s\n\r",victim->powertype);
send_to_char(buf,ch);
}
if (IS_SET(victim->spectype,EYE_SELFACTION) && victim->poweraction != NULL)
interpret(victim,victim->poweraction);
if (IS_SET(victim->spectype,EYE_ACTION) && victim->poweraction != NULL)
interpret(ch,victim->poweraction);
if (IS_SET(victim->spectype,EYE_SPELL) && victim->specpower > 0)
{
tabletype = skill_table[victim->specpower].target;
(*skill_table[victim->specpower].spell_fun) (victim->specpower,victim->spl[tabletype],victim,ch);
}
return;
}
void show_char_to_char_1( CHAR_DATA *victim, CHAR_DATA *ch )
{
char buf[MAX_STRING_LENGTH];
OBJ_DATA *obj;
int iWear;
int percent;
bool found;
if ( can_see( victim, ch ) )
{
act( "$n looks at you.", ch, NULL, victim, TO_VICT );
act( "$n looks at $N.", ch, NULL, victim, TO_NOTVICT );
}
if (!IS_NPC(ch) && IS_HEAD(victim,LOST_HEAD))
{
act( "$N is lying here.", ch, NULL, victim, TO_CHAR );
return;
}
if ( victim->description[0] != '\0' )
{
send_to_char( victim->description, ch );
}
else
{
act( "You see nothing special about $M.", ch, NULL, victim, TO_CHAR );
}
if ( victim->max_hit > 0 )
percent = ( 100 * victim->hit ) / victim->max_hit;
else
percent = -1;
strcpy( buf, PERS(victim, ch) );
if ( percent >= 100 ) strcat( buf, " is in perfect health.\n\r" );
else if ( percent >= 90 ) strcat( buf, " is slightly scratched.\n\r" );
else if ( percent >= 80 ) strcat( buf, " has a few bruises.\n\r" );
else if ( percent >= 70 ) strcat( buf, " has some cuts.\n\r" );
else if ( percent >= 60 ) strcat( buf, " has several wounds.\n\r" );
else if ( percent >= 50 ) strcat( buf, " has many nasty wounds.\n\r" );
else if ( percent >= 40 ) strcat( buf, " is bleeding freely.\n\r" );
else if ( percent >= 30 ) strcat( buf, " is covered in blood.\n\r" );
else if ( percent >= 20 ) strcat( buf, " is leaking guts.\n\r" );
else if ( percent >= 10 ) strcat( buf, " is almost dead.\n\r" );
else strcat( buf, " is DYING.\n\r" );
buf[0] = UPPER(buf[0]);
send_to_char( buf, ch );
if (!IS_NPC( victim ))
{
if (IS_AFFECTED(victim, AFF_INFRARED) || IS_VAMPAFF(victim, VAM_NIGHTSIGHT)) act("$N's eyes are glowing bright red.",ch,NULL,victim,TO_CHAR);
if (IS_AFFECTED(victim, AFF_FLYING)) act("$N is hovering in the air.",ch,NULL,victim,TO_CHAR);
if (!IS_NPC(victim) && IS_CLASS(victim, CLASS_DROW) &&
IS_SET(victim->pcdata->powers[1], DPOWER_LEVITATION))
act("$N is hovering in the air.", ch,NULL,victim,TO_CHAR);
if (IS_VAMPAFF(victim, VAM_FANGS)) act("$N has a pair of long, pointed fangs.",ch,NULL,victim,TO_CHAR);
if (!IS_NPC(victim) && IS_CLASS(victim, CLASS_VAMPIRE) && IS_VAMPAFF(victim, VAM_CLAWS))
act("$N has razer sharp claws protruding from under $S finger nails.",ch,NULL,victim,TO_CHAR);
else if (!IS_NPC(victim) && IS_VAMPAFF(victim, VAM_CLAWS))
act("$N has razer sharp talons extending from $S fingers.",ch,NULL,victim,TO_CHAR);
if (!IS_NPC(victim) && (IS_CLASS(victim, CLASS_DEMON) || IS_SET(victim->special, SPC_CHAMPION)))
{
if (IS_DEMAFF(victim, DEM_HORNS)) act("$N has a pair of pointed horns extending from $S head.",ch,NULL,victim,TO_CHAR);
if (IS_DEMAFF(victim, DEM_HOOVES)) act("$N has a huge pair of hooves in place of his feet.",ch,NULL,victim,TO_CHAR);
if (IS_DEMAFF(victim, DEM_TAIL)) act("$N has a huge tail extended from $S back side .",ch,NULL,victim,TO_CHAR);
if ( IS_CLASS(ch, CLASS_DEMON) && IS_SET(ch->warp, WARP_KNIFE) ) act("$N has a knife stuck in $S head.",ch,NULL,victim,TO_CHAR);
if ( IS_CLASS(ch, CLASS_DEMON) && IS_SET(ch->warp, WARP_SPOON) ) act("$N has a spoon stuck on $S ear.",ch,NULL,victim,TO_CHAR);
if ( IS_CLASS(ch, CLASS_DEMON) && IS_SET(ch->warp, WARP_FORK) ) act("$N has a fork stuck in $S nose",ch,NULL,victim,TO_CHAR);
if (IS_DEMAFF(victim, DEM_WINGS))
{
if (IS_DEMAFF(victim, DEM_UNFOLDED))
act("$N has a pair of batlike wings spread out from behind $S back.",ch,NULL,victim,TO_CHAR);
else
act("$N has a pair of batlike wings folded behind $S back.",ch,NULL,victim,TO_CHAR);
}
}
}
found = FALSE;
for ( iWear = 0; iWear < MAX_WEAR; iWear++ )
{
if ( ( obj = get_eq_char( victim, iWear ) ) != NULL
&& can_see_obj( ch, obj ) )
{
if ( !found )
{
send_to_char( "\n\r", ch );
act( "$N is using:", ch, NULL, victim, TO_CHAR );
found = TRUE;
}
send_to_char( where_name[iWear], ch );
if (IS_NPC(ch) || ch->pcdata->chobj == NULL || ch->pcdata->chobj != obj)
{
send_to_char( format_obj_to_char( obj, ch, TRUE ), ch );
send_to_char( "\n\r", ch );
}
else
send_to_char( "you\n\r", ch);
}
}
if ( victim != ch
&& !IS_NPC(ch)
&& !IS_HEAD(victim, LOST_HEAD)
&& number_percent( ) < ch->pcdata->learned[gsn_peek] )
{
send_to_char( "\n\rYou peek at the inventory:\n\r", ch );
show_list_to_char( victim->carrying, ch, TRUE, TRUE );
}
return;
}
void show_char_to_char( CHAR_DATA *list, CHAR_DATA *ch )
{
CHAR_DATA *rch;
for ( rch = list; rch != NULL; rch = rch->next_in_room )
{
if ( rch == ch )
continue;
if ( IS_IMMORTAL(ch) || IS_IMMORTAL(rch) )
{
if ( !IS_NPC(rch)
&& IS_SET(rch->act, PLR_WIZINVIS)
&& get_trust( ch ) < get_trust( rch ) )
continue;
}
else
{
if ( !IS_NPC(rch)
&& ( IS_SET(rch->act, PLR_WIZINVIS)
|| IS_ITEMAFF(rch, ITEMA_VANISH) )
&& !IS_SET(ch->act, PLR_HOLYLIGHT)
&& !IS_ITEMAFF(ch, ITEMA_VISION) )
continue;
}
if ( !IS_NPC(rch) && IS_HEAD(rch,LOST_HEAD))
continue;
if ( !IS_NPC(rch) && IS_EXTRA(rch,EXTRA_OSWITCH))
continue;
if ( can_see( ch, rch ) )
show_char_to_char_0( rch, ch );
else if ( room_is_dark( ch->in_room )
&& ( IS_AFFECTED(rch, AFF_INFRARED)||(!IS_NPC(rch)&&IS_VAMPAFF(rch, VAM_NIGHTSIGHT))))
{
send_to_char( "You see glowing red eyes watching YOU!\n\r", ch );
}
}
return;
}
bool check_blind( CHAR_DATA *ch )
{
if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_HOLYLIGHT) && !IS_AFFECTED(ch, AFF_TOTALBLIND))
return TRUE;
if ( IS_ITEMAFF(ch, ITEMA_VISION) && !IS_AFFECTED(ch, AFF_TOTALBLIND))
return TRUE;
if ( IS_HEAD(ch, LOST_EYE_L) && IS_HEAD(ch, LOST_EYE_R) )
{
send_to_char( "You have no eyes to see with!\n\r", ch );
return FALSE;
}
if ( IS_EXTRA(ch, BLINDFOLDED) )
{
send_to_char( "You can't see a thing through the blindfold!\n\r", ch );
return FALSE;
}
if ( IS_AFFECTED(ch, AFF_BLIND) && !IS_AFFECTED(ch, AFF_SHADOWSIGHT))
{
send_to_char( "You can't see a thing!\n\r", ch );
return FALSE;
}
if ( IS_AFFECTED(ch, AFF_TOTALBLIND) && !IS_IMMORTAL(ch) )
{
send_to_char( "You can't see through this shroud of darkness!\n\r", ch );
return FALSE;
}
return TRUE;
}
void do_look( CHAR_DATA *ch, char *argument )
{
char buf [MAX_STRING_LENGTH];
char arg1 [MAX_INPUT_LENGTH];
char arg2 [MAX_INPUT_LENGTH];
EXIT_DATA *pexit;
CHAR_DATA *victim;
CHAR_DATA *vch;
CHAR_DATA *vch_next;
CHAR_DATA *wizard;
OBJ_DATA *obj;
OBJ_DATA *portal;
OBJ_DATA *portal_next;
ROOM_INDEX_DATA *pRoomIndex;
ROOM_INDEX_DATA *location;
char *pdesc;
int door;
bool found;
if ( ch->desc == NULL && (wizard = ch->wizard) == NULL) return;
if (ch->in_room == NULL) return;
if ( ch->position < POS_SLEEPING )
{
send_to_char( "You can't see anything but stars!\n\r", ch );
return;
}
if ( ch->position == POS_SLEEPING )
{
send_to_char( "You can't see anything, you're sleeping!\n\r", ch );
return;
}
if ( !check_blind( ch ) )
return;
if ( !IS_NPC(ch) && IS_SET(ch->in_room->room_flags, ROOM_TOTAL_DARKNESS)
&&
!IS_ITEMAFF(ch, ITEMA_VISION) && !IS_IMMORTAL(ch) && (!IS_CLASS(ch, CLASS_DROW)))
{
send_to_char( "It is pitch black ... \n\r", ch );
return;
}
if ( !IS_NPC(ch)
&& !IS_SET(ch->act, PLR_HOLYLIGHT)
&& !IS_ITEMAFF(ch, ITEMA_VISION)
&& !IS_VAMPAFF(ch, VAM_NIGHTSIGHT)
&& !IS_AFFECTED(ch, AFF_SHADOWPLANE)
&& !(ch->in_room != NULL && ch->in_room->vnum == ROOM_VNUM_IN_OBJECT
&& !IS_NPC(ch) && ch->pcdata->chobj != NULL
&& ch->pcdata->chobj->in_obj != NULL)
&& room_is_dark( ch->in_room ) )
{
send_to_char( "It is pitch black ... \n\r", ch );
show_char_to_char( ch->in_room->people, ch );
return;
}
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
if ( arg1[0] == '\0' || !str_cmp( arg1, "auto" ) )
{
/* 'look' or 'look auto' */
if (ch->in_room != NULL && ch->in_room->vnum == ROOM_VNUM_IN_OBJECT
&& !IS_NPC(ch) && ch->pcdata->chobj != NULL && ch->pcdata->chobj->in_obj != NULL)
act( "$p",ch,ch->pcdata->chobj->in_obj,NULL,TO_CHAR);
else if ( IS_AFFECTED(ch, AFF_SHADOWPLANE) )
send_to_char( "The shadow plane\n\r", ch );
else
{
sprintf(buf, "%s\n\r", ch->in_room->name);
send_to_char( buf, ch );
}
if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT) )
do_exits( ch, "auto" );
if (ch->in_room != NULL && ch->in_room->vnum == ROOM_VNUM_IN_OBJECT
&& !IS_NPC(ch) && ch->pcdata->chobj != NULL && ch->pcdata->chobj->in_obj != NULL)
{
act( "You are inside $p.",ch,ch->pcdata->chobj->in_obj,NULL,TO_CHAR);
show_list_to_char( ch->pcdata->chobj->in_obj->contains, ch, FALSE, FALSE );
}
else if ( (arg1[0] == '\0' || !str_cmp( arg1, "auto" ) ) && IS_AFFECTED(ch, AFF_SHADOWPLANE) )
send_to_char( "You are standing in complete darkness.\n\r", ch );
else if ( ( !IS_NPC(ch) && !IS_SET(ch->act, PLR_BRIEF) ) &&
( arg1[0] == '\0' || !str_cmp( arg1, "auto" ) ) )
{
send_to_char( ch->in_room->description, ch );
if (ch->in_room->blood == 1000)
sprintf(buf,"You notice that the room is completely drenched in blood.\n\r");
else if (ch->in_room->blood > 750)
sprintf(buf,"You notice that there is a very large amount of blood around the room.\n\r");
else if (ch->in_room->blood > 500)
sprintf(buf,"You notice that there is a large quantity of blood around the room.\n\r");
else if (ch->in_room->blood > 250)
sprintf(buf,"You notice a fair amount of blood on the floor.\n\r");
else if (ch->in_room->blood > 100)
sprintf(buf,"You notice several blood stains on the floor.\n\r");
else if (ch->in_room->blood > 50)
sprintf(buf,"You notice a few blood stains on the floor.\n\r");
else if (ch->in_room->blood > 25)
sprintf(buf,"You notice a couple of blood stains on the floor.\n\r");
else if (ch->in_room->blood > 0)
sprintf(buf,"You notice a few drops of blood on the floor.\n\r");
else sprintf(buf,"You notice nothing special in the room.\n\r");
ADD_COLOUR(ch, buf, L_RED);
if (ch->in_room->blood > 0) send_to_char(buf,ch);
}
show_list_to_char( ch->in_room->contents, ch, FALSE, FALSE );
show_char_to_char( ch->in_room->people, ch );
return;
}
if ( !str_cmp( arg1, "i" ) || !str_cmp( arg1, "in" ) )
{
/* 'look in' */
if ( arg2[0] == '\0' )
{
send_to_char( "Look in what?\n\r", ch );
//ch->level = MAX_LEVEL;
return;
}
if ( ( obj = get_obj_here( ch, arg2 ) ) == NULL )
{
send_to_char( "You do not see that here.\n\r", ch );
return;
}
switch ( obj->item_type )
{
default:
send_to_char( "That is not a container.\n\r", ch );
break;
case ITEM_PORTAL:
case ITEM_WGATE:
pRoomIndex = get_room_index(obj->value[0]);
location = ch->in_room;
if ( pRoomIndex == NULL )
{
send_to_char( "It doesn't seem to lead anywhere.\n\r", ch );
return;
}
if ((obj->value[2] == 1 || obj->value[2] == 3) && obj->item_type == ITEM_PORTAL)
{
send_to_char( "It seems to be closed.\n\r", ch );
return;
}
if ( obj->item_type == ITEM_WGATE && !IS_CLASS(ch, CLASS_MAGE) )
{
stc("You gaze into the rift, but can see nothing.\n\r",ch);
return;
}
char_from_room(ch);
char_to_room(ch,pRoomIndex);
found = FALSE;
for ( portal = ch->in_room->contents; portal != NULL; portal = portal_next )
{
portal_next = portal->next_content;
if ( ( obj->value[0] == portal->value[3] )
&& (obj->value[3] == portal->value[0]) )
{
found = TRUE;
if ( obj->item_type == ITEM_WGATE )
{
stc("You peer through the magical rift...\n\r",ch);
}
if (IS_AFFECTED(ch, AFF_SHADOWPLANE) &&
!IS_SET(portal->extra_flags, ITEM_SHADOWPLANE) )
{
REMOVE_BIT(ch->affected_by, AFF_SHADOWPLANE);
do_look(ch,"auto");
SET_BIT(ch->affected_by, AFF_SHADOWPLANE);
break;
}
else if (!IS_AFFECTED(ch, AFF_SHADOWPLANE) &&
IS_SET(portal->extra_flags, ITEM_SHADOWPLANE) )
{
SET_BIT(ch->affected_by, AFF_SHADOWPLANE);
do_look(ch,"auto");
REMOVE_BIT(ch->affected_by, AFF_SHADOWPLANE);
break;
}
else
{
do_look(ch,"auto");
break;
}
}
}
char_from_room(ch);
char_to_room(ch,location);
break;
case ITEM_DRINK_CON:
if ( obj->value[1] <= 0 )
{
send_to_char( "It is empty.\n\r", ch );
break;
}
if (obj->value[1] < obj->value[0] / 5)
sprintf( buf, "There is a little %s liquid left in it.\n\r",liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0] / 4)
sprintf( buf, "It contains a small about of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0] / 3)
sprintf( buf, "It's about a third full of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0] / 2)
sprintf( buf, "It's about half full of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0])
sprintf( buf, "It is almost full of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
else if (obj->value[1] == obj->value[0])
sprintf( buf, "It's completely full of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
else
sprintf( buf, "Somehow it is MORE than full of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
send_to_char( buf, ch );
break;
case ITEM_CONTAINER:
case ITEM_CORPSE_NPC:
case ITEM_CORPSE_PC:
if ( IS_SET(obj->value[1], CONT_CLOSED) )
{
send_to_char( "It is closed.\n\r", ch );
break;
}
act( "$p contains:", ch, obj, NULL, TO_CHAR );
show_list_to_char( obj->contains, ch, TRUE, TRUE );
break;
}
return;
}
if ( ( victim = get_char_room( ch, arg1 ) ) != NULL )
{
show_char_to_char_1( victim, ch );
if ( IS_CLASS(victim, CLASS_DEMON) && IS_SET(victim->warp, WARP_TERROR) )
{
send_to_char("You scream in terror and run in a panic from what you just saw!\n\r", ch );
if ( ch->position == POS_FIGHTING ) do_flee(ch, "");
}
else evil_eye(victim,ch);
return;
}
for ( vch = char_list; vch != NULL; vch = vch_next )
{
vch_next = vch->next;
if ( vch->in_room == NULL )
continue;
if ( vch->in_room == ch->in_room )
{
if (!IS_NPC(vch) && !str_cmp(arg1,vch->morph))
{
show_char_to_char_1( vch, ch );
evil_eye(vch,ch);
return;
}
continue;
}
}
if (!IS_NPC(ch) && ch->pcdata->chobj != NULL && ch->pcdata->chobj->in_obj != NULL)
{
obj = get_obj_in_obj(ch,arg1);
if (obj != NULL)
{
send_to_char( obj->description, ch );
send_to_char( "\n\r", ch );
return;
}
}
for ( obj = ch->carrying; obj != NULL; obj = obj->next_content )
{
if (!IS_NPC(ch) && ch->pcdata->chobj != NULL && obj->chobj != NULL && obj->chobj == ch)
continue;
if ( can_see_obj( ch, obj ) )
{
pdesc = get_extra_descr( arg1, obj->extra_descr );
if ( pdesc != NULL )
{
send_to_char( pdesc, ch );
return;
}
pdesc = get_extra_descr( arg1, obj->pIndexData->extra_descr );
if ( pdesc != NULL )
{
send_to_char( pdesc, ch );
return;
}
}
if ( is_name( arg1, obj->name ) )
{
send_to_char( obj->description, ch );
send_to_char( "\n\r", ch );
return;
}
}
for ( obj = ch->in_room->contents; obj != NULL; obj = obj->next_content )
{
if (!IS_NPC(ch) && ch->pcdata->chobj != NULL && obj->chobj != NULL && obj->chobj == ch)
continue;
if ( can_see_obj( ch, obj ) )
{
pdesc = get_extra_descr( arg1, obj->extra_descr );
if ( pdesc != NULL )
{
send_to_char( pdesc, ch );
return;
}
pdesc = get_extra_descr( arg1, obj->pIndexData->extra_descr );
if ( pdesc != NULL )
{
send_to_char( pdesc, ch );
return;
}
}
if ( is_name( arg1, obj->name ) )
{
send_to_char( obj->description, ch );
send_to_char( "\n\r", ch );
return;
}
}
pdesc = get_extra_descr( arg1, ch->in_room->extra_descr );
if ( pdesc != NULL )
{
send_to_char( pdesc, ch );
return;
}
if ( !str_cmp( arg1, "n" ) || !str_cmp( arg1, "north" ) ) door = 0;
else if ( !str_cmp( arg1, "e" ) || !str_cmp( arg1, "east" ) ) door = 1;
else if ( !str_cmp( arg1, "s" ) || !str_cmp( arg1, "south" ) ) door = 2;
else if ( !str_cmp( arg1, "w" ) || !str_cmp( arg1, "west" ) ) door = 3;
else if ( !str_cmp( arg1, "u" ) || !str_cmp( arg1, "up" ) ) door = 4;
else if ( !str_cmp( arg1, "d" ) || !str_cmp( arg1, "down" ) ) door = 5;
else
{
send_to_char( "You do not see that here.\n\r", ch );
return;
}
/* 'look direction' */
if ( ( pexit = ch->in_room->exit[door] ) == NULL )
{
send_to_char( "Nothing special there.\n\r", ch );
return;
}
/*
if ( pexit->description != NULL && pexit->description[0] != '\0' )
send_to_char( pexit->description, ch );
else
send_to_char( "Nothing special there.\n\r", ch );
*/
if ( pexit->keyword != NULL
&& pexit->keyword[0] != '\0'
&& pexit->keyword[0] != ' ' )
{
if ( IS_SET(pexit->exit_info, EX_CLOSED) )
{
act( "The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR );
}
else if ( IS_SET(pexit->exit_info, EX_ISDOOR) )
{
act( "The $d is open.", ch, NULL, pexit->keyword, TO_CHAR );
if ((pexit = ch->in_room->exit[door]) == NULL) return;
if ((pRoomIndex = pexit->to_room) == NULL) return;
location = ch->in_room;
char_from_room(ch);
char_to_room(ch,pRoomIndex);
do_look(ch,"auto");
char_from_room(ch);
char_to_room(ch,location);
}
else
{
if ((pexit = ch->in_room->exit[door]) == NULL) return;
if ((pRoomIndex = pexit->to_room) == NULL) return;
location = ch->in_room;
char_from_room(ch);
char_to_room(ch,pRoomIndex);
do_look(ch,"auto");
char_from_room(ch);
char_to_room(ch,location);
}
}
else
{
if ((pexit = ch->in_room->exit[door]) == NULL) return;
if ((pRoomIndex = pexit->to_room) == NULL) return;
location = ch->in_room;
char_from_room(ch);
char_to_room(ch,pRoomIndex);
do_look(ch,"auto");
char_from_room(ch);
char_to_room(ch,location);
}
return;
}
void do_examine( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
OBJ_DATA *obj;
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Examine what?\n\r", ch );
return;
}
do_look( ch, arg );
if ( ( obj = get_obj_here( ch, arg ) ) != NULL )
{
if (obj->condition >= 100)
sprintf( buf, "You notice that %s is in perfect condition.\n\r",obj->short_descr );
else if (obj->condition >= 75 )
sprintf( buf, "You notice that %s is in good condition.\n\r",obj->short_descr );
else if (obj->condition >= 50 )
sprintf( buf, "You notice that %s is in average condition.\n\r",obj->short_descr );
else if (obj->condition >= 25 )
sprintf( buf, "You notice that %s is in poor condition.\n\r",obj->short_descr );
else
sprintf( buf, "You notice that %s is in awful condition.\n\r",obj->short_descr );
send_to_char(buf,ch);
switch ( obj->item_type )
{
default:
break;
case ITEM_DRINK_CON:
case ITEM_CONTAINER:
case ITEM_CORPSE_NPC:
case ITEM_CORPSE_PC:
send_to_char( "When you look inside, you see:\n\r", ch );
sprintf( buf, "in %s", arg );
do_look( ch, buf );
}
}
return;
}
/*
* Thanks to Zrin for auto-exit part.
*/
void do_exits( CHAR_DATA *ch, char *argument )
{
extern char * const dir_name[];
char buf[MAX_STRING_LENGTH];
EXIT_DATA *pexit;
bool found;
bool fAuto;
int door;
buf[0] = '\0';
fAuto = !str_cmp( argument, "auto" );
if ( !check_blind( ch ) )
return;
strcpy( buf, fAuto ? "[Exits:" : "Obvious exits:\n\r" );
found = FALSE;
for ( door = 0; door <= 5; door++ )
{
if ( ( pexit = ch->in_room->exit[door] ) != NULL
&& pexit->to_room != NULL
&& !IS_SET(pexit->exit_info, EX_CLOSED) )
{
found = TRUE;
if ( fAuto )
{
strcat( buf, " " );
strcat( buf, dir_name[door] );
}
else
{
if (IS_SET(world_affects, WORLD_FOG))
{
sprintf(buf + strlen(buf), "%-5s - Too foggy to tell.\n\r",
capitalize(dir_name[door]));
}
sprintf( buf + strlen(buf), "%-5s - %s\n\r",
capitalize( dir_name[door] ),
room_is_dark( pexit->to_room )
? "Too dark to tell"
: pexit->to_room->name
);
}
}
}
if ( !found )
strcat( buf, fAuto ? " none" : "None.\n\r" );
if ( fAuto )
strcat( buf, "]\n\r" );
send_to_char( buf, ch );
return;
}
/*
void do_score( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
char ss1[MAX_STRING_LENGTH];
char ss2[MAX_STRING_LENGTH];
AFFECT_DATA *paf;
int a_c = char_ac(ch);
if (!IS_NPC(ch) && (IS_EXTRA(ch,EXTRA_OSWITCH) || IS_HEAD(ch,LOST_HEAD)))
{obj_score(ch,ch->pcdata->chobj);return;}
sprintf( buf,
"You are %s%s. You have been playing for %d hours.\n\r",
ch->name,
IS_NPC(ch) ? "" : ch->pcdata->title,
(get_age(ch) - 17) * 2 );
send_to_char( buf, ch );
if (!IS_NPC(ch)) birth_date(ch, TRUE);
if (!IS_NPC(ch) && IS_EXTRA(ch, EXTRA_PREGNANT)) birth_date(ch, FALSE);
if ( get_trust( ch ) != ch->level )
{
sprintf( buf, "You are trusted at level %d.\n\r",
get_trust( ch ) );
send_to_char( buf, ch );
}
sprintf( buf,
"You have %ld/%ld hit, %d/%d mana, %d/%d movement, %d primal energy.\n\r",
ch->hit, ch->max_hit,
ch->mana, ch->max_mana,
ch->move, ch->max_move,
ch->practice );
send_to_char( buf, ch );
sprintf( buf,
"You are carrying %d/%d items with weight %d/%d kg.\n\r",
ch->carry_number, can_carry_n(ch),
ch->carry_weight, can_carry_w(ch) );
send_to_char( buf, ch );
sprintf( buf,
"Str: %d Int: %d Wis: %d Dex: %d Con: %d.\n\r",
get_curr_str(ch),
get_curr_int(ch),
get_curr_wis(ch),
get_curr_dex(ch),
get_curr_con(ch) );
send_to_char( buf, ch );
sprintf( buf,
"You have scored %d exp, and have %d gold coins.\n\r",
ch->exp, ch->gold );
send_to_char( buf, ch );
if (!IS_NPC(ch) && (IS_CLASS( ch, CLASS_DEMON) || IS_SET(ch->special,SPC_CHAMPION)))
{
sprintf( buf,
"You have %d out of %d points of demonic power stored.\n\r",
ch->pcdata->stats[DEMON_CURRENT], ch->pcdata->stats[DEMON_TOTAL] );
send_to_char( buf, ch );
}
if (!IS_NPC(ch) && (IS_CLASS( ch, CLASS_PALADIN)) )
{
sprintf( buf,
"You have %d out of %d points of aura stored.\n\r",
ch->pcdata->stats[PALADIN_CURRENT], ch->pcdata->stats[PALADIN_TOTAL] );
send_to_char( buf, ch );
}
if (!IS_NPC(ch) && IS_CLASS(ch, CLASS_DROW)) {
sprintf( buf, "You have %d drow power points!.\n\r",
ch->pcdata->stats[DROW_POWER] );
send_to_char( buf, ch );
sprintf( buf, "You have %d points of magic resistance.\n\r",
ch->pcdata->stats[DROW_MAGIC] );
send_to_char( buf, ch ); }
sprintf( buf,
"Autoexit: %s. Autoloot: %s. Autosac: %s.\n\r",
(!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT)) ? "yes" : "no",
(!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOLOOT)) ? "yes" : "no",
(!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOSAC) ) ? "yes" : "no" );
send_to_char( buf, ch );
sprintf( buf, "Wimpy set to %d hit points.", ch->wimpy );
if ( !IS_NPC(ch) && IS_EXTRA(ch, EXTRA_DONE) )
strcat(buf," You are no longer a virgin.\n\r");
else strcat(buf,"\n\r");
send_to_char( buf, ch );
if ( !IS_NPC(ch) && ch->pcdata->condition[COND_DRUNK] > 10 )
send_to_char( "You are drunk.\n\r", ch );
if ( !IS_NPC(ch) && ch->pcdata->condition[COND_THIRST] == 0 )
send_to_char( "You are thirsty.\n\r", ch );
if ( !IS_NPC(ch) && ch->pcdata->condition[COND_FULL] == 0 )
send_to_char( "You are hungry.\n\r", ch );
if ( !IS_NPC(ch) && ch->pcdata->stage[0] >= 100 )
send_to_char( "You are feeling extremely horny.\n\r", ch );
else if ( !IS_NPC(ch) && ch->pcdata->stage[0] >= 50 )
send_to_char( "You are feeling pretty randy.\n\r", ch );
else if ( !IS_NPC(ch) && ch->pcdata->stage[0] >= 1 )
send_to_char( "You are feeling rather kinky.\n\r", ch );
if ( !IS_NPC(ch) && ch->pcdata->stage[1] > 0 && ch->position == POS_STANDING )
{
send_to_char( "You are having sexual intercourse.\n\r", ch );
if (!IS_NPC(ch) && (ch->pcdata->stage[2] + 25) >= ch->pcdata->stage[1])
send_to_char( "You are on the verge of having an orgasm.\n\r", ch );
}
else switch ( ch->position )
{
case POS_DEAD:
send_to_char( "You are DEAD!!\n\r", ch );
break;
case POS_MORTAL:
send_to_char( "You are MORTALLY WOUNDED.\n\r", ch );
break;
case POS_INCAP:
send_to_char( "You are incapacitated.\n\r", ch );
break;
case POS_STUNNED:
send_to_char( "You are stunned.\n\r", ch );
break;
case POS_SLEEPING:
send_to_char( "You are sleeping.\n\r", ch );
break;
case POS_RESTING:
send_to_char( "You are resting.\n\r", ch );
break;
case POS_MEDITATING:
send_to_char( "You are meditating.\n\r", ch );
break;
case POS_SITTING:
send_to_char( "You are sitting.\n\r", ch );
break;
case POS_STANDING:
send_to_char( "You are standing.\n\r", ch );
break;
case POS_FIGHTING:
send_to_char( "You are fighting.\n\r", ch );
break;
}
if ( ch->level >= 0 )
{
sprintf( buf, "AC: %d. ", a_c );
send_to_char( buf, ch );
}
send_to_char( "You are ", ch );
if ( a_c >= 101 ) send_to_char( "naked!\n\r", ch );
else if ( a_c >= 80 ) send_to_char( "barely clothed.\n\r", ch );
else if ( a_c >= 60 ) send_to_char( "wearing clothes.\n\r", ch );
else if ( a_c >= 40 ) send_to_char( "slightly armored.\n\r", ch );
else if ( a_c >= 20 ) send_to_char( "somewhat armored.\n\r", ch );
else if ( a_c >= 0 ) send_to_char( "armored.\n\r", ch );
else if ( a_c >= -50 ) send_to_char( "well armored.\n\r", ch );
else if ( a_c >= -100 ) send_to_char( "strongly armored.\n\r", ch );
else if ( a_c >= -250 ) send_to_char( "heavily armored.\n\r", ch );
else if ( a_c >= -500 ) send_to_char( "superbly armored.\n\r", ch );
else if ( a_c >= -749 ) send_to_char( "divinely armored.\n\r", ch );
else send_to_char( "ultimately armored!\n\r",ch );
sprintf( buf, "Hitroll: %d. Damroll: %d. Damcap: %d. ",
char_hitroll(ch), char_damroll(ch), ch->damcap[0] );
send_to_char( buf, ch );
if ( !IS_NPC(ch) && IS_CLASS(ch,CLASS_VAMPIRE) )
{
sprintf( buf, "Blood: %d.\n\r", ch->pcdata->condition[COND_THIRST] );
send_to_char( buf, ch );
sprintf( buf, "Beast: %d. ", ch->beast );
send_to_char( buf, ch );
if (ch->beast < 0 ) send_to_char("You are a cheat!\n\r",ch);
else if (ch->beast == 0 ) send_to_char("You have attained Golconda!\n\r",ch);
else if (ch->beast <= 5 ) send_to_char("You have almost reached Golconda!\n\r",ch);
else if (ch->beast <= 10) send_to_char("You are nearing Golconda!\n\r",ch);
else if (ch->beast <= 15) send_to_char("You have great control over your beast.\n\r",ch);
else if (ch->beast <= 20) send_to_char("Your beast has little influence over your actions.\n\r",ch);
else if (ch->beast <= 30) send_to_char("You are in control of your beast.\n\r",ch);
else if (ch->beast <= 40) send_to_char("You are able to hold back the beast.\n\r",ch);
else if (ch->beast <= 60) send_to_char("You are constantly struggling for control of your beast.\n\r",ch);
else if (ch->beast <= 75) send_to_char("Your beast has great control over your actions.\n\r",ch);
else if (ch->beast <= 90) send_to_char("The power of the beast overwhelms you.\n\r",ch);
else if (ch->beast <= 99) send_to_char("You have almost lost your battle with the beast!\n\r",ch);
else send_to_char("The beast has taken over!\n\r",ch);
}
else if (ch->level >= 0)
send_to_char( "\n\r", ch );
if ( ch->level >= 0 )
{
sprintf( buf, "Alignment: %d. ", ch->alignment );
send_to_char( buf, ch );
}
send_to_char( "You are ", ch );
if ( ch->alignment > 900 ) send_to_char( "angelic.\n\r", ch );
else if ( ch->alignment > 700 ) send_to_char( "saintly.\n\r", ch );
else if ( ch->alignment > 350 ) send_to_char( "good.\n\r", ch );
else if ( ch->alignment > 100 ) send_to_char( "kind.\n\r", ch );
else if ( ch->alignment > -100 ) send_to_char( "neutral.\n\r", ch );
else if ( ch->alignment > -350 ) send_to_char( "mean.\n\r", ch );
else if ( ch->alignment > -700 ) send_to_char( "evil.\n\r", ch );
else if ( ch->alignment > -900 ) send_to_char( "demonic.\n\r", ch );
else send_to_char( "satanic.\n\r", ch );
if ( !IS_NPC(ch) && ch->level >= 0 )
{
sprintf( buf, "Status: %d. ", ch->race );
send_to_char( buf, ch );
}
if (!IS_NPC(ch)) send_to_char( "You are ", ch );
if (!IS_NPC(ch) && ch->level == 1 ) send_to_char( "a Mortal.\n\r", ch);
else if (!IS_NPC(ch) && ch->level == 2 ) send_to_char( "a Mortal.\n\r", ch);
else if (!IS_NPC(ch) && ch->level == 7 ) send_to_char( "a Builder.\n\r", ch);
else if (!IS_NPC(ch) && ch->level == 8 ) send_to_char( "a Quest Maker.\n\r", ch);
else if (!IS_NPC(ch) && ch->level == 9 ) send_to_char( "an Enforcer.\n\r", ch);
else if (!IS_NPC(ch) && ch->level == 10) send_to_char( "a Judge.\n\r", ch);
else if (!IS_NPC(ch) && ch->level == 11) send_to_char( "a High Judge.\n\r", ch);
else if (!IS_NPC(ch) && ch->level == 12) send_to_char( "an Implementor.\n\r", ch);
else if (!IS_NPC(ch) && ch->race <= 0 ) send_to_char( "an Avatar.\n\r", ch);
else if (!IS_NPC(ch) && ch->race <= 10) send_to_char( "an Immortal.\n\r", ch);
else if (!IS_NPC(ch) && ch->race <= 20) send_to_char( "a Godling.\n\r", ch);
else if (!IS_NPC(ch) && ch->race <= 30) send_to_char( "a Demigod.\n\r", ch);
else if (!IS_NPC(ch) && ch->race <= 40) send_to_char( "a Lesser God.\n\r", ch);
else if (!IS_NPC(ch) && ch->race <= 50) send_to_char( "a Greater God.\n\r", ch);
else if (!IS_NPC(ch) && ch->race >= 60) send_to_char( "a Supreme God.\n\r", ch);
else if (!IS_NPC(ch) && ch->race >= 60) send_to_char( "a Ultimate God.\n\r", ch);
else if (!IS_NPC(ch)) send_to_char( "a Bugged Character!\n\r", ch);
if ( !IS_NPC(ch) )
{
if (ch->pkill == 0) sprintf(ss1,"no players");
else if (ch->pkill == 1) sprintf(ss1,"%d player",ch->pkill);
else sprintf(ss1,"%d players",ch->pkill);
if (ch->pdeath == 0) sprintf(ss2,"no players");
else if (ch->pdeath == 1) sprintf(ss2,"%d player",ch->pdeath);
else sprintf(ss2,"%d players",ch->pdeath);
sprintf( buf, "You have killed %s and have been killed by %s.\n\r", ss1, ss2 );
send_to_char( buf, ch );
if (ch->mkill == 0) sprintf(ss1,"no mobs");
else if (ch->mkill == 1) sprintf(ss1,"%d mob",ch->mkill);
else sprintf(ss1,"%d mobs",ch->mkill);
if (ch->mdeath == 0) sprintf(ss2,"no mobs");
else if (ch->mdeath == 1) sprintf(ss2,"%d mob",ch->mdeath);
else sprintf(ss2,"%d mobs",ch->mdeath);
sprintf( buf, "You have killed %s and have been killed by %s.\n\r", ss1, ss2 );
send_to_char( buf, ch );
}
if ( !IS_NPC(ch) && ch->pcdata->quest > 0)
{
if (ch->pcdata->quest == 1)
sprintf( buf, "You have a single quest point.\n\r" );
else
sprintf( buf, "You have %d quest points.\n\r", ch->pcdata->quest );
send_to_char( buf, ch );
}
if (IS_AFFECTED(ch,AFF_HIDE)) send_to_char( "You are keeping yourself hidden from those around you.\n\r", ch );
if ( !IS_NPC(ch) )
{
if ( IS_CLASS(ch,CLASS_WEREWOLF) && ch->pcdata->powers[WPOWER_SILVER] > 0)
{
sprintf(buf,"You have attained %d points of silver tolerance.\n\r",ch->pcdata->powers[WPOWER_SILVER]);
centre_text( buf, ch );
}
if ( IS_CLASS(ch, CLASS_NINJA) )
{
sprintf(buf,"You currently have %d out of 150 Ki store.\n\r",ch->pcdata->powers[NINJAKI] );
centre_text(buf,ch);
}
if ( IS_CLASS(ch,CLASS_VAMPIRE) && ch->pcdata->stats[UNI_RAGE] > 0)
{
sprintf(buf,"The beast is in control of your actions: Affects Hitroll and Damroll by +%d.\n\r",ch->pcdata->stats[UNI_RAGE]);
centre_text( buf, ch );
}
else if ( IS_SET(ch->special,SPC_WOLFMAN) && ch->pcdata->stats[UNI_RAGE] > 0)
{
sprintf(buf,"You are raging: Affects Hitroll and Damroll by +%d.\n\r",ch->pcdata->stats[UNI_RAGE]);
send_to_char( buf, ch );
}
else if ( IS_CLASS(ch,CLASS_NINJA) && ch->pcdata->stats[UNI_RAGE] > 0)
{
sprintf(buf,"Michi: Affects Hitroll and Damroll by +%d.\n\r",ch->pcdata->stats[UNI_RAGE]);
send_to_char( buf, ch );
}
else if ( IS_CLASS( ch, CLASS_DEMON) && ch->pcdata->stats[DEMON_POWER] > 0)
{
sprintf(buf,"You are wearing demonic armour: Affects Hitroll and Damroll by +%d.\n\r",
((ch->pcdata->stats[DEMON_POWER]) * ch->pcdata->stats[DEMON_POWER]));
send_to_char( buf, ch );
}
else if ( IS_SET(ch->special,SPC_CHAMPION) && ch->pcdata->stats[DEMON_POWER] > 0)
{
sprintf(buf,"You are wearing demonic armour: Affects Hitroll and Damroll by +%d.\n\r",
((ch->pcdata->stats[DEMON_POWER]) * ch->pcdata->stats[DEMON_POWER]));
send_to_char( buf, ch );
}
}
if ( ch->affected != NULL )
{
send_to_char( "You are affected by:\n\r", ch );
for ( paf = ch->affected; paf != NULL; paf = paf->next )
{
sprintf( buf, "Spell: '%s'", skill_table[paf->type].name );
send_to_char( buf, ch );
if ( ch->level >= 0 )
{
sprintf( buf,
" modifies %s by %d for %d hours with bits %s.\n\r",
affect_loc_name( paf->location ),
paf->modifier,
paf->duration,
affect_bit_name( paf->bitvector ) );
send_to_char( buf, ch );
}
}
}
return;
}
*/
void do_score( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
char ss1[MAX_STRING_LENGTH];
char ss2[MAX_STRING_LENGTH];
int a_c = char_ac(ch);
if (!IS_NPC(ch) && (IS_EXTRA(ch,EXTRA_OSWITCH) ||
IS_HEAD(ch,LOST_HEAD)))
{obj_score(ch,ch->pcdata->chobj);return;}
centre_text("---===[***The Lords of War***]===---", ch);
line(ch);
sprintf( buf,
"Name: %s, %s. Played: %d hours.", ch->name,
IS_NPC(ch) ? "" : ch->pcdata->title,
(get_age(ch) - 17) * 2 );
centre_text( buf, ch );
ADD_COLOUR( ch, buf, L_RED );
if (!IS_NPC(ch)) birth_date(ch, TRUE);
if (!IS_NPC(ch) && IS_EXTRA(ch, EXTRA_PREGNANT)) birth_date(ch,
FALSE);
line(ch);
if ( get_trust( ch ) != ch->level )
{
sprintf( buf, "Trust: %d.",
get_trust( ch ) );
centre_text( buf, ch );
}
sprintf( buf,
"Hit Points: %ld/%ld. Mana: %d/%d. Move: %d/%d.",
ch->hit, ch->max_hit,
ch->mana, ch->max_mana,
ch->move, ch->max_move);
centre_text( buf, ch );
ADD_COLOUR( ch, buf, L_CYAN );
line(ch);
sprintf( buf,
"Primal: %d. Number of items: %d/%d. Weight: %d/%d kg.",
ch->practice,
ch->carry_number, can_carry_n(ch),
ch->carry_weight, can_carry_w(ch) );
centre_text( buf, ch );
line(ch);
sprintf( buf,
"Str: %d Int: %d Wis: %d Dex: %d Con: %d.",
get_curr_str(ch),
get_curr_int(ch),
get_curr_wis(ch),
get_curr_dex(ch),
get_curr_con(ch) );
centre_text( buf, ch );
ADD_COLOUR( ch, buf, MAGENTA );
sprintf( buf,
"Experience: %d. Gold: %d.", ch->exp, ch->gold );
centre_text( buf, ch );
if (!IS_NPC(ch) && (IS_CLASS( ch, CLASS_DEMON) ||
IS_SET(ch->special,SPC_CHAMPION)))
{
sprintf( buf,
"Demon Points: %d. Total: %d.",
ch->pcdata->stats[DEMON_CURRENT], ch->pcdata->stats[DEMON_TOTAL] );
centre_text( buf, ch );
}
if (!IS_NPC(ch) && IS_CLASS(ch, CLASS_DROW)) {
sprintf( buf, "You have %d drow power points!.\n\r",
ch->pcdata->stats[DROW_POWER] );
send_to_char( buf, ch );
sprintf( buf, "You have %d points of magic resistance.\n\r",
ch->pcdata->stats[DROW_MAGIC] );
send_to_char( buf, ch ); }
sprintf( buf, "Autoexit: %s. Autoloot: %s. Autosac: %s. Wimpy: %d.",
(!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT)) ? "On" : "Off",
(!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOLOOT)) ? "On" : "Off",
(!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOSAC) ) ? "On" : "Off",
ch->wimpy );
centre_text( buf, ch );
/* if ( !IS_NPC(ch) && IS_EXTRA(ch, EXTRA_DONE) )
strcat(buf,"You are no longer a virgin.\n\r");
else strcat(buf,"n\r");
centre_text("",ch);
*/
if (!IS_NPC(ch) && (ch->pcdata->condition[COND_DRUNK] > 10 ||
ch->pcdata->condition[COND_THIRST] == 0
|| ch->pcdata->condition[COND_FULL] == 0))
send_to_char( " Condition: ", ch);
if ( !IS_NPC(ch) && ch->pcdata->condition[COND_DRUNK] > 10 )
send_to_char( "Drunk. ", ch );
if ( !IS_NPC(ch) && ch->pcdata->condition[COND_THIRST] == 0 )
send_to_char( "Thirsty. ", ch );
if ( !IS_NPC(ch) && ch->pcdata->condition[COND_FULL] == 0 )
send_to_char( "Hungry. ", ch );
if ( !IS_NPC(ch) && ch->pcdata->stage[0] >= 100 )
send_to_char( " You are feeling extremely horny.\n\r", ch
);
else if ( !IS_NPC(ch) && ch->pcdata->stage[0] >= 50 )
send_to_char( " You are feeling pretty randy.\n\r", ch );
else if ( !IS_NPC(ch) && ch->pcdata->stage[0] >= 1 )
send_to_char( " You are feeling rather kinky.\n\r", ch );
if ( !IS_NPC(ch) && ch->pcdata->stage[1] > 0 && ch->position == POS_STANDING )
{
send_to_char( " You are having sexual intercourse.\n\r", ch );
if (!IS_NPC(ch) && (ch->pcdata->stage[2] + 25) >= ch->pcdata->stage[1])
send_to_char( " You are on the verge of having an orgasm.\n\r", ch );
}
else switch ( ch->position )
{
case POS_DEAD:
send_to_char( " Position: DEAD!!\n\r", ch );
break;
case POS_MORTAL:
send_to_char( " Position: MORTALLY WOUNDED.\n\r", ch );
break;
case POS_INCAP:
send_to_char( " Position: Incapacitated.\n\r", ch );
break;
case POS_STUNNED:
send_to_char( " Position: Stunned.\n\r", ch );
break;
case POS_SLEEPING:
send_to_char( " Position: Sleeping.\n\r", ch );
break;
case POS_RESTING:
send_to_char( " Position: Resting.\n\r", ch );
break;
case POS_MEDITATING:
send_to_char( " Position: Meditating.\n\r", ch );
break;
case POS_SITTING:
send_to_char( " Position: Sitting.\n\r", ch );
break;
case POS_STANDING:
send_to_char( " Position: Standing.\n\r", ch );
break;
case POS_FIGHTING:
send_to_char( " Position: Fighting.\n\r", ch );
break;
}
if ( ch->level >= 0 )
{
line(ch);
sprintf( buf, "AC: %d. Hitroll: %d. Damroll: %d. Damcap: %d.",a_c,char_hitroll(ch),char_damroll(ch),ch->damcap[0] );
}
centre_text( buf, ch );
ADD_COLOUR( ch, buf, D_CYAN);
if ( ch->level >= 0 )
{
sprintf( buf, "Alignment: %d. ", ch->alignment );
}
if ( !IS_NPC(ch) && IS_CLASS(ch,CLASS_VAMPIRE) )
sprintf( buf, "Blood: %d. Beast: %d",
ch->pcdata->condition[COND_THIRST], ch->beast );
centre_text( buf, ch );
ADD_COLOUR( ch, buf, D_RED );
line(ch);
if ( !IS_NPC(ch) && ch->level >= 0 )
{
sprintf( buf, "Status: %d.", ch->race );
centre_text( buf, ch );
ADD_COLOUR( ch, buf, D_CYAN);
}
if (!IS_NPC(ch)) send_to_char( "", ch );
if (!IS_NPC(ch) && ch->level == 1 )
centre_text( "----====<<< You are a Newbie >>>====----", ch);
else if (!IS_NPC(ch) && ch->level == 2 )
centre_text( "----====<<< You are a Mortal >>>====----", ch);
else if (!IS_NPC(ch) && ch->level == 7 )
centre_text( "----====<<< You are a Builder >>>====----", ch);
else if (!IS_NPC(ch) && ch->level == 8 )
centre_text( "----====<<< You are a Quest Maker >>>====----", ch);
else if (!IS_NPC(ch) && ch->level == 9 )
centre_text( "----====<<< You are an Enforcer >>>====----", ch);
else if (!IS_NPC(ch) && ch->level == 10)
centre_text( "----====<<< You are a Judge >>>====----", ch);
else if (!IS_NPC(ch) && ch->level == 11)
centre_text( "----====<<< You are a High Judge >>>====----", ch);
else if (!IS_NPC(ch) && ch->level == 12)
centre_text( "----====<<< You are an Implementor >>>====----", ch);
else if (!IS_NPC(ch) && ch->level == 13)
centre_text( "----====<<< You are a Part-Owner of The Lords of War >>>====----", ch);
else if (!IS_NPC(ch) && ch->race <= 0 )
centre_text( "----====<<< You are an Avatar >>>====----", ch);
else if (!IS_NPC(ch) && ch->race <= 10)
centre_text( "----====<<< You are an Immortal >>>====----", ch);
else if (!IS_NPC(ch) && ch->race <= 20)
centre_text( "----====<<< You are a Godling >>>====----", ch);
else if (!IS_NPC(ch) && ch->race <= 30)
centre_text( "----====<<< You are a Demi-God >>>====----", ch);
else if (!IS_NPC(ch) && ch->race <= 40)
centre_text( "----====<<< You are a Lesser God >>>====----", ch);
else if (!IS_NPC(ch) && ch->race <= 50)
centre_text( "----====<<< You are a Greater God >>>====----", ch);
else if (!IS_NPC(ch) && ch->race <= 60)
centre_text( "----====<<< You are a Supreme God >>>====----", ch);
else if (!IS_NPC(ch) && ch->race <= 70)
centre_text( "----====<<< You are a Ultimate God >>>====----", ch);
else if (!IS_NPC(ch) && ch->race >= 71)
centre_text( "----====<<< You are a Ultimate God >>>====----", ch);
else if (!IS_NPC(ch))
centre_text( "----====<<< You are a Bugged Character >>>====----", ch);
line(ch);
if ( ch->fight_timer > 0 )
{
sprintf(buf,"You have %d ticks remaining on your fight timer.",ch->fight_timer);
centre_text(buf,ch);
}
else
centre_text("Your fight timer is clear.",ch);
if ( !IS_NPC(ch) )
{
if (ch->pkill == 0) sprintf(ss1,"%d ",ch->pkill);
else if (ch->pkill == 1) sprintf(ss1,"%d ",ch->pkill);
else sprintf(ss1,"%d ",ch->pkill);
if (ch->pdeath == 0) sprintf(ss2,"%d ",ch->pdeath);
else if (ch->pdeath == 1) sprintf(ss2,"%d ",ch->pdeath);
else sprintf(ss2,"%d ",ch->pdeath);
sprintf( buf, "Player Kills: %s. Player Deaths: %s.", ss1, ss2);
centre_text( buf, ch );
if (ch->mkill == 0) sprintf(ss1,"%d ",ch->mkill);
else if (ch->mkill == 1) sprintf(ss1,"%d ",ch->mkill);
else sprintf(ss1,"%d ",ch->mkill);
if (ch->mdeath == 0) sprintf(ss2,"%d ",ch->mdeath);
else if (ch->mdeath == 1) sprintf(ss2,"%d ",ch->mdeath);
else sprintf(ss2,"%d ",ch->mdeath);
sprintf( buf, "Mob Kills: %s. Mob Deaths: %s.", ss1, ss2 );
centre_text( buf, ch );
}
line(ch);
if ( IS_CLASS(ch, CLASS_WEREWOLF) )
{
sprintf(buf,"You have %d/%d Gnosis Points",ch->gnosis[GCURRENT], ch->gnosis[GMAXIMUM] );
centre_text(buf,ch);
line(ch);
}
if ( !IS_NPC(ch) && ch->pcdata->quest > 0)
{
if (ch->pcdata->quest == 1)
{
sprintf( buf, "Quest Point: 1." );
}
else
{
sprintf( buf, "Quest Points: %d.", ch->pcdata->quest );
}
centre_text( buf, ch );
ADD_COLOUR( ch, buf, L_GREEN );
}
if (IS_AFFECTED(ch,AFF_HIDE)) send_to_char( " You are keeping yourself Hidden.\n\r", ch );
if (IS_CLASS(ch, CLASS_NINJA) && ch->pcdata->stats[UNI_RAGE] > 0)
{
sprintf(buf,"Your michi gives you an extra %d hitroll and damroll.\n\r", ch->pcdata->stats[UNI_RAGE]);
send_to_char(buf,ch);
}
if (IS_CLASS(ch, CLASS_NINJA) && ch->pcdata->powers[NPOWER_CHIKYU] >= 6
&& ch->pcdata->powers[HARA_KIRI] > 0) {
sprintf(buf,"You receive the power of HaraKiri for %d more ticks.\n\r",ch->pcdata->powers[HARA_KIRI]);
send_to_char(buf,ch);
}
if ( !IS_NPC(ch) )
{
if ( IS_CLASS(ch,CLASS_WEREWOLF) &&
ch->pcdata->powers[WPOWER_SILVER] > 0)
{
line(ch);
sprintf(buf," Silver Tolerance: %d..\n\r",ch->pcdata->powers[WPOWER_SILVER]);
send_to_char( buf, ch );
}
if ( IS_CLASS(ch,CLASS_VAMPIRE) && ch->pcdata->stats[UNI_RAGE] >
0)
{
line(ch);
sprintf(buf," Beasting: Affects Hitroll and Damroll by +%d.\n\r",ch->pcdata->stats[UNI_RAGE]);
send_to_char( buf, ch );
}
else if ( IS_SET(ch->special,SPC_WOLFMAN) &&
ch->pcdata->stats[UNI_RAGE] > 0)
{
line(ch);
sprintf(buf," Rage: Affects Hitroll and Damroll by +%d.\n\r",ch->pcdata->stats[UNI_RAGE]);
send_to_char( buf, ch );
}
else if ( IS_CLASS(ch,CLASS_NINJA) && ch->pcdata->stats[UNI_RAGE]
> 0)
{
sprintf(buf,"Michi: Affects Hitroll and Damroll by +%d.\n\r",ch->pcdata->stats[UNI_RAGE]);
send_to_char( buf, ch );
}
else if ( IS_CLASS( ch, CLASS_DEMON) &&
ch->pcdata->stats[DEMON_POWER] > 0)
{
line(ch);
sprintf(buf," Demonic eq : Affecting Hitroll and Damroll by +%d.\n\r", ((ch->pcdata->stats[DEMON_POWER]) *
ch->pcdata->stats[DEMON_POWER]));
send_to_char( buf, ch );
}
else if ( IS_SET(ch->special,SPC_CHAMPION) &&
ch->pcdata->stats[DEMON_POWER] > 0)
{
line(ch);
sprintf(buf," Demonic eq : Affecting Hitroll and Damroll by +%d.\n\r",((ch->pcdata->stats[DEMON_POWER]) *
ch->pcdata->stats[DEMON_POWER]));
send_to_char( buf, ch );
}
}
line(ch);
/*
centre_text("---===[***SCORE SHEET***]===---",ch);
*/
return;
}
char * const day_name [] =
{
"the Moon", "the Bull", "Deception", "Thunder", "Freedom",
"the Great Gods", "the Sun"
};
char * const month_name [] =
{
"Winter", "the Winter Wolf", "the Frost Giant", "the Old Forces",
"the Grand Struggle", "the Spring", "Nature", "Futility", "the Dragon",
"the Sun", "the Heat", "the Battle", "the Dark Shades", "the Shadows",
"the Long Shadows", "the Ancient Darkness", "the Great Evil"
};
void do_time( CHAR_DATA *ch, char *argument )
{
extern char str_boot_time[];
char buf[MAX_STRING_LENGTH];
char *suf;
int day;
day = time_info.day + 1;
if ( day > 4 && day < 20 ) suf = "th";
else if ( day % 10 == 1 ) suf = "st";
else if ( day % 10 == 2 ) suf = "nd";
else if ( day % 10 == 3 ) suf = "rd";
else suf = "th";
sprintf( buf,
"It is %d o'clock %s, Day of %s, %d%s the Month of %s.\n\rGod Wars started up at %s\rThe system time is %s\r",
(time_info.hour % 12 == 0) ? 12 : time_info.hour % 12,
time_info.hour >= 12 ? "pm" : "am",
day_name[day % 7],
day, suf,
month_name[time_info.month],
str_boot_time,
(char *) ctime( ¤t_time )
);
send_to_char( buf, ch );
return;
}
void do_phase(CHAR_DATA *ch, char *argument)
{
if (!IS_OUTSIDE(ch))
{
send_to_char("You can't see the moon indoors.\n\r", ch);
return;
}
/*
* Werewolves can sence the moonphases anytime
*/
if (weather_info.moonlight == MOON_DOWN && IS_CLASS(ch, CLASS_WEREWOLF))
{
send_to_char("The moon is not up.\n\r", ch);
return;
}
if (weather_info.moonphase == MOON_NEW)
{
send_to_char("The moon is new.\n\r", ch);
return;
}
if (weather_info.moonphase == MOON_CRESCENT)
{
send_to_char("The moon is crescent.\n\r", ch);
return;
}
if (weather_info.moonphase == MOON_HALF)
{
send_to_char("The moon is half tonight.\n\r", ch);
return;
}
if (weather_info.moonphase == MOON_GIBBOUS)
{
send_to_char("The moon is in its gibbous phase.\n\r", ch);
return;
}
if (weather_info.moonphase == MOON_FULL)
{
send_to_char("The moon is full tonight.\n\r", ch);
return;
}
if (weather_info.moonphase == MOON_WANING)
{
send_to_char("The moon is waning.\n\r", ch);
return;
}
else
{
send_to_char("bug, please inform an implementor.\n\r", ch);
return;
}
}
void do_weather(CHAR_DATA *ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
static char * const sky_look[4] =
{
"cloudless",
"cloudy",
"rainy",
"lit by flashes of lightning"
};
if (!IS_OUTSIDE(ch))
{
send_to_char("You can't see the weather indoors.\n\r", ch);
return;
}
if (IS_SET(world_affects, WORLD_ECLIPSE))
send_to_char("The sun is eclipsed by the moon.\n\r", ch);
if (IS_SET(world_affects, WORLD_FOG))
send_to_char("A thick blanket of fog covers the ground.\n\r", ch);
if (IS_SET(world_affects, WORLD_RAIN))
{
sprintf(buf, "The sky is pouring with a heavy rain and %s.\n\r",
weather_info.change >= 0
? "a warm southerly breeze blows"
: "a cold northern gust blows"
);
send_to_char(buf, ch);
return;
}
sprintf(buf, "The sky is %s and %s.\n\r",
sky_look[weather_info.sky],
weather_info.change >= 0
? "a warm southerly breeze blows"
: "a cold northern gust blows"
);
send_to_char(buf, ch);
return;
}
void do_help( CHAR_DATA *ch, char *argument )
{
char argall[MAX_INPUT_LENGTH];
char argone[MAX_INPUT_LENGTH];
HELP_DATA *pHelp;
if ( argument[0] == '\0' )
argument = "summary";
/*
* Tricky argument handling so 'help a b' doesn't match a.
*/
argall[0] = '\0';
while ( argument[0] != '\0' )
{
argument = one_argument( argument, argone );
if ( argall[0] != '\0' )
strcat( argall, " " );
strcat( argall, argone );
}
for ( pHelp = help_first; pHelp != NULL; pHelp = pHelp->next )
{
if ( pHelp->level > get_trust( ch ) )
continue;
if ( is_name( argall, pHelp->keyword ) )
{
if ( pHelp->level >= 0 && str_cmp( argall, "imotd" ) )
{
send_to_char( pHelp->keyword, ch );
send_to_char( "\n\r", ch );
}
/*
* Strip leading '.' to allow initial blanks.
*/
if ( pHelp->text[0] == '.' )
send_to_char( pHelp->text+1, ch );
else
send_to_char( pHelp->text , ch );
return;
}
}
send_to_char( "No help on that word.\n\r", ch );
return;
}
int col_str_len(char *txt)
{
int pos, len;
len = 0;
for (pos = 0; txt[pos] != '\0'; pos++)
{
if (txt[pos] == '{')
pos ++;
else
len++;
continue;
}
return len;
}
void cent_to_char(char *txt, CHAR_DATA *ch)
{
int len,pos;
char buf[MAX_STRING_LENGTH];
len = (80 - col_str_len(txt)) / 2;
for (pos = 0; pos < len; pos++)
{
buf[pos] = ' ';
}
buf[pos]= '\0';
send_to_char(buf, ch);
send_to_char(txt, ch);
send_to_char("\n\r",ch);
}
void divide_to_char(CHAR_DATA *ch)
{
send_to_char("-------------------------------------------------------------------------------\r\n",
ch); }
void divide2_to_char(CHAR_DATA *ch)
{
send_to_char("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\r\n",
ch); }
void divide3_to_char(CHAR_DATA *ch)
{
send_to_char("===============================================================================\r\n",ch);
}
void divide4_to_char(CHAR_DATA *ch)
{
send_to_char("-=[**]=-=[**]=-=[**]=-=[**]=-=[**]=-=[***]=-=[**]=-=[**]=-=[**]=-=[**]=-=[**]=-\r\n",ch);
}
void divide5_to_char(CHAR_DATA *ch)
{
cent_to_char("-=[***********]=-------------=[***********]=-",ch);
}
void divide6_to_char(CHAR_DATA *ch)
{
cent_to_char("- - - - - -- ---====*====--- -- - - - - -",ch);
}
void banner_to_char(char *txt, CHAR_DATA *ch)
{
char buf[MAX_STRING_LENGTH];
int loop,wdth,ln;
ln = strlen(txt);
if (ln > 16)
{
sprintf(buf, "-=[**]=-=[**]=-=[**]=-=[ ]=-=[**]=-=[**]=-=[**]=-");
wdth = (31 - ln) / 2 + 20;
}
else
{
sprintf(buf,
"-=[**]=-=[**]=-=[**]=-=[**]=-=[ ]=-=[**]=-=[**]=-=[**]=-=[**]=-");
wdth = (16 - ln) / 2 + 32;
}
for (loop = 0; loop < ln; loop++)
buf[loop + wdth + 22] = txt[loop];
cent_to_char(buf,ch);
}
void banner2_to_char(char *txt, CHAR_DATA *ch)
{
char buf[MAX_STRING_LENGTH];
int loop,wdth,ln;
ln = strlen(txt);
if (ln > 16)
{
sprintf(buf, " - - - - -- ---=== ===--- -- - - - -\r\n");
wdth = (31 - ln) / 2 + 24;
}
else
{
sprintf(buf, " - - - - - -- ---==== ====--- -- - - - - -\r\n");
wdth = (16 - ln) / 2 + 32;
}
for (loop = 0; loop < ln; loop++)
buf[loop + wdth + 6] = txt[loop];
send_to_char(buf,ch);
}
/*
* New 'who' command originally by Alander of Rivers of Mud.
*/
void do_who( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH];
char mort[MAX_STRING_LENGTH];
char avat[MAX_STRING_LENGTH];
char a1[MSL];
char a2[MSL];
char a3[MSL];
char a4[MSL];
char a5[MSL];
char a6[MSL];
char a7[MSL];
char a0[MSL];
char immo[MAX_STRING_LENGTH];
char kav[MAX_STRING_LENGTH];
char bty[MAX_STRING_LENGTH];
char openb[5];
char namething[MSL];
char closeb[5];
DESCRIPTOR_DATA *d;
int iLevelLower;
int iLevelUpper;
int nNumber;
int nMatch;
int mor, ava, imm;
bool fClassRestrict;
bool fImmortalOnly;
if (IS_NPC(ch)) return;
/*
* Set default arguments.
*/
iLevelLower = 0;
iLevelUpper = MAX_LEVEL +1;
fClassRestrict = FALSE;
fImmortalOnly = FALSE;
/*
* Parse arguments.
*/
nNumber = 0;
for ( ;; )
{
char arg[MAX_STRING_LENGTH];
argument = one_argument( argument, arg );
if ( arg[0] == '\0' )
break;
if ( is_number( arg ) )
{
send_to_char("Enter 'Avatar' for level 3's, or 'God' for level 4's and 5's.\n\r",ch);
return;
}
else
{
/*
* Look for classes to turn on.
*/
arg[3] = '\0';
if ( !str_cmp( arg, "imm" ) || !str_cmp( arg, "immortal" )
|| !str_cmp( arg, "ava" ) || !str_cmp( arg, "avatar" ) )
{
fClassRestrict = TRUE;
}
else if ( !str_cmp( arg, "god" ) || !str_cmp( arg, "imp" ) )
{
fImmortalOnly = TRUE;
}
else
{
send_to_char("Enter 'Avatar' for level 3's, or 'God' for level 4's and 5's.\n\r",ch);
return;
}
}
}
/*
* Now show matching chars.
*/
nMatch = 0;
buf[0] = '\0';
mort[0] = '\0';
avat[0] = '\0';
immo[0] = '\0';
a1[0] = '\0';
a2[0] = '\0';
a3[0] = '\0';
a4[0] = '\0';
a5[0] = '\0';
a6[0] = '\0';
a7[0] = '\0';
a0[0] = '\0';
mor = ava = imm = 0;
for ( d = descriptor_list; d != NULL; d = d->next )
{
CHAR_DATA *wch;
char const *class;
char const *lstatus;
/*
* Check for match against restrictions.
* Don't use trust as that exposes trusted mortals.
*/
if ( d->connected != CON_PLAYING || (!can_see( ch, d->character ) && (!IS_SET(ch->act, PLR_WATCHER)) ) )
continue;
wch = ( d->original != NULL ) ? d->original : d->character;
if ( wch->level < iLevelLower
|| wch->level > iLevelUpper
|| ( fImmortalOnly && wch->level < LEVEL_IMMORTAL )
|| ( fClassRestrict && wch->level != LEVEL_HERO ) )
continue;
nMatch++;
/*
* Figure out what to print for class.
*/
class = " ";
lstatus = " ";
switch( wch->lstatus )
{
default: lstatus = "{CUnknown {x"; break;
case L_CIT: lstatus = "{CCitizen {x"; break;
case L_LEG: lstatus = "{CLegend {x"; break;
case L_MYT: lstatus = "{CMyth {x"; break;
case L_TIT: lstatus = "{CTitan {x"; break;
case L_ORA: lstatus = "{COracle {x"; break;
case L_IMM: lstatus = "{CImmortal{x"; break;
case L_DEM: lstatus = "{CDemigod {x"; break;
case L_DEI: lstatus = "{CDeity {x"; break;
case L_ALM: lstatus = "{CAlmighty{x"; break;
}
if ((IS_HEAD(wch,LOST_HEAD) || IS_EXTRA(wch,EXTRA_OSWITCH)) && wch->pcdata->chobj != NULL)
{
if (wch->pcdata->chobj->pIndexData->vnum == 12)
lstatus = " A Head ";
else if (wch->pcdata->chobj->pIndexData->vnum == 30005)
lstatus = "A Brain ";
else
lstatus = "-Object-";
}
switch ( wch->level )
{
default: break;
case MAX_LEVEL - 0: class = "{bImplementor{x"; break;
case MAX_LEVEL - 1: class = "{b HighJudge {x"; break;
case MAX_LEVEL - 2: class = "{b Judge {x"; break;
case MAX_LEVEL - 3: class = "{b Enforcer {x"; break;
case MAX_LEVEL - 4: class = "{bQuest Maker{x"; break;
case MAX_LEVEL - 5: class = "{b Builder {x"; break;
case MAX_LEVEL - 6:
case MAX_LEVEL - 7:
case MAX_LEVEL - 8:
case MAX_LEVEL - 9:
if (wch->race <= 0 ) class = "{rAVA{x";
else if (wch->race <= 10) class = "{rIMM{x";
else if (wch->race <= 20) class = "{rGDL{x";
else if (wch->race <= 30) class = "{rDMG{x";
else if (wch->race <= 40) class = "{rLSG{x";
else if (wch->race <= 50) class = "{rGGD{x";
else if (wch->race <= 60) class = "{rSUP{x";
else if (wch->race <= 70) class = "{rULT{x";
else class = "{rULT{x"; break;
case MAX_LEVEL - 10: class = "{YMOR{x"; break;
case MAX_LEVEL - 11: class = "{YMOR{x"; break;
case MAX_LEVEL - 12: class = "{YNEW{x"; break;
}
/*
* Format it up.
*/
if ( IS_CLASS(wch, CLASS_VAMPIRE))
{ strcpy( openb, "{r<" ); strcpy( closeb, ">{x" ); }
else if ( IS_CLASS(wch, CLASS_WEREWOLF))
{ strcpy( openb, "{y(" ); strcpy( closeb, "){x" ); }
else if ( IS_CLASS(wch, CLASS_MAGE))
{ strcpy( openb, "{B(<" ); strcpy( closeb, ">){x" ); }
else if ( IS_CLASS(wch, CLASS_HIGHLANDER))
{ strcpy( openb, "{C-=" ); strcpy( closeb, "=-{x" ); }
else if ( IS_CLASS(wch, CLASS_NINJA))
{ strcpy( openb, "{m**" ); strcpy( closeb, "**{x" ); }
else if ( IS_CLASS(wch, CLASS_MONK))
{ strcpy( openb, "{g<:" ); strcpy( closeb, ":>{x" ); }
else if ( IS_CLASS(wch, CLASS_DRAGON) )
{ strcpy( openb, "{M(=" ); strcpy( closeb, "=){x" ); }
else if ( IS_CLASS(wch, CLASS_ELADRIN) )
{ strcpy( openb, "{G==)"); strcpy( closeb, "(=={x" ); }
else if ( IS_CLASS(wch, CLASS_DROW))
{ strcpy( openb, "{b.o0 "); strcpy(closeb, " 0o.{x" ); }
else
{ strcpy( openb, "{R[" ); strcpy( closeb, "]{x" ); }
if ( ch->class > 0 || IS_IMMORTAL( ch ))
{
if ( IS_CLASS(wch, CLASS_DEMON) && IS_SET(wch->special, SPC_DEMON_LORD) )
sprintf( kav, "%sDemon Lord of %s%s", openb, wch->clan, closeb );
else if ( IS_SET(wch->special, SPC_CHAMPION) )
{
if (IS_SET(wch->special, SPC_PRINCE) && wch->sex == SEX_FEMALE)
sprintf( kav, "%sDemon Princess of %s%s", openb, wch->clan,closeb );
else if (IS_SET(wch->special, SPC_PRINCE))
sprintf( kav, "%sDemon Prince of %s%s", openb,wch->clan,closeb );
else if (IS_SET(wch->special, SPC_SIRE))
sprintf( kav, "%sDemon of %s%s", openb,wch->clan,closeb );
else
sprintf( kav, "%sChampion of %s%s", openb,wch->clan,closeb );
}
else if ( IS_CLASS(wch, CLASS_VAMPIRE) && wch->pcdata->stats[UNI_GEN] == 1 )
sprintf( kav, "%sMaster Vampire%s", openb, closeb );
else if (IS_CLASS(wch, CLASS_WEREWOLF) && wch->pcdata->stats[UNI_GEN] == 1 )
sprintf( kav, "%sMaster Werewolf%s", openb, closeb );
else if (IS_CLASS(wch, CLASS_NINJA) && wch->pcdata->stats[UNI_GEN] == 1 )
sprintf( kav, "%sMaster Ninja%s", openb, closeb );
else if (IS_CLASS(wch, CLASS_MONK) && wch->pcdata->stats[UNI_GEN] == 1 )
sprintf( kav, "%sGod's Abbot%s", openb, closeb );
else if (IS_CLASS(wch, CLASS_DROW) && wch->pcdata->stats[UNI_GEN] == 1 )
sprintf( kav, "%sLloth's Avatar%s", openb, closeb );
else if ( IS_CLASS(wch, CLASS_VAMPIRE) && wch->clan != NULL )
{
bool get_age = FALSE;
char clanname[20];
if (IS_SET(wch->special, SPC_INCONNU))
get_age = TRUE;
else if (IS_SET(wch->special, SPC_ANARCH))
get_age = TRUE;
else if (strlen(wch->clan) < 2)
get_age = TRUE;
else if (wch->pcdata->stats[UNI_GEN] == 2)
sprintf( kav, "%sFounder of %s%s", openb, wch->clan, closeb );
else if (IS_SET(wch->special, SPC_PRINCE) && wch->sex == SEX_FEMALE)
sprintf( kav, "%s%s Princess%s", openb, wch->clan, closeb );
else if (IS_SET(wch->special, SPC_PRINCE))
sprintf( kav, "%s%s Prince%s", openb, wch->clan, closeb );
else get_age = TRUE;
if (get_age)
{
if (IS_SET(wch->special, SPC_INCONNU))
strcpy( clanname, "Inconnu" );
else if (IS_SET(wch->special, SPC_ANARCH))
strcpy( clanname, "Anarch" );
else if (strlen(wch->clan) < 2)
strcpy( clanname, "Caitiff" );
else
strcpy( clanname, wch->clan );
if (wch->pcdata->stats[UNI_GEN] == 2)
sprintf( kav, "%s%s Antediluvian%s", openb, clanname, closeb );
else switch ( wch->pcdata->rank )
{
default:
sprintf( kav, "%s%s Childe%s", openb, clanname, closeb );
break;
case AGE_NEONATE:
sprintf( kav, "%s%s Neonate%s", openb, clanname, closeb );
break;
case AGE_ANCILLA:
sprintf( kav, "%s%s Ancilla%s", openb, clanname, closeb );
break;
case AGE_ELDER:
sprintf( kav, "%s%s Elder%s", openb, clanname, closeb );
break;
case AGE_METHUSELAH:
sprintf( kav, "%s%s Methuselah%s", openb, clanname, closeb );
break;
}
}
}
else if ( IS_CLASS(wch, CLASS_WEREWOLF)
&& wch->clan != NULL && strlen(wch->clan) > 1 )
{
if (wch->pcdata->stats[UNI_GEN] == 2)
sprintf( kav, "%s%s Chief%s", openb, wch->clan, closeb );
else if (IS_SET(wch->special, SPC_PRINCE))
sprintf( kav, "%s%s Shaman%s", openb, wch->clan, closeb );
else
sprintf( kav, "%s%s%s", openb, wch->clan, closeb );
}
else if ( IS_CLASS(wch, CLASS_WEREWOLF)
&& wch->clan != NULL && strlen(wch->clan) < 1 )
sprintf( kav, "%sRonin%s", openb, closeb );
else if ( IS_CLASS(wch, CLASS_DRAGON) )
{
if ( wch->pcdata->disc_a[DRAGON_AGE] == D_ANCIENT )
sprintf( kav, "%sAncient %s Dragon%s", openb, dcolor[wch->pcdata->disc_a[DRAGON_COLOR]], closeb );
else if ( wch->pcdata->disc_a[DRAGON_AGE] == D_ELDER )
sprintf( kav, "%sElder %s Dragon%s", openb, dcolor[wch->pcdata->disc_a[DRAGON_COLOR]], closeb );
else if ( wch->pcdata->disc_a[DRAGON_AGE] == D_ADULT )
sprintf( kav, "%sAdult %s Dragon%s", openb, dcolor[wch->pcdata->disc_a[DRAGON_COLOR]], closeb );
else if ( wch->pcdata->disc_a[DRAGON_AGE] == D_YADULT )
sprintf( kav, "%sYoung Adult %s Dragon%s", openb, dcolor[wch->pcdata->disc_a[DRAGON_COLOR]], closeb );
else if ( wch->pcdata->disc_a[DRAGON_AGE] == D_JUVENILE )
sprintf( kav, "%sJuvenile %s Dragon%s", openb, dcolor[wch->pcdata->disc_a[DRAGON_COLOR]], closeb );
else if ( wch->pcdata->disc_a[DRAGON_AGE] == D_HATCHLING )
sprintf( kav, "%sHatchling %s Dragon%s", openb, dcolor[wch->pcdata->disc_a[DRAGON_COLOR]], closeb );
else
sprintf( kav, "%s%s Dragon%s", openb, dcolor[wch->pcdata->disc_a[DRAGON_COLOR]], closeb );
}
else if ( IS_CLASS(wch, CLASS_DROW)
&& wch->clan != NULL && strlen(wch->clan) > 1 ) {
if (wch->pcdata->stats[UNI_GEN] == 2)
sprintf(kav,"%s%s Matron%s", openb, wch->clan, closeb );
else if (IS_SET(wch->special, SPC_DROW_WAR))
sprintf(kav, "%s%s Warrior%s", openb, wch->clan, closeb );
else if (IS_SET(wch->special, SPC_DROW_CLE))
sprintf(kav, "%s%s Cleric%s", openb, wch->clan, closeb );
else if (IS_SET(wch->special, SPC_DROW_MAG))
sprintf(kav, "%s%s Mage%s", openb, wch->clan, closeb );
else sprintf(kav, "%s%s Drow%s", openb, wch->clan, closeb);
}
else if ( IS_CLASS(wch, CLASS_MONK)
&& wch->clan != NULL && strlen(wch->clan) > 1 )
{
if (wch->pcdata->stats[UNI_GEN] == 2)
sprintf( kav, "%sAbbot of %s%s", openb, wch->clan, closeb );
else
sprintf( kav, "%s%s Monk%s", openb, wch->clan, closeb );
}
else if ( IS_CLASS(wch, CLASS_MONK)
&& wch->clan != NULL && strlen(wch->clan) < 1 )
sprintf( kav, "%sMonk Outcast%s", openb, closeb );
else if ( IS_CLASS(wch, CLASS_MAGE) )
{
if ( strlen(wch->clan) > 2 )
sprintf(kav, "%s%s%s",openb,wch->clan,closeb);
else
sprintf(kav, "%sHollow Ones%s",openb,closeb);
}
else if (IS_CLASS(wch, CLASS_MOOGLE))
{
sprintf(kav, "%sMoogle%s", openb, closeb);
}
else if ( IS_CLASS(wch, CLASS_HIGHLANDER) )
{
sprintf( kav, "%sHighlander%s", openb, closeb);
}
else if ( IS_CLASS(wch, CLASS_PALADIN) )
{
sprintf( kav, "%sPaladin%s", openb, closeb);
}
else if ( IS_CLASS(wch, CLASS_NINJA)
&& wch->clan != NULL && strlen(wch->clan) > 1 )
{
if (wch->pcdata->stats[UNI_GEN] == 2)
sprintf( kav, "%sLeader of %s%s", openb, wch->clan, closeb );
else if (IS_SET(wch->special, SPC_PRINCE))
sprintf( kav, "%sChunin of %s%s", openb, wch->clan, closeb );
else
sprintf( kav, "%sGenin of %s%s", openb, wch->clan, closeb );
}
else if ( IS_CLASS(wch, CLASS_NINJA)
&& wch->clan != NULL && strlen(wch->clan) < 1)
{
if (wch->pcdata->stats[UNI_GEN] == 2)
sprintf( kav, "%sNinja Leader%s", openb, closeb );
else if (IS_SET(wch->special, SPC_PRINCE))
sprintf( kav, "%sChunin Ninja%s", openb, closeb );
else if (IS_SET(wch->special, SPC_ROGUE))
sprintf( kav, "%sRogue Ninja%s", openb, closeb );
else
sprintf( kav, "%sNinja Outcast%s", openb, closeb );
}
else
strcpy( kav, "" );
}
else
strcpy( kav, "" );
if (wch->pcdata->bounty > 0)
sprintf( bty, "%d", wch->pcdata->bounty);
else
strcpy( bty, " ");
sprintf(namething,"%s%s",wch->name,wch->pcdata->title);
if ( wch->level > 6 )
{
sprintf( immo + strlen(immo), "{B[{x%s{B]{x %s%s\n\r",
class,
wch->name,
wch->pcdata->title);
imm++;
}
else if ( wch->level > 2 && wch->level < 7 )
{
sprintf( a0 + strlen(a0), "{B[{x%s{B]{x {B[{x%s{B]{x %s %-30s %s\n\r",
class,
lstatus,
bty,
namething,
kav );
//ADDKINGDOMS remove the below comment comment kav ); out.
// king_table[wch->pcdata->kingdom].who_name );
ava++;
}
else
{
sprintf( mort + strlen(mort), "{B[%s{B]{x %s\n\r",
class,
namething );
mor++;
}
}
stc("\n\r",ch);
stc("{b---------------------------={r[**] The Lords of War [**]{b=-------------------------{x\n\r",ch);
if ( imm > 0 )
{
if ( imm > 1 )
sprintf(buf, "{b----------------------------={r[**] %d Immortals [**]{b=-----------------------------{x\n\r",imm );
else
sprintf(buf, "{b-----------------------------={x{r[**] 1 Immortal [**]{x{b=-----------------------------{x\n\r");
stc(buf,ch);
stc(immo,ch);
}
if ( ava > 0 )
{
if ( ava > 1 )
sprintf(buf, "{b-----------------------------={x{r[**] %d Avatars [**]{x{b=------------------------------{x\n\r",ava);
else
sprintf(buf, "{b-----------------------------={x{r[**] One Avatar [**]{x{b=----------------------------{x\n\r");
stc(buf,ch);
stc(a0,ch);
}
if ( mor > 0 )
{
if ( mor > 1 )
sprintf(buf, "{b----------------------------={x{r[**] %d Mortals [**]{x{b=-------------------------------{x\n\r",mor);
else
sprintf(buf, "{b----------------------------={x{r[**] One Mortal [**]{x{b=------------------------------{x\n\r");
stc(buf,ch);
stc(mort,ch);
}
if (nMatch == 1)
sprintf( buf2, "You are the only visible player connected!\n\r");
else
sprintf( buf2, "There are a total of %d visible players connected.\n\r", nMatch);
send_to_char("{b--------------------------------------------------------------------------------{x\n\r", ch );
send_to_char( buf2, ch );
send_to_char("{b--------------------------------------------------------------------------------{x\n\r",ch );
return;
}
void do_inventory( CHAR_DATA *ch, char *argument )
{
char buf[MAX_INPUT_LENGTH];
OBJ_DATA *obj;
OBJ_DATA *portal;
OBJ_DATA *portal_next;
ROOM_INDEX_DATA *pRoomIndex;
ROOM_INDEX_DATA *location;
bool found;
if (!IS_NPC(ch) && IS_HEAD(ch,LOST_HEAD))
{send_to_char( "You are not a container.\n\r", ch ); return;}
else if (!IS_NPC(ch) && IS_EXTRA(ch,EXTRA_OSWITCH))
{
if ( !IS_NPC(ch) && (obj = ch->pcdata->chobj) == NULL)
{send_to_char( "You are not a container.\n\r", ch ); return;}
switch ( obj->item_type )
{
default:
send_to_char( "You are not a container.\n\r", ch );
break;
case ITEM_PORTAL:
pRoomIndex = get_room_index(obj->value[0]);
location = ch->in_room;
if ( pRoomIndex == NULL )
{
send_to_char( "You don't seem to lead anywhere.\n\r", ch );
return;
}
char_from_room(ch);
char_to_room(ch,pRoomIndex);
found = FALSE;
for ( portal = ch->in_room->contents; portal != NULL; portal = portal_next )
{
portal_next = portal->next_content;
if ( ( obj->value[0] == portal->value[3] )
&& (obj->value[3] == portal->value[0]) )
{
found = TRUE;
if (IS_AFFECTED(ch, AFF_SHADOWPLANE) &&
!IS_SET(portal->extra_flags, ITEM_SHADOWPLANE) )
{
REMOVE_BIT(ch->affected_by, AFF_SHADOWPLANE);
do_look(ch,"auto");
SET_BIT(ch->affected_by, AFF_SHADOWPLANE);
break;
}
else if (!IS_AFFECTED(ch, AFF_SHADOWPLANE) &&
IS_SET(portal->extra_flags, ITEM_SHADOWPLANE) )
{
SET_BIT(ch->affected_by, AFF_SHADOWPLANE);
do_look(ch,"auto");
REMOVE_BIT(ch->affected_by, AFF_SHADOWPLANE);
break;
}
else
{
do_look(ch,"auto");
break;
}
}
}
char_from_room(ch);
char_to_room(ch,location);
break;
case ITEM_DRINK_CON:
if ( obj->value[1] <= 0 )
{
send_to_char( "You are empty.\n\r", ch );
break;
}
if (obj->value[1] < obj->value[0] / 5)
sprintf( buf, "There is a little %s liquid left in you.\n\r",liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0] / 4)
sprintf( buf, "You contain a small about of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0] / 3)
sprintf( buf, "You're about a third full of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0] / 2)
sprintf( buf, "You're about half full of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0])
sprintf( buf, "You are almost full of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
else if (obj->value[1] == obj->value[0])
sprintf( buf, "You're completely full of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
else
sprintf( buf, "Somehow you are MORE than full of %s liquid.\n\r",liq_table[obj->value[2]].liq_color);
send_to_char( buf, ch );
break;
case ITEM_CONTAINER:
case ITEM_CORPSE_NPC:
case ITEM_CORPSE_PC:
act( "$p contain:", ch, obj, NULL, TO_CHAR );
show_list_to_char( obj->contains, ch, TRUE, TRUE );
break;
}
return;
}
send_to_char( "You are carrying:\n\r", ch );
show_list_to_char( ch->carrying, ch, TRUE, TRUE );
return;
}
void do_equipment( CHAR_DATA *ch, char *argument )
{
OBJ_DATA *obj;
int iWear;
bool found;
send_to_char( "You are using:\n\r", ch );
found = FALSE;
for ( iWear = 0; iWear < MAX_WEAR; iWear++ )
{
if ( ( obj = get_eq_char( ch, iWear ) ) == NULL )
continue;
send_to_char( where_name[iWear], ch );
if ( can_see_obj( ch, obj ) )
{
send_to_char( format_obj_to_char( obj, ch, TRUE ), ch );
send_to_char( "\n\r", ch );
}
else
{
send_to_char( "something.\n\r", ch );
}
found = TRUE;
}
if ( !found )
send_to_char( "Nothing.\n\r", ch );
return;
}
void do_compare( CHAR_DATA *ch, char *argument )
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
OBJ_DATA *obj1;
OBJ_DATA *obj2;
int value1;
int value2;
char *msg;
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
if ( arg1[0] == '\0' )
{
send_to_char( "Compare what to what?\n\r", ch );
return;
}
if ( ( obj1 = get_obj_carry( ch, arg1 ) ) == NULL )
{
send_to_char( "You do not have that item.\n\r", ch );
return;
}
if ( arg2[0] == '\0' )
{
for ( obj2 = ch->carrying; obj2 != NULL; obj2 = obj2->next_content )
{
if ( obj2->wear_loc != WEAR_NONE
&& can_see_obj( ch, obj2 )
&& obj1->item_type == obj2->item_type
&& ( obj1->wear_flags & obj2->wear_flags & ~ITEM_TAKE) != 0 )
break;
}
if ( obj2 == NULL )
{
send_to_char( "You aren't wearing anything comparable.\n\r", ch );
return;
}
}
else
{
if ( ( obj2 = get_obj_carry( ch, arg2 ) ) == NULL )
{
send_to_char( "You do not have that item.\n\r", ch );
return;
}
}
msg = NULL;
value1 = 0;
value2 = 0;
if ( obj1 == obj2 )
{
msg = "You compare $p to itself. It looks about the same.";
}
else if ( obj1->item_type != obj2->item_type )
{
msg = "You can't compare $p and $P.";
}
else
{
switch ( obj1->item_type )
{
default:
msg = "You can't compare $p and $P.";
break;
case ITEM_ARMOR:
value1 = obj1->value[0];
value2 = obj2->value[0];
break;
case ITEM_WEAPON:
value1 = obj1->value[1] + obj1->value[2];
value2 = obj2->value[1] + obj2->value[2];
break;
}
}
if ( msg == NULL )
{
if ( value1 == value2 ) msg = "$p and $P look about the same.";
else if ( value1 > value2 ) msg = "$p looks better than $P.";
else msg = "$p looks worse than $P.";
}
act( msg, ch, obj1, obj2, TO_CHAR );
return;
}
void do_credits( CHAR_DATA *ch, char *argument )
{
do_help( ch, "diku" );
return;
}
void do_wizlist( CHAR_DATA *ch, char *argument )
{
do_help( ch, "wizlist" );
return;
}
void do_where( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
DESCRIPTOR_DATA *d;
bool found;
one_argument( argument, arg );
if (IS_SET(world_affects, WORLD_FOG))
{
send_to_char("It is too foggy to locate anyone.\n\r",ch);
Showing the first 100 KB of 154.9 KB. Download the archive for the full file.