act_info.c
atd/src/act_info.c · 188.1 KB
From the archive AtDv2.0.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"
#include "leader.h"
#include "commands.h"
#include "build.h"
/*
* Locals
*/
/*
* %s will be replaced by his or her
*/
const struct where_type where_name [MAX_WEAR] =
{
{ "{r[ {nMastery{r ]{x ", WEAR_MASTERY, "as %s mastery" },
{ "{r[ {nLight{r ]{x ", WEAR_LIGHT, "as %s a light" },
{ "{r[ {nFinger{r ]{x ", WEAR_FINGER_L, "on %s left finger" },
{ "{r[ {nFinger{r ]{x ", WEAR_FINGER_R, "on %s right finger" },
{ "{r[ {nNeck{r ]{x ", WEAR_NECK_1, "around %s neck" },
{ "{r[ {nNeck{r ]{x ", WEAR_NECK_2, "around %s neck" },
{ "{r[ {nBody{r ]{x ", WEAR_BODY, "covering %s body" },
{ "{r[ {nHead{r ]{x ", WEAR_HEAD, "on %s head" },
{ "{r[ {nFace {r ]{x ", WEAR_FACE, "covering %s face" },
{ "{r[ {nNose{r ]{x ", WEAR_NOSE, "pierced through %s nose" },
{ "{r[ {nEar{r ]{x ", WEAR_EAR_R, "on %s right ear" },
{ "{r[ {nEar{r ]{x ", WEAR_EAR_L, "on %s left ear" },
{ "{r[ {nLegs{r ]{x ", WEAR_LEGS, "covering %s legs" },
{ "{r[ {nAnkle{r ]{x ", WEAR_ANKLE_L, "straped around %s left ankle" },
{ "{r[ {nAnkle{r ]{x ", WEAR_ANKLE_R, "straped around %s right anklet" },
{ "{r[ {nFeet{r ]{x ", WEAR_FEET, "as %s boots" },
{ "{r[ {nHands{r ]{x ", WEAR_HANDS, "covering %s fingers"},
{ "{r[ {nArms{r ]{x ", WEAR_ARMS, "straped around %s arms" },
{ "{r[ {nOff Hand{r ]{x ", WEAR_SHIELD, "straped to %s off-hand" },
{ "{r[ {nAbout{r ]{x ", WEAR_ABOUT, "draped about %s body" },
{ "{r[ {nWaist{r ]{x ", WEAR_WAIST, "tied around %s waiste" },
{ "{r[ {nWrist{r ]{x ", WEAR_WRIST_L, "straped on %s left forarm" },
{ "{r[ {nWrist{r ]{x ", WEAR_WRIST_R, "straped on %s right forarm" },
{ "{r[ {nRight Hand{r ]{x ", WEAR_WIELD, "held in %s right hand" },
{ "{r[ {nLeft Hand{r ]{x ", WEAR_HOLD, "held in %s left hand" },
{ "{r[ {nThird Hand{r ]{x ", WEAR_THIRD, "held in %s third hand" },
{ "{r[ {nFourth Hand{r ]{x ", WEAR_FOURTH, "held in %s fourth hand" },
{ "{r[ {nL Scabbard {r ]{x ", WEAR_SCABBARD_L, "sheathed on the left side of %s belt" },
{ "{r[ {nR Scabbard {r ]{x ", WEAR_SCABBARD_R, "sheathed on the right side of %s belt" }
};
const char *const sector_string[SECT_MAX] = {
"{w[inside]", "{D[{wcity{D]", "{y[{gfield{y]", "{g[forest]",
"{Y[{ghills{Y]", "{D[{ymountain{D]", "{b[{cwater{b]", "{b[water]",
"{b[underwater]", "{c[air]", "{y[{Ydesert{y]"
};
char * from_room [] =
{
"$n looks north.", "$n looks east.", "$n looks south.",
"$n looks west.", "$n looks up.", "$n looks down."
};
char * to_room [] =
{
"Someone peeks in from the south.", "Someone peeks in from the west.",
"Someone peeks in from the north.", "Someone peeks in from the east.",
"Someone peeks in from below.", "Someone peeks in from above."
};
/*
* Externals
*/
char * class_name args( ( int class ) );
void text_bar args( ( CHAR_DATA *ch, char *argument, bool pager ) );
char * all_capitalize args( ( char *argument ) );
/*
* 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 ) );
void show_equipment args( (CHAR_DATA *victim, CHAR_DATA *ch) );
sh_int str_similar args( ( const char *astr, const char *bstr ) );
sh_int str_prefix_level args( ( const char *astr, const char *bstr ) );
void similar_help_files args( (CHAR_DATA *ch, char *argument ) );
char *num_punct(char * xbuf, int foo)
{
int index, index_new, rest;
char buf[16];
sprintf(buf,"%d",foo);
rest = strlen(buf)%3;
*xbuf = '\0';
for (index=index_new=0;index<strlen(buf);index++,index_new++)
{
if (index!=0 && (index-rest)%3==0 )
{
xbuf[index_new]=',';
index_new++;
xbuf[index_new]=buf[index];
}
else
xbuf[index_new] = buf[index];
}
xbuf[index_new]='\0';
return xbuf;
}
/*
* Ranks the number of Match's in Characters between 2
* full strings
*/
sh_int str_similar( const char *astr, const char *bstr )
{
sh_int matches=0;
if (!astr || !bstr)
return matches;
for ( ; *astr; astr++)
{
if ( LOWER(*astr) == LOWER(*bstr) )
matches++;
if (++bstr == '\0')
return matches;
}
return matches;
}
/*
* Ranks the number of matchs there are until there is
* a non-matching character
*/
sh_int str_prefix_level( const char *astr, const char *bstr )
{
sh_int matches=0;
if (!astr || !bstr)
return matches;
for ( ; *astr; astr++)
{
if ( LOWER(*astr) == LOWER(*bstr) )
matches++;
else
return matches;
if (++bstr == '\0')
return matches;
}
return matches;
}
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, "{W({DArtifact{W){x " );
else if ( IS_OBJ_STAT(obj,ITEM_SATANIC ) )
strcat(buf, "{R(Satanic){x " );
else if ( IS_SET(obj->quest, QUEST_RELIC))
strcat(buf, "{W({gR{Ge{wL{Gi{gC{W){x " );
else if ( IS_SET(obj->quest,ITEM_EQUEST))
strcat(buf,"{W({cPriceless{W){x " );
else if( obj->points > 0 )
{
if( obj->points >= 8000 )
strcat(buf, "{M(Immortal){x " );
else if ( obj->points >= 4000 )
strcat(buf, "{C(Mythical){x " );
else if ( obj->points >= 2000 )
strcat(buf, "{Y(Legendary){x " );
}
if (IS_OBJ_STAT(obj, ITEM_INVIS) )
strcat( buf, "{W({DInvis{W){x " );
if ( IS_AFFECTED(ch, AFF_DETECT_EVIL)
&& !IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)
&& IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) )
strcat( buf, "{W({bBlue Aura{W){n " );
else if ( IS_AFFECTED(ch, AFF_DETECT_EVIL)
&& IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)
&& !IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) )
strcat( buf, "{W({rRed Aura{W){n " );
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, "{W({yYellow Aura{W){w " );
if ( IS_AFFECTED(ch, AFF_DETECT_MAGIC)
&& IS_OBJ_STAT(obj, ITEM_MAGIC) )
strcat( buf, "{W({bMag{W){x " );
if ( IS_VAMPIRE(ch) && IS_OBJ_STAT(obj, ITEM_CLOAKED) )
strcat( buf, "{D(Cl){x " );
if ( IS_OBJ_STAT(obj, ITEM_GLOW) )
strcat( buf, "{W({YGlow{W){x " );
if ( IS_OBJ_STAT(obj, ITEM_HUM) )
strcat( buf, "{W({bHum{W){x " );
if ( IS_OBJ_STAT(obj, ITEM_VANISH ) )
strcat( buf, "{D(Illusion){x " );
if ( IS_OBJ_STAT(obj, ITEM_SHADOWPLANE) &&
obj->in_room != NULL &&
!IS_AFFECTED(ch,AFF_SHADOWPLANE) )
strcat( buf, "{W({DShadow{W){x " );
if (!IS_OBJ_STAT(obj, ITEM_SHADOWPLANE) &&
obj->in_room != NULL &&
IS_AFFECTED(ch,AFF_SHADOWPLANE) )
strcat( buf, "{D({WNormal{D){x " );
if ( fShort )
{
if ( obj->short_descr != NULL )
{
strcat( buf, "{x" );
strcat( buf, obj->short_descr );
if ( obj->condition < 20 )
strcat(buf, " {r(Terrible)");
else if( obj->condition < 40 )
strcat(buf, " {r(Very bad)");
else if( obj->condition < 60 )
strcat(buf, " {r(Bad)" );
else if( obj->condition < 100 )
strcat( buf, " {r(Notched)" );
strcat( buf, "{x" );
}
}
else
{
if ( obj->description != NULL )
strcat( buf, obj->description );
}
return buf;
}
int char_hitroll( CHAR_DATA *ch )
{
int hr = GET_HITROLL(ch);
int hours;
hr = ch->hitroll;
hr += get_curr_str(ch)/2;
hours = get_hours_played(ch);
if( IS_NPC(ch) )
{
hr += ch->level * 3;
}
if (!IS_NPC(ch) && hours <= 4)
{
hr += 25;
}
if (!IS_NPC(ch) && hours >= 5)
{
hr += hours /2;
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_CLASS(ch,CLASS_DEMON) && IS_POLYAFF(ch,POLY_ZULO) )
{
if (ch->wpn[0] > 100)
hr *= (ch->wpn[0]);
hr /= 100;
}
else if (IS_POLYAFF(ch, POLY_ZULO))
hr += 200;
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))
{
if( 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_DROW ) && IS_POLYAFF(ch,POLY_SPIDERFORM) )
hr += 750;
if( IS_EXTRA(ch,EXTRA_DRAGON) && IS_VAMPIRE(ch))
hr *= 1.6;
if( IS_ANGEL(ch) )
{
if( IS_POLYAFF(ch, POLY_ANGELFORM) )
hr += 500;
if( IS_POLYAFF(ch, POLY_ZULO) )
hr *= 1.25;
}
if( IS_MONK(ch) && ch->wpn[0] > 300 )
hr *= (ch->wpn[0] / 300) > 2 ? 2 : ch->wpn[0] / 300;
if( IS_SET(ch->newbits, NEW_POWER ) )
hr += 250;
}
return hr;
}
int char_damroll( CHAR_DATA *ch )
{
int dr = GET_DAMROLL(ch);
int hours;
dr = ch->damroll;
dr += get_curr_str(ch)/2;
hours = get_hours_played(ch);
if( IS_NPC(ch) )
dr += ch->level * 3;
if (!IS_NPC(ch) && hours <= 4)
{
dr += 25;
}
if (!IS_NPC(ch) && hours >= 5)
{
dr += hours / 2;
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_DROW ) && IS_POLYAFF(ch,POLY_SPIDERFORM) )
dr += 750;
if( IS_EXTRA(ch,EXTRA_DRAGON) && IS_VAMPIRE(ch))
dr *= 1.6;
if( IS_ANGEL(ch) )
{
if( IS_POLYAFF(ch, POLY_ANGELFORM) )
dr += 500;
if( IS_POLYAFF(ch, POLY_ZULO) )
dr *= 1.25;
}
else if (IS_POLYAFF(ch, POLY_ZULO))
{
if( IS_CLASS(ch,CLASS_DEMON) )
{
if( ch->wpn[0] > 100 )
{
dr *= ch->wpn[0];
dr /= 100;
}
}
else
dr += 200;
}
if( IS_MONK(ch) && ch->wpn[0] > 300 )
dr *= (ch->wpn[0] / 300) > 2 ? 2 : ch->wpn[0] / 300;
if( IS_SET(ch->newbits, NEW_POWER ) )
dr += 250;
}
return dr;
}
int char_ac( CHAR_DATA *ch )
{
int a_c = GET_AC(ch);
a_c = ch->armor;
if( IS_AWAKE(ch) )
if( get_curr_dex(ch) < 25 )
a_c += dex_app[get_curr_dex(ch)].defensive;
else
a_c -= (get_curr_dex(ch)*2.5);
if (!IS_NPC(ch))
{
if (IS_WEREWOLF(ch) && ch->gifts[CHILDRENOFGAIA] >= 1)
{
a_c += -100;
}
if (IS_SET(ch->pcdata->powers[1], DPOWER_TOUGHSKIN))
a_c += -400;
if( IS_CLASS(ch,CLASS_DEMON) && IS_POLYAFF(ch,POLY_ZULO) )
{
if( ch->wpn[0] > 100 )
a_c -= ch->wpn[0] * 2;
}
if( IS_MONK(ch) && ch->wpn[0] > 300 )
a_c -= (ch->wpn[0] / 300) > 2 ? 2 : ch->wpn[0] / 300;
}
return a_c;
}
char * format_char_to_char( CHAR_DATA *ch, CHAR_DATA *victim )
{
static char buf[MAX_STRING_LENGTH];
buf[0] = '\0';
if (!IS_NPC(victim) && victim->desc==NULL )
strcat( buf,"{y(LD)");
if ( IS_AFFECTED(victim, AFF_INVISIBLE) )
strcat( buf, "{D(In)" );
if ( IS_AFFECTED(victim, AFF_HIDE) )
strcat( buf, "{D(Hi)" );
if ( IS_AFFECTED(victim, AFF_CHARM) )
strcat( buf, "{M(Cha)" );
if ( IS_AFFECTED(victim, AFF_FAERIE_FIRE) ) strcat( buf, "{M(Fa)" );
if ( IS_EVIL(victim)
&& IS_AFFECTED(ch, AFF_DETECT_EVIL) ) strcat( buf, "{R(Ev)");
if ( IS_AFFECTED(victim, AFF_SANCTUARY) ) strcat( buf, "{W(Sa)");
if ( IS_AFFECTED(victim, AFF_STEELSHIELD) ) strcat( buf, "{c(St)");
strcat(buf, " {n" );
if ( IS_AFFECTED(ch, AFF_SHADOWPLANE) && !IS_AFFECTED(victim, AFF_SHADOWPLANE))
strcat( buf, "{W({xNP{W){x " );
else if ( !IS_AFFECTED(ch, AFF_SHADOWPLANE) && IS_AFFECTED(victim, AFF_SHADOWPLANE))
strcat( buf, "{W({DSP{W){x " );
if( !IS_NPC( victim) && !IS_NPC(ch)
&& ch->level > 2 )
{
char buf2[ 256 ];
int cl = class_lookup(victim->class );
if( cl > 0 )
{
sprintf( buf2, "%s[%c%s] {x",
class_table[cl].col,
( victim->race == 0 ) ? ' ' :
( victim->race <= ch->race ) ? '*' : '+',
class_table[cl].class_name );
strcat( buf, buf2 );
}
}
return buf;
}
char * format_char( char * buf, CHAR_DATA *victim, CHAR_DATA *ch )
{
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 buf;
if ((mount = victim->mount) != NULL && IS_SET(victim->mounted, IS_MOUNT))
return buf;
if ( IS_HEAD(victim, LOST_HEAD) && IS_AFFECTED(victim, AFF_POLYMORPH))
strcat( buf, " " );
else {
strcat( buf, format_char_to_char( ch, victim ) );
}
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{R...%s is engulfed in blazing flames!", victim->short_descr );
else if (!IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf2, "\n\r{R...%s is engulfed in blazing flames!", victim->morph );
else
sprintf( buf2, "\n\r{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, "{c...%s is gagged and blindfolded!", victim->morph );
else if (IS_EXTRA(victim,GAGGED))
sprintf( buf3, "{g...%s is gagged!", victim->morph );
else if (IS_EXTRA(victim,BLINDFOLDED))
sprintf( buf3, "{G...%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" );
return buf;
}
if ( IS_EXTRA(victim, TIED_UP) )
{
if (IS_NPC(victim))
sprintf( buf3, "\n\r{C...%s is tied up", victim->short_descr );
else if (!IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf3, "\n\r{C...%s is tied up", victim->morph );
else
sprintf( buf3, "\n\r{C...%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{y...%s is coated in a sticky web.", victim->short_descr );
else if (!IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf4, "\n\r{y...%s is coated in a sticky web.", victim->morph );
else
sprintf( buf4, "\n\r{y...%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{y...%s is surrounded by earth.",victim->short_descr);
else if ( !IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf4, "\n\r{y...%s is surrounded by earth.",victim->morph);
else
sprintf( buf4, "\n\r{y...%s is surrounded by earth.",victim->name);
strcat( buf3, buf4 );
}
if ( victim->position == POS_STANDING
&& victim->long_descr[0] != '\0'
&& strlen( victim->long_descr ) > 3
&& !(mount = victim->mount)
&& victim->stance[0] < 1 )
{
strcpy( buf4, victim->long_descr);
buf4[strlen(buf4)-2] = '\0';
strcat( buf, buf4 );
strcat( buf, buf2 );
strcat( buf, buf3 );
strcat( buf, "\n\r" );
if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_BRIEF) )
return buf;
buf2[0] = '\0';
buf3[0] = '\0';
buf4[0] = '\0';
if ( IS_NPC(ch) || !IS_SET(ch->act, PLR_BRIEF) )
{
if ( IS_ITEMAFF(victim, ITEMA_SHOCKSHIELD)
|| IS_ITEMAFF(victim, ITEMA_FIRESHIELD)
|| IS_ITEMAFF(victim, ITEMA_ICESHIELD)
|| IS_ITEMAFF(victim, ITEMA_ACIDSHIELD)
|| IS_ITEMAFF(victim, ITEMA_CHAOSSHIELD) )
{
sprintf( buf3, "{n....%s is surrounded by ",
PERS( victim, ch ) );
if ( IS_ITEMAFF(victim, ITEMA_FIRESHIELD) )
strcat( buf3, "{r(fire)");
if ( IS_ITEMAFF(victim, ITEMA_ICESHIELD) )
strcat( buf3, "{C(ice)");
if ( IS_ITEMAFF(victim, ITEMA_ACIDSHIELD) )
strcat( buf3,"{g(acid)" );
if( IS_ITEMAFF(victim, ITEMA_SHOCKSHIELD) )
strcat( buf3, "{W(lightning)" );
if ( IS_ITEMAFF(victim, ITEMA_CHAOSSHIELD) )
strcat( buf3, "{m(chaos)" );
if ( IS_ITEMAFF(victim, ITEMA_REFLECT) )
strcat( buf3, "{D(dark){x" );
if( IS_ITEMAFF(victim, ITEMA_SUNSHIELD ) )
strcat( buf3, "{Y(sun){x" );
strcat( buf3, "{n.\n\r" );
strcat( buf, buf3 );
}
if ( IS_ITEMAFF(victim, ITEMA_ANGHALO) )
{
sprintf( buf3, "{n....%s has a halo surrounding %s head.",
PERS( victim, ch ), HIS_HER( victim ) );
strcat( buf, buf3 );
}
}
return buf;
}
else if ( !IS_NPC(victim) && IS_AFFECTED(victim, AFF_POLYMORPH) )
strcat( buf, victim->morph );
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:
if (IS_VAMPIRE(victim))
strcat( buf, " is lying here torpored." );
else
strcat( buf, " is lying here mortally wounded." );
break;
case POS_INCAP: strcat( buf, " is lying here 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 if (!IS_NPC(victim) && victim->stance[0] == STANCE_RABBIT )
strcat( buf, " is here, crouched in a rabbit fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_COBRA )
strcat( buf, " is here, crouched in a cobra fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_BEAR )
strcat( buf, " is here, crouched in a bear fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_COUGAR )
strcat( buf, " is here, crouched in a cougar fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_EAGLE )
strcat( buf, " is here, crouched in a eagle 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;
}
}
if (buf2[0] != '\0')
strcat( buf, "\n\r" );
strcat( buf, buf2 );
strcat( buf, buf3 );
strcat( buf, "{x\n\r" );
if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_BRIEF) ) return buf;
if ( IS_ITEMAFF(victim, ITEMA_SHOCKSHIELD)
|| IS_ITEMAFF(victim, ITEMA_FIRESHIELD)
|| IS_ITEMAFF(victim, ITEMA_ICESHIELD)
|| IS_ITEMAFF(victim, ITEMA_ACIDSHIELD)
|| IS_ITEMAFF(victim, ITEMA_CHAOSSHIELD) )
{
sprintf( buf3, "{n....%s is surrounded by ",
PERS( victim, ch ) );
if ( IS_ITEMAFF(victim, ITEMA_FIRESHIELD) )
strcat( buf3, "{r(fire)");
if ( IS_ITEMAFF(victim, ITEMA_ICESHIELD) )
strcat( buf3, "{C(ice)");
if ( IS_ITEMAFF(victim, ITEMA_ACIDSHIELD) )
strcat( buf3,"{g(acid)" );
if( IS_ITEMAFF(victim, ITEMA_SHOCKSHIELD) )
strcat( buf3, "{W(lightning)" );
if ( IS_ITEMAFF(victim, ITEMA_CHAOSSHIELD) )
strcat( buf3, "{m(chaos)" );
if ( IS_ITEMAFF(victim, ITEMA_REFLECT) )
strcat( buf3, "{D(dark)" );
if( IS_ITEMAFF(victim, ITEMA_SUNSHIELD ) )
strcat( buf3, "{Y(sun)" );
strcat( buf3, "{n.\n\r" );
strcat( buf, buf3 );
}
if ( IS_ITEMAFF(victim, ITEMA_ANGHALO) )
{
sprintf( buf3, "{W....%s has a halo surrounding %s head.",
PERS( victim, ch ), HIS_HER( victim ) );
strcat( buf, buf3 );
}
return buf;
}
/*
* Show amob list to a character - Hack of show_list_to_char
*/
void show_mlist_to_char( CHAR_DATA *list, CHAR_DATA *ch )
{
CHAR_DATA *vch;
char * pStr;
char buf [ MAX_STRING_LENGTH ];
bool fCombine;
int count;
int nShow,iShow;
char **prgpstrShow;
int *prgnShow;
if( ch->desc == NULL )
return;
fCombine = TRUE;
count = 0;
if( !list )
return;
/*
* Alloc space for output lines.
*/
for ( vch = list; vch; vch = vch->next_in_room )
if( IS_NPC(vch) )
count++;
prgpstrShow = alloc_mem( count * sizeof(char *) );
prgnShow = alloc_mem( count * sizeof(int) );
nShow = 0;
/*
* Format the list of mobs
*/
for ( vch = list; vch; vch = vch->next_in_room )
{
if( !IS_NPC(vch ) )
continue;
if( !IS_IMMORTAL(ch) && !can_see( ch,vch ) )
continue;
if( STR(vch,long_descr) && (pStr = format_char( buf, vch, ch)) )
{
fCombine = FALSE;
if( IS_NPC(ch ) || IS_SET(ch->act, PLR_COMBINE) )
{
/*
* Look for duplicates, case sensitive.
*/
for ( iShow = nShow - 1; iShow >= 0; iShow-- )
{
if( !str_cmp( prgpstrShow[iShow], pStr ) )
{
prgnShow[iShow]++;
fCombine = TRUE;
}
}
}
/*
* Couldn't combine, or didn't want to.
*/
if ( !fCombine )
{
prgpstrShow [nShow] = str_dup( pStr );
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 )
{
ch_printf( ch, "(%2d) ", prgnShow[iShow]);
}
else
{
send_to_char( " ", ch );
}
}
else
send_to_char( " ", ch );
ch_printf( ch, "%s",
prgpstrShow[iShow]);
free_string( prgpstrShow[iShow] );
}
/*
* Gotta free it
*/
free_mem( prgpstrShow, count * sizeof(char *) );
free_mem( prgnShow, count * sizeof(int) );
return;
}
/*
* 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;
/*
* if theres no list... then don't do all this crap! -Dreimas
*/
if( !list )
{
if ( fShowNothing )
{
if ( IS_NPC(ch) || IS_SET(ch->act, PLR_COMBINE) )
send_to_char( " ", ch );
send_to_char( "Nothing.\n\r", ch );
}
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
&& prgpstrShow[ iShow ][ 0 ] != '\0' )
{
sprintf( buf, "(%2d) ", prgnShow[iShow] );
send_to_char( buf, ch );
}
else
{
if( prgpstrShow[ iShow ][ 0 ] != '\0' )
send_to_char( " ", ch );
}
}
send_to_char( prgpstrShow[iShow], ch );
/*
* The if only adds a line feed if the object->description
* is actually there.. now hit hides stuff so people have
* to figure things out.
*/
if( prgpstrShow[ iShow ][ 0 ] != '\0' )
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 )
{
static 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( ch == victim )
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
strcat( buf, format_char_to_char( ch, victim ) );
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, PERS(victim,ch));
strcat( buf, ") ");
}
if ( IS_AFFECTED(victim, AFF_FLAMING) )
{
if (IS_NPC(victim))
sprintf( buf2, "\n\r{R...%s is engulfed in blazing flames!", victim->short_descr );
else if (!IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf2, "\n\r{R...%s is engulfed in blazing flames!", victim->morph );
else
sprintf( buf2, "\n\r{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, "{c...%s is gagged and blindfolded!", victim->morph );
else if (IS_EXTRA(victim,GAGGED))
sprintf( buf3, "{g...%s is gagged!", victim->morph );
else if (IS_EXTRA(victim,BLINDFOLDED))
sprintf( buf3, "{G...%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" );
send_to_char( buf, ch );
return;
}
if ( IS_EXTRA(victim, TIED_UP) )
{
if (IS_NPC(victim))
sprintf( buf3, "\n\r{C...%s is tied up", victim->short_descr );
else if (!IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf3, "\n\r{C...%s is tied up", victim->morph );
else
sprintf( buf3, "\n\r{C...%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{y...%s is coated in a sticky web.", victim->short_descr );
else if (!IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf4, "\n\r{y...%s is coated in a sticky web.", victim->morph );
else
sprintf( buf4, "\n\r{y...%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{y...%s is surrounded by earth.",victim->short_descr);
else if ( !IS_NPC(victim) && IS_AFFECTED(victim,AFF_POLYMORPH))
sprintf( buf4, "\n\r{y...%s is surrounded by earth.",victim->morph);
else
sprintf( buf4, "\n\r{y...%s is surrounded by earth.",victim->name);
strcat( buf3, buf4 );
}
if ( victim->position == POS_STANDING
&& victim->long_descr[0] != '\0'
&& strlen( victim->long_descr ) > 3
&& !(mount = victim->mount)
&& victim->stance[0] < 1 )
{
strcpy( buf4, victim->long_descr);
buf4[strlen(buf4)-2] = '\0';
strcat( buf, buf4 );
strcat( buf, buf2 );
strcat( buf, buf3 );
strcat( buf, "\n\r" );
stc( buf, ch );
if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_BRIEF) )
return;
buf2[0] = '\0';
buf3[0] = '\0';
buf4[0] = '\0';
if ( IS_NPC(ch) || !IS_SET(ch->act, PLR_BRIEF) )
{
if ( IS_ITEMAFF(victim, ITEMA_SHOCKSHIELD)
|| IS_ITEMAFF(victim, ITEMA_FIRESHIELD)
|| IS_ITEMAFF(victim, ITEMA_ICESHIELD)
|| IS_ITEMAFF(victim, ITEMA_ACIDSHIELD)
|| IS_ITEMAFF(victim, ITEMA_CHAOSSHIELD) )
{
sprintf( buf3, "{n....%s is surrounded by ",
PERS( victim, ch ) );
if ( IS_ITEMAFF(victim, ITEMA_FIRESHIELD) )
strcat( buf3, "{r(fire)");
if ( IS_ITEMAFF(victim, ITEMA_ICESHIELD) )
strcat( buf3, "{C(ice)");
if ( IS_ITEMAFF(victim, ITEMA_ACIDSHIELD) )
strcat( buf3,"{g(acid)" );
if( IS_ITEMAFF(victim, ITEMA_SHOCKSHIELD) )
strcat( buf3, "{W(lightning)" );
if ( IS_ITEMAFF(victim, ITEMA_CHAOSSHIELD) )
strcat( buf3, "{m(chaos)" );
if ( IS_ITEMAFF(victim, ITEMA_REFLECT) )
strcat( buf3, "{D(dark){x" );
if( IS_ITEMAFF(victim, ITEMA_SUNSHIELD ) )
strcat( buf3, "{Y(sun){x" );
strcat( buf3, "{n.\n\r" );
strcat( buf, buf3 );
}
if ( IS_ITEMAFF(victim, ITEMA_ANGHALO) )
{
sprintf( buf3, "{n....%s has a halo surrounding %s head.",
PERS( victim, ch ), HIS_HER( victim ) );
strcat( buf, buf3 );
}
stc( buf, ch );
}
return;
}
else if ( !IS_NPC(victim) && IS_AFFECTED(victim, AFF_POLYMORPH) )
strcat( buf, victim->morph );
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:
if (IS_VAMPIRE(victim))
strcat( buf, " is lying here torpored." );
else
strcat( buf, " is lying here mortally wounded." );
break;
case POS_INCAP: strcat( buf, " is lying here 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 if (!IS_NPC(victim) && victim->stance[0] == STANCE_RABBIT )
strcat( buf, " is here, crouched in a rabbit fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_COBRA )
strcat( buf, " is here, crouched in a cobra fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_BEAR )
strcat( buf, " is here, crouched in a bear fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_COUGAR )
strcat( buf, " is here, crouched in a cougar fighting stance." );
else if (!IS_NPC(victim) && victim->stance[0] == STANCE_EAGLE )
strcat( buf, " is here, crouched in a eagle 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;
}
}
if (buf2[0] != '\0')
strcat( buf, "\n\r" );
strcat( buf, buf2 );
strcat( buf, buf3 );
strcat( buf, "{x\n\r" );
if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_BRIEF) )
{
stc( buf, ch );
return;
}
if ( IS_ITEMAFF(victim, ITEMA_SHOCKSHIELD)
|| IS_ITEMAFF(victim, ITEMA_FIRESHIELD)
|| IS_ITEMAFF(victim, ITEMA_ICESHIELD)
|| IS_ITEMAFF(victim, ITEMA_ACIDSHIELD)
|| IS_ITEMAFF(victim, ITEMA_CHAOSSHIELD) )
{
sprintf( buf3, "{n....%s is surrounded by ",
PERS( victim, ch ) );
if ( IS_ITEMAFF(victim, ITEMA_FIRESHIELD) )
strcat( buf3, "{r(fire)");
if ( IS_ITEMAFF(victim, ITEMA_ICESHIELD) )
strcat( buf3, "{C(ice)");
if ( IS_ITEMAFF(victim, ITEMA_ACIDSHIELD) )
strcat( buf3,"{g(acid)" );
if( IS_ITEMAFF(victim, ITEMA_SHOCKSHIELD) )
strcat( buf3, "{W(lightning)" );
if ( IS_ITEMAFF(victim, ITEMA_CHAOSSHIELD) )
strcat( buf3, "{m(chaos)" );
if ( IS_ITEMAFF(victim, ITEMA_REFLECT) )
strcat( buf3, "{D(dark)" );
if( IS_ITEMAFF(victim, ITEMA_SUNSHIELD ) )
strcat( buf3, "{Y(sun)" );
strcat( buf3, "{n.\n\r" );
strcat( buf, buf3 );
}
if ( IS_ITEMAFF(victim, ITEMA_ANGHALO) )
{
sprintf( buf3, "{W....%s has a halo surrounding %s head.",
PERS( victim, ch ), HIS_HER( victim ) );
strcat( buf, buf3 );
}
stc( buf, ch);
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_equipment(CHAR_DATA *victim, CHAR_DATA *ch)
{
OBJ_DATA *obj;
bool found;
int cnt;
found = FALSE;
for ( cnt = 0; cnt < MAX_WEAR; cnt++ )
{
if ( ( obj = get_eq_char( victim, where_name[cnt].place ) )
&& can_see_obj( ch, obj ) )
{
if( ch != victim
&& IS_OBJ_STAT(obj, ITEM_CLOAKED)
&& !IS_VAMPIRE(ch)
&& !IS_IMMORTAL(ch))
continue;
if ( !found )
{
send_to_char( "\n\r", ch );
act( "$N is using:", ch, NULL, victim, TO_CHAR );
found = TRUE;
}
send_to_char( where_name[cnt].name, 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);
}
}
return;
}
void show_char_to_char_1( CHAR_DATA *victim, CHAR_DATA *ch )
{
char buf[MAX_STRING_LENGTH];
char final[MAX_STRING_LENGTH];
if ( IS_ITEMAFF(ch,ITEMA_VISION) || can_see( victim, ch ) )
{
act( "$n looks at you.", ch, NULL, victim, TO_VICT );
if( ch != victim )
act( "$n looks at $N.", ch, NULL, victim, TO_NOTVICT );
else
act( "$n looks $mself over.", 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( "{n ", ch );
send_to_char( victim->description, ch );
}
final[0] = '\0';
if (!IS_NPC( victim ))
{
sprintf(buf,"%s, is a ",capitalize(victim->name) );
if( get_curr_con(victim) >= 100 ) strcat(buf,"collassal");
else if( get_curr_con(victim) >= 80) strcat(buf,"mountainous");
else if( get_curr_con(victim) >= 70) strcat(buf,"sizeable");
else if( get_curr_con(victim) >= 60) strcat(buf,"massive");
else if( get_curr_con(victim) >= 50) strcat(buf,"large");
else if( get_curr_con(victim) >= 30) strcat(buf,"average sized");
else if( get_curr_con(victim) >= 20) strcat(buf,"petite");
else strcat(buf,"infinitesimal");
strcat(buf,", ");
if( get_curr_str(victim) >= 100 ) strcat(buf,"hardy");
else if( get_curr_str(victim) >= 80 ) strcat(buf,"stalwart");
else if( get_curr_str(victim) >= 70 ) strcat(buf,"stout");
else if( get_curr_str(victim) >= 60 ) strcat(buf,"sturdy");
else if( get_curr_str(victim) >= 50 ) strcat(buf,"tough");
else if( get_curr_str(victim) >= 30 ) strcat(buf,"solid");
else if( get_curr_str(victim) >= 20 ) strcat(buf,"scrawny");
else strcat(buf,"pathetic");
strcat(final,buf);
sprintf( buf, " %s.", MAL_FEM(victim) );
strcat( final, buf );
sprintf(buf,"%s moves with ", HE_SHE(victim));
if( get_curr_dex(victim) >= 100 ) strcat(buf,"prowness");
else if( get_curr_dex(victim) >= 80 ) strcat(buf,"cleverness");
else if( get_curr_dex(victim) >= 70 ) strcat(buf,"deftness");
else if( get_curr_dex(victim) >= 60 ) strcat(buf,"nimbleness");
else if( get_curr_dex(victim) >= 50 ) strcat(buf,"readiness");
else if( get_curr_dex(victim) >= 30 ) strcat(buf,"catlike qualities");
else if( get_curr_dex(victim) >= 20 ) strcat(buf,"slowness");
else strcat(buf,"sluggish");
strcat(final,buf);
sprintf(buf," and appears to be ");
if( get_curr_int(victim) >= 100 ) strcat(buf,"brilliant");
else if( get_curr_int(victim) >= 80 ) strcat(buf,"intellectual");
else if( get_curr_int(victim) >= 70 ) strcat(buf,"all knowing");
else if( get_curr_int(victim) >= 60 ) strcat(buf,"knowledgeable");
else if( get_curr_int(victim) >= 50 ) strcat(buf,"logical");
else if( get_curr_int(victim) >= 30 ) strcat(buf,"compitent");
else if( get_curr_int(victim) >= 20 ) strcat(buf,"dull");
else strcat(buf,"utterly moronic");
strcat(buf, " and ");
if( get_curr_wis(victim) >= 100 ) strcat(buf,"discerning");
else if( get_curr_wis(victim) >= 80 ) strcat(buf,"sagacious");
else if( get_curr_wis(victim) >= 70 ) strcat(buf,"impudent");
else if( get_curr_wis(victim) >= 60 ) strcat(buf,"shrewd");
else if( get_curr_wis(victim) >= 50 ) strcat(buf,"insightful");
else if( get_curr_wis(victim) >= 30 ) strcat(buf,"thoughtless");
else if( get_curr_wis(victim) >= 20 ) strcat(buf,"inattentive");
else strcat(buf,"thick-skinned");
strcat( buf, ".");
strcat( final, buf );
{
int age = PERCENTAGE(get_hours_played(victim), 500 );
sprintf( buf, "%s is a%s %s.\n\r",
capitalize(victim->name),
age < 30 ? " young" :
age < 40 ? " matured" :
age < 60 ? " middle-aged" :
age < 80 ? "n aging" :
age < 90 ? "n elderly" : "n ancient",
class_name( victim->class) );
strcat(final,buf);
}
if( final[0] != '\0' && final[0] != '.' )
{
char *p;
p = format_string( str_dup(final) );
send_to_char( " ", ch );
send_to_char( p , ch);
free_string(p);
}
final[0] = '\0';
if (IS_SET(victim->newbits, NEW_OBEAH))
{
sprintf( buf, " %s has a%s eye in the centre of %s forehead.",
PERS(victim,ch),
(victim->obeah_timer == 0) ? "" : "n brigthly glowing",
HIS_HER(ch) );
strcat( final, buf );
}
if (IS_VAMPAFF(victim, VAM_NIGHTSIGHT))
{
if (IS_AFFECTED(victim, AFF_SHADOWSIGHT))
{
if (IS_CLASS(victim, CLASS_WEREWOLF))
sprintf( buf,
" %s eyes are glowing a lambent green and are surrounded in shadow.",
HIS_HER(victim) );
else
sprintf( buf,
" %s eyes are glowing bright red and are surrounded in shadow.",
HIS_HER(victim) );
}
else if ( IS_CLASS(victim, CLASS_WEREWOLF) )
sprintf( buf, " %s eyes are glowing a lambent green.",
HIS_HER(victim) );
else
sprintf( buf, " %s eyes are glowing bright red.",
HIS_HER(victim) );
strcat( final, buf );
}
if (IS_VAMPAFF(victim, VAM_FANGS))
{
sprintf( buf, " %s has a pair of long, pointed fangs.",
PERS(victim,ch));
strcat( final, buf );
}
if (IS_VAMPAFF(victim, VAM_CLAWS))
{
if (IS_CLASS(victim, CLASS_VAMPIRE))
{
if (IS_POLYAFF(victim, POLY_ZULO))
sprintf( buf, " %s has long black talons extending from %s fingers.",
HE_SHE(victim), HIS_HER(victim) );
else if (IS_POLYAFF(victim, POLY_WOLF))
sprintf( buf, " %s has razor sharp talons extending from %s paws.",
HE_SHE(victim), HIS_HER(victim) );
else if (IS_POLYAFF(victim, POLY_BAT))
sprintf( buf, " %s has tiny, razor sharp claws extending from %s wing tips.",
HE_SHE(victim), HIS_HER(victim) );
else
sprintf( buf, " %s has razor sharp claws protruding from under %s finger nails.",
HE_SHE(victim), HIS_HER(victim) );
strcat( final , buf );
}
if (IS_CLASS(victim, CLASS_WEREWOLF) )
{
if(IS_GAR1(victim, WOLF_VISCERAL))
{
if( IS_GAR1(victim, WOLF_RAZORCLAWS) )
sprintf( buf, " Venom-dripping razor sharp %s talons extending from %s fingers.",
(victim->gifts[SILVERFANGS] >= 2) ? "silver" : "",
HIS_HER(victim) );
}
else if(IS_GAR1(victim, WOLF_RAZORCLAWS) )
{
if(victim->gifts[SILVERFANGS] >=2)
sprintf( buf, " Razor sharp silver talons are extending from %s fingers.",
HIS_HER(victim));
else
sprintf( buf, " Razor sharp talons are extending from %s fingers.",
HIS_HER(victim));
}
else if(victim->gifts[SILVERFANGS] >=2)
sprintf( buf, " %s has silver talons extending from %s fingers.",
PERS(victim,ch), HIS_HER(victim));
else
sprintf( buf, " %s talons extending from %s fingers.",
PERS(victim,ch), HIS_HER(victim));
strcat( final, buf );
}
if (IS_CLASS(victim, CLASS_NINJA))
{
sprintf( buf, " Attached to %s wrists are iron claws.",
HIS_HER(victim));
strcat(final, buf);
}
if (IS_CLASS(victim, CLASS_DEMON))
{
sprintf( buf, " Protruding from %s fingers are black talons.",
HIS_HER(victim));
strcat(final, buf);
}
}
if (IS_SET(victim->newbits, NEW_MONKFLAME))
{
if (IS_CLASS(victim, CLASS_VAMPIRE))
{
if (IS_POLYAFF(victim, POLY_WOLF))
sprintf( buf, " %s paws are engulfed in blazing flames.",
PERS(victim,ch));
else if (IS_POLYAFF(victim, POLY_BAT))
sprintf( buf, " %s wing tips are engulfed in blazing flames.",
PERS(victim,ch));
else
sprintf( buf, " %s hands are engulfed in blazing flames.",
PERS(victim,ch));
strcat(final, buf);
}
if( IS_CLASS(victim,CLASS_MONK))
{
sprintf( buf, " %s hands are engulfed in blazing flames.",
PERS(victim,ch));
strcat(final,buf);
}
}
if (IS_SET(victim->newbits, NEW_MONKADAM))
{
sprintf( buf, " %s palms are as hard as adamantium.",
HIS_HER(victim));
strcat(final, buf);
}
if (IS_SET(victim->special, SPC_WOLFMAN))
{
if (IS_SET(victim->newbits, NEW_QUILLS))
sprintf( buf, " Thick fur and quill-like spines cover %s body.",
HIS_HER(victim));
else
sprintf( buf, " Thick fur covers %s body.",
HIS_HER(victim));
strcat(final, buf);
}
if (IS_CLASS(victim, CLASS_DROW) )
{
if( IS_POLYAFF(victim, POLY_SPIDERFORM)
&& IS_SET(victim->pcdata->powers[1], DPOWER_ARMS) )
{
sprintf( buf, " Eight spidery arms hanging from %s sides!",
HIS_HER(victim));
strcat(final, buf);
}
if( IS_SET(victim->pcdata->powers[1], DPOWER_LEVITATION))
{
sprintf( buf, " %s is levitating in the air.",
PERS(victim,ch));
strcat(final,buf);
}
}
if (IS_AFFECTED(victim, AFF_FLYING))
{
sprintf( buf, " %s is hovering in the air.",
HE_SHE(victim));
strcat(final,buf);
}
if( IS_CLASS(victim, CLASS_DEMON)
|| IS_SET(victim->special, SPC_CHAMPION))
{
if (IS_DEMAFF(victim, DEM_HORNS))
{
sprintf(buf, " A pair of pointed horns extending from %s head.",
HIS_HER(victim));
strcat(final,buf);
}
if (IS_DEMAFF(victim, DEM_HOOVES))
{
sprintf(buf, " A huge pair of hooves %s has in place of %s feet.",
PERS(victim,ch), HIS_HER(victim));
strcat(final,buf);
}
if (IS_DEMAFF(victim, DEM_TAIL))
{
sprintf(buf, " A huge tail is extended from %s back side.",
HIS_HER(victim));
strcat(final,buf);
}
if (IS_DEMAFF(victim, DEM_WINGS))
{
if (IS_DEMAFF(victim, DEM_UNFOLDED))
sprintf(buf, " A pair of batlike wings spread out from behind %s back.",
HIS_HER(victim));
else
sprintf(buf, " A pair of batlike wings folded behind %s back.",
HIS_HER(victim));
strcat(final,buf);
}
}
if( final[0] != '\0' && final[0] != '.' )
{
char *p;
p = format_string( str_dup(final) );
send_to_char( " ", ch );
send_to_char( p , ch);
free_string(p);
final[0] = '\0';
}
}
sprintf( buf, " %s looks %s.\n\r",
capitalize(PERS( victim, ch )), STRING_HITS(victim) );
strcat( final, buf );
switch ( victim->position )
{
case POS_DEAD:
sprintf( buf, "%s is dead. ", capitalize(PERS(victim,ch)) );
strcat( final, buf );
break;
case POS_MORTAL:
sprintf( buf, "%s has wounds that may bring death. ",
capitalize(PERS(victim,ch)) );
strcat( final, buf );
break;
case POS_INCAP:
sprintf( buf, "%s has been rendered incapacitated. ",
capitalize(PERS(victim,ch)) );
strcat( final, buf );
break;
case POS_STUNNED:
sprintf( buf, "%s is stunned. ",
capitalize(PERS(victim,ch)) );
strcat( final, buf );
break;
case POS_SLEEPING:
sprintf( buf, "%s is fast asleep. ",
capitalize(HE_SHE(victim)) );
strcat( final, buf );
break;
case POS_MEDITATING:
sprintf( buf, "%s is mediating. ",
capitalize(HE_SHE(victim)) );
strcat( final, buf );
break;
case POS_SITTING:
sprintf( buf, "%s is sitting. ",
capitalize(HE_SHE(victim)) );
strcat( final, buf );
break;
case POS_RESTING:
sprintf( buf, "%s is resting. ",
capitalize(HE_SHE(victim)) );
strcat( final, buf );
break;
case POS_FIGHTING:
if ( victim->fighting != NULL )
{
sprintf( buf, " %s is fighting with %s.\n\r",
PERS( victim, ch ), PERS( victim->fighting, ch ) );
strcat( final, buf );
}
break;
default: break;
}
if ( victim->mount )
{
if( victim->mounted == IS_RIDING )
sprintf( buf, " %s rides atop %s.\n\r",
HE_SHE(victim), NAME(victim->mount) );
else
sprintf( buf, " %s is being ridden by %s.\n\r",
HE_SHE(victim), NAME(victim->mount) );
strcat( final, buf );
}
if ( GET_PC(victim,condition[COND_DRUNK],0) > 50 )
{
sprintf( buf, " %s looks a bit tipsy and smells of drink.\n\r",
HE_SHE(victim) );
strcat( final, buf );
}
{
char *p;
p = format_string( str_dup(final) );
send_to_char( " ", ch );
send_to_char( p, ch );
free_string( p );
}
show_equipment( victim, ch );
send_to_char( "\n\r{n", 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 );
}
send_to_char( "\n\r", ch );
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 ( IS_NPC(rch) )
continue;
if ( rch == ch )
continue;
if ( IS_IMMORTAL(ch) || IS_IMMORTAL(rch) )
{
if ( !IS_NPC(rch)
&& IS_SET(rch->act, PLR_WIZINVIS)
&& get_trust( ch ) < rch->pcdata->wizinvis)
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 ( IS_ITEMAFF(ch,ITEMA_VISION) || 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( "{RYou see glowing red eyes watching YOU!{x\n\r", ch );
}
}
if( !room_is_dark( ch->in_room )
|| IS_AFFECTED( ch, AFF_INFRARED)
|| ( !IS_NPC(ch) && IS_VAMPAFF( ch, VAM_NIGHTSIGHT) )
|| IS_DROW(ch) )
show_mlist_to_char( list, 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;
char *kwd;
int door;
bool found;
bool twastes = FALSE;
if ( !ch->desc && !(wizard = ch->wizard))
return;
if (!ch->in_room)
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! {bZZzzz{x\n\r", ch );
return;
}
if ( !check_blind( ch ) )
return;
if ( !IS_NPC(ch)
&& IS_SET(ch->in_room->affected_by, ROOM_TOTAL_DARKNESS)
&& !IS_ITEMAFF(ch, ITEMA_VISION)
&& !IS_IMMORTAL(ch)
&& !IS_DROW(ch))
{
send_to_char( "It is pitch black ... \n\r", ch );
return;
}
if(IS_SET(ch->in_room->area->bits,WASTE))
twastes=TRUE;
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
&& ch->in_room->vnum == ROOM_VNUM_IN_OBJECT
&& !IS_NPC(ch)
&& ch->pcdata->chobj
&& ch->pcdata->chobj->in_obj )
&& 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" ) )
{
if ( ch->in_room
&& ch->in_room->vnum == ROOM_VNUM_IN_OBJECT
&& !IS_NPC(ch)
&& ch->pcdata->chobj
&& ch->pcdata->chobj->in_obj )
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
{
if ( !IS_NPC(ch) && PLR_FLAGS(ch,PLR_AUTOMAPPER))
{
do_mapper( ch, "7" );
send_to_char("{x",ch);
}
else
{
char sec [ MSL ];
if( ch->in_room->sector_type < 0
|| ch->in_room->sector_type > SECT_MAX )
strcpy(sec, "BAD SECTOR" );
else
strcpy(sec, sector_string[ch->in_room->sector_type] );
if(twastes)
ch_printf(ch,"{yTrackless Wastes{x\n\r");
else if (IS_IMMORTAL(ch) )
ch_printf( ch, "{C%s {b[{y%d{b]{W %s{n {c%s{x\n\r",
ch->in_room->name,
ch->in_room->vnum,
sec,
flag_string( room_flags, ch->in_room->room_flags) );
else
ch_printf(ch, "{C%s %s{x\n\r",
ch->in_room->name,
sec );
}
}
if ( !IS_NPC(ch) && !PLR_FLAGS(ch,PLR_AUTOMAPPER))
{
if ( ch->in_room
&& ch->in_room->vnum == ROOM_VNUM_IN_OBJECT
&& !IS_NPC(ch)
&& ch->pcdata->chobj
&& ch->pcdata->chobj->in_obj )
{
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" ) ) )
{
if(twastes)
stc("The land surrounding you is devoid of any landmarks.\n\r",ch);
else
{
send_to_char( "{n", ch );
if( ch->in_room->description[0] == '.' )
send_to_char( ch->in_room->description + 1, ch );
else
send_to_char( ch->in_room->description, ch );
}
if ( ch->in_room->sector_type != SECT_INSIDE
&& IS_OUTSIDE(ch))
{
if (number_range(0,10) < 5 )
{
if (weather_info.sky == SKY_RAINING)
send_to_char("{cA cool wind howls and brings a light rain.{x\n\r",ch);
else if (weather_info.sky == SKY_CLOUDY)
send_to_char("{cA cold wind is blowing.{x\n\r",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);
}
if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT) )
do_exits( ch, "auto" );
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;
kwd = is_hiscore_obj( obj );
if( kwd )
{
show_hiscore( kwd, ch );
return;
}
if ( IS_ITEMAFF(ch,ITEMA_VISION) || 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 ( IS_SET(pexit->exit_info, EX_CLOSED) )
{
if( pexit->keyword[0] != '\0' && pexit->keyword[0] != '.' )
act( "The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR );
else
stc( "The door is closed.\n\r", ch );
}
else
{
if ((pexit = ch->in_room->exit[door]) == NULL) return;
if ((pRoomIndex = pexit->to_room) == NULL) return;
location = ch->in_room;
act(from_room[door],ch,NULL,NULL,TO_ROOM);
char_from_room(ch);
char_to_room(ch,pRoomIndex);
act(to_room[door],ch,NULL,NULL,TO_ROOM);
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;
char * dir2_name[] = { "north", "east", "south", "west", "up", "down" };
buf[0] = '\0';
fAuto = !str_cmp( argument, "auto" );
if ( !check_blind( ch ) )
return;
strcpy( buf, "{yObvious exits:" );
if( !fAuto )
strcat( buf, "\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, dir2_name[door] );
}
else
{
if (IS_SET(sysdata.world, WORLD_FOG))
{
sprintf(buf + strlen(buf), "%-5s - Too foggy to tell.\n\r",
capitalize(dir2_name[door]));
}
sprintf( buf + strlen(buf), "%-5s - %s\n\r",
capitalize( dir2_name[door] ),
room_is_dark( pexit->to_room )
? "Too dark to tell"
: pexit->to_room->name
);
}
}
}
if ( !found )
strcat( buf, fAuto ? " NONE!!" : "{bN{Bone{x.\n\r" );
if ( fAuto )
strcat( buf, "{x\n\r" );
send_to_char( buf, ch );
return;
}
/*
* Misc functions used for score
* -- Dreimas
*/
char * num_thing ( int num )
{
log_buf[0] = '\0';
if( num == 0 )
sprintf( log_buf, "none" );
else
sprintf( log_buf, "%d", num );
return log_buf;
}
char * score_stat( int race )
{
if( race > 29 ) return "Legend";
if( race > 23 ) return "Master";
if( race > 19 ) return "Elder";
if( race > 14 ) return "Grand";
if( race > 9 ) return "Greater";
if( race > 4 ) return "DemiGod";
if( race > 1 ) return "LesserGod";
return "Avatar";
}
/*
* Took trackers current do_show and modified it
* -- Dreimas
*/
void do_score( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
char rep[MAX_STRING_LENGTH];
int a_c = char_ac(ch);
if( IS_NPC(ch) )
return;
if( !IS_NPC(ch) && (IS_EXTRA(ch,EXTRA_OSWITCH)
|| IS_HEAD(ch,LOST_HEAD ) ))
{
obj_score(ch,ch->pcdata->chobj);
return;
}
send_to_char( LINE_SEPERATOR, ch );
ch_printf( ch," {n%s...{x\n\r",ch->name);
send_to_char( LINE_SEPERATOR, ch );
ch_printf( ch,"{n Hps {D[{R %7ld{D/{R%7ld {D]{n Hitroll {D[{R %5d {D]{n Str {D[{R %3d {D]{n Exp {D[{R %10d {D]{x\n\r",
ch->hit,
ch->max_hit,
char_hitroll(ch),
get_curr_str(ch),
ch->exp);
ch_printf( ch, "{n Mana {D[{R %7ld{D/{R%7ld {D]{n Damroll {D[{R %5d {D]{n Int {D[{R %3d {D]{n Qp/TQst{D[{R %5d/%4d {D]{x\n\r",
ch->mana,
ch->max_mana,
char_damroll(ch),
get_curr_int(ch),
ch->pcdata->quest,
PC(ch,score[SCORE_NUM_QUEST]) );
ch_printf( ch,"{n Move {D[{R %7ld{D/{R%7ld {D]{n Damcap {D[{R %5d {D]{n Wis {D[{R %3d {D]{n Primal {D[{R %10d {D]{x\n\r",
ch->move,
ch->max_move,
ch->damcap[0],
get_curr_wis(ch),
ch->practice);
ch_printf( ch,"{n Items {D[{R %5d{D/{R%5d {D]{n AC {D[{R %5d {D]{n Dex {D[{R %3d {D]{n Hours {D[{R %10d {D]{x\n\r",
ch->carry_number, can_carry_n(ch),
a_c,
get_curr_dex(ch),
(get_age(ch) - 17) * 2);
ch_printf( ch,"{nWeight {D[{R%8d{D/{R%-8d{D]{n Vs. Sp {D[{R %5d {D]{n Con {D[{R %3d {D]{n Align {D[{R %10d {D]{x\n\r",
ch->carry_weight,
can_carry_w(ch),
ch->saving_throw,
get_curr_con(ch),
ch->alignment);
send_to_char( LINE_SEPERATOR, ch );
send_to_char( LINE_SEPERATOR, 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");
strcat( buf, "\n\r\n\r" );
if ( PC(ch,stage[0]) >= 100 )
send_to_char( "You are feeling extremely horny.\n\r", ch );
else if ( PC(ch,stage[0]) >= 50 )
send_to_char( "You are feeling pretty randy.\n\r", ch );
else if ( PC(ch,stage[0]) >= 1 )
send_to_char( "You are feeling rather kinky.\n\r", ch );
if ( PC(ch,stage[1]) && ch->position == POS_STANDING )
{
send_to_char( "You are having sexual intercourse.\n\r", ch );
if ( PC(ch,stage[2]) + 25 >= ch->pcdata->stage[1] )
send_to_char( "You are on the verge of having an orgasm.\n\r", ch );
}
birth_date( ch, TRUE );
if( PC(ch,conception) )
birth_date( ch, FALSE );
send_to_char( LINE_SEPERATOR, ch );
{
char buf2 [ MIL ];
buf2[ 0]='\0';
sprintf( buf, "{nStatus {D[{r %-9s {D]{n",
score_stat(ch->race) );
strcat( buf2, buf );
sprintf( buf, " Pkills {D[{r %-6s {D]{n",
num_thing(ch->pkill) );
strcat( buf2, buf );
sprintf( buf, " Pdeaths {D[{r %-6s {D]{n",
num_thing(ch->pdeath) );
strcat( buf2, buf );
sprintf( buf, " Timers Cps %s\n\r",
IS_SET(ch->act, PLR_WIZINVIS) ? "Vanished" : "" );
strcat( buf2, buf );
stc( buf2, ch );
}
if( ch->fight_timer == 0 )
sprintf( rep, "{Mc{n-" );
else
{
sprintf( buf, "%2d", ch->fight_timer );
sprintf( rep, "%s", buf );
}
strcat( rep, "{D/" );
if( ch->arena_timer == 0 )
strcat( rep, "{Ca{n-" );
else
{
sprintf( buf, "{C%2d", ch->arena_timer );
strcat( rep, buf );
}
{
char buf2 [ MIL ];
buf2[0] = '\0';
sprintf( buf, "{nStatus {D[{r %-9s {D]",
num_thing(ch->race) );
strcat( buf2, buf );
sprintf( buf, "{n Mkills {D[{r %-6s {D]",
num_thing(ch->mkill) );
strcat( buf2, buf );
sprintf( buf, "{n Mdeaths {D[{r %-6s {D]",
num_thing( ch->mdeath) );
strcat( buf2, buf );
sprintf( buf, "{n [%s{D] {r%-8d\n\r",
rep, PC(ch,stats[DEMON_CURRENT]) );
strcat( buf2, buf );
stc( buf2, ch );
}
send_to_char( LINE_SEPERATOR, ch );
send_to_char( LINE_SEPERATOR, ch );
if ( IS_CLASS(ch, CLASS_MAGE) || IS_CLASS(ch,CLASS_DROW) )
ch_printf( ch,"{WYou have{M %d {Wpoints of magic resistance.\n\r",
PC(ch,stats[DROW_MAGIC]) );
if ( IS_CLASS(ch, CLASS_MONK) )
{
ch_printf( ch, "{WYou are currently focusing {n%d{W out of {n%d{W chi.\n\r",
ch->chi[CURRENT], ch->chi[MAXIMUM] );
ch_printf( ch, "{WYour focus points are {n%d{W out of {n%d{W foci.\n\r",
ch->focus[CURRENT], ch->focus[MAXIMUM] );
}
if ( IS_CLASS(ch,CLASS_VAMPIRE) )
{
ch_printf( ch, "{WBlood:{r %d{n {WBeast:{y %d{n.\n\r",
ch->pcdata->condition[COND_THIRST],ch->beast );
if(PC(ch,stats[UNI_RAGE]) > 0 )
ch_printf( ch, "{WBeast affects {rHitroll{W and {rDamroll{W by {y%d.\n\r",
PC(ch,stats[UNI_RAGE]) );
}
if ( IS_CLASS(ch, CLASS_WEREWOLF) )
{
ch_printf( ch, "{WYou have {y%d{n/{y%d {WGnosis Points\n\r",
ch->gnosis[GCURRENT],
ch->gnosis[GMAXIMUM] );
if( PC(ch,powers[WPOWER_SILVER]) > 0 )
ch_printf( ch,"{WYou have attained{n %d {Wpoints of silver tolerance.\n\r",
ch->pcdata->powers[WPOWER_SILVER]);
if( IS_SET(ch->special,SPC_WOLFMAN)
&& PC(ch,stats[UNI_RAGE]) > 0 )
ch_printf( ch, "{WRage: Affects {rHitroll{W and {rDamroll{W by {y%d.\n\r",
PC(ch,stats[UNI_RAGE]) );
}
if ( IS_CLASS(ch, CLASS_NINJA) )
{
ch_printf( ch,"{WYou currently have{n %d{W out of {n500{W Ki store.\n\r",
ch->pcdata->powers[NINJAKI] );
if(PC(ch,stats[UNI_RAGE]) > 0 )
ch_printf(ch,"{WMichi: Affects Hitroll and Damroll by {y%d{n.\n\r",
PC(ch,stats[UNI_RAGE]) );
if ( PC(ch,powers[NPOWER_CHIKYU]) >= 6
&& PC(ch,powers[HARA_KIRI]) > 0)
ch_printf(ch,"{WYou receive the power of HaraKiri for{m %d {Wmore ticks.\n\r",
PC(ch,powers[HARA_KIRI]) );
}
if ( IS_CLASS( ch, CLASS_DEMON) && ch->pcdata->stats[DEMON_POWER] > 0)
ch_printf(ch,"{WDemonic armor affects {RHitroll{W and {RDamroll{W by {r%d{W.\n\r",
((ch->pcdata->stats[DEMON_POWER]) *
ch->pcdata->stats[DEMON_POWER]));
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[];
extern time_t boot_time;
extern time_t current_time;
char buf[MAX_STRING_LENGTH];
char descr [ MAX_INPUT_LENGTH ];
char arg [ MAX_INPUT_LENGTH ];
char * suf;
int day;
int hours;
int minutes;
int seconds;
argument = one_argument( argument, arg );
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";
switch ( time_info.hour )
{
case 1:
case 2: sprintf( descr, "late night" ); break;
case 3:
case 4: sprintf( descr, "early morning" ); break;
case 5: sprintf( descr, "just before dawn" ); break;
case 6: sprintf( descr, "dawn" ); break;
case 7:
case 8: sprintf( descr, "early morning" ); break;
case 9:
case 10:
case 11: sprintf( descr, "morning" ); break;
case 12: sprintf( descr, "midday" ); break;
case 13:
case 15: sprintf( descr, "afternoon" ); break;
case 14: sprintf( descr, "mid-afternoon" ); break;
case 16:
case 17: sprintf( descr, "evening" ); break;
case 18: sprintf( descr, "twilight" ); break;
case 19: sprintf( descr, "dusk" ); break;
case 20:
case 21:
case 22: sprintf( descr, "night" ); break;
case 23: sprintf( descr, "late at night" ); break;
case 0: sprintf( descr, "midnight" ); break;
}
sprintf( buf, "{YIt is %s (%d o'clock %s) on the day of %s. The %d%s of the month of %s, in the year %s.",
descr,
(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],
numberize( time_info.year ) );
if( !IS_OUTSIDE(ch) )
{
strcat( buf, "You cannot tell what the weather is like from here." );
}
else
{
static char * const sky_look[4] =
{
"cloudless",
"cloudy",
"rainy",
"lit by flashes of lightning"
};
descr[0] = '\0';
if (IS_SET(sysdata.world, WORLD_ECLIPSE))
strcat(buf, "The sun is eclipsed by the moon. ");
if (IS_SET(sysdata.world, WORLD_FOG))
strcat(buf, "A thick blanket of fog covers the ground. ");
if (IS_SET(sysdata.world, WORLD_RAIN))
{
sprintf(descr, "The sky is pouring with a heavy rain and %s. ",
weather_info.change >= 0
? "a warm southerly breeze blows"
: "a cold northern gust blows" );
}
else
{
sprintf(descr, "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" );
strcat( buf, descr );
}
}
/*
* Wolves can see moon anytime..
* otherwise, outside and from midnight to 4
*/
if ( IS_CLASS(ch, CLASS_WEREWOLF)
|| (IS_OUTSIDE(ch) && time_info.hour < 4) )
{
if ( weather_info.sky != SKY_CLOUDLESS
&& weather_info.moonphase != MOON_NEW
&& !IS_CLASS(ch, CLASS_WEREWOLF) )
strcat( buf, "The moon is behind a cloud." );
else
switch ( weather_info.moonphase )
{
case MOON_NEW:
strcat( buf, "No moon graces the heavens tonight." ); break;
case MOON_HALF:
strcat( buf, "The waxing half-moon can be seen on this night." ); break;
case MOON_FULL:
strcat( buf, "The moon is full." ); break;
case MOON_GIBBOUS:
strcat( buf, "Tonight, the moon is near full, a waxing gibbous of celestial harmony." ); break;
case MOON_WANING:
strcat( buf, "The moon is in the phase of a waning gibbous." ); break;
case MOON_CRESCENT:
strcat( buf, "Only a sliver of moon remains in the heavens." ); break;
default:
if ( IS_IMMORTAL(ch) )
strcat( buf, "{cSomething is drastically wrong with the moon! E-gads!" );
break;
}
}
{
char *p;
p = format_string( str_dup( buf ) );
send_to_char( p, ch );
free_string( p );
}
ch_printf(ch, "{Y\n\rBooted at: %s\n\rSystem time: %s\n\r",
str_boot_time, (char *) ctime( ¤t_time ) );
seconds = (int) (current_time - boot_time);
hours = seconds / 3600;
minutes = (seconds - hours*3600) / 60;
ch_printf(ch, "{YAscension to Darkness has been up: %d hr%s and %d mn%s.\n\r\n\r",
hours,
hours == 1 ? "": "s",
minutes,
minutes > 1 ? "s" : "" );
if ( IS_IMMORTAL( ch ) && !str_cmp( arg, "full" ) )
{
extern int pulse_area;
extern int pulse_mobile;
extern int pulse_violence;
extern int pulse_save;
extern int pulse_rooms;
sprintf( buf, "\n\r{YBooted at: %s\rSystem time: %s\r",
str_boot_time, (char *) ctime( ¤t_time ) );
send_to_char( buf, ch );
sprintf( buf,
"Time\n\r"
"Hour: %4d Day: %4d Month: %4d Year: %4d\n\r"
"Weather\n\r"
"Mmhg: %4d Sky: %4d Sun: %4d Chnge: %4d\n\r"
"Pulse\n\r"
"Area: %4d Mob: %4d Fight: %4d Save: %4d\n\r"
"Room: %4d\n\r",
time_info.hour, day,
time_info.month, time_info.year,
weather_info.mmhg, weather_info.sky,
weather_info.moonphase, weather_info.change,
pulse_area, pulse_mobile,
pulse_violence, pulse_save,
pulse_rooms );
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(sysdata.world, WORLD_ECLIPSE))
send_to_char("The sun is eclipsed by the moon.\n\r", ch);
if (IS_SET(sysdata.world, WORLD_FOG))
send_to_char("A thick blanket of fog covers the ground.\n\r", ch);
if (IS_SET(sysdata.world, 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 tracker_to_char(char *txt, CHAR_DATA *ch)
{
char buf[MAX_STRING_LENGTH];
int loop,wdth,ln;
ln = strlen(txt);
if (ln > 16)
{
sprintf(buf,"{D--------------------------------------------------------------------------------{n");
wdth = (31 - ln) / 2 + 20;
}
else
{
sprintf(buf,"{D--------------------------------------------------------------------------------{n");
wdth = (16 - ln) / 2 + 32;
}
for (loop = 0; loop < ln; loop++)
buf[loop + wdth + 22] = txt[loop];
cent_to_char(buf,ch);
}
/*
* Main function of Similar Helpfiles. It loops through
* all of the helpfiles, using the string matching function defined to
* find the closest matching helpfiles to the argument. It then checks
* for singles. Then, if matching helpfiles are found at all, it loops
* through and prints out the closest matching helpfiles. If its a
* single(there's only one), it opens the helpfile.
*/
void similar_help_files(CHAR_DATA *ch, char *argument)
{
HELP_DATA *pHelp=NULL;
char buf[MAX_STRING_LENGTH];
char *extension;
sh_int lvl=0;
bool single=FALSE;
page_to_char( "{CSimilar Help Files:\n\r", ch);
for ( pHelp = help_first; pHelp; pHelp=pHelp->next)
{
buf[0]='\0';
extension = pHelp->keyword;
if (pHelp->level > get_trust(ch))
continue;
while ( extension[0] != '\0' )
{
extension= one_argument(extension, buf);
if ( str_similar(argument, buf) > lvl)
{
lvl=str_similar(argument, buf);
single=TRUE;
}
else if ( str_similar(argument, buf) == lvl && lvl > 0)
{
single=FALSE;
}
}
}
if (lvl==0)
{
page_to_char( "{CNo similar help files.\n\r", ch);
return;
}
for ( pHelp = help_first; pHelp; pHelp=pHelp->next)
{
buf[0]='\0';
extension = pHelp->keyword;
while ( extension[0] != '\0' )
{
extension=one_argument(extension, buf);
if ( str_similar(argument, buf) >= lvl
&& pHelp->level <= get_trust(ch))
{
if (single)
{
page_to_char( "{COpening only similar helpfile.{x\n\r", ch);
do_help( ch, buf);
return;
}
pager_printf(ch, "'help %s'\n\r", pHelp->keyword);
break;
}
}
}
return;
}
void do_help( CHAR_DATA *ch, char *argument )
{
char argall[MAX_INPUT_LENGTH];
char argone[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
char origarg[MIL];
HELP_DATA *pHelp;
bool found;
if ( argument[0] == '\0' )
argument = "summary";
sprintf(origarg,argument);
/*
* Tricky argument handling so 'help a b' doesn't match a.
*/
argall[0] = '\0';
while ( argument[0] != '\0' )
Showing the first 100 KB of 188.1 KB. Download the archive for the full file.