act_info.cpp
act_info.cpp · 167.2 KB
From the archive wotl-src.zip
Download the archive « Back to the archive contents
/**************************************************************************/
// act_info.cpp - primarily code showing players information
/***************************************************************************
* The Dawn of Time v1.69r (c)1997-2004 Michael Garratt *
* >> A number of people have contributed to the Dawn codebase, with the *
* majority of code written by Michael Garratt - www.dawnoftime.org *
* >> To use this source code, you must fully comply with all the licenses *
* in licenses.txt... In particular, you may not remove this copyright *
* notice. *
***************************************************************************
* >> Original Diku Mud copyright (c)1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, & Katja Nyboe. *
* >> Merc Diku Mud improvements copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* >> ROM 2.4 is copyright 1993-1995 Russ Taylor and has been brought to *
* you by the ROM consortium: Russ Taylor(rtaylor@pacinfo.com), *
* Gabrielle Taylor(gtaylor@pacinfo.com) & Brian Moore(rom@rom.efn.org) *
* >> Oblivion 1.2 is copyright 1996 Wes Wagner *
**************************************************************************/
#include "include.h" // dawn standard includes
#include "magic.h"
#include "olc.h"
#include "duel.h"
#include "math.h"
#include "msp.h"
#include "ictime.h"
#include "lockers.h"
#include "nanny.h"
/* command procedures needed */
DECLARE_DO_FUN( do_exits );
DECLARE_DO_FUN( do_look );
DECLARE_DO_FUN( do_help );
DECLARE_DO_FUN( do_affects );
DECLARE_DO_FUN( do_map); // Kal
DECLARE_DO_FUN( do_tracks); // Kal
int get_birthmonth( char_data *ch );
char *get_weapontype(OBJ_DATA *obj);
void where_char args((char_data *victim, char_data *ch,
sh_int depth, sh_int door));
char *const where_distance[2] = {
"in the same room.",
"directly to the %s."
};
void letter_read( char_data *ch, OBJ_DATA *letter );
DECLARE_DO_FUN( do_count );
char * const where_name [] =
{
"<used as light> ",
"<worn on finger> ",
"<worn on finger> ",
"<worn around neck> ",
"<worn around neck> ",
"<worn on torso> ",
"<worn on head> ",
"<worn on legs> ",
"<worn on feet> ",
"<worn on hands> ",
"<worn on arms> ",
"<worn as shield> ",
"<worn about body> ",
"<worn about waist> ",
"<worn around wrist> ",
"<worn around wrist> ",
"<wielded> ",
"<held> ",
"<floating nearby> ",
"<secondary weapon> ",
"<lodged in arm> ",
"<lodged in leg> ",
"<lodged in rib> ",
"<sheathed> ",
"<concealed> ",
"<worn on eyes> ",
"<worn on ear> ",
"<worn on ear> ",
"<worn on face> ",
"<worn on ankle> ",
"<worn on ankle> ",
"<worn on back> ",
"<wielded 3rd hand> ",
"<held in 4th hand> ",
"<wielded 4th hand> "
};
/*
* Local functions.
*/
void show_list_to_char args( ( OBJ_DATA *list, char_data *ch, char *filter,
bool fShort, bool fShowNothing ) );
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 ) );
char_data *rand_figment( char_data *ch )
{
connection_data *d;
char_data *figment;
bool dfig = false;
for ( d = connection_list; d; d = d->next )
{
if ( d->connected_state == CON_PLAYING
&& d->character != ch
&& d->character->in_room
&& can_see( ch, d->character ) )
{
dfig = true;
break;
}
}
if ( !dfig )
figment = ch;
else
figment = d->character;
return figment;
}
MOB_INDEX_DATA *rand_figment_mob( char_data *ch )
{
MOB_INDEX_DATA *figmentmob;
int figmentnum = 0;
int lfig = 0;
int ufig = 0;
int count = 0;
lfig = ch->in_room->area->min_vnum;
ufig = ch->in_room->area->max_vnum;
while( !(figmentmob = get_mob_index( figmentnum ) ) )
{
figmentnum = number_range( lfig, ufig );
count++;
if (count == 20)
{
switch(dice (1,10))
{
case 1:
figmentnum = 10398; // Death
break;
case 2:
figmentnum = 1100; // Beholder
break;
case 3:
figmentnum = 9819; // Undead Beholder
break;
case 4:
figmentnum = 3114; // Hassan
break;
case 5:
figmentnum = 12720; // Ghost of Patrick
break;
case 6:
figmentnum = 2485; // Red Dragon
break;
case 7:
figmentnum = 2486; // Blue Dragon
break;
case 8:
figmentnum = 1021; // Spike the Dog
break;
case 9:
figmentnum = 48012; // Dravar the Lich
break;
case 10:
figmentnum = 9899; // Dargoth the Lich
break;
}
}
}
return figmentmob;
}
OBJ_INDEX_DATA *rand_figment_obj( char_data *ch )
{
OBJ_INDEX_DATA *figmentobj;
int figmentnum = 0;
int lfig = 0;
int ufig = 0;
lfig = ch->in_room->area->min_vnum;
ufig = ch->in_room->area->max_vnum;
while( !(figmentobj = get_obj_index( figmentnum ) ) )
figmentnum = number_range( lfig, ufig );
return figmentobj;
}
/**************************************************************************/
#define NUM_DAYS 21
/* Match this to the number of days per month; this is the moon cycle */
#define NUM_MONTHS 12
/* Match this to the number of months defined in month_name[]. */
#define MAP_WIDTH 72
#define MAP_HEIGHT 8
/* Should be the string length and number of the constants below.*/
const char * star_map[] =
{
" C. C. g*",
" O: R* G* G. W* W. W. C. C. Y* Y. Y. ",
" O*. c. W.W. W. C. Y..Y. ",
"O.O. O. c. G..G. W: B* Y.",
" O. c. c. W. W. r* Y.",
" O.c. c. G. P.. W. p. Y. Y: ",
" c. G* P. P. p. p: Y. Y. ",
" b* P.: P* p.p: "
};
/****************** CONSTELLATIONS and STARS *****************************
Cygnus Mars Orion Dragon Cassiopeia Venus
Ursa Ninor Mercurius Pluto
Uranus Leo Crown Raptor
*************************************************************************/
const char * sun_map[] =
{
"\\'|'/",
"- O -",
"/.|.\\"
};
const char * moon_map[] =
{
" @@@ ",
"@@@@@",
" @@@ "
};
/**************************************************************************/
void look_sky ( char_data * ch )
{
static char buf[MSL];
static char buf2[4];
int starpos, sunpos, moonpos, moonphase, i, linenum, precip;
ch->println("You gaze up towards the heavens and see:");
precip = weather_info[ch->in_room->sector_type].sky;
if (precip > 1)
{
ch->println("There are some clouds in the sky so you cannot see anything else.");
return;
}
sunpos = (MAP_WIDTH * (24 - time_info.hour) / 24);
moonpos = (sunpos + time_info.day * MAP_WIDTH / NUM_DAYS) % MAP_WIDTH;
if ((moonphase = ((((MAP_WIDTH + moonpos - sunpos ) % MAP_WIDTH ) +
(MAP_WIDTH/16)) * 8 ) / MAP_WIDTH)
> 4) moonphase -= 8;
starpos = (sunpos + MAP_WIDTH * time_info.month / NUM_MONTHS) % MAP_WIDTH;
/* The left end of the star_map will be straight overhead at midnight during
month 0 */
for ( linenum = 0; linenum < MAP_HEIGHT; linenum++ )
{
if ((time_info.hour >= 6 && time_info.hour <= 18) &&
(linenum < 3 || linenum >= 6))
continue;
sprintf(buf," ");
/* for ( i = MAP_WIDTH/4; i <= 3*MAP_WIDTH/4; i++)*/
for ( i = 1; i <= MAP_WIDTH; i++)
{
/* plot moon on top of anything else...unless new moon & no eclipse */
if ((time_info.hour >= 6 && time_info.hour <= 18) /* daytime? */
&& (moonpos >= MAP_WIDTH/4 - 2) && (moonpos <= 3*MAP_WIDTH/4 + 2) /* in sky? */
&& ( i >= moonpos - 2 ) && (i <= moonpos + 2) /* is this pixel near moon? */
&& ((sunpos == moonpos && time_info.hour == 12) || moonphase != 0 ) /*no eclipse*/
&& (moon_map[linenum-3][i+2-moonpos] == '@'))
{
if ((moonphase < 0 && i - 2 - moonpos >= moonphase) ||
(moonphase > 0 && i + 2 - moonpos <= moonphase))
strcat(buf,"`W@");
else
strcat(buf," ");
}
else
if ((linenum >= 3) && (linenum < 6) && /* nighttime */
(moonpos >= MAP_WIDTH/4 - 2) && (moonpos <= 3*MAP_WIDTH/4 + 2) /* in sky? */
&& ( i >= moonpos - 2 ) && (i <= moonpos + 2) /* is this pixel near moon? */
&& (moon_map[linenum-3][i+2-moonpos] == '@'))
{
if ((moonphase < 0 && i - 2 - moonpos >= moonphase) ||
(moonphase > 0 && i + 2 - moonpos <= moonphase))
strcat(buf,"&W@");
else
strcat(buf," ");
}
else /* plot sun or stars */
{
if (time_info.hour>=6 && time_info.hour<=18) /* daytime */
{
if ( i >= sunpos - 2 && i <= sunpos + 2 )
{
sprintf(buf2,"&Y%c",sun_map[linenum-3][i+2-sunpos]);
strcat(buf,buf2);
}
else
strcat(buf," ");
}
else
{
switch (star_map[linenum][(MAP_WIDTH + i - starpos)%MAP_WIDTH])
{
default : strcat(buf," "); break;
case ':' : strcat(buf,":"); break;
case '.' : strcat(buf,"."); break;
case '*' : strcat(buf,"*"); break;
case 'G' : strcat(buf,"`G "); break;
case 'g' : strcat(buf,"`g "); break;
case 'R' : strcat(buf,"`R "); break;
case 'r' : strcat(buf,"`r "); break;
case 'C' : strcat(buf,"`C "); break;
case 'O' : strcat(buf,"`S "); break;
case 'B' : strcat(buf,"`B "); break;
case 'P' : strcat(buf,"`M "); break;
case 'W' : strcat(buf,"`W "); break;
case 'b' : strcat(buf,"`b "); break;
case 'p' : strcat(buf,"`m "); break;
case 'Y' : strcat(buf,"`Y "); break;
case 'c' : strcat(buf,"`c "); break;
}
}
}
}
strcat(buf,"\n\r");
ch->println(buf);
}
}
/**************************************************************************/
char *get_canwear_colour( OBJ_DATA *obj, char_data *ch)
{
int can_wear=0; // if not 0, it can't be worn
if( ( IS_SET(obj->extra_flags, OBJEXTRA_MAGIC)
&& HAS_CLASSFLAG(ch, CLASSFLAG_MAGIC_ANTIPATHY)
)
||(!IS_NPC(ch) && obj->pIndexData->relative_size<
race_table[ch->race]->low_size &&
obj->item_type != ITEM_LIGHT &&
!CAN_WEAR( obj, OBJWEAR_HOLD) &&
!CAN_WEAR( obj, OBJWEAR_FLOAT) )
||(!IS_NPC(ch) && obj->pIndexData->relative_size>
race_table[ch->race]->high_size &&
obj->item_type != ITEM_LIGHT &&
!CAN_WEAR( obj, OBJWEAR_FLOAT) )
)
{
can_wear=1;
}
if(!IS_NPC(ch) && !can_wear)
{
can_wear = DISALLOWED_OBJECT_FOR_CHAR(obj, ch)?1:0;
}
// restrictions for objects
if(!IS_NPC(ch) && !can_wear)
{
if(obj->pIndexData && ch->pcdata
&& HAS_CONFIG(ch,CONFIG_OBJRESTRICT)
&& ((ch->pcdata->objrestrict& obj->pIndexData->objrestrict)>0))
{
can_wear=2;
}
}
switch(can_wear){
case 0:
return "`=d";
case 1:
return "`=k";
case 2:
return "`=K";
}
bugf("get_canwear_colour(): unknown value %d", can_wear);
return "`x";
}
/**************************************************************************/
char *format_obj_to_char_new( OBJ_DATA *obj, char_data *ch, bool fShort )
{
static char buf[MSL];
buf[0] = '\0';
char name[MSL];
name[0] = '\0';
// get the objects name into 'name'
if ( fShort ){
if ( !IS_NULLSTR(obj->short_descr) ){
strcpy( name, obj->short_descr );
}
}else{
if ( !IS_NULLSTR(obj->description) ){
strcpy( name, obj->description );
}
}
if ( ( fShort && IS_NULLSTR(obj->short_descr) )
|| (!fShort && IS_NULLSTR(obj->description) ) )
{
if (HAS_HOLYLIGHT(ch))
{
char buf2[MSL];
sprintf(buf2," `#`m(no short|long%s%d)",
obj->pIndexData?" ":"", obj->pIndexData?obj->pIndexData->vnum:0);
strcat(buf,buf2);
if (obj->pIndexData &&
!IS_UNSWITCHED_MOB(ch) && IS_SET(TRUE_CH(ch)->act, PLR_HOLYVNUM))
{
sprintf(buf2," `#`g[%d,%d]", obj->pIndexData->vnum, obj->level);
strcat(buf,buf2);
}
strcat(buf,"`&");
}
return buf;
}
if ( IS_OBJ_STAT(obj, OBJEXTRA_INVIS) ) strcat( buf, game_settings->aura_invis);
if ( IS_AFFECTED(ch, AFF_DETECT_EVIL)
&& IS_OBJ_STAT(obj, OBJEXTRA_EVIL) ) strcat( buf, game_settings->aura_evil);
if ( IS_OBJ2_STAT(obj, OBJEXTRA2_SHADOWPLANE) ) strcat( buf, game_settings->aura_shadowplane);
if ( IS_AFFECTED(ch, AFF_DETECT_GOOD)
&& IS_OBJ_STAT(obj,OBJEXTRA_BLESS)) strcat( buf, game_settings->aura_good);
if ( IS_AFFECTED3(ch, AFF3_DETECT_TAINT)
&& IS_OBJ_STAT(obj, OBJEXTRA_MAGIC)) strcat( buf, "`#`m(`rT`ma`gi`mn`rt`me`gd`m)`^");
else if ( IS_AFFECTED(ch, AFF_DETECT_MAGIC)
&& IS_OBJ_STAT(obj, OBJEXTRA_MAGIC)) strcat( buf, game_settings->aura_magical);
if ( IS_OBJ_STAT(obj, OBJEXTRA_GLOW) ) strcat( buf, game_settings->aura_glowing);
if ( IS_OBJ_STAT(obj, OBJEXTRA_CHAOS) ) strcat( buf, game_settings->aura_chaos);
if ( IS_OBJ_STAT(obj, OBJEXTRA_HUM) ) strcat( buf, game_settings->aura_hum);
if ( IS_SET( obj->extra2_flags, OBJEXTRA2_BURIED)) strcat( buf, game_settings->aura_buried);
// if ( IS_TRAPPED( obj )
// && IS_AFFECTED2( ch, AFF2_DET_TRAPS )) strcat( buf, "{#{r(Trapped){& " );
if ( IS_WEAPON_STAT(obj, WEAPON_HOLY)
&& IS_OBJ_STAT(obj,OBJEXTRA_ANTI_EVIL)) strcat(buf,game_settings->aura_holy);
if(CAN_WEAR(obj, OBJWEAR_WIELD))
{
if ( IS_WEAPON_STAT(obj, WEAPON_HOLY) && IS_OBJ_STAT(obj,OBJEXTRA_ANTI_GOOD)){
strcat(buf,game_settings->aura_unholy);
}
if ( IS_WEAPON_STAT(obj, WEAPON_FLAMING)){
strcat(buf,game_settings->aura_flaming);
}
if ( IS_WEAPON_STAT(obj, WEAPON_VAMPIRIC)){
strcat(buf,game_settings->aura_vampric);
}
if ( IS_WEAPON_STAT(obj, WEAPON_SHOCKING)){
strcat(buf,game_settings->aura_shocking);
}
if ( IS_WEAPON_STAT(obj, WEAPON_FROST)){
strcat(buf,game_settings->aura_frost);
}
}
if ( obj->item_type == ITEM_CORPSE_NPC)
{
if (IS_SET (obj->corpse_flags, DAM_BASH))
strcat(buf, "`#`w(`bBattered`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_PIERCE))
strcat(buf, "`#`w(`rGouged`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_SLASH))
strcat(buf, "`#`w(`rSlashed`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_FIRE))
strcat(buf, "`#`w(`RB`ru`RR`rn`RE`rd`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_COLD))
strcat(buf, "`#`w(`CF`cr`CO`cz`CE`cn`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_LIGHTNING))
strcat(buf, "`#`w(`SB`wl`SA`wc`SK`we`SN`we`SD`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_ACID))
strcat(buf, "`#`w(`YL`yi`Yq`yu`Yi`yf`Yi`ye`Yd`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_NEGATIVE))
strcat(buf, "`#`w(`ST`ww`SI`ws`ST`we`SD`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_POISON))
strcat(buf, "`#`w(`gSickly`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_HOLY))
strcat(buf, "`#`w(`rIncinerated`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_ENERGY))
strcat(buf, "`#`w(`SC`wh`SA`wr`SR`we`SD`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_DISEASE))
strcat(buf, "`#`w(`SDiseased`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_DROWNING))
strcat(buf, "`#`w(`BBloated`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_LIGHT))
strcat(buf, "`#`w(`SC`wh`SA`wr`SR`we`SD`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_HARM))
strcat(buf, "`#`w(`cRigid`w)`^ ");
if (IS_SET (obj->corpse_flags, CORPSE_DAM_SOUND))
strcat(buf, "`#`w(`bBattered`w)`^ ");
}
// mxp the object
strcat(buf, mxp_create_tag(ch, mxp_tag_for_object(ch, obj), name));
if (!IS_UNSWITCHED_MOB(ch) && IS_SET(TRUE_CH(ch)->act, PLR_HOLYVNUM)){
char buf2[MSL];
if (obj->pIndexData)
{
sprintf(buf2," `#`g[%d,%d]`&", obj->pIndexData->vnum, obj->level);
strcat(buf,buf2);
}
}
return buf;
}
/**************************************************************************/
char *format_obj_to_char( OBJ_DATA *obj, char_data *ch, bool fShort )
{
static char buf[MSL];
sprintf(buf,"`#%s%s`&",
get_canwear_colour( obj, ch),
format_obj_to_char_new( obj, ch, fShort ));
return buf;
}
/**************************************************************************/
/* Show a list to a character.
* Can coalesce duplicated items.
* filter support added by Kalahn Feb 01.
*/
void show_list_to_char( OBJ_DATA *list, char_data *ch, char *filter, bool fShort, bool fShowNothing )
{
char buf[MSL];
BUFFER *output;
char **prgpstrShow;
char **prgpstrShowMXP=NULL;
char **prgpstrColour;
int *prgnShow;
char *pstrShow;
OBJ_DATA *obj;
int nShow;
int iShow;
int count;
bool fCombine;
if ( ch->desc == NULL ){
return;
}
// pre count the number of items we will be displaying
count = 0;
for ( obj = list; obj; obj = obj->next_content ){
count++;
}
if(count<1){
return; // dont do anything if nothing to display
}
// record if they have MXP, if they do, initially work with non MXP versions
// of the object list so we can compact easily without MXP UID's confusing
// the compact system.
bool player_has_mxp;
if(HAS_MXP(ch)){
TRUE_CH(ch)->pcdata->mxp_enabled=false;
player_has_mxp=true;
}else{
player_has_mxp=false;
}
// Alloc space for output lines.
output = new_buf();
// allocate memory to handle the sorting of this list etc
prgnShow = (int *)alloc_mem( count * sizeof(int) );
prgpstrShow = (char **)alloc_mem( count * sizeof(char *) );
prgpstrColour = (char **)alloc_mem( count * sizeof(char *) );
if(player_has_mxp){
prgpstrShowMXP =(char **)alloc_mem( count * sizeof(char *) );
}
nShow = 0;
// Format the list of objects.
bool matched;
for ( obj = list; obj != NULL; obj = obj->next_content )
{
// filter support for inventory list etc
if(!IS_NULLSTR(filter)){
matched=false;
if(is_name( filter, obj->name)) {
matched=true;
}else if(is_name( filter, obj->short_descr )) {
matched=true;
}else if(is_name( filter, obj->description )) {
matched=true;
}else if(flag_value( item_types, filter) == obj->item_type){
matched=true;
}
if(!matched){
continue;
}
}
if ( obj->wear_loc == WEAR_NONE && can_see_obj( ch, obj ))
{
pstrShow = format_obj_to_char_new( obj, ch, fShort );
fCombine = false;
if ( IS_NPC(ch) || IS_SET(ch->comm, COMM_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;
// record the colour code of this object
prgpstrColour[nShow]=str_dup(get_canwear_colour( obj, ch));
// record MXP version if necessary
if(player_has_mxp){
TRUE_CH(ch)->pcdata->mxp_enabled=true;
prgpstrShowMXP[nShow]=str_dup(format_obj_to_char_new( obj, ch, fShort ));
TRUE_CH(ch)->pcdata->mxp_enabled=false;
}
nShow++;
}
}
}
// Output the formatted list.
for ( iShow = 0; iShow < nShow; iShow++ )
{
if (prgpstrShow[iShow][0] == '\0')
{
free_string(prgpstrShow[iShow]);
continue;
}
if ( IS_NPC(ch) || IS_SET(ch->comm, COMM_COMBINE) )
{
add_buf(output, "`#");
add_buf(output, prgpstrColour[iShow]);
if ( prgnShow[iShow] != 1 ){
sprintf( buf, "(%2d) ", prgnShow[iShow] );
add_buf(output,buf);
}else{
add_buf(output," ");
}
}
if(player_has_mxp){
add_buf(output,prgpstrShowMXP[iShow]);
free_string( prgpstrShowMXP[iShow] );
}else{
add_buf(output,prgpstrShow[iShow]);
}
add_buf(output,"`&\r\n");
free_string( prgpstrShow[iShow] );
free_string( prgpstrColour[iShow] );
}
if ( fShowNothing && nShow == 0 )
{
if ( IS_NPC(ch) || IS_SET(ch->comm, COMM_COMBINE) )
ch->print(" ");
ch->println( "Nothing." );
}
ch->sendpage(buf_string(output));
free_buf(output);
// Clean up.
free_mem( prgnShow, count * sizeof(int) );
free_mem( prgpstrShow, count * sizeof(char *) );
free_mem( prgpstrColour, count * sizeof(char *) );
if(player_has_mxp){
// free the memory allocated to store the MXP version of the list
free_mem( prgpstrShowMXP, count * sizeof(char *) );
// turn MXP back on for connection
TRUE_CH(ch)->pcdata->mxp_enabled=true;
}
return;
}
/**************************************************************************/
void show_char_to_char_0( char_data *victim, char_data *ch )
{
char buf[MSL], buf2[MSL];
//prototype
char * char_position_text( char_data *ch);
if (IS_UNSWITCHED_MOB(ch))
{
return;
}
buf[0] = '\0';
if( IS_SET(victim->comm,COMM_AFK ) ) strcat( buf, "[AFK] " );
if(IS_LINKDEAD(victim)){
if(victim->pload){
strcat( buf, "[PLOAD] ");
}else{
strcat( buf, "[LINKDEAD] ");
}
}
if( IS_AFFECTED(victim, AFF_INVISIBLE) ) strcat( buf, "(Invis) " );
// wizi stuff
if (INVIS_LEVEL(victim)&& IS_IMMORTAL(ch)){
if (INVIS_LEVEL(victim)==LEVEL_IMMORTAL){
strcat( buf, "(Wizi) " );
}else{
buf2[0]='\0';
sprintf(buf2, "(Wizi %d) ", INVIS_LEVEL(victim));
strcat( buf, buf2);
buf2[0]='\0';
}
}
if ( IS_AFFECTED(victim, AFF_HIDE) ) strcat( buf, "`#`g(Hide)`& " );
if ( IS_AFFECTED(victim, AFF_CHARM) ) strcat( buf, "`#`c(Charmed)`& " );
if ( IS_AFFECTED(victim, AFF_PASS_DOOR) ) strcat( buf, "`#`C(Translucent)`& ");
if ( IS_AFFECTED(victim, AFF_FAERIE_FIRE) ) strcat( buf, "`#`r(Pink Aura)`& " );
if ( IS_EVIL(victim)
&& IS_AFFECTED(ch, AFF_DETECT_EVIL) ) strcat( buf, "`#`R(Red Aura)`& " );
if ( IS_GOOD(victim)
&& IS_AFFECTED(ch, AFF_DETECT_GOOD) ) strcat( buf, "`#`Y(Golden Aura)`& ");
if ( IS_AFFECTED(victim, AFF_SANCTUARY) ) strcat( buf, "`#`W(White Aura)`& " );
if ( IS_SET(victim->config2, CONFIG2_BEHOLDER_EYE) ) strcat( buf, "`#`R(Glowing Eye)`& " );
if ( (IS_AFFECTED2(ch, AFF2_SHADOWSIGHT) || IS_AFFECTED2(ch, AFF2_SHADOWPLANE) || HAS_HOLYLIGHT(ch))
&& IS_AFFECTED2(victim, AFF2_SHADOWPLANE)) strcat( buf, "`#`S(Shadow)`& " );
if (HAS_HOLYLIGHT(ch)
&& IS_AFFECTED2(victim, AFF2_POLYMORPH)) strcat( buf, "`#`G(Polymorph)`& " );
if ( (IS_AFFECTED2(ch, AFF2_HIGHLANDER) || HAS_HOLYLIGHT(ch))
&& IS_AFFECTED2(victim, AFF2_HIGHLANDER)) strcat( buf, "`#`Y(Highlander)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_VAMPIRE(ch))
&& IS_VAMPIRE(victim)) strcat( buf, "`#`R(Vampire)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_WEREBEAST(ch))
&& IS_WEREWOLF(victim)) strcat( buf, "`#`R(WereWolf)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_WEREBEAST(ch))
&& IS_WERERAT(victim)) strcat( buf, "`#`R(WereRat)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_WEREBEAST(ch))
&& IS_WEREBOAR(victim)) strcat( buf, "`#`R(WereBoar)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_WEREBEAST(ch))
&& IS_WEREBEAR(victim)) strcat( buf, "`#`R(WereBear)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_WEREBEAST(ch))
&& IS_WERETIGER(victim)) strcat( buf, "`#`R(WereTiger)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_WEREBEAST(ch))
&& IS_WERESPIDER(victim)) strcat( buf, "`#`R(WereSpider)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_WEREBEAST(ch))
&& IS_WERECOBRA(victim)) strcat( buf, "`#`R(WereCobra)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_WEREBEAST(ch))
&& IS_WEREBAT(victim)) strcat( buf, "`#`R(WereBat)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_WEREBEAST(ch))
&& IS_WERECROCODILE(victim)) strcat( buf, "`#`R(WereCroc)`& " );
if ((HAS_HOLYLIGHT(ch) || IS_AFFECTED2(ch, AFF2_ETHEREAL)) &&
IS_AFFECTED2(victim, AFF2_ETHEREAL)) strcat( buf, "`#`W(Mist)`& " );
// should only ever been seen by imms (because of can_see)
if ( IS_AFFECTED2(victim, AFF2_TREEFORM) ) strcat( buf, "`#`G(Tree)`& " );
// imms and faeries
if ( IS_AFFECTED2(victim, AFF2_VANISH) ) strcat( buf, "`#`S(Vanished)`& " );
if ( IS_NPC(victim) && IS_SET(victim->act, ACT_IS_UNSEEN)){
if (HAS_HOLYLIGHT(ch)){
strcat( buf, "(UNSEEN) " );
}else{
return;
}
}
/////////////////////////////////////////////////////////////////////
// Below displays chars in positions that dont use victim->postion //
/////////////////////////////////////////////////////////////////////
// subdued players
if (IS_SUBDUED(victim) && IS_VAMPIRE(victim))
{
ch->printlnf( "%s%s is lying here mortally wounded.",
buf, capitalize( PERS( victim, ch )));
return;
}
if (IS_SUBDUED(victim))
{
ch->printlnf( "%s%s is here looking a little subdued.",
buf, capitalize( PERS( victim, ch )));
return;
}
// mounted players
if (IS_MOUNTED(victim))
{
if (IS_RIDING(ch)==victim)
{
// we are riding the victim
ch->printlnf( "%s`#`sYou are riding on %s.`&",
buf, PERS( victim, ch ));
return;
}
else
{
// the victim is being ridden, but not by us,
// show them with the rider (not by themselves)
return;
}
}
// mob is tethered (NPC's only at this stage)
if (IS_TETHERED(victim))
{
ch->printlnf( "%s`#`s%s is tethered here.`&",
buf, capitalize( PERS( victim, ch )));
return;
}
// characters riding others
if (IS_RIDING(victim))
{
ch->printlnf( "%s`#`s%s is here riding %s.`&`B",
buf,
capitalize( PERS( victim, ch )),
((IS_RIDING(victim) != ch)?PERS( IS_RIDING(victim), ch ):"you"));
return;
}
/* NOTE: need to add
* - subdued and tethered?
* - subdued and being ridden?
*/
//////////////////////////////////////////////////////////////
// Above postions that dont use victim->postion above //
//////////////////////////////////////////////////////////////
// mobs that are in default position and have look descripts
if (IS_NPC(victim)
&& victim->position == victim->start_pos
&& !IS_NULLSTR(victim->long_descr))
{
ch->printlnf( "%s%s", buf, LONGPERS(victim, ch));
return;
}
// players and mobs in positions defined with victim->pos
strcat ( buf, PERS(victim, ch));
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:
if(!IS_NPC(victim) && victim->race == race_lookup("beholder"))
{
strcat( buf, " is floating here asleep." );
break;
} else
strcat( buf, char_position_text(victim));
break;
case POS_RESTING:
case POS_SITTING:
case POS_KNEELING:
case POS_STANDING:
if(is_affected( victim, gsn_hold_person))
{
strcat( buf, " is standing here immobilized." );
break;
} else
if(!IS_NPC(victim) && victim->race == race_lookup("beholder"))
{
strcat( buf, " is floating here." );
break;
} else
if(!IS_NPC(victim) &&
IS_SET(victim->config2, CONFIG2_POSING) &&
victim->posing != NULL)
{
strcat( buf, victim->posing);
}
else
strcat( buf, char_position_text(victim));
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, "someone who left??" );
break;
} // end of switch (victim->postion)
buf[0]= UPPER(buf[0]);
ch->println(buf);
return;
}
/**************************************************************************/
void show_char_to_char_1( char_data *victim, char_data *ch )
{
char buf[MSL];
OBJ_DATA *obj;
int iWear;
int percent;
bool found;
bool peeking;
peeking = ( victim != ch && !IS_NPC(ch)
&& IS_SET(ch->act,PLR_AUTOPEEK)
&& number_percent( ) < get_skill(ch,gsn_peek));
// can't peek at IC immortals unless you are an imm
if (!IS_NPC(victim) && victim->level>= LEVEL_IMMORTAL)
{
peeking= false;
}
// ic imms always exceed at peeking
if (!IS_NPC(ch) && (ch->level>= LEVEL_IMMORTAL) && IS_SET(ch->act,PLR_AUTOPEEK))
{
peeking= true;
}
if ( can_see( victim, ch ) )
{
if (ch == victim)
act( "$n looks at $mself.",ch,NULL,NULL,TO_ROOM);
else
{
if (peeking || number_percent( )<=5)
{
act( "$n looks at you thoroughly.", ch, NULL, victim, TO_VICT );
act( "$n looks at $N thoroughly.", ch, NULL, victim, TO_NOTVICT );
}
else
{
act( "$n looks at you.", ch, NULL, victim, TO_VICT );
act( "$n looks at $N.", ch, NULL, victim, TO_NOTVICT );
}
}
}
if ( victim->description[0] != '\0' )
{
if( IS_SET( victim->affected_by2, AFF2_POLYMORPH ) )
{
ch->print(victim->poly_description );
} else {
ch->print(victim->description );
}
}
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 excellent condition.\r\n");
else if (percent >= 90)
strcat( buf, " has a few scratches.\r\n");
else if (percent >= 75)
strcat( buf," has some small wounds and bruises.\r\n");
else if (percent >= 50)
strcat( buf, " has quite a few wounds.\r\n");
else if (percent >= 30)
strcat( buf, " has some big nasty wounds and scratches.\r\n");
else if (percent >= 15)
strcat ( buf, " looks pretty hurt.\r\n");
else if (percent >= 0 )
strcat (buf, " is in `#`Rawful condition`&.\r\n");
else
strcat(buf, " is `#`Rbleeding`& to death.\r\n");
buf[0] = UPPER(buf[0]);
ch->print( buf );
if (victim->mounted_on)
{
ch->printlnf( "%s is mounted on %s.",
capitalize( victim->short_descr),
victim->mounted_on->short_descr );
}
if (victim->ridden_by)
{
ch->printlnf( "%s is being ridden by %s.",
capitalize( victim->short_descr),
victim->ridden_by->short_descr );
}
// flying status
if ( IS_AFFECTED(victim, AFF_FLYING) ){
ch->printlnf( "%s appears to be airborne.", PERS(victim,ch) );
}
// money changers
if ( IS_NPC(victim) && IS_SET(victim->act,ACT_IS_CHANGER)){
ch->printlnf( "%s appears to be willing to exchange "
"your silver coins for gold.", PERS(victim,ch) );
}
if (IS_VAMPAFF(victim, VAM_NIGHTSIGHT)) {
ch->printlnf( "%s eyes are glowing bright red.", PERS(victim,ch) );
}
if (IS_VAMPAFF(victim, VAM_FANGS)) {
ch->printlnf( "%s has a pair of long, pointed fangs.", PERS(victim,ch) );
}
if (IS_VAMPAFF(victim, VAM_CLAWS)) {
ch->printlnf( "%s has sharp claws protruding from under their finger nails.", PERS(victim,ch) );
}
if(IS_AFFECTED2(victim, AFF2_POLYMORPH) && !HAS_HOLYLIGHT(ch) && ch!=victim) {
return;
}
if(IS_SET(victim->config2, CONFIG2_BEHOLDER_EYE))
{
ch->printlnf( "%s central eye is `#`Rglowing red`^.", PERS(victim,ch) );
}
if(IS_AFFECTED2(victim, AFF2_PREGNANT))
{
if( victim->pcdata->pregnant >= current_time + (7 * ICTIME_IRLSECS_PER_MONTH)) {
ch->printlnf( "%s has a small round belly and is with child.", PERS(victim,ch) ); }
else {
if( victim->pcdata->pregnant >= current_time + (4 * ICTIME_IRLSECS_PER_MONTH)) {
ch->printlnf( "%s has a round belly and is with child.", PERS(victim,ch) ); }
else {
ch->printlnf( "%s has a large round belly and is with child.", PERS(victim,ch) ); }
}
} // End Pregnant Look
found = false;
for ( iWear = 0; iWear < MAX_WEAR; iWear++ )
{
if ( iWear == WEAR_CONCEALED
&& ch != victim
&& !HAS_HOLYLIGHT( ch ))
continue;
if ( ( obj = get_eq_char( victim, iWear ) ) != NULL
&& can_see_obj( ch, obj ) )
{
if ( !found )
{
ch->println( "" );
act( "$N is using:", ch, NULL, victim, TO_CHAR );
found = true;
}
ch->printlnf( "`=\xab""%s%s`x",
where_name[iWear],
format_obj_to_char( obj, ch, true ));
}
}
if (peeking)
{
ch->printlnf( "\r\nYou peek at the inventory of %s:`=\xab",
PERS(victim,ch));
check_improve(ch,gsn_peek,true,4);
show_list_to_char( victim->carrying, ch, "", true, true );
ch->print( "`x" );
}
return;
}
/**************************************************************************/
void show_char_to_char( char_data *list, char_data *ch )
{
char_data *rch;
char_data *rch2;
int figchance = 0;
for ( rch = list; rch; rch = rch->next_in_room )
{
if ( rch == ch )
continue;
if ( get_trust(ch) < INVIS_LEVEL(rch))
continue;
if ( can_see( ch, rch ) )
{
if ( IS_AFFECTED2( ch, AFF2_HALLUCINATE) && number_percent() > 55 )
{
rch2 = rch;
rch = rand_figment( ch );
show_char_to_char_0( rch, ch );
rch = rch2;
}
else
show_char_to_char_0( rch, ch );
}
else if ( room_is_dark( ch->in_room ) && !IS_AFFECTED( ch, AFF_DARK_VISION)
&& IS_AFFECTED(rch, AFF_INFRARED ) &&
(IS_NPC(rch) && !IS_SET(rch->act, ACT_IS_UNSEEN)) )
{
ch->println( "You see glowing red eyes watching YOU!" );
}
}
if ( IS_AFFECTED2( ch, AFF2_HALLUCINATE))
{
while( figchance != 5 )
{
if ( IS_AFFECTED2( ch, AFF2_HALLUCINATE) && number_percent() > 55 )
{
MOB_INDEX_DATA *figment;
figment = rand_figment_mob( ch );
if(!IS_SET(figment->act, ACT_IS_UNSEEN))
{
ch->println( figment->long_descr );
}
}
figchance += 1;
}
}
return;
}
/**************************************************************************/
// Kalahn - June 98
void do_peek(char_data *ch, char *argument)
{
char_data *victim;
char arg[MIL];
bool peeking;
argument = one_argument( argument, arg );
victim = get_char_room( ch, arg );
if (victim)
{
if (victim==ch)
{
ch->println( "Use the inventory command to see your inventory." );
}
peeking = (!IS_NPC(ch) && (number_percent( ) < get_skill(ch,gsn_peek)));
// can't peek at IC immortals unless an IC imm yourself
if (!IS_NPC(victim) && (victim->level>= LEVEL_IMMORTAL))
{
peeking= false;
}
if (peeking)
{
act( "$n looks at you thoroughly.", ch, NULL, victim, TO_VICT );
act( "$n looks at $N thoroughly.", ch, NULL, victim, TO_NOTVICT );
}
else
{
act( "$n looks at you.", ch, NULL, victim, TO_VICT );
act( "$n looks at $N.", ch, NULL, victim, TO_NOTVICT );
}
// ic imms always exceed at peeking
if (!IS_NPC(ch) && ch->level>= LEVEL_IMMORTAL)
{
peeking= true;
}
ch->printlnf( "You peek at the inventory of %s:`=\xab",
PERS(victim,ch));
check_improve(ch,gsn_peek,true,4);
if (peeking){
show_list_to_char( victim->carrying, ch, "", true, true );
}else{
ch->println( "You didn't manage to see anything." );
}
ch->print("`x" );
}
else
{
ch->println( "You can't see them here." );
}
return;
}
/**************************************************************************/
bool check_blind( char_data *ch )
{
if (HAS_HOLYLIGHT(ch))
return true;
if ( IS_AFFECTED(ch, AFF_BLIND) )
{
ch->println( "You can't see a thing!" );
return false;
}
return true;
}
/**************************************************************************/
void do_consider( char_data *ch, char *argument )
{
char arg[MIL];
char_data *victim;
char msg[MIL];
int diffhp;
int difflevel;
one_argument( argument, arg );
if ( IS_NULLSTR(arg) )
{
ch->println( "Consider killing whom?" );
return;
}
if ( ( victim = get_char_room( ch, arg ) ) == NULL )
{
// do an object check
// get_obj_here() supports uid
OBJ_DATA *obj= get_obj_here( ch, arg );
if ( obj ){
act( "You can't fight $p.", ch, obj, NULL, TO_CHAR );
return;
}
ch->println( "They're not here." );
return;
}
if (is_safe(ch,victim))
{
ch->println( "Don't even think about it." );
return;
}
if ( victim == ch )
{
ch->println( "Why are you considering hurting yourself?" );
return;
}
diffhp = number_range(victim->hit* 7/10, victim->hit* 13/10) -
number_range(ch->hit* 8/10, ch->hit* 12/10);
if(IS_SET(victim->dyn2, DYN2_BLUFF_STRONG))
diffhp += abs(diffhp) * (get_skill(victim, gsn_bluff) / 300);
if(IS_SET(victim->dyn2, DYN2_BLUFF_WEAK))
diffhp -= abs(diffhp) * (get_skill(victim, gsn_bluff) / 300);
if ( diffhp <= -100 ) strcpy(msg, "$N looks tiny in comparison ");
else if ( diffhp <= -50 ) strcpy(msg, "$N is much smaller than you ");
else if ( diffhp <= -20 ) strcpy(msg, "$N is smaller than you ");
else if ( diffhp <= 10 ) strcpy(msg, "$N is about your size ");
else if ( diffhp <= 40 ) strcpy(msg, "$N is larger than you ");
else if ( diffhp <= 90 ) strcpy(msg, "$N is quite larger than you ");
else strcpy(msg, "$N is huge in comparison ");
if (IS_NPC(victim) && !IS_CONTROLLED(victim)){
difflevel = victim->level - ch->level;
difflevel = number_range(difflevel-2, difflevel+2);
if(IS_SET(victim->dyn2, DYN2_BLUFF_STRONG))
difflevel += difflevel + (get_skill(victim, gsn_bluff) / 30);
if(IS_SET(victim->dyn2, DYN2_BLUFF_WEAK))
difflevel -= difflevel + (get_skill(victim, gsn_bluff) / 30);
if ( difflevel <= -11 ) strcat(msg, "and \r\n$E could be snapped like a twig.");
else if ( difflevel <= -8 ) strcat(msg, "and \r\n$E looks like an easy kill. ");
else if ( difflevel <= -5 ) strcat(msg, "and \r\n$E could barely offer any resistance. ");
else if ( difflevel <= -2 ) strcat(msg, "and \r\n$E would give you little trouble. ");
else if ( difflevel <= 2 ) strcat(msg, "and \r\n$E is a perfect match for you.");
else if ( difflevel <= 5 ) strcat(msg, "and \r\n$E would put up a good fight.");
else if ( difflevel <= 8 ) strcat(msg, "and \r\n$E would be difficult to defeat.");
else if ( difflevel <= 11 ) strcat(msg, "and \r\nyou had better get some help for this one.");
else strcat(msg, "and \r\ndeath would welcome the gift of yourself.");
}
act( msg, ch, NULL, victim, TO_CHAR );
return;
}
/**************************************************************************/
/* changes your scroll */
void do_scroll(char_data *ch, char *argument)
{
char arg[MIL];
int lines;
one_argument(argument,arg);
if (arg[0] == '\0')
{
if (ch->lines == 0)
ch->println( "You do not page long messages." );
else
{
ch->printlnf( "You currently display %d lines per page.", ch->lines + 2);
}
return;
}
if (!is_number(arg))
{
ch->println( "You must provide a number." );
return;
}
lines = atoi(arg);
if (lines == 0)
{
ch->println( "Paging disabled." );
ch->lines = 0;
return;
}
if (lines < 10 || lines > 100)
{
ch->println( "You must provide a reasonable number." );
return;
}
ch->printlnf( "Scroll set to %d lines.", lines );
ch->lines = lines - 2;
}
/**************************************************************************/
void do_motd(char_data *ch, char *)
{
do_help(ch,"motd");
}
/**************************************************************************/
void do_imotd(char_data *ch, char *)
{
do_help(ch,"imotd");
}
/**************************************************************************/
void do_rules(char_data *ch, char *)
{
do_help(ch,"rules");
}
/**************************************************************************/
void do_story(char_data *ch, char *)
{
do_help(ch,"story");
}
/**************************************************************************/
void do_autoreformat(char_data *ch, char *)
{
if (IS_NPC(ch))
return;
if (IS_SET(ch->act,PLR_AUTOREFORMAT))
{
ch->println( "Your notes will no longer be automatically reformatted when posting." );
REMOVE_BIT(ch->act,PLR_AUTOREFORMAT);
}
else
{
ch->println( "Your notes will now be automatically reformatted when posting." );
SET_BIT(ch->act,PLR_AUTOREFORMAT);
}
}
/**************************************************************************/
void do_autowraptells(char_data *ch, char *)
{
if (HAS_CONFIG(ch, CONFIG_AUTOWRAPTELLS))
{
ch->println( "Tells you send and receive will no longer be "
"automatically wordwraped." );
REMOVE_CONFIG(ch, CONFIG_AUTOWRAPTELLS);
}
else
{
ch->println( "Tells you send and receive will now be "
"automatically wordwraped." );
SET_CONFIG(ch, CONFIG_AUTOWRAPTELLS);
}
}
/**************************************************************************/
void do_autoself(char_data *ch, char *argument)
{
char_data *target=TRUE_CH(ch);
char arg[MIL];
one_argument(argument, arg);
if(IS_NULLSTR(arg)){
if (IS_SET(target->comm,COMM_AUTOSELF))
{
ch->println( "You can refer to yourself with your name, description and the keyword 'self'." );
REMOVE_BIT(target->comm,COMM_AUTOSELF);
}
else
{
ch->println( "You can only refer to yourself with the word 'self'." );
SET_BIT(target->comm,COMM_AUTOSELF);
}
}else{
if(!str_cmp(arg,"on")){
SET_BIT(target->comm,COMM_AUTOSELF);
ch->println( "Autoself is now ON." );
}
if(!str_cmp(arg,"off")){
REMOVE_BIT(target->comm,COMM_AUTOSELF);
ch->println( "Autoself is now OFF." );
}
}
}
/**************************************************************************/
void do_autowizilogin(char_data *ch, char *)
{
if(HAS_CONFIG2(ch, CONFIG2_AUTOWIZILOGIN)){
ch->println( "You wizi status will be unmodified during login." );
REMOVE_CONFIG2(ch, CONFIG2_AUTOWIZILOGIN);
}else{
ch->println( "You will automatically be made wizi on login.");
SET_CONFIG2(ch, CONFIG2_AUTOWIZILOGIN);
}
}
/**************************************************************************/
void do_autokeepalive(char_data *ch, char *)
{
if(HAS_CONFIG2(ch, CONFIG2_AUTOKEEPALIVE)){
ch->println( "Autokeepalive turned off." );
REMOVE_CONFIG2(ch, CONFIG2_AUTOKEEPALIVE);
}else{
ch->println( "Autokeepalive turned on.");
SET_CONFIG2(ch, CONFIG2_AUTOKEEPALIVE);
}
ch->titlebar("ABOUT AUTOKEEPALIVE");
ch->wrapln("Autokeepalive is a system which can in some cases "
"work around some ADSL/Cable routers which 'forget' about "
"a connection after a certain time of inactivity - say "
"30 minutes. With this option turned on, the mud will send "
"to your mud client a 'blank message' every minute if you "
"have been inactive for more than 5 minutes... this should keep "
"the connection active in the view of the ADSL/Cable router. "
"Some mud clients will incorrectly display 2 characters (one "
"looks like a 'y' with a horizontal colon on top, and the other an 'n' "
"with a tilde (`-) on top. Regardless of if you see this or "
"not, the system will in some cases keep your connection alive. "
"The system is entirely optional, and will NOT prevent your "
"character being automatically logged out for inactivity if the "
"mud is configured to do so.");
ch->titlebar("");
}
/**************************************************************************/
void do_autowhoinvislogin(char_data *ch, char *)
{
if(HAS_CONFIG2(ch, CONFIG2_AUTOWHOINVISLOGIN))
{
ch->println( "You whoinvis status will be unmodified during login." );
REMOVE_CONFIG2(ch, CONFIG2_AUTOWHOINVISLOGIN);
}else{
ch->println( "You will automatically be made wizi on login.");
SET_CONFIG2(ch, CONFIG2_AUTOWHOINVISLOGIN);
}
}
/**************************************************************************/
void do_autolist(char_data *ch, char *)
{
char *alon="`CON`x";
char *aloff="`cOFF`x";
if (IS_NPC(ch)){
ch->println("autolist: players only.");
return;
}
ch->println( " action status" );
ch->println( "`=j---------------------`x" );
ch->printlnf( "autoanswer %s", !HAS_CONFIG(ch, CONFIG_NOAUTOANSWER)?alon:aloff);
ch->printlnf( "autoassist %s", IS_SET(ch->act,PLR_AUTOASSIST)?alon:aloff);
if(!GAMESETTING2(GAMESET2_NO_AUTODAMAGE_COMMAND)){
ch->printlnf( "autodamage %s", HAS_CONFIG2(ch, CONFIG2_AUTODAMAGE)?alon:aloff);
}
ch->printlnf( "autoexamine %s", HAS_CONFIG(ch, CONFIG_AUTOEXAMINE)?alon:aloff);
ch->printlnf( "autoexit %s", IS_SET(ch->act,PLR_AUTOEXIT)?alon:aloff);
ch->printlnf( "autogold %s", IS_SET(ch->act,PLR_AUTOGOLD)?alon:aloff);
ch->printlnf( "autokeepalive %s", HAS_CONFIG2(ch, CONFIG2_AUTOKEEPALIVE)?alon:aloff);
ch->printlnf( "autolandonrest %s", HAS_CONFIG(ch, CONFIG_AUTOLANDONREST)?alon:aloff);
ch->printlnf( "autoloot %s", IS_SET(ch->act,PLR_AUTOLOOT)?alon:aloff);
ch->printlnf( "automap %s", HAS_CONFIG(ch, CONFIG_AUTOMAP )?alon:aloff);
ch->printlnf( "autopeek %s", IS_SET(ch->act,PLR_AUTOPEEK)?alon:aloff);
ch->printlnf( "autopkassist %s", IS_SET(ch->dyn,DYN_AUTOPKASSIST)?alon:aloff);
ch->printlnf( "autorecall %s", HAS_CONFIG(ch,CONFIG_AUTORECALL)?alon:aloff);
ch->printlnf( "autoreformat %s", IS_SET(ch->act,PLR_AUTOREFORMAT)?alon:aloff);
ch->printlnf( "autosaycolorc %s", HAS_CONFIG2(ch,CONFIG2_AUTOSAYCOLOURCODES)?alon:aloff);
ch->printlnf( "autosaymote %s", HAS_CONFIG2(ch,CONFIG2_NOAUTOSAYMOTE)?aloff:alon);
ch->printlnf( "autosplit %s", IS_SET(ch->act,PLR_AUTOSPLIT)?alon:aloff);
ch->printlnf( "autosubdue %s", IS_SET(ch->act,PLR_AUTOSUBDUE)?alon:aloff);
ch->printlnf( "autotrack %s", HAS_CONFIG(ch, CONFIG_AUTOTRACK)?alon:aloff);
ch->printlnf( "autowraptells %s", HAS_CONFIG(ch, CONFIG_AUTOWRAPTELLS)?alon:aloff);
ch->printlnf( "battlelag %s", !HAS_CONFIG2(ch,CONFIG2_NO_BATTLELAG_PROMPT)?alon:aloff);
ch->printlnf( "combine items %s", IS_SET(ch->comm,COMM_COMBINE)?alon:aloff);
ch->printlnf( "compact mode %s", IS_SET(ch->comm,COMM_COMPACT)?alon:aloff);
if ( ch->level > 89 ){
ch->printlnf( "hero messages %s", HAS_CONFIG(ch,CONFIG_NOHEROMSG)?alon:aloff);
}
ch->printlnf( "nonames %s", HAS_CONFIG(ch, CONFIG_NONAMES)?alon:aloff);
ch->printlnf( "noteach %s", IS_SET(ch->act,PLR_NOTEACH)?alon:aloff);
ch->printlnf( "prompt %s", IS_SET(ch->comm,COMM_PROMPT)?alon:aloff);
ch->printlnf( "specify self %s (to toggle type autoself)", HAS_AUTOSELF(ch)?alon:aloff);
if(!IS_NPC(ch) && IS_SET(ch->form, FORM_MOUNTABLE))
ch->printlnf( "mountable %s", IS_SET(ch->pcdata->pconfig, PCONFIG_MOUNTABLE)?alon:aloff);
if(IS_IMMORTAL(ch)){
ch->printlnf( "autowizilogin %s", HAS_CONFIG2(ch,CONFIG2_AUTOWIZILOGIN)?alon:aloff);
ch->printlnf( "autowhoinvislogin %s", HAS_CONFIG2(ch,CONFIG2_AUTOWHOINVISLOGIN)?alon:aloff);
}
if (IS_UNSWITCHED_MOB(ch) && ch->desc){
if(ch->desc->colour_mode==CT_NOCOLOUR){
ch->println( "You are playing in monochrome");
}else{
ch->println( "You are playing in `?color`x");
}
}
ch->printlnf( "You can%s be summoned.", IS_SET(ch->act,PLR_NOSUMMON)?"not":"");
ch->printlnf( "You can%s be charmed.", HAS_CONFIG(ch,CONFIG_NOCHARM)?"not":"");
ch->printlnf( "You %saccept followers.", IS_SET(ch->act,PLR_NOFOLLOW)?"do not ":"");
if(HAS_CONFIG(ch, CONFIG_SHOWMISC)){
ch->println( "Misc notes are shown in unread." );
}else{
ch->println( "Details of unread misc notes are not shown in unread." );
}
ch->printlnf( "You have misc note reading %sbled.", HAS_CONFIG(ch,CONFIG_NOMISC)?"disa":"ena");
ch->printlnf( "You are speaking %s.", ch->language->name );
if (ch->seeks)
{
ch->printlnf( "You are currently seeking the clan '%s'",
ch->seeks->name());
}
}
/**************************************************************************/
void do_name_b4short( char_data *ch, char *)
{
if (IS_UNSWITCHED_MOB(ch)){
ch->println("Players only.");
return;
}
if ( HAS_CONFIG(ch,CONFIG_NAMES_BEFORE_SHORT))
{
REMOVE_CONFIG(ch,CONFIG_NAMES_BEFORE_SHORT);
ch->println("Known names are now displayed after short descriptions.");
}
else
{
SET_CONFIG(ch,CONFIG_NAMES_BEFORE_SHORT);
ch->println("Known names are now displayed before short descriptions.");
}
return;
}
/**************************************************************************/
void do_name_only_4known( char_data *ch, char *)
{
if (IS_UNSWITCHED_MOB(ch)){
ch->println("Players only.");
return;
}
if ( HAS_CONFIG2(ch,CONFIG2_NAME_ONLY_FOR_KNOWN)){
ch->println("If you know someones name, you will see both their name and short description.");
REMOVE_CONFIG2(ch,CONFIG2_NAME_ONLY_FOR_KNOWN);
}else{
ch->println("If you know someones name, you wont see their short description.");
SET_CONFIG2(ch,CONFIG2_NAME_ONLY_FOR_KNOWN);
}
return;
}
/**************************************************************************/
void do_autoassist(char_data *ch, char *)
{
if (IS_NPC(ch))
return;
if (IS_SET(ch->act,PLR_AUTOASSIST))
{
ch->println( "Autoassist removed." );
REMOVE_BIT(ch->act,PLR_AUTOASSIST);
}
else
{
ch->println( "You will now assist when needed." );
SET_BIT(ch->act,PLR_AUTOASSIST);
}
}
/**************************************************************************/
void do_autopkassist(char_data *ch, char *)
{
if (IS_NPC(ch))
return;
if (IS_SET(ch->dyn,DYN_AUTOPKASSIST))
{
ch->println( "Autopkassist removed." );
REMOVE_BIT(ch->dyn,DYN_AUTOPKASSIST);
}
else
{
ch->println( "You will now assist in pk fights when needed." );
SET_BIT(ch->dyn,DYN_AUTOPKASSIST);
}
}
/**************************************************************************/
void do_autoexit(char_data *ch, char *)
{
if (IS_NPC(ch))
return;
if (IS_SET(ch->act,PLR_AUTOEXIT))
{
ch->println( "Exits will no longer be displayed." );
REMOVE_BIT(ch->act,PLR_AUTOEXIT);
}
else
{
ch->println( "Exits will now be displayed." );
ch->println( "note: use `=Cfullexits`x to have the name of each exit displayed." );
SET_BIT(ch->act,PLR_AUTOEXIT);
}
}
/**************************************************************************/
void do_fullexits(char_data *ch, char *)
{
if (IS_UNSWITCHED_MOB(ch)){
ch->println("Players only.");
return;
}
if(HAS_CONFIG2(ch,CONFIG2_FULL_EXITS)){
ch->println( "Full exit info will no longer be shown automatically.");
REMOVE_CONFIG2(ch,CONFIG2_FULL_EXITS);
}else{
ch->println( "Full exit info will now automatically be shown.");
SET_CONFIG2(ch,CONFIG2_FULL_EXITS);
}
}
/**************************************************************************/
void do_detect_oldstyle_note_writing(char_data *ch, char *)
{
if (IS_UNSWITCHED_MOB(ch)){
ch->println("Players only.");
return;
}
if(HAS_CONFIG2(ch,CONFIG2_NO_DETECT_OLDSTYLE_NOTE_WRITING)){
ch->println( "The note system will now automatically detect the use of {} "
"and convert it to a newline code.");
REMOVE_CONFIG2(ch,CONFIG2_NO_DETECT_OLDSTYLE_NOTE_WRITING);
}else{
ch->println( "The note system will no longer automatically detect the use "
"of {} and convert it to a newline code.");
SET_CONFIG2(ch,CONFIG2_NO_DETECT_OLDSTYLE_NOTE_WRITING);
}
}
/**************************************************************************/
void do_autoexamine(char_data *ch, char *)
{
if (HAS_CONFIG(ch, CONFIG_AUTOEXAMINE))
{
ch->println( "Autoexamining removed." );
REMOVE_CONFIG(ch, CONFIG_AUTOEXAMINE);
}
else
{
ch->println( "Automatic corpse examining set." );
SET_CONFIG(ch, CONFIG_AUTOEXAMINE);
}
}
/**************************************************************************/
void do_autolandonrest(char_data *ch, char *)
{
if (HAS_CONFIG(ch, CONFIG_AUTOLANDONREST))
{
ch->println( "Automatic landing when you rest disabled." );
REMOVE_CONFIG(ch, CONFIG_AUTOLANDONREST);
}
else
{
ch->println( "You will automatically land when you rest if flying." );
SET_CONFIG(ch, CONFIG_AUTOLANDONREST);
}
}
/**************************************************************************/
// Kal
void do_nonames(char_data *ch, char *)
{
if (HAS_CONFIG(ch, CONFIG_NONAMES)){
ch->println( "You will now see the names players have introduced themselves to you." );
REMOVE_CONFIG(ch, CONFIG_NONAMES);
}else{
ch->println( "You will no longer see playernames beside their short descriptions." );
SET_CONFIG(ch, CONFIG_NONAMES);
}
}
/**************************************************************************/
// Kal
void do_autoanswer(char_data *ch, char *)
{
if (HAS_CONFIG(ch, CONFIG_NOAUTOANSWER)){
ch->println( "You will now automatically introduce yourself to someone who asks your name." );
REMOVE_CONFIG(ch, CONFIG_NOAUTOANSWER);
}else{
ch->println( "You will no longer automatically introduce yourself to someone who asks your name." );
SET_CONFIG(ch, CONFIG_NOAUTOANSWER);
}
}
/**************************************************************************/
void do_autogold(char_data *ch, char *)
{
if (IS_NPC(ch))
return;
if (IS_SET(ch->act,PLR_AUTOGOLD))
{
ch->println( "Autogold removed." );
REMOVE_BIT(ch->act,PLR_AUTOGOLD);
}
else
{
ch->println( "Automatic gold looting set." );
SET_BIT(ch->act,PLR_AUTOGOLD);
}
}
/**************************************************************************/
void do_autoloot(char_data *ch, char *)
{
if (IS_NPC(ch))
return;
if (IS_SET(ch->act,PLR_AUTOLOOT))
{
ch->println( "Autolooting removed." );
REMOVE_BIT(ch->act,PLR_AUTOLOOT);
}
else
{
ch->println("Automatic corpse looting set." );
SET_BIT(ch->act,PLR_AUTOLOOT);
}
}
/**************************************************************************/
void do_autosubdue(char_data *ch, char *)
{
// unswitched mobs can't ooc
if (IS_UNSWITCHED_MOB(ch))
{
ch->println( "Players or switched players only." );
return;
}
// link dead players can't ooc (ie can't force ooc from a linkdead)
if (!TRUE_CH(ch))
{
ch->println( "Linkdead players can't use this command." );
return;
}
if (IS_SET(TRUE_CH(ch)->act,PLR_AUTOSUBDUE))
{
ch->println( "You will fight other players to the death." );
REMOVE_BIT(TRUE_CH(ch)->act,PLR_AUTOSUBDUE);
}
else
{
ch->println( "When you fight other players, you will fight to subdue them." );
SET_BIT(TRUE_CH(ch)->act,PLR_AUTOSUBDUE);
}
}
/**************************************************************************/
void do_autopeek(char_data *ch, char *)
{
if (IS_NPC(ch))
{
ch->println( "Players only." );
return;
}
if (IS_SET(ch->act,PLR_AUTOPEEK))
{
ch->println( "You will NOT automatically peek at people when you look at them." );
REMOVE_BIT(ch->act,PLR_AUTOPEEK);
}
else
{
ch->println( "You will automatically peek at people when you look at them." );
SET_BIT(ch->act,PLR_AUTOPEEK);
}
}
/**************************************************************************/
void do_autorecall(char_data *ch, char *)
{
if (IS_NPC(ch))
return;
if (HAS_CONFIG(ch,CONFIG_AUTORECALL))
{
ch->println( "You will no longer automatically recall if "
"linkdead when you are attacked." );
REMOVE_CONFIG(ch,CONFIG_AUTORECALL);
}
else
{
ch->println( "You will automatically recall if linkdead when "
"you are attacked." );
SET_CONFIG(ch,CONFIG_AUTORECALL);
}
}
/**************************************************************************/
void do_autosaymote(char_data *ch, char *)
{
if (IS_UNSWITCHED_MOB(ch)){
ch->println("Players only.");
return;
}
char colprefix[3];
if(ch->colour_prefix==COLOURCODE){
sprintf(colprefix, "%c%c",ch->colour_prefix,ch->colour_prefix);
}else{
sprintf(colprefix, "%c", ch->colour_prefix);
}
// logic reversed from command name
if (HAS_CONFIG2(ch,CONFIG2_NOAUTOSAYMOTE)){
ch->println( "Say's will automatically be treated as saymotes.");
REMOVE_CONFIG2(ch,CONFIG2_NOAUTOSAYMOTE);
}else{
ch->wrapln( "Say's will no longer automatically be treated as saymotes, "
"you can use saymote manually to get a saymote.");
SET_CONFIG2(ch,CONFIG2_NOAUTOSAYMOTE);
}
ch->wraplnf("note: You can also use `=Cautosaycolorcodes`x to make your "
"says automatically insert %s in front of color codes (so you don't "
"talk with color).", colprefix);
}
/**************************************************************************/
void do_autosaycolourcodes(char_data *ch, char *)
{
if (IS_UNSWITCHED_MOB(ch)){
ch->println("Players only.");
return;
}
char colprefix[3];
if(ch->colour_prefix==COLOURCODE){
sprintf(colprefix, "%c%c",ch->colour_prefix,ch->colour_prefix);
}else{
sprintf(colprefix, "%c", ch->colour_prefix);
}
// logic reversed from command name
if (HAS_CONFIG2(ch,CONFIG2_AUTOSAYCOLOURCODES)){
ch->println( "Say's will now allow colors in them.");
REMOVE_CONFIG2(ch,CONFIG2_AUTOSAYCOLOURCODES);
}else{
ch->wraplnf( "Say's will automatically convert the color code character (%s) into %s%s "
"so you will be able to talk color codes easily.",
colprefix, colprefix, colprefix);
ch->println( "Note: you can bypass this behaviour for individual says by using saymote.");
SET_CONFIG2(ch,CONFIG2_AUTOSAYCOLOURCODES);
}
}
/**************************************************************************/
// Kal - June 01
void do_autodamage(char_data *ch, char *)
{
if (IS_UNSWITCHED_MOB(ch)){
ch->println("Players only.");
return;
}
// logic reversed from command name
if (HAS_CONFIG2(ch,CONFIG2_AUTODAMAGE)){
ch->println( "Numeric damage values will no longer be shown during combat.");
REMOVE_CONFIG2(ch,CONFIG2_AUTODAMAGE);
}else{
ch->println( "Numeric damage values will now be shown during combat.");
SET_CONFIG2(ch,CONFIG2_AUTODAMAGE);
}
}
/**************************************************************************/
void do_autosplit(char_data *ch, char *)
{
if (IS_NPC(ch))
return;
if (IS_SET(ch->act,PLR_AUTOSPLIT))
{
ch->println( "Autosplitting removed." );
REMOVE_BIT(ch->act,PLR_AUTOSPLIT);
}
else
{
ch->println( "Automatic gold splitting set." );
SET_BIT(ch->act,PLR_AUTOSPLIT);
}
}
/**************************************************************************/
void do_brief(char_data *ch, char *)
{
if (IS_SET(ch->comm,COMM_BRIEF))
{
ch->println( "Full descriptions activated." );
REMOVE_BIT(ch->comm,COMM_BRIEF);
}
else
{
ch->println( "Short descriptions activated." );
SET_BIT(ch->comm,COMM_BRIEF);
}
}
/**************************************************************************/
void do_compact(char_data *ch, char *)
{
if (IS_SET(ch->comm,COMM_COMPACT))
{
ch->println( "Compact mode removed." );
REMOVE_BIT(ch->comm,COMM_COMPACT);
}
else
{
ch->println( "Compact mode set." );
SET_BIT(ch->comm,COMM_COMPACT);
}
}
/**************************************************************************/
void do_showaffects(char_data *ch, char *)
{
if (IS_SET(ch->comm,COMM_SHOW_AFFECTS))
{
ch->println( "Affects will no longer be shown in score." );
REMOVE_BIT(ch->comm,COMM_SHOW_AFFECTS);
}
else
{
ch->println( "Affects will now be shown in score." );
SET_BIT(ch->comm,COMM_SHOW_AFFECTS);
}
}
/**************************************************************************/
void do_battlelag(char_data *ch, char *argument)
{
if(!TRUE_CH_PCDATA(ch)){
ch->println("Only players or controlled mobs can use the battlelag command.");
return;
}
if(IS_NULLSTR(argument)){
ch->wrapln("Battlelag text (when set), is displayed in front of "
"your prompt when you are currently affected by combat lag.");
ch->println("syntax: battlelag <lagtext/symbols> (to set/change the current battle lag text)");
ch->println("syntax: battlelag off (to turn off battle lag)");
ch->println("syntax: battlelag on (to enable the displaying of battlelag text)");
ch->println("syntax: battlelag clear (to clear your battle lag text and use mudwide default)");
if(IS_NULLSTR(TRUE_CH_PCDATA(ch)->battlelag)){
ch->printlnf("You are currently using the mudwide default battle lag text of '%s'",
game_settings->mud_default_battlelag_text);
}else{
ch->printlnf("You are currently have your battle lag text set to '%s'",
TRUE_CH_PCDATA(ch)->battlelag);
}
return;
}
if(!str_cmp(argument, "on")){
ch->println("Battle lag prompt enabled.");
REMOVE_CONFIG2(ch, CONFIG2_NO_BATTLELAG_PROMPT);
return;
}
if(!str_cmp(argument, "off")){
ch->println("Battle lag prompt disabled.");
SET_CONFIG2(ch, CONFIG2_NO_BATTLELAG_PROMPT);
return;
}
if(!str_cmp(argument, "clear")){
argument="";
}
ch->printlnf("Battle lag prompt changed from '%s' to '%s'",
TRUE_CH_PCDATA(ch)->battlelag,
argument);
replace_string(TRUE_CH_PCDATA(ch)->battlelag, argument);
}
/**************************************************************************/
void do_prompt(char_data *ch, char *argument)
{
char buf[MSL];
if (IS_NPC(ch))
{
ch->println( "Players only." );
return;
}
if ( IS_NULLSTR(argument))
{
if (IS_SET(ch->comm,COMM_PROMPT))
{
if (ch->desc->editor
&& ch->desc->editor != ED_CRAFT) // working in olc
{
if (IS_NULLSTR(ch->olcprompt))
{
sprintf(buf,"Your OLCprompt was not defined... "
"using your normal prompt\r\n%s\r\n",ch->prompt );
}
else
{
sprintf(buf,"Your OLCprompt was '%s'\r\n",ch->olcprompt );
}
}
else
{
if(IS_NULLSTR(ch->prompt)){
sprintf(buf,"Your prompt was the system wide default (%s)\r\n",
game_settings->default_prompt);
}else{
sprintf(buf,"Your prompt was '%s'\r\n", ch->prompt);
}
}
ch->printbw(buf);
ch->println( "You will no longer see prompts." );
REMOVE_BIT(ch->comm,COMM_PROMPT);
}
else
{
ch->println( "You will now see prompts." );
if (ch->desc->editor
&& ch->desc->editor != ED_CRAFT) // working in olc
{
if (IS_NULLSTR(ch->olcprompt))
{
sprintf(buf,"Your current OLCprompt is not defined... "
"using your normal prompt\r\n%s\r\n",ch->prompt );
}
else
{
sprintf(buf,"Your current OLCprompt is %s\r\n",ch->olcprompt );
}
}
else
{
sprintf(buf,"Your current prompt is %s\r\n",ch->prompt );
}
ch->printbw(buf);
SET_BIT(ch->comm,COMM_PROMPT);
}
ch->println("Note: you can change your group prompt using `=Cgprompt`x");
return;
}
if( !strcmp( argument, "basic" ) )
strcpy( buf, "[%hhp %mm %vmv> ");
else if( !strcmp( argument, "all" ) )
strcpy( buf, "[%h/%Hhp %m/%Mm %vmv %Xxp> ");
else if( !strcmp( argument, "all1" ) )
strcpy( buf, "[%e %t %h/%Hhp %m/%Mm %vmv> ");
else if( !strcmp( argument, "all2" ) )
strcpy( buf, "[%e %t %h/%Hhp %m/%Mm %vmv %Xxp> ");
else if( !strcmp( argument, "all2c" ) )
strcpy( buf, "`g[`Y%e`g %t `R%h/%Hhp `B%m/%Mm `m%vmv `g%Xxp> ");
else if( !strcmp( argument, "all3" ) )
strcpy( buf, "[%e %t %l %gg %h/%Hhp %m/%Mm %vmv %Xxp%d> ");
else if( !strcmp( argument, "all3c" ) )
strcpy( buf, "`g[`Y%e`g %t `x%l `y%gg `R%h/%Hhp `B%m/%Mm `m%vmv `g%Xxp%d> ");
else if( !strcmp( argument, "all4" ) )
strcpy( buf, "[%e %t %l %gg %ss %h/%Hhp %m/%Mm %vmv %Xxp%d> ");
else if( !strcmp( argument, "all4c" ) )
strcpy( buf, "`g[`Y%e`g %t `x%l `y%gg `s%ss `R%h/%Hhp `B%m/%Mm `m%vmv `g%Xxp%d> ");
else if( !strcmp( argument, "all5" ) )
strcpy( buf, "[%e %t %l %gg %ss %h/%Hhp %m/%Mm %v/%Vmv %Xxp> ");
else if( !strcmp( argument, "all5c" ) )
strcpy( buf, "`g[`Y%e`g %t `x%l `y%gg `s%ss `R%h/%Hhp `B%m/%Mm `m%v/%Vmv `g%Xxp%d> ");
else if( !strcmp( argument, "all6" ) )
strcpy( buf, "[%e %t %l %gg %ss %h/%Hhp %m/%Mm %v/%Vmv %Xxp%d> ");
else if( !strcmp( argument, "all6c" ) )
strcpy( buf, "`g[`Y%e`g %t `x%l `Y%g`yg `s%s`ws `R%h/`r%Hhp `B%m/`b%Mm `M%v/`m%Vmv `G%X`gxp%d> ");
else if( !strcmp( argument, "default" ) )
buf[0]='\0';
else if( !strcmp( argument, "olc" ) ){
if (ch->desc->editor)
{
if(ch->desc->editor != ED_CRAFT) // in olc editor
strcpy( buf, "[`#`m%e`^ in `R%o`mv`R%O`g%Z`^ - %T`^ - %t%d>");
else
strcpy( buf, "`#`C[`cCrafting`C -`c %t%d`C]`^");
}else{ // not in olc or crafting
strcpy( buf, "[`#`m%e`^ in `mv`R%R `g%Z`^ - %T`^ - %t%d>");
}
}else if( !strcmp( argument, "olc2" ) ){
if (ch->desc->editor){ // in olc editor
strcpy( buf, "[`#`m%e`^ in `R%o`mv`R%O`g%Z`^ - %T`^ - %t - %d>");
}else{ // not in olc
strcpy( buf, "[`#`m%e`^ in `mv`R%R `g%Z`^ - %T`^ - %t - %d>");
}
}
else if( !strcmp( argument, "build1" ) )
strcpy( buf, "[--= %hhp %mm %vmv %R %z =-->");
else if( !strcmp( argument, "build2" ) )
strcpy( buf, "[--= %hhp %mm %vmv %R %z(%Z) %e =-->");
else
{
if ( str_len(argument) > 160 ){
argument[160] = '\0';
}
strcpy( buf, argument );
smash_tilde( buf );
if (str_suffix("%c",buf)){
strcat(buf," ");
}
}
if (ch->desc->editor) // working in olc - set the olc prompt
{
replace_string(ch->olcprompt, buf);
sprintf(buf,"OLCprompt set to '%s'\r\n",ch->olcprompt );
}else{
replace_string(ch->prompt, buf);
if(IS_NULLSTR(ch->prompt)){
sprintf(buf,"Prompt cleared, now using the system default prompt of '%s'\r\n",
game_settings->default_prompt);
}else{
sprintf(buf,"Prompt set to '%s'\r\n",ch->prompt );
}
}
ch->printbw(buf);
return;
}
/**************************************************************************/
// GroupPrompt - Kal, Dec 2001
void do_gprompt(char_data *ch, char *argument)
{
char buf[MSL];
if (IS_NPC(ch))
{
ch->println("Players only.");
return;
}
if ( IS_NULLSTR(argument) )
{
if(!IS_SET(ch->comm,COMM_NOGPROMPT))
{
sprintf(buf,"Your group prompt was '%s'\r\n",ch->gprompt );
ch->printbw(buf);
ch->println( "You will no longer see group prompts." );
SET_BIT(ch->comm,COMM_NOGPROMPT);
}
else
{
ch->println( "You will now see group prompts." );
sprintf(buf,"Your current group prompt is '%s'\r\n",ch->gprompt );
ch->printbw(buf);
REMOVE_BIT(ch->comm,COMM_NOGPROMPT);
}
ch->printlnf("Type `=C%s`x for help on the group prompt %% codes.",
mxp_create_send(ch, "gprompt help"));
return;
}
if( !str_cmp(argument,"help") )
{
ch->titlebar("GROUP PROMPT PERCENTAGE CODES");
ch->println(
"`1 %g - begin group section"
"`1 %G - end group section"
"`1 %h - lowest hitpoints % for group members in the room"
"`1 %m - lowest mana % for group members in the room"
"`1 %v - lowest move % for group members in the room"
"`1 %p - begin pet section"
"`1 %P - end pet section"
"`1 %q - pet hitpoints %"
"`1 %r - pet mana %"
"`1 %s - pet move %"
"`1 %N - number of group members in the current room"
"`1 %c - carriage return"
"`1 %C - carriage return only if there is preceeding text"
"`1 %x - number of charmies in the current room (excluding pet)"
"`1");
ch->println("Anything between %p and %P is 'eaten' when you dont have a pet in the room.");
ch->println("Anything between %g and %G is 'eaten' when you dont have a group member in the room.");
ch->println("Group prompts only work on pets and other players - not charmies (except %x).");
ch->println("The default group prompt is:");
ch->printlnbw(" '`#%g[`xgrp `R%hhp `B%mm `M%vmv`&]%G%p[`spet `r%qhp `b%rm `m%smv`&>%P%c'");
ch->titlebar("");
return;
}
{
if ( str_len(argument) > 160 ){
argument[160] = '\0';
}
strcpy( buf, argument );
smash_tilde( buf );
if (str_suffix("%c",buf)){
strcat(buf," ");
}
}
ch->printfbw("Prompt changed from '%s' to '%s'\r\n",ch->gprompt, buf );
replace_string( ch->gprompt, buf );
REMOVE_BIT(ch->comm,COMM_NOGPROMPT);
return;
}
/**************************************************************************/
void do_combine(char_data *ch, char *)
{
if (IS_SET(ch->comm,COMM_COMBINE))
{
ch->println( "Long inventory selected." );
REMOVE_BIT(ch->comm,COMM_COMBINE);
}
else
{
ch->println( "Combined inventory selected." );
SET_BIT(ch->comm,COMM_COMBINE);
}
}
/**************************************************************************/
void do_nofollow(char_data *ch, char *)
{
if (IS_NPC(ch))
return;
// Check to see if ch is charmed and being ordered to cast
if ( IS_AFFECTED(ch,AFF_CHARM) && !IS_SET( ch->dyn, DYN_IS_BEING_ORDERED ))
{
ch->println( "You must wait for your master to tell you to do that." );
return;
}
if (IS_SET(ch->act,PLR_NOFOLLOW))
{
ch->println( "You now accept followers." );
REMOVE_BIT(ch->act,PLR_NOFOLLOW);
}
else
{
ch->println( "You no longer accept followers." );
SET_BIT(ch->act,PLR_NOFOLLOW);
die_follower( ch );
}
}
/**************************************************************************/
void do_noteach(char_data *ch, char *)
{
if (IS_NPC(ch))
return;
if (IS_SET(ch->act,PLR_NOTEACH))
{
ch->println( "You now can be taught." );
REMOVE_BIT(ch->act,PLR_NOTEACH);
}
else
{
ch->println( "You no longer can be taught.");
SET_BIT(ch->act,PLR_NOTEACH);
}
}
/**************************************************************************/
void do_nosummon(char_data *ch, char *)
{
if (IS_NPC(ch))
{
if (IS_SET(ch->imm_flags,IMM_SUMMON))
{
ch->println( "You are no longer immune to summon." );
REMOVE_BIT(ch->imm_flags,IMM_SUMMON);
}
else
{
ch->println( "You are now immune to summoning." );
SET_BIT(ch->imm_flags,IMM_SUMMON);
}
}
else
{
if (IS_SET(ch->act,PLR_NOSUMMON))
{
ch->println( "You are no longer immune to summon." );
REMOVE_BIT(ch->act,PLR_NOSUMMON);
}
else
{
ch->println( "You are now immune to summoning." );
SET_BIT(ch->act,PLR_NOSUMMON);
}
}
}
/**************************************************************************/
void do_nocharm(char_data *ch, char *)
{
if (IS_NPC(ch))
{
if (IS_SET(ch->imm_flags,IMM_CHARM))
{
ch->println( "You are no longer immune to charm." );
REMOVE_BIT(ch->imm_flags,IMM_CHARM);
}
else
{
ch->println( "You are now immune to charming." );
SET_BIT(ch->imm_flags,IMM_CHARM);
}
}
else
{
if(GAMESETTING2(GAMESET2_NOCHARM_HAS_NOAFFECT)){
ch->println("NOTE: This setting has no affect while the affects of nocharm have been disabled in the gamesettings.");
}
if (HAS_CONFIG(ch,CONFIG_NOCHARM))
{
ch->println( "You are no longer immune to charm." );
REMOVE_CONFIG(ch,CONFIG_NOCHARM);
}
else
{
ch->println( "You are now immune to charming." );
SET_CONFIG(ch,CONFIG_NOCHARM);
}
}
}
/**************************************************************************/
void do_glance( char_data *ch, char *argument )
{
char_data *victim;
char buf[MSL];
int percent;
if(IS_NULLSTR(argument)){
ch->println( "Glance at whom?" );
return;
}
victim = get_char_room( ch, argument );
if(!victim){
ch->printlnf( "You can't seem to see any '%s' in the room.", argument);
return;
}
if ( victim->max_hit > 0 )
percent = ( 100 * victim->hit ) / victim->max_hit;
else
percent = -1;
strcpy( buf, "`#`Y");
strcat( buf, PERS(victim, ch) );
if (percent >= 100)
strcat( buf, " is in excellent condition.\r\n");
else if (percent >= 90)
strcat( buf, " has a few scratches.\r\n");
else if (percent >= 75)
strcat( buf," has some small wounds and bruises.\r\n");
else if (percent >= 50)
strcat( buf, " has quite a few wounds.\r\n");
else if (percent >= 30)
strcat( buf, " has some big nasty wounds and scratches.\r\n");
else if (percent >= 15)
strcat ( buf, " looks pretty hurt.\r\n");
else if (percent >= 0 )
strcat (buf, " is in `Rawful condition`Y.\r\n");
else
strcat(buf, " is `Rbleeding`Y to death.\r\n");
ch->printlnf( "%s`&", capitalize( buf ));
// flying status
if ( IS_AFFECTED(victim, AFF_FLYING) ){
ch->println( "They appear to be airborne." );
}
if (IS_VAMPAFF(victim, VAM_NIGHTSIGHT)) {
ch->printlnf( "%s eyes are glowing bright red.", PERS(victim,ch) );
}
if (IS_VAMPAFF(victim, VAM_FANGS)) {
ch->printlnf( "%s has a pair of long, pointed fangs.", PERS(victim,ch) );
}
if (IS_VAMPAFF(victim, VAM_CLAWS)) {
ch->printlnf( "%s has sharp claws protruding from under their finger nails.", PERS(victim,ch) );
}
}
/**************************************************************************/
void send_zmudmap_to_char(char_data *ch);
void do_lockers( char_data *ch, char *argument );
/**************************************************************************/
// supports uid
void do_look( char_data *ch, char *argument )
{
char buf [MSL];
char arg1 [MIL];
char arg2 [MIL];
char arg3 [MIL];
EXIT_DATA *pexit;
char_data *victim;
OBJ_DATA *obj;
char *pdesc;
int door;
int number,count;
if ( ch->desc == NULL )
return;
if ( ch->position < POS_SLEEPING )
{
ch->println( "You can't see anything but stars!" );
return;
}
if ( ch->position == POS_SLEEPING )
{
ch->println( "You can't see anything, you're sleeping!" );
return;
}
if ( IS_IC(ch) && !check_blind( ch ) )
return;
if ( !IS_NPC(ch)
&& !HAS_HOLYLIGHT(ch)
&& !IS_VAMPAFF(ch, VAM_NIGHTSIGHT)
&& !IS_AFFECTED( ch, AFF_DARK_VISION)
&& room_is_dark( ch->in_room ) )
{
ch->println( "It is pitch black ... " );
// attempt to display room contents, glowing objects should be seen
show_list_to_char( ch->in_room->contents, ch, "", false, false );
show_char_to_char( ch->in_room->people, ch );
if ( (IS_SET(TRUE_CH(ch)->act, PLR_AUTOEXIT) || HAS_CONFIG2(ch,CONFIG2_FULL_EXITS))
&& !IS_SET(ch->in_room->room_flags, ROOM_NOAUTOEXITS))
{
ch->println( "" );
if(HAS_CONFIG2(ch,CONFIG2_FULL_EXITS)){
do_exits( ch, "fullexits" );
}else{
do_exits( ch, "auto" );
}
}
if(!IS_SET(ch->in_room->room_flags, ROOM_NOAUTOMAP)){
if (USING_AUTOMAP(ch)) {
do_map(ch,"");
}
}
return;
}
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
number = number_argument(arg1,arg3);
count = 0;
if ( IS_NULLSTR(arg1) || !str_cmp( arg1, "auto" ) || !str_cmp( arg1, "brief" ))
{
if (IS_SET(ch->dyn,DYN_MAPCLEAR) && USING_AUTOMAP(ch)){
do_map(ch,"");
}
// 'look' or 'look auto'
ch->printf( "`=B%s`x", mxp_create_tag(ch, "RName", ch->in_room->name));
if(!GAMESETTING2(GAMESET2_HIDE_AREA_SHORTNAMES)
&& !IS_NULLSTR(ch->in_room->area->short_name))
{
ch->printf(" `#[%s%s`^]",
colour_table[(ch->in_room->area->vnum%14)+1].code,
ch->in_room->area->short_name);
}
if ( (IS_IMMORTAL(ch) && HAS_HOLYLIGHT(ch))
|| (IS_SET(ch->comm, COMM_BUILDING) && ch->in_room
&& IS_BUILDER(ch, ch->in_room->area, BUILDRESTRICT_ROOMS)) )
{
ch->printf( " [Room %d]",ch->in_room->vnum );
}
if (IS_OOC(ch)){
ch->print(" `=^(OOC ROOM)" );
}
if (IS_OLCAREA(ch->in_room->area)){
ch->print( " `=&(OLC AREA)" );
}
ch->println( "`x" );
if ( IS_NULLSTR(arg1)
|| !IS_SET(TRUE_CH(ch)->comm,COMM_BRIEF)){
if ( ch->desc && !ch->desc->speedwalk_buf && str_cmp( arg1, "brief" )){
ch->printf( "`=b %s", mxp_create_tag(ch, "RDesc", ch->in_room->description));
}
}
if( (IS_SET(TRUE_CH(ch)->act, PLR_AUTOEXIT) || HAS_CONFIG2(ch,CONFIG2_FULL_EXITS))
&& !IS_SET(ch->in_room->room_flags, ROOM_NOAUTOEXITS))
{
ch->println( "" );
if(HAS_CONFIG2(ch,CONFIG2_FULL_EXITS)){
do_exits( ch, "fullexits" );
}else{
do_exits( ch, "auto" );
}
}
show_list_to_char( ch->in_room->contents, ch, "", false, false );
// if there are lockers in this room, display them
if(lockers->room_has_lockers(ch->in_room)){
ch->printlnf(" `=\x8d%s",
mxp_create_send(ch,"look treasury",
FORMATF("`#`gA large treasury is here.`^")));
}
ch->print( "`=D" );
show_char_to_char( ch->in_room->people, ch );
ch->print( "`x" );
if(!IS_SET(ch->in_room->room_flags, ROOM_NOAUTOMAP)){
if (!IS_SET(ch->dyn,DYN_MAPCLEAR) && USING_AUTOMAP(ch)){
do_map(ch,"");
}
}
// do track if they arent following anyone and have the skills and arent speedwalking
if(HAS_CONFIG(ch, CONFIG_AUTOTRACK) && !ch->master ){
if(get_skill(ch, gsn_fieldtrack)>1
|| get_skill(ch, gsn_citytrack)>1)
{
if(!(ch->desc && ch->desc->speedwalk_buf)){
do_tracks(ch,"");
}
}
}
return;
}
if ( !str_cmp( arg1, "sky" ) )
{
if ( !IS_OUTSIDE(ch) )
{
ch->println( "You can't see the sky indoors.");
return;
}
else
{
look_sky(ch);
return;
}
}
if (ch->in_room->sector_type == SECT_VEHICLE && !str_cmp(arg1, "out"))
{
OBJ_DATA *building, *building_next = NULL;
OBJ_DATA *vehicle = NULL;
ROOM_INDEX_DATA *in_room = NULL;
for ( building = ch->in_room->contents; building != NULL; building = building_next )
{
building_next = building->next_content;
if ( building->item_type==ITEM_VEHICLE_EXIT || building->item_type==ITEM_VEHICLE_CONTROLS)
{
if ( ( vehicle = get_obj_type( get_obj_index( building->value[0] ) ) ) == NULL )
{
ch->println("Error, can't find ship for vehicle exit." );
return;
}
in_room = ch->in_room;
char_from_room( ch );
char_to_room( ch, get_room_index(vehicle->in_room->vnum) );
do_look( ch, "" );
char_from_room( ch );
char_to_room( ch, in_room );
return;
}
}
ch->println("You cannot see anything from here.");
return;
}
if ( !str_cmp( arg1, "i" ) || !str_cmp(arg1, "in") || !str_cmp(arg1,"on"))
{
// 'look in'
if ( IS_NULLSTR(arg2) )
{
ch->println( "Look in what?" );
return;
}
// get_obj_here() supports uid
if ( ( obj = get_obj_here( ch, arg2 ) ) == NULL )
{
ch->println( "You do not see that here." );
return;
}
switch ( obj->item_type )
{
default:
ch->println( "That is not a container." );
break;
case ITEM_DRINK_CON:
if ( obj->value[1] <= 0 )
{
ch->println( "It is empty." );
break;
}
ch->printlnf( "It's %sfilled with a %s liquid.",
obj->value[1] < obj->value[0] / 4 ?
"less than half-" : obj->value[1] < 3 * obj->value[0] / 4 ?
"about half-" : "more than half-",
liq_table[obj->value[2]].liq_color );
break;
case ITEM_PORTAL:
{
bool autolook = false;
ROOM_INDEX_DATA *location;
int lvnum;
if (IS_SET(obj->value[2],GATE_OPAQUE)) {
ch->println( "The portal is opaque, you can't see anything inside it." );
return;
};
if( IS_SET( ch->act, PLR_AUTOEXIT )) {
autolook = true;
REMOVE_BIT( ch->act, PLR_AUTOEXIT );
}
if(IS_SET(obj->value[2],GATE_SHORT_LOOKINTO)){
act( "You look through $p and see", ch, obj, NULL, TO_CHAR );
}else{
act( "You gaze through the portal and see:", ch, NULL, NULL, TO_CHAR );
}
if (IS_SET(obj->value[2],GATE_RANDOM) || obj->value[3] == -1)
{
location = get_random_room(ch);
lvnum = location->vnum; // for record keeping :)
}else{
lvnum = obj->value[3];
}
sprintf( buf, "%d look", lvnum);
do_at( ch, buf );
if( autolook )
SET_BIT( ch->act, PLR_AUTOEXIT );
}
break;
case ITEM_CAULDRON:
case ITEM_QUIVER:
case ITEM_CONTAINER:
case ITEM_FLASK:
case ITEM_MORTAR:
case ITEM_CORPSE_NPC:
case ITEM_CORPSE_PC:
if ( IS_SET(obj->value[1], CONT_CLOSED) )
{
ch->println( "It is closed." );
break;
}
act( "$p holds:", ch, obj, NULL, TO_CHAR );
show_list_to_char( obj->contains, ch, "", true, true );
break;
}
return;
}
// get_char_room() supports uid
if ( ( victim = get_char_room( ch, arg1 ) ) != NULL )
{
show_char_to_char_1( victim, ch );
return;
}
// support UID
int uid=get_uid(arg3);
if(uid){
// uid looking at objects in inventory
for ( obj = ch->carrying; obj; obj = obj->next_content )
{
if(uid==obj->uid && can_see_obj( ch, obj ) ){
// parchments are displayed differently
if ( obj->item_type == ITEM_PARCHMENT ){
letter_read( ch, obj );
return;
}
// take the first name field, and if it is longer than
// 2 characters, see if we can find an extended description
// that matches it... if so show that instead of the objects
// description
{
char firstname[MIL];
one_argument(obj->name, firstname);
if(str_len(firstname)>2){
// use only one of the sets of extended descriptions
if (obj->extra_descr)
{ // unique objects extended descriptions
EXTRA_DESCR_DATA *ed = NULL;
for ( ed = obj->extra_descr; ed; ed = ed->next )
{
if ( is_name( (char *)firstname, ed->keyword ) )
break;
}
pdesc = get_extra_descr( firstname, obj->extra_descr );
if( pdesc
&& (IS_IMMORTAL(ch) || !is_name("_", ed->keyword))){
ch->sendpage(pdesc);
return;
}
}
else // vnums extended descriptions
{
EXTRA_DESCR_DATA *ed = NULL;
for ( ed = obj->pIndexData->extra_descr; ed; ed = ed->next )
{
if ( is_name((char *)firstname, ed->keyword ) )
break;
}
pdesc = get_extra_descr( firstname, obj->pIndexData->extra_descr );
if ( pdesc
&& (IS_IMMORTAL(ch) || !is_name("_", ed->keyword))){
ch->sendpage(pdesc);
return;
}
}
}
}
ch->println( obj->description );
return;
}
}
// uid looking at objects in room
for ( obj = ch->in_room->contents; obj; obj = obj->next_content )
{
if(uid==obj->uid && can_see_obj( ch, obj ) ){
// parchments are displayed differently
if ( obj->item_type == ITEM_PARCHMENT ){
letter_read( ch, obj );
return;
}
// take the first name field, and if it is longer than
// 2 characters, see if we can find an extended description
// that matches it... if so show that instead of the objects
// description
{
char firstname[MIL];
one_argument(obj->name, firstname);
if(str_len(firstname)>2){
// use only one of the sets of extended descriptions
if (obj->extra_descr)
{
// unique objects extended descriptions
EXTRA_DESCR_DATA *ed = NULL;
for ( ed = obj->extra_descr; ed; ed = ed->next )
{
if ( is_name((char *)firstname, ed->keyword ) )
break;
}
pdesc = get_extra_descr( firstname, obj->extra_descr );
if( pdesc
&& (IS_IMMORTAL(ch) || !is_name("_", ed->keyword))){
ch->sendpage(pdesc);
return;
}
}
else // vnums extended descriptions
{
EXTRA_DESCR_DATA *ed = NULL;
for ( ed = obj->pIndexData->extra_descr; ed; ed = ed->next )
{
if ( is_name((char *)firstname, ed->keyword ) )
break;
}
pdesc = get_extra_descr( firstname, obj->pIndexData->extra_descr );
if ( pdesc
&& (IS_IMMORTAL(ch) || !is_name("_", ed->keyword))){
ch->sendpage(pdesc);
return;
}
}
}
}
ch->println( obj->description );
return;
}
}
ch->println( "You do not see that here." );
return;
}
// support lockers
if( !str_prefix(arg3, "treasury") ){
do_lockers(ch, "look");
return;
}
for ( obj = ch->carrying; obj; obj = obj->next_content )
{
if ( can_see_obj( ch, obj ) )
{ // player can see object
// parchments take highest priority
if ( obj->item_type == ITEM_PARCHMENT && is_name( arg3, obj->name ) )
{
if (++count == number)
{
letter_read( ch, obj );
return;
}
}
// use only one of the sets of extended descriptions
if (obj->extra_descr)
{ // unique objects extended descriptions
pdesc = get_extra_descr( arg3, obj->extra_descr );
if( pdesc ){
if (++count == number){
ch->sendpage(pdesc);
return;
}
continue;
}
}
else // vnums extended descriptions
{
pdesc = get_extra_descr( arg3, obj->pIndexData->extra_descr );
if ( pdesc )
{
if (++count == number){
ch->sendpage(pdesc);
return;
}
continue;
}
}
if ( is_name( arg3, obj->name ) )
{
if (++count == number){
ch->println( obj->description );
return;
}
}
}
}
for ( obj = ch->in_room->contents; obj; obj = obj->next_content )
{
if ( can_see_obj( ch, obj ) )
{
// use only one of the sets of extended descriptions
if (obj->extra_descr)
{ // unique objects extended descriptions
pdesc = get_extra_descr( arg3, obj->extra_descr );
if ( pdesc ){
if (++count == number) {
ch->sendpage(pdesc);
return;
}
continue;
}
}
else // vnums extended descriptions
{
pdesc = get_extra_descr( arg3, obj->pIndexData->extra_descr );
if ( pdesc != NULL )
{
if (++count == number)
{
ch->sendpage(pdesc);
return;
}
continue;
}
}
}
if ( is_name( arg3, obj->name ) )
{
if (++count == number){
ch->println( obj->description );
return;
}
}
}
// match room extended descriptions
pdesc = get_extra_descr(arg3,ch->in_room->extra_descr);
if (pdesc )
{
if (++count == number){
ch->sendpage(pdesc);
return;
}
}
// tell them how many they matched on
if (count > 0 && count != number)
{
if (count == 1){
ch->printlnf( "You only see one %s here.", arg3 );
}else{
ch->printlnf( "You only see %d of those here.", count );
}
return;
}
// try looking at a direction
door = dir_lookup( arg1 );
if ( door == -1 ){
ch->println( "You do not see that here." );
return;
}
// 'look direction'
if ( ( pexit = ch->in_room->exit[door] ) == NULL )
{
ch->println( "Nothing special there." );
return;
}
if ( !IS_NULLSTR(pexit->description)){
ch->print( pexit->description );
}else{
ch->println( "Nothing special there." );
}
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 );
}
}
}
return;
}
/**************************************************************************/
void do_read (char_data *ch, char *argument )
{
do_look(ch,argument);
}
/**************************************************************************/
// supports uid
void do_examine( char_data *ch, char *argument )
{
char buf[MSL];
char arg[MIL];
OBJ_DATA *obj;
bool partial;
bool frozen;
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
ch->println( "Examine what?" );
return;
}
do_look( ch, arg );
if ( ( obj = get_obj_here( ch, arg ) ) != NULL )
{
switch ( obj->item_type )
{
default:
break;
case ITEM_SLOTMACHINE:
if(obj->value[3] == 1)
partial = true;
else
partial = false;
if(obj->value[4] == 1)
frozen = true;
else
frozen = false;
sprintf(buf,"This is a %d bar slot machine costing %d gold with a jackpot of %d gold coins.\n\rThe jackpot is %sfrozen with %spartial winnings.", obj->value[2], obj->value[0], obj->value[1], frozen ? "" : "not ", partial ? "" : "no ");
ch->printlnf(buf);
break;
case ITEM_JUKEBOX:
// do_play(ch,"list");
break;
case ITEM_MONEY:
if (obj->value[0] == 0)
{
if (obj->value[1] == 0)
ch->println( "Odd...there are no coins in the pile." );
else if (obj->value[1] == 1)
ch->println( "Wow. One gold coin." );
else
ch->printlnf( "There are %d gold coins in the pile.", obj->value[1]);
}
else if (obj->value[1] == 0)
{
if (obj->value[0] == 1)
ch->println( "Wow. One silver coin." );
else
ch->printlnf( "There are %d silver coins in the pile.", obj->value[0]);
}
else
{
ch->printlnf( "There are %d gold and %d silver coins in the pile.",
obj->value[1],obj->value[0]);
}
break;
case ITEM_FIREARM:
ch->printlnf( "There are %d/%d rounds in the weapon.",
obj->value[1],obj->value[0]);
break;
case ITEM_CAULDRON:
case ITEM_QUIVER:
case ITEM_CONTAINER:
case ITEM_FLASK:
case ITEM_MORTAR:
case ITEM_DRINK_CON:
case ITEM_CORPSE_NPC:
case ITEM_CORPSE_PC:
sprintf(buf,"in %s",argument);
do_look( ch, buf );
}
}
return;
}
/**************************************************************************/
void do_exits( char_data *ch, char *argument )
{
EXIT_DATA *pexit;
char buf[MSL];
bool found;
bool fAuto;
int door;
fAuto = !str_cmp( argument, "auto" );
if ( !check_blind( ch ) )
return;
if (fAuto){
sprintf(buf,"[Exits:");
}else{
if (IS_IMMORTAL(ch)){
sprintf(buf,"Obvious exits from room %d:\r\n",ch->in_room->vnum);
}else{
sprintf(buf,"Obvious exits:\r\n");
}
}
if(!str_cmp( argument, "fullexits" )){
strcat(buf, "`=\xac");
}
found = false;
for ( door = 0; door<MAX_DIR; door++ )
{
if ( ( pexit = ch->in_room->exit[door] ) != NULL
&& pexit->u1.to_room != NULL
&& can_see_room(ch,pexit->u1.to_room)
&& !IS_SET(pexit->exit_info, EX_CLOSED) )
{
found = true;
if ( fAuto ){
strcat( buf, mxp_create_tagf(ch, "Ex", " %s",dir_name[door]));
}
else
{
sprintf( buf + str_len(buf), "%-5s - %s",
capitalize( dir_name[door] ),
(!HAS_HOLYLIGHT(ch)
&& room_is_dark( pexit->u1.to_room) )
? "Too dark to tell"
: pexit->u1.to_room->name
);
if (IS_IMMORTAL(ch))
sprintf(buf + str_len(buf),
" (room %d)\r\n",pexit->u1.to_room->vnum);
else
sprintf(buf + str_len(buf), "\r\n");
}
}
}
// hidden exits for those with holylight
if (HAS_HOLYLIGHT(ch))
{
for ( door = 0; door < MAX_DIR; door++ )
{
if ( ( pexit = ch->in_room->exit[door] ) != NULL
&& pexit->u1.to_room != NULL
&& can_see_room(ch,pexit->u1.to_room)
&& IS_SET(pexit->exit_info, EX_CLOSED) )
{
found = true;
if ( fAuto )
{
strcat( buf, " (" );
strcat( buf, dir_name[door] );
strcat( buf, ")" );
}
else
{
sprintf( buf + str_len(buf), "(%s) - %s",
capitalize( dir_name[door] ),
pexit->u1.to_room->name);
if (IS_IMMORTAL(ch))
sprintf(buf + str_len(buf),
" (room %d)\r\n",pexit->u1.to_room->vnum);
else
sprintf(buf + str_len(buf), "\r\n");
}
}
}
}
if ( !found )
strcat( buf, fAuto ? " none" : "None." );
if ( fAuto ){
strcat( buf, "]");
strcpy( buf, mxp_create_tag(ch, "RExits", buf ));
}
ch->printlnf( "`=a%s`x", buf);
return;
}
/**************************************************************************/
void do_worth( char_data *ch, char * )
{
char buf[MSL], message[MSL];
ch->titlebar("WORTH");
if (IS_NPC(ch))
{
ch->printlnf( "You have %ld gold and %ld silver.",
ch->gold,ch->silver);
return;
}
ch->printlnf(
" You have %ld gold, \r\n %ld silver, \r\n %ld Rps, \r\n and %d experience (%d exp to level).",
ch->gold, ch->silver, ch->pcdata->rp_points, ch->exp,
(ch->level + 1) * exp_per_level(ch,ch->pcdata->points) - ch->exp);
ch->printlnf( " Wimpy set to %d hitpoint%s.", ch->wimpy, ch->wimpy==1?"":"s");
ch->printlnf( " Panic set to %d hitpoint%s.", ch->pcdata->panic, ch->pcdata->panic==1?"":"s");
ch->printlnf( " You're currently speaking in %s.", ch->language->name);
if (HAS_CLASSFLAG( ch, CLASSFLAG_TOTEMS )){
int month = get_birthmonth( ch );
if ( month >= 0 )
{
ch->printlnf( " Your totemic spirit is the %s.",
totem_table[month].name );
}
}
if (HAS_CLASSFLAG( ch, CLASSFLAG_DEITIES )){
if ( ch->deity && ch->deity->name)
{
ch->printlnf( " You worship `#`W%s`^.", ch->deity->name );
}
}
if(GET_SECURITY(ch)){
ch->printlnf( " You have an OLC security rating of %d.", GET_SECURITY(ch));
}
if ( IS_IMMORTAL(ch)) {
ch->printlnf( " Council: %s", flag_string( council_flags, ch->pcdata->council ));
}
if (IS_NEWBIE_SUPPORT(ch)){
ch->println( " You are a newbie support member." );
}
if (HAS_CONFIG(ch,CONFIG_PRACSYS_TESTER))
{
ch->println( " You are tester of the new prac system." );
}
if (IS_NOBLE(ch))
{
ch->printlnf(" `MYou are a noble with a diplomacy of `W%d`M and have currently `W%d`M vote%s,\r\n"
" Your autovote setting is currently at `W%d`M.`x",
TRUE_CH(ch)->pcdata->diplomacy,
TRUE_CH(ch)->pcdata->dip_points,
TRUE_CH(ch)->pcdata->dip_points==1?"":"s",
TRUE_CH(ch)->pcdata->autovote);
}
if(HAS_CONFIG(ch, CONFIG_COURTMEMBER))
{
ch->println( " You are a member of some court." );
}
if (HAS_CONFIG(ch, CONFIG_DISALLOWED_PKILL))
{
ch->println( " You have a restriction on you that prevents you from pkilling!" );
}
if (IS_SET(ch->comm, COMM_CANNOCHANNEL))
{
ch->println( " You can nochannel other players." );
}
if(!IS_NPC(ch)){
ch->printlnf( " Creation points: %d XPPerLvl: %d",
ch->pcdata->points,
exp_per_level(ch, ch->pcdata->points));
if(IS_SET(ch->act, PLR_QUESTER)){
ch->println(" You have your quester status enabled.");
}else{
ch->println(" You have your quester status disabled.");
}
if(GAMESETTING(GAMESET_PEACEFUL_MUD)){
if(HAS_CONFIG(ch, CONFIG_ACTIVE)){
ch->println(" You are flagged as an active player - but the game is locked to peaceful.");
}else{
ch->println(" You are a peaceful player - the game is locked as peaceful.");
}
}else{
if(HAS_CONFIG(ch, CONFIG_ACTIVE)){
ch->println(" You are an active player.");
}else{
ch->println(" You are a peaceful player.");
}
}
if(IS_SET(ch->act, PLR_NOREDUCING_MAXKARN)){
ch->println(" Your maxkarns is permanently 5.");
}
if (HAS_CONFIG(ch, CONFIG_NOTE_ONLY_TO_IMM)){
ch->println(" You can only write your notes to the immortals.");
}
if(ch->pcdata->autoafkafter){
ch->printlnf(" You automatically go afk after %d minute%s",
ch->pcdata->autoafkafter,
ch->pcdata->autoafkafter==1?"":"s");
}
}
sprintf(buf, " You are");
if ( ch->pcdata->tired > 16 ) strcat( buf, " tired," );
( ch->pcdata->condition[COND_HUNGER] == 0 ) ?
strcat( buf, " hungry," ) : strcat( buf, " full," );
( ch->pcdata->condition[COND_DRUNK] == 0 ) ?
strcat( buf, " sober" ) : strcat( buf, " drunk" );
( ch->pcdata->condition[COND_THIRST] == 0 ) ?
strcat( buf, ", thirsty." ) : strcat( buf, "." );
ch->printlnf( "%s", buf );
sprintf(buf, " You are currently ");
if (ch->subdued)
strcat( buf, "subdued." );
else
{
switch ( ch->position )
{
case POS_DEAD: strcat( buf, "DEAD!!" ); break;
case POS_MORTAL: strcat( buf, "mortally wounded." ); break;
case POS_INCAP: strcat( buf, "incapacitated." ); break;
case POS_STUNNED: strcat( buf, "lying here stunned." ); break;
case POS_SLEEPING:
if (ch->on != NULL)
{
if ( IS_SET( ch->on->value[2], SLEEP_AT ))
{
sprintf( message, "sleeping at %s.", ch->on->short_descr );
strcat( buf, message );
}
else if ( IS_SET( ch->on->value[2], SLEEP_ON ))
{
sprintf( message, "sleeping on %s.", ch->on->short_descr);
strcat( buf, message );
}
else if ( IS_SET( ch->on->value[2], SLEEP_UNDER ))
{
sprintf(messShowing the first 100 KB of 167.2 KB. Download the archive for the full file.