act_info.c
exodus2/src/act_info.c · 193.7 KB
From the archive exodus2.tar.gz
Download the archive « Back to the archive contents
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
#include <crypt.h>
#include <unistd.h>
#include "merc.h"
#include "magic.h"
#include "recycle.h"
#include "tables.h"
#include "lookup.h"
#include "ansi.h"
#include "olc.h"
#include "heros.h"
#include "clans/new_clans.h"
#include "clans/new_clans_comm.h"
#include "clans/new_clans_io.h"
#include "clans/new_clans_util.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_play);
DECLARE_DO_FUN (do_color);
DECLARE_DO_FUN (do_scanning);
extern bool quad;
extern bool doub;
extern bool half;
extern bool battle_royale;
extern int quad_timer;
extern int double_timer;
extern int half_timer;
extern int battle_royale_timer;
extern CHAR_DATA *br_leader;
extern int setbit args ((char *explored, int index));
extern int getbit args ((char *explored, int index));
extern int arearooms args ((CHAR_DATA * ch));
extern int areacount args ((CHAR_DATA * ch));
extern int roomcount args ((CHAR_DATA * ch));
extern long int level_cost (int level);
void sense_life (CHAR_DATA * ch);
char *condition_noun args ((int condition));
void send_card_stats args((OBJ_DATA *obj, CHAR_DATA *ch));
void appraise args((CHAR_DATA *ch, OBJ_DATA* card));
bool can_move_char args ((CHAR_DATA * ch, ROOM_INDEX_DATA * to_room, bool follow, bool show_messages));
char imm_who_msg[MAX_STRING_LENGTH] = "remove";
void do_sword args((CHAR_DATA * ch, char *argument));
void save_cardcount args((void));
/* do_scanning */
char *ocean_desc[] = {
"The cold, rolling crystal aquamarine waves wash over your feet, sending\n\r" "stinging sensations up and down your spine. As you look all around you,\n\r" "you realize with just the tiniest sense of despair that their is no end in\n\r" "sight. The rippling water surface shimmers like a mirror that has been\n\r" "placed to face the sky, to sate the gods' appetites for drink, a massive\n\r" "pool of swirling salt and water that makes you both ache for dry land, and\n\r" "wish for more. It is impossible to tell where you are on this ocean, the\n\r" "slightest turn from the smallest wave has probably already set you off\n\r" "course.\n\r", /* 0 */
"The frothing blue-green sea rolls off from here to the curving horizon.\n\r"
"Heavy swells rise and fall steadily and silently, crawling towards the coast\n\r"
"where they will break on the sand. The murky waters are dark, and you can\n\r"
"make out life living beneath them in myriad strands of seaweed.\n\r\r",
/* 1 */
"A steady cycle of swells pass beneath you and disappear into the distance.\n\r"
"A hundred blue-green hill-tops rolling silently by, peaceful waters slowly\n\r"
"grinding into sand a thousand rocks, shells, and sunken ships. The waters\n\r"
"are murky, and nothing can be seen floating on the swirling surface.\n\r",
/* 2 */
"The dark waters look deceptively peaceful, and as empty as a starless sky.\n\r" "Murky waves roll smoothly and silently by, occasional white crests of foam\n\r" "gathering on their tops only to disappear again into the blue-green waters.\n\r" "The calm swells hiding the chaos beneath the surface, waiting for release\n\r" "on sandy beaches or in raging storms.\n\r", /* 3 */
"Light refracts off the dancing waves of the water, sending sparkles of shine\n\r" "and glisten all around you. It is a good thing that you find that\n\r" "interesting, because there isn't much else around you. Water, water, water\n\r" "and air, their colors blending into one perfectly woven mesh, a blur of\n\r" "grey and blue that never seems to end, and never even seems to begin. It is\n\r" "a paradox that only one lost at sea has the time or inclination to ponder.\n\r" "The churning of the waves rock you back and forth, a soothing motion that\n\r" "soon has you feeling sick. Yet another paradox in this massive pool of\n\r" "salt and water.\n\r", /* 4 */
"You ponder your existence as you drift along, your thoughts your only\n\r" "companion. In the distance a bird dives for a fish. Suddenly, a ripple\n\r" "oscillates around you, almost startling you overboard. Dark shapes glide by,\n\r" "on errands only they understand. Some of the shapes are short and round,\n\r" "some are long and skinny, while still others are in shapes impossible to\n\r" "describe. A few are very large. You just hope they have plenty more\n\r" "appetizing meals down below...\n\r", /* 5 */
"The glistening sunlight is slowly driving you insane. It stabs into your\n\r"
"eyes and beats into your brain. You wonder if the tinge of salt enveloping\n\r"
"you will ever dissipate. Clouds and darkness are your only solace,\n\r"
"providing a temporary, uneasy peace. But even the clouds are not a\n\r"
"completely welcome sight. You can see faces in them, as if mocking you for\n\r"
"your mortal attempt at mastering such a vast entity, the endless ocean.\n\r"
"Maybe the pain from the stark, desolate light is better...\n\r",
/* 6 */
"You begin to think the rhythm of the universe is reflected in the steady\n\r" "movement of the waves. Up and down...back and forth. As constant as the\n\r" "stars, as eternal as the earth. The water begins to look warm and inviting,\n\r" "its promise of death becoming preferable to the endless beating of the sun\n\r" "and sway of the waves. Anything to end the monotony of the ceaseless blue\n\r" "horizon. Time has no meaning here - here where the cycles of life display\n\r" "themselves in unchanging rhythms of waves.\n\r", /* 7 */
"Undulating cerulean waves caress the bottom of your seacraft as you continue\n\r"
"your endless journey across this vast uncharted ocean. Save for the\n\r"
"occasional reflections of light gleaming off intrepid crests which spray\n\r"
"froth over the bow of your ship, the sole movement across the boundless\n\r"
"horizon comes from gulls swooping low to snatch fish in their protracted\n\r"
"beaks or creatures splashing in your wake. So remote from the madness of\n\r"
"complication, this extremity of solitude forces you to throw aside the\n\r"
"facades which have buffeted you, so that at this particular moment, you\n\r"
"stand precariously on the edge of epiphany and utter despair.\n\r",
/* 8 */
"The ocean churns on, sea-foam and shells, driving skeletal once-fish and the\n\r"
"glassy-crystal remains of a jellyfish broken by a storm. The waters swirl\n\r"
"on, salty and dark, grinding to sand the last stones of what once was a\n\r"
"mountain. The cycle rolls on, a clump of greenish seaweed riding the froth\n\r"
"of a wave from the other side of the world. A perpetual inventory of the\n\r"
"sea, awash with debris, alive and dead, inevitable and silent.\n\r",
/* 9 */
"A plethora of blue-green colors is the entirety of existence here. Light\n\r" "shimmering off the water gives the ocean an appearance of lacking depth,\n\r" "but the dimensions of the crashing waves and tumbling current render that\n\r" "perception false. The clear sky poses as a reflection of the sea, using the\n\r" "horizon as a point of symmetry. The monotony is at once tranquil and\n\r" "disturbing.\n\r", /* 10 */
"The sounds of tumbling currents drone on, and the colors of the sea behave\n\r"
"similarly. There appears to be no end in sight. The landscape is broken\n\r"
"only by the occasional odd sea organism leaping out of and then back into\n\r"
"the endless pool of water. The sky mirrors this loneliness as the blue\n\r"
"above is marred only by the random cloud streaking across it. Peering far\n\r"
"and wide, there is only this infinite world of blues to be seen.\n\r"
/* 11 */
};
char *ac_info (CHAR_DATA *, int);
extern char *const dir_name[];
extern bool is_encrypted;
char *const dist_name[] =
{ "right here", "close by", "not far off", "a short distance away",
"rather far off", "in the distance", "almost out of sight"
};
char *const dir_desc[] =
{ "to the north", "to the east", "to the south", "to the west",
"upwards", "downwards"
};
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 right> ",
"<wielded left> ", "<held> ",
"<floating nearby> ", "<tattoed> ",
"<worn on face> ", "<worn in ears> ",
"<worn as crest> ",
};
/* for do_count */
int max_on = 0;
void do_battlecry (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
if (IS_NPC (ch))
{
send_to_char ("NPCs cannot have battlecries.\n\r", ch);
return;
}
if (!str_cmp (argument, "delete"))
{
free_string (ch->pcdata->battlecry);
ch->pcdata->battlecry = str_dup ("");
send_to_char ("Battlecry deleted.\n\r", ch);
return;
}
if (argument[0] == '\0')
{
if (ch->pcdata->battlecry[0] == '\0')
sprintf (buf, "<none>\n\r");
else
sprintf (buf, "%s %s``\n\r", ch->name, ch->pcdata->battlecry);
send_to_char ("Syntax: battlecry <battle cry message>\n\r", ch);
send_to_char (" battlecry delete\n\r\n\r", ch);
send_to_char ("Your present battlecry is:\n\r", ch);
send_to_char (buf, ch);
return;
}
argument[65] = '\0';
free_string (ch->pcdata->battlecry);
ch->pcdata->battlecry = str_dup (argument);
send_to_char ("Battlecry changed.\n\r", ch);
return;
}
void do_plan (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (argument[0] != '\0')
{
if (!str_cmp ("delete", argument))
{
send_to_char ("Your finger information has been deleted.\n\r", ch);
free_string (ch->pcdata->plan);
ch->pcdata->plan = str_dup ("");
return;
}
else
{
send_to_char
("Syntax: plan (Edit your finger information)\n\r", ch);
send_to_char
(" plan delete (Delete your current finger information)\n\r",
ch);
return;
}
}
send_to_char
("Please use the Exodus Editor to enter your finger information.\n\r\n\r",
ch);
ch->desc->editor = FINGER_INFO;
edit_string (ch, &ch->pcdata->plan);
return;
}
void do_description (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (argument[0] != '\0')
{
if (!str_cmp ("delete", argument))
{
send_to_char ("Your description has been deleted.\n\r", ch);
free_string (ch->description);
ch->description = str_dup ("");
return;
}
else
{
send_to_char
("Syntax: description (Edit your description)\n\r", ch);
send_to_char
(" description delete (Delete your current description)\n\r",
ch);
return;
}
}
send_to_char
("Please use the Exodus Editor to enter your description.\n\r\n\r", ch);
ch->desc->editor = DESC_INFO;
edit_string (ch, &ch->description);
return;
}
void do_finger (CHAR_DATA * ch, char *argument)
{
CHAR_DATA *victim = NULL, *original;
FILE *ffp;
char to_finger[MAX_INPUT_LENGTH], plan[10 * MAX_STRING_LENGTH] = "";
char host[MAX_STRING_LENGTH];
char email[MAX_STRING_LENGTH];
char referrer[MAX_STRING_LENGTH];
char tcbuf[MAX_STRING_LENGTH], strsave[MAX_STRING_LENGTH];
char *word, letter;
time_t last_logoff = 0, fake_logoff = 0, creation_time = 0;
FAKE_DATA *fake_vict;
DESCRIPTOR_DATA *d;
one_argument (argument, to_finger);
if (to_finger[0] == '\0')
{
send_to_char ("Syntax: finger <user>\n\r", ch);
return;
}
for (fake_vict = fake_list; fake_vict != NULL; fake_vict = fake_vict->next)
{
if (is_name (to_finger, fake_vict->name))
{
sprintf (tcbuf,
"Player: %s\n\rPlayer is currently online.\n\r\n\rPlan:\n\rNo plan.\n\r",
fake_vict->name);
send_to_char (tcbuf, ch);
return;
}
}
if ((victim = get_char_world (ch, to_finger)) != NULL
&& can_see (ch, victim))
{
if (IS_NPC (victim))
{
sprintf (tcbuf, "Player '%s' not found.\n\r",
capitalize (to_finger));
send_to_char (tcbuf, ch);
return;
}
strcpy (plan, victim->pcdata->plan);
if (victim->desc == NULL)
last_logoff = -2;
else
last_logoff = -1;
}
else
{
bool period = FALSE;
int i = 0;
sprintf (strsave, "%s%c/%s", PLAYER_DIR, toupper (to_finger[0]),
capitalize (to_finger));
for (i = 0; i<strlen(to_finger);i++)
if (to_finger[i] == '.')
period = TRUE;
if ((ffp = fopen (strsave, "r")) == NULL || (period && !IS_IMMORTAL(ch)))
{
sprintf (tcbuf, "Player '%s' not found.\n\r",
capitalize (to_finger));
send_to_char (tcbuf, ch);
return;
}
is_encrypted = FALSE;
strcpy (referrer, "");
while (1)
{
if (feof (ffp))
break;
letter = fread_letter (ffp);
if (letter != 'P' && letter != 'L' && letter != 'H'
&& letter != 'E' && letter != 'R' && letter != 'I')
{
if (feof (ffp))
{
send_to_char ("Error reading player information.\n\r", ch);
fclose (ffp);
return;
}
fread_to_eol (ffp);
continue;
}
word = fread_word (ffp);
if (!str_cmp (word, "lan"))
strcpy (plan, fread_string (ffp));
else if (!str_cmp (word, "mail"))
strcpy (email, fread_string (ffp));
else if (!str_cmp (word, "eferrer"))
strcpy (referrer, fread_string (ffp));
else if (!str_cmp (word, "ost"))
strcpy (host, fread_string (ffp));
else if (!str_cmp (word, "ogO"))
last_logoff = fread_number (ffp);
else if (!str_cmp (word, "ogF"))
fake_logoff = fread_number (ffp);
else if (!str_cmp (word, "d"))
creation_time = fread_number (ffp);
}
fclose (ffp);
}
if (victim != NULL)
{
if (is_affected (victim, gsn_mask) && victim->mask != NULL)
{
plan[0] = '\0';
sprintf (tcbuf, "Player: %s\n\r", victim->mask);
}
else
sprintf (tcbuf, "Player: %s\n\r", capitalize (victim->name));
}
else
sprintf (tcbuf, "Player: %s\n\r", capitalize (to_finger));
if (creation_time > 0)
{
strcat (tcbuf, "Created on: ");
strcat (tcbuf, ctime (&creation_time));
}
else if (victim && victim->id)
{
strcat (tcbuf, "Created on: ");
strcat (tcbuf, ctime (&victim->id));
}
if (last_logoff == -2)
strcat (tcbuf, "Player is currently link-dead.\n");
else if (last_logoff == -1)
strcat (tcbuf, "Player is currently online.\n");
else
{
strcat (tcbuf, "Last On: ");
victim = NULL;
for (d = descriptor_list; d != NULL; d = d->next)
{
if (d == NULL || d->connected != CON_PLAYING)
continue;
original = d->original ? d->original : d->character;
if (tolower (to_finger[0]) != tolower (original->name[0]))
continue;
if (!str_cmp (original->name, to_finger))
{
victim = original;
break;
}
}
if (fake_logoff > 0 && victim != NULL && !can_see (ch, victim))
strcat (tcbuf, ctime (&fake_logoff));
else if (last_logoff != 0)
strcat (tcbuf, ctime (&last_logoff));
else
strcat (tcbuf, "Unknown\n");
}
if (plan[0] != '\0')
{
strcat (tcbuf, "\r\n\rPlan:\n\r");
strcat (tcbuf, plan);
}
else
strcat (tcbuf, "No plan.\n\r");
if (ch->level == 100) /*&& (last_logoff != -1)*/
{
if (last_logoff == -1 && victim != NULL)
strcpy(host,victim->desc->realhost);
if (host[0] != '\0')
{
strcat (tcbuf, "\n\rLast host used: ");
strcat (tcbuf, host);
}
else
strcat (tcbuf, "No host recorded.\n\r");
if (last_logoff == -1 && victim != NULL && victim->pcdata)
strcpy(referrer,victim->pcdata->referrer);
if (referrer[0] != '\0')
{
strcat (tcbuf, "\r\n\rReferred By: ");
strcat (tcbuf, referrer);
strcat (tcbuf, "");
}
else strcat(tcbuf, "\r\n\rNo referrer given.");
if (last_logoff == -1 && victim != NULL && victim->pcdata)
strcpy(email,victim->pcdata->email_addr);
if (email[0] != '\0')
{
strcat (tcbuf, "\r\n\rEmail address: ");
strcat (tcbuf, email);
strcat (tcbuf, "\r\n\r");
}
else
strcat (tcbuf, "\r\n\rNo email address recorded.\r\n\r");
}
send_to_char (tcbuf, ch);
return;
}
/*
* Local functions.
*/
char *format_obj_to_char args ((OBJ_DATA * obj, CHAR_DATA * ch, bool fShort));
char *format_obj_to_char args ((OBJ_DATA * obj, CHAR_DATA * ch, bool fShort));
void show_list_to_char
args ((OBJ_DATA * list, CHAR_DATA * ch, 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));
void show_game_stats args ((CHAR_DATA * ch, int type));
char *center_text (char *txtstr, int txtnum)
{
int xsize, xcnt, osize, txtsize;
static char retbuf[MAX_STRING_LENGTH];
char tmpbuf[MAX_STRING_LENGTH], *cptr;
osize = strlen (txtstr);
txtsize = txtnum;
for (cptr = txtstr; *cptr != '\0'; cptr++)
{
if (*cptr == '`')
{
txtsize += 2;
cptr++;
}
}
xsize = txtsize - osize;
xsize /= 2;
sprintf (tmpbuf, "%%%ds%%s", xsize);
sprintf (retbuf, tmpbuf, "", txtstr);
for (xcnt = (xsize + osize); xcnt < txtsize; xcnt++)
strcat (retbuf, " ");
return (retbuf);
}
char retbuf[16];
char *level_name (int level)
{
if (level <= LEVEL_HERO)
sprintf (retbuf, "%d", level);
else
switch (level)
{
case 91:
case 92:
case 93:
case 94:
strcpy (retbuf, "DEMIGOD");
break;
case 95:
case 96:
case 97:
strcpy (retbuf, "GOD");
break;
case 98:
case 99:
strcpy (retbuf, "WIZARD");
break;
case 100:
strcpy (retbuf, "OVERLORD");
break;
}
return (retbuf);
}
bool is_pressed (OBJ_DATA * obj)
{
OBJ_DATA *eObj;
ELEVATOR_DEST_LIST *edest;
bool found = FALSE;
for (eObj = object_list; eObj != NULL; eObj = eObj->next)
{
if (eObj->item_type != ITEM_ELEVATOR)
continue;
if (eObj->pIndexData->vnum == obj->value[0])
{
found = TRUE;
break;
}
}
if (!found)
return (FALSE);
for (edest = eObj->dest_list; edest; edest = edest->next)
{
if (edest->vnum == obj->value[2])
return (TRUE);
}
return (FALSE);
}
char *format_obj_to_char (OBJ_DATA * obj, CHAR_DATA * ch, bool fShort)
{
static char buf[MAX_STRING_LENGTH];
buf[0] = '\0';
if ((fShort && (obj->short_descr == NULL || obj->short_descr[0] == '\0')))
return buf;
if (IS_SET(obj->extra_flags[1],ITEM_WINGED))
strcat(buf, "`g(Winged)`` ");
if (detect_obj_trap(ch,obj))
strcat(buf, "`b(Trapped)`` ");
if (IS_OBJ_STAT (obj, ITEM_INVIS))
strcat (buf, "`E(Invis)`` ");
if (IS_SET (obj->extra_flags[1], ITEM_WIZI))
strcat (buf, "`h(Wizi)`` ");
if (IS_AFFECTED (ch, AFF_DETECT_EVIL) && IS_OBJ_STAT (obj, ITEM_EVIL))
strcat (buf, "`b(Red Aura)`` ");
if (IS_AFFECTED (ch, AFF_DETECT_GOOD) && IS_OBJ_STAT (obj, ITEM_BLESS))
strcat (buf, "`l(Blue Aura)`` ");
if (IS_AFFECTED (ch, AFF_DETECT_MAGIC) && IS_OBJ_STAT (obj, ITEM_MAGIC))
strcat (buf, "`j(Magical)`` ");
if (IS_OBJ_STAT (obj, ITEM_GLOW))
strcat (buf, "`k(Glowing)`` ");
if (IS_OBJ_STAT (obj, ITEM_HUM))
strcat (buf, "`n(Humming)`` ");
if (IS_SET(obj->extra_flags[1],ITEM_PULSATING))
strcat (buf, "`h(Pulsating)`` ");
if (obj->item_type == ITEM_EBUTTON)
if (is_pressed (obj))
{
if (IS_SET (obj->value[3], BUTTON_PULL))
strcat (buf, "(Pulled) ");
else
strcat (buf, "(Pressed) ");
}
if (fShort)
{
if (obj->short_descr != NULL)
{
strcat (buf, "`d");
strcat (buf, obj->short_descr);
strcat (buf, "``");
}
}
else
{
if (obj->description != NULL)
{
strcat (buf, "`d");
if (obj->pIndexData->vnum == OBJ_VNUM_CLAN_SYMBOL)
{
sprintf (buf + strlen (buf), obj->description,
get_clan_symbol (ch->in_room->area->clan));
}
else
{
strcat (buf, obj->description);
}
strcat (buf, "``");
}
}
return buf;
}
/*
* 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];
BUFFER *output;
char **prgpstrShow;
int *prgnShow;
char *pstrShow;
OBJ_DATA *obj;
int nShow;
int iShow;
int count;
bool fCombine;
if (ch->desc == NULL)
return;
/*
* Alloc space for output lines.
*/
output = new_buf ();
count = 0;
for (obj = list; obj != NULL && obj->next_content != obj;
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->next_content != obj;
obj = obj->next_content)
{
if ((obj->item_type == ITEM_FURNITURE || obj->item_type == ITEM_RAFT) && obj->pIndexData->vnum != OBJ_VNUM_HEXAGRAM)
if (obj->value[0] > 0 && count_users (obj) >= obj->value[0])
continue;
if (obj->wear_loc == WEAR_NONE && can_see_obj (ch, obj)
&& obj->description[0] != '\0')
{
pstrShow = format_obj_to_char (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;
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))
{
if (prgnShow[iShow] != 1)
{
sprintf (buf, "(%2d) ", prgnShow[iShow]);
add_buf (output, buf);
}
else
{
add_buf (output, " ");
}
}
add_buf (output, prgpstrShow[iShow]);
add_buf (output, "\n\r");
free_string (prgpstrShow[iShow]);
}
if (fShowNothing && nShow == 0)
{
if (IS_NPC (ch) || IS_SET (ch->comm, COMM_COMBINE))
send_to_char (" ", ch);
send_to_char ("Nothing.\n\r", ch);
}
page_to_char (buf_string (output), ch);
/*
* Clean up.
*/
free_buf (output);
free_mem (prgpstrShow, count * sizeof (char *));
free_mem (prgnShow, count * sizeof (int));
return;
}
void
show_list_to_char_but (OBJ_DATA * list, CHAR_DATA * ch, bool fShort,
bool fShowNothing, OBJ_DATA * not_show)
{
char buf[MAX_STRING_LENGTH];
BUFFER *output;
char **prgpstrShow;
int *prgnShow;
char *pstrShow;
OBJ_DATA *obj;
int nShow;
int iShow;
int count;
bool fCombine;
if (ch->desc == NULL)
return;
/*
* Alloc space for output lines.
*/
output = new_buf ();
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 (obj == not_show)
continue;
if ((obj->item_type == ITEM_FURNITURE || obj->item_type == ITEM_RAFT) && obj->pIndexData->vnum != OBJ_VNUM_HEXAGRAM)
if (obj->value[0] > 0 && count_users (obj) >= obj->value[0])
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->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;
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))
{
if (prgnShow[iShow] != 1)
{
sprintf (buf, "(%2d) ", prgnShow[iShow]);
add_buf (output, buf);
}
else
{
add_buf (output, " ");
}
}
add_buf (output, prgpstrShow[iShow]);
add_buf (output, "\n\r");
free_string (prgpstrShow[iShow]);
}
if (fShowNothing && nShow == 0)
{
if (IS_NPC (ch) || IS_SET (ch->comm, COMM_COMBINE))
send_to_char (" ", ch);
send_to_char ("Nothing.\n\r", ch);
}
page_to_char (buf_string (output), ch);
/*
* Clean up.
*/
free_buf (output);
free_mem (prgpstrShow, count * sizeof (char *));
free_mem (prgnShow, count * sizeof (int));
return;
}
void scanning (CHAR_DATA * ch, int door)
{
char buf[MAX_STRING_LENGTH];
int distance, visibility;
bool found;
ROOM_INDEX_DATA *was_in_room;
visibility = 6;
if (!IS_SET (ch->act, PLR_HOLYLIGHT))
{
switch (weather_info.sunlight)
{
case SUN_SET:
visibility = 4;
break;
case SUN_DARK:
visibility = 2;
break;
case SUN_RISE:
visibility = 4;
break;
case SUN_LIGHT:
visibility = 6;
break;
}
switch (weather_info.sky)
{
case SKY_CLOUDLESS:
break;
case SKY_CLOUDY:
visibility -= 1;
break;
case SKY_RAINING:
visibility -= 2;
break;
case SKY_LIGHTNING:
visibility -= 3;
break;
}
}
was_in_room = ch->in_room;
found = FALSE;
for (distance = 1; distance <= 6; distance++)
{
EXIT_DATA *pexit;
CHAR_DATA *list;
CHAR_DATA *rch;
if ((pexit = ch->in_room->exit[door]) != NULL
&& pexit->u1.to_room != NULL && pexit->u1.to_room != was_in_room)
{
/* If the door is closed, stop looking... */
if (IS_SET (pexit->exit_info, EX_CLOSED))
{
char door_name[80];
one_argument (pexit->keyword, door_name);
if (door_name[0] == '\0')
strcat (door_name, "door");
sprintf (buf, "A closed %s %s %s.\n\r", door_name,
dist_name[distance - 1], dir_desc[door]);
send_to_char (buf, ch);
found = TRUE;
break;
}
ch->in_room = pexit->u1.to_room;
if (IS_OUTSIDE (ch) ? distance > visibility : distance > 4)
break;
list = ch->in_room->people;
for (rch = list; rch != NULL; rch = rch->next_in_room)
if (can_see (ch, rch))
{
found = TRUE;
sprintf (buf, "%s%s is %s %s.\n\r",
(is_affected (rch, gsn_mask)
&& rch->mask != NULL) ? rch->mask : PERS (rch,
ch),
(IS_NPC (rch) && !IS_SET(rch->act2,ACT_ILLUSION)) ? "" : " (PLAYER)",
dist_name[distance], dir_desc[door]);
buf[0] = UPPER (buf[0]);
send_to_char (buf, ch);
}
if (detect_room_trap(ch,ch->in_room))
{
sprintf(buf,"`bA trap is %s %s.``\n\r",dist_name[distance],dir_desc[door]);
send_to_char(buf,ch);
}
}
}
ch->in_room = was_in_room;
if (!found)
{
sprintf (buf, "You can't see anything %s.\n\r", dir_desc[door]);
send_to_char (buf, ch);
}
return;
}
void do_scanning (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
int dir;
bool found;
if (!check_blind (ch))
return;
if (is_affected (ch, gsn_disorientation))
{
send_to_char ("You are too disoriented to scan.\n\r", ch);
return;
}
if (is_affected(ch,skill_lookup("nearsight")))
{
send_to_char ("You can't make out anything outside this room.\n\r",ch);
return;
}
if (IS_AFFECTED(ch,AFF_BLIND))
{
send_to_char ("You are blind.\n\r",ch);
return;
}
if (argument[0] == '\0')
{
act ("$n scans intensely all around $m.", ch, NULL, NULL, TO_ROOM);
found = FALSE;
for (dir = 0; dir <= 5; dir++)
if (ch->in_room->exit[dir] != NULL)
{
sprintf (buf, "\n\r`n[`o%s`n]``\n\r", dir_desc[dir]);
send_to_char (buf, ch);
scanning (ch, dir);
found = TRUE;
}
if (!found)
send_to_char ("There are no exits here.\n\r", ch);
}
else
{
if (!str_prefix (argument, "north"))
dir = DIR_NORTH;
else if (!str_prefix (argument, "east"))
dir = DIR_EAST;
else if (!str_prefix (argument, "south"))
dir = DIR_SOUTH;
else if (!str_prefix (argument, "west"))
dir = DIR_WEST;
else if (!str_prefix (argument, "up"))
dir = DIR_UP;
else if (!str_prefix (argument, "down"))
dir = DIR_DOWN;
else
{
send_to_char ("That's not a direction!\n\r", ch);
return;
}
act ("$n scans the area $T of $m.", ch, NULL, dir_desc[dir], TO_ROOM);
if (ch->in_room->exit[dir] == NULL)
{
send_to_char
("There does not seem to be an exit in that direction.\n\r", ch);
return;
}
sprintf (buf, "\n\r`n[`o%s`n]``\n\r", dir_desc[dir]);
send_to_char (buf, ch);
scanning (ch, dir);
}
return;
}
void show_char_to_char_0 (CHAR_DATA * victim, CHAR_DATA * ch)
{
char buf[MAX_STRING_LENGTH], message[MAX_STRING_LENGTH];
char wizi[MAX_STRING_LENGTH];
char incog[MAX_STRING_LENGTH];
buf[0] = '\0';
if (victim->invis_level > 1)
sprintf (wizi, "`l(Wizi %d)`` ", victim->invis_level);
else
sprintf (wizi, "``");
if (victim->incog_level > 1)
sprintf (incog, "`l(Incog %d)`` ", victim->incog_level);
else
sprintf (incog, "``");
if (victim->riders != NULL)
return;
if (IS_NPC (victim) && victim->long_descr[0] == '\0')
return;
if (IS_SET (victim->comm, COMM_AFK))
strcat (buf, "[AFK] ");
if (IS_SET (victim->comm, COMM_QUIET))
strcat (buf, "[QUIET] ");
if (!IS_NPC (victim) && victim->desc == NULL)
{
if (IS_SET(victim->act2,ACT_PUPPETEER))
strcat(buf,"`d(Trance)`` ");
else strcat (buf, "`h(Linkdead)`` ");
}
if (victim->desc != NULL && victim->desc->editor != 0)
if (victim->desc->editor == ED_AREA
|| victim->desc->editor == ED_ROOM
|| victim->desc->editor == ED_OBJECT
|| victim->desc->editor == ED_MOBILE
|| victim->desc->editor == BUILD_MAIN
|| victim->desc->editor == BUILD_NAME
|| victim->desc->editor == BUILD_FLAGS
|| victim->desc->editor == BUILD_KEYWORDS
|| victim->desc->editor == BUILD_KEYWORDS_ADD
|| victim->desc->editor == BUILD_DOORS
|| victim->desc->editor == BUILD_DRESETS
|| victim->desc->editor == BUILD_DNAME)
strcat (buf, "[BUILDING] ");
if (is_affected (victim, skill_lookup ("web")))
strcat (buf, "(Webbed) ");
if (is_affected (victim, gsn_entangle))
strcat (buf, "(Entangled) ");
if (is_affected (victim, skill_lookup("ghost form")))
strcat (buf, "`h(Blurred)`` ");
if (is_affected (victim, gsn_clasp))
strcat (buf, "`a(Clasped)`` ");
if (is_affected (victim, gsn_torture))
strcat (buf, "`a(Chained)`` ");
if (victim->stunned)
strcat (buf, "`b(Stunned)`` ");
if (is_affected (victim, skill_lookup("eldritch miasma")))
strcat (buf, "`j(Green fog)`` ");
if (is_affected (victim, gsn_mirror) &&
(is_affected (ch, skill_lookup ("detect magic")) || IS_IMMORTAL (ch)))
strcat (buf, "`h(Mirror)`` ");
if (IS_AFFECTED (victim, AFF_INVISIBLE))
strcat (buf, "`E(Invis)`` ");
if (victim->invis_level >= 2)
strcat (buf, wizi);
if (victim->incog_level >= 2)
strcat (buf, incog);
if (IS_AFFECTED (victim, AFF_HIDE))
strcat (buf, "`G(Hide)`` ");
if (IS_AFFECTED (victim, AFF_CAMOUFLAGE))
strcat (buf, "`c(Camouflaged)`` ");
if (IS_AFFECTED (victim, AFF_CHARM))
{
if (!(IS_SET(victim->act2,ACT_FAMILIAR)))
strcat (buf, "`H(Charmed)`` ");
else strcat (buf, "`h(Controlled)`` ");
}
if (is_affected (victim, gsn_locust_wings))
strcat (buf, "`g(Winged)`` ");
if (IS_AFFECTED (victim, AFF_PASS_DOOR))
strcat (buf, "`g(Translucent)`` ");
if (IS_AFFECTED (victim, AFF_FAERIE_FIRE))
strcat (buf, "`i(Pink Aura)`` ");
if (IS_EVIL (victim) && IS_AFFECTED (ch, AFF_DETECT_EVIL))
strcat (buf, "`b(Red Aura)`` ");
if (IS_GOOD (victim) && IS_AFFECTED (ch, AFF_DETECT_GOOD))
strcat (buf, "`k(Golden Aura)`` ");
if (IS_AFFECTED (victim, AFF_SANCTUARY))
strcat (buf, "`o(White Aura)`` ");
if (!IS_NPC (victim) && IS_SET (victim->act, PLR_WANTED))
strcat (buf, "`b[Wanted]`` ");
if (!IS_NPC (victim) && IS_SET (victim->act, PLR_JAILED))
strcat (buf, "`i[Jailed]`` ");
if (victim->position == victim->start_pos && victim->long_descr[0] != '\0'
&& ch->race != PC_RACE_SWARM)
{
if ((IS_NPC (victim) && !IS_SET(victim->act2, ACT_ILLUSION))
|| IS_SET(victim->act2,ACT_TRANSFORMER))
strcat (buf, "`f");
else
strcat (buf, "`g");
if (IS_SET(victim->act2, ACT_ILLUSION) && IS_SET (ch->comm, COMM_BRIEF))
{
strcat (buf, victim->short_descr);
strcat (buf, " ``is here.\n\r");
}
else strcat (buf, victim->long_descr);
send_to_char (buf, ch);
return;
}
if (IS_NPC (victim) || IS_SET(victim->act2,ACT_TRANSFORMER))
strcat (buf, "`f");
else
strcat (buf, "`g");
if (ch->race != PC_RACE_SWARM)
{
if (!IS_NPC (victim) && !victim->pcdata->flaming && !IS_SET(victim->act2,ACT_TRANSFORMER))
{
if (victim->pcdata->pretitle[0] != '\0')
{
strcat (buf, victim->pcdata->pretitle);
strcat (buf, " ");
}
}
if (IS_NPC(victim) || (!victim->pcdata->flaming && !IS_SET(victim->act2,ACT_TRANSFORMER)))
{
if (is_affected (victim, gsn_mask) && victim->mask != NULL)
strcat (buf, victim->mask);
else strcat (buf, PERS (victim, ch));
}
if (!IS_NPC (victim) && !IS_SET (ch->comm, COMM_BRIEF) && victim->position == POS_STANDING
&& !victim->pcdata->flaming && !IS_SET(victim->act2,ACT_TRANSFORMER)) /* && ch->on == NULL) */
strcat (buf, victim->pcdata->title);
if (victim->position == POS_STANDING && victim->fighting != NULL)
victim->position = POS_FIGHTING;
if (!IS_NPC(victim) && victim->pcdata->flaming)
strcat (buf, "`kA flaming apparition");
if (!IS_NPC(victim) && IS_SET(victim->act2,ACT_TRANSFORMER))
{
strcat (buf, victim->long_descr);
if (victim->position == POS_STANDING)
{
send_to_char (buf, ch);
return;
}
}
}
//Iblis 9/17/04 - Swarm only see this orace_lookup
else
{
sprintf (message, "`gA %s``", race_table[victim->race].name);
strcat (buf,message);
}
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_COMA:
case POS_SLEEPING:
if (victim->on != NULL)
{
if (IS_SET (victim->on->value[2], SLEEP_AT))
{
sprintf (message, " is sleeping at %s.",
victim->on->short_descr);
strcat (buf, message);
}
else if (IS_SET (victim->on->value[2], SLEEP_ON))
{
sprintf (message, " is sleeping on %s.",
victim->on->short_descr);
strcat (buf, message);
}
else
{
sprintf (message, " is sleeping in %s.",
victim->on->short_descr);
strcat (buf, message);
}
}
else
strcat (buf, " is sleeping here.");
break;
case POS_RESTING:
if (victim->on != NULL)
{
if (IS_SET (victim->on->value[2], REST_AT))
{
sprintf (message, " is resting at %s.",
victim->on->short_descr);
strcat (buf, message);
}
else if (IS_SET (victim->on->value[2], REST_ON))
{
sprintf (message, " is resting on %s.",
victim->on->short_descr);
strcat (buf, message);
}
else
{
sprintf (message, " is resting in %s.",
victim->on->short_descr);
strcat (buf, message);
}
}
else
strcat (buf, " is resting here.");
break;
case POS_TETHERED:
strcat (buf, " is tethered here.");
break;
case POS_CHOPPING:
strcat (buf, " is here, chopping away like a good little lumberjack.");
break;
case POS_MILLING:
strcat (buf, " is here, milling away like a good little miller.");
break;
case POS_SITTING:
if (victim->on != NULL)
{
if (IS_SET (victim->on->value[2], SIT_AT))
{
sprintf (message, " is sitting at %s.",
victim->on->short_descr);
strcat (buf, message);
}
else if (IS_SET (victim->on->value[2], SIT_ON))
{
sprintf (message, " is sitting on %s.",
victim->on->short_descr);
strcat (buf, message);
}
else
{
sprintf (message, " is sitting in %s.",
victim->on->short_descr);
strcat (buf, message);
}
}
else
strcat (buf, " is sitting here.");
break;
case POS_STANDING:
if (victim->on != NULL)
{
if (IS_SET (victim->on->value[2], STAND_AT))
{
sprintf (message, " is standing at %s.",
victim->on->short_descr);
strcat (buf, message);
}
else if (IS_SET (victim->on->value[2], STAND_ON))
{
sprintf (message, " is standing on %s.",
victim->on->short_descr);
strcat (buf, message);
}
else
{
sprintf (message, " is standing in %s.",
victim->on->short_descr);
strcat (buf, message);
}
}
else
strcat (buf, " ``is here.");
break;
case POS_MOUNTED:
if (victim->mount != NULL)
{
sprintf (message, " ``is riding on %s.",
victim->mount->short_descr);
strcat (buf, message);
}
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;
case POS_FEIGNING_DEATH:
sprintf (buf, " `dThe corpse of %s is lying here.",victim->name);
break;
}
strcat (buf, "``\n\r");
buf[0] = UPPER (buf[0]);
send_to_char (buf, ch);
return;
}
void show_char_to_char_1 (CHAR_DATA * victim, CHAR_DATA * ch)
{
char buf[MAX_STRING_LENGTH];
OBJ_DATA *obj;
int iWear;
int i=0;
int percent,amount=0,k=0;
long wear_flags_left=0;
bool found;
char *last_statement = NULL;
char wbuf[MAX_STRING_LENGTH];
if (is_dueling (ch) && is_dueling (victim))
{
switch (victim->sex)
{
case SEX_NEUTRAL:
sprintf (buf, "%s looks piercingly at %s, sizing it up.\n\r",
ch->name, victim->name);
break;
case SEX_MALE:
sprintf (buf, "%s looks piercingly at %s, sizing him up.\n\r",
ch->name, victim->name);
break;
case SEX_FEMALE:
sprintf (buf, "%s looks piercingly at %s, sizing her up.\n\r",
ch->name, victim->name);
break;
}
arena_report (buf);
}
if (can_see (victim, ch))
{
if (ch == victim)
act ("$n looks at $mself.", ch, NULL, NULL, TO_ROOM);
else if (!IS_IMMORTAL(ch))
{
switch (number_range (0, 5))
{
case 0:
act ("$n regards you pensively.", ch, NULL, victim, TO_VICT);
act ("$n regards $N pensively.", ch, NULL, victim, TO_NOTVICT);
break;
case 1:
act ("$n assesses you.", ch, NULL, victim, TO_VICT);
act ("$n assesses $N.", ch, NULL, victim, TO_NOTVICT);
break;
case 2:
act ("$n examines you closely.", ch, NULL, victim, TO_VICT);
act ("$n examines $N closely.", ch, NULL, victim, TO_NOTVICT);
break;
case 3:
act ("$n sizes you up.", ch, NULL, victim, TO_VICT);
act ("$n sizes up $N.", ch, NULL, victim, TO_NOTVICT);
break;
case 4:
act ("$n looks at you appraisingly.", ch, NULL, victim, TO_VICT);
act ("$n looks at $N appraisingly.", ch, NULL, victim,
TO_NOTVICT);
break;
case 5:
act ("$n ruminates your existence.", ch, NULL, victim, TO_VICT);
act ("$n ruminates $N's existence.", ch, NULL, victim,
TO_NOTVICT);
break;
}
}
}
if (!IS_NPC(victim) && victim->pcdata->flaming && !IS_IMMORTAL(ch) && ch->race != PC_RACE_LITAN)
{
AFFECT_DATA af;
send_to_char ("The flame from the flaming apparition burns your eyes!\n\r",ch);
act ("$n's eyes are burnt by the flaming apparition!",ch,NULL,victim,TO_ROOM);
af.where = TO_AFFECTS;
af.type = skill_lookup ("fire breath");
af.level = victim->level;
af.duration = 0;
af.location = APPLY_HITROLL;
af.modifier = -4;
af.bitvector = AFF_BLIND;
af.permaff = FALSE;
af.composition = FALSE;
af.comp_name = str_dup ("");
affect_to_char (ch, &af);
return;
}
if (victim->description[0] != '\0')
{
send_to_char (victim->description, ch);
send_to_char ("``", ch);
}
else
{
act ("You see nothing out of the ordinary with $M.", ch, NULL,
victim, TO_CHAR);
}
if (victim->max_hit > 0)
percent = (100 * victim->hit) / victim->max_hit;
else
percent = -1;
if (is_affected (victim, gsn_mask) && victim->mask != NULL)
strcpy (buf, victim->mask);
else
strcpy (buf, PERS (victim, ch));
if (percent >= 100)
strcat (buf, " is in excellent condition.\n\r");
else if (percent >= 90)
strcat (buf, " has a few scratches.\n\r");
else if (percent >= 75)
strcat (buf, " has some small wounds and bruises.\n\r");
else if (percent >= 50)
strcat (buf, " has quite a few wounds.\n\r");
else if (percent >= 30)
strcat (buf, " has some big nasty wounds and scratches.\n\r");
else if (percent >= 15)
strcat (buf, " has suffered grievous wounds which bleed profusely.\n\r");
else if (percent >= 0)
strcat (buf, " is barely clinging to life.\n\r");
else
strcat (buf, " is knocking on death's door.\n\r");
buf[0] = UPPER (buf[0]);
send_to_char (buf, ch);
found = FALSE;
for (i = 1; wear_conversion_table[i].wear_loc != -2;++i)
wear_flags_left |= wear_conversion_table[i].wear_flag;
for (i = 1; wear_conversion_table[i].wear_loc != -2; ++i)
{
iWear = wear_conversion_table[i].wear_flag;
if (iWear == ITEM_TAKE || iWear == ITEM_NO_SAC)
continue;
if (!IS_SET(wear_flags_left,iWear))
continue;
if ((obj = get_eq_char_new (victim, iWear)) != NULL
&& can_see_obj (ch, obj))
{
if (!found)
{
send_to_char ("\n\r", ch);
act ("$N is using:", ch, NULL, victim, TO_CHAR);
found = TRUE;
}
if (victim->race == PC_RACE_SWARM && iWear == ITEM_WEAR_BODY)
send_to_char("<radiates> ",ch);
wear_flags_left -= iWear;
if (wear_conversion_table[i].wear_flag == ITEM_WEAR_WRIST
&& IS_SET(obj->wear_loc,ITEM_WEAR_ANOTHER_WRIST))
{
sprintf(buf,"<%s","worn around both wrists");
wear_flags_left -= ITEM_WEAR_ANOTHER_WRIST;
}
else if (wear_conversion_table[i].wear_flag == ITEM_WEAR_FINGER
&& IS_SET(obj->wear_loc,ITEM_WEAR_ANOTHER_FINGER))
{
sprintf(buf,"<%s","worn on both fingers");
wear_flags_left -= ITEM_WEAR_ANOTHER_FINGER;
}
else if (wear_conversion_table[i].wear_flag == ITEM_WEAR_NECK
&& IS_SET(obj->wear_loc,ITEM_WEAR_ANOTHER_NECK))
{
sprintf(buf,"<%s","worn around entire neck");
wear_flags_left -= ITEM_WEAR_ANOTHER_NECK;
}
else if (wear_conversion_table[i].wear_flag == ITEM_WIELD
&& IS_SET(obj->wear_loc,ITEM_TWO_HANDS))
{
sprintf(buf,"<%s","wielded in both hands");
wear_flags_left -= ITEM_TWO_HANDS;
}
else sprintf(buf,"<%s",wear_conversion_table[i].where_name);
amount = 0;
last_statement = NULL;
for (k = i+1; wear_conversion_table[k].wear_loc != -2;++k)
{
//should never hit this
if (!IS_SET(wear_flags_left,wear_conversion_table[k].wear_flag))
continue;
if (!IS_SET(obj->wear_loc,wear_conversion_table[k].wear_flag))
continue;
++amount;
if (amount < 2)
{
}
else
{
if (amount > 1)
strcat(buf,", ");
strcat(buf,last_statement);
}
wear_flags_left -= wear_conversion_table[k].wear_flag;
if (wear_conversion_table[k].wear_flag == ITEM_WEAR_WRIST
&& IS_SET(obj->wear_flags,ITEM_WEAR_ANOTHER_WRIST))
{
last_statement = "both wrists";
wear_flags_left -= ITEM_WEAR_ANOTHER_WRIST;
}
else if (wear_conversion_table[k].wear_flag == ITEM_WEAR_FINGER
&& IS_SET(obj->wear_flags,ITEM_WEAR_ANOTHER_FINGER))
{
last_statement = "both fingers";
wear_flags_left -= ITEM_WEAR_ANOTHER_FINGER;
}
else if (wear_conversion_table[k].wear_flag == ITEM_WEAR_NECK
&& IS_SET(obj->wear_flags,ITEM_WEAR_ANOTHER_NECK))
{
last_statement = "entire neck";
wear_flags_left -= ITEM_WEAR_ANOTHER_NECK;
}
else if (wear_conversion_table[k].wear_flag == ITEM_WIELD
&& IS_SET(obj->wear_loc,ITEM_TWO_HANDS))
{
last_statement = "as a weapon";
wear_flags_left -= ITEM_TWO_HANDS;
}
else last_statement = wear_conversion_table[k].wear_name;
}
if (amount > 1)
strcat(buf,",");
if (amount > 0)
strcat(buf," and ");
if (last_statement)
strcat(buf,last_statement);
strcat(buf,">");
sprintf(wbuf,"%-30s ",buf);
send_to_char(wbuf,ch);
// send_to_char (where_name[wear_conversion_table[i].wear_loc], ch);
send_to_char (format_obj_to_char (obj, ch, TRUE), ch);
send_to_char ("\n\r", ch);
}
}
if (victim != ch
&& !IS_NPC (ch) && number_percent () < get_skill (ch, gsn_peek))
{
send_to_char ("\n\rYou peek at the inventory:\n\r", ch);
check_improve (ch, gsn_peek, TRUE, 4);
show_list_to_char (victim->carrying, ch, TRUE, TRUE);
}
return;
}
void do_peek (CHAR_DATA * ch, char *argument)
{
CHAR_DATA *victim;
if (argument[0] == '\0')
send_to_char ("Syntax: Peek CharName.\n\r", ch);
if (get_skill (ch, gsn_peek) <= 0)
send_to_char
("The most you know about peek is peek-a-boo, and that won't help you now!\n\r",
ch);
victim = get_char_room (ch, argument);
if (victim == NULL)
{
send_to_char ("That person is not here.\n\r", ch);
return;
}
if ((number_percent () < get_skill (ch, gsn_peek) * (2.0/3.0)) && !IS_IMMORTAL(ch))
{
act ("$n takes a peek at $N.", ch, NULL, victim, TO_NOTVICT);
act ("$n takes a peek at you.", ch, NULL, victim, TO_VICT);
}
if (victim != ch && !IS_NPC (ch)
&& number_percent () < get_skill (ch, gsn_peek))
{
act ("You peek at $N's inventory:", ch, NULL, victim, TO_CHAR);
check_improve (ch, gsn_peek, TRUE, 4);
if (victim->silver + victim->gold * 100 < 1000)
act ("$N's coin purse looks fairly light.\n\r", ch, NULL,
victim, TO_CHAR);
else if (victim->silver + victim->gold * 100 < 10000)
act ("$N's coin purse looks about half full.\n\r", ch, NULL,
victim, TO_CHAR);
else if (victim->silver + victim->gold * 100 < 100000)
act ("$N's coin purse looks full.\n\r", ch, NULL, victim, TO_CHAR);
else if (victim->silver + victim->gold * 100 < 1000000)
act ("$N's coin purse is overflowing with coins!\n\r", ch,
NULL, victim, TO_CHAR);
else
act
("$N's coin purse is so full you're amazed $N can even lift it!\n\r",
ch, NULL, victim, TO_CHAR);
show_list_to_char (victim->carrying, ch, TRUE, TRUE);
}
}
void show_char_to_char_2 (CHAR_DATA * victim, CHAR_DATA * ch)
{
char buf[MAX_STRING_LENGTH];
int percent;
if (can_see (victim, ch)
|| (!IS_NPC (ch) && IS_SET (ch->act, PLR_HOLYLIGHT)))
{
if (ch == victim)
act ("$n glances at $mself.", ch, NULL, NULL, TO_ROOM);
else
{
act ("$n glances in your direction.", ch, NULL, victim, TO_VICT);
act ("$n takes a quick glance at $N.", ch, NULL, victim,
TO_NOTVICT);
}
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.\n\r");
else if (percent >= 90)
strcat (buf, " has a few scratches.\n\r");
else if (percent >= 75)
strcat (buf, " has some small wounds and bruises.\n\r");
else if (percent >= 50)
strcat (buf, " has quite a few wounds.\n\r");
else if (percent >= 30)
strcat (buf, " has some big nasty wounds and scratches.\n\r");
else if (percent >= 15)
strcat (buf, " looks pretty hurt.\n\r");
else if (percent >= 0)
strcat (buf, " is in awful condition.\n\r");
else
strcat (buf, " is bleeding to death.\n\r");
buf[0] = UPPER (buf[0]);
send_to_char (buf, ch);
return;
}
send_to_char ("You do not see that here.\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 (rch == ch)
continue;
if (get_trust (ch) < rch->invis_level)
continue;
if (IS_NPC (rch))
send_to_char ("`f", ch);
else
send_to_char ("`g", ch);
if (can_see (ch, rch))
{
if (is_dueling (ch) && is_dueling (rch))
{
char buf[MAX_STRING_LENGTH];
sprintf (buf, "%s prepares as %s approaches.\n\r",
ch->name, rch->name);
arena_report (buf);
}
show_char_to_char_0 (rch, ch);
}
else
{
if (is_dueling (ch) && is_dueling (rch))
{
char buf[MAX_STRING_LENGTH];
sprintf (buf, "%s evades %s's notice.\n\r", rch->name,
ch->name);
arena_report (buf);
}
if (room_is_dark (ch->in_room) && ch->race != PC_RACE_KALIAN && IS_AFFECTED (rch, AFF_INFRARED))
{
send_to_char
("You see nothing except the glowing red eyes watching you in the inky darkness.\n\r",
ch);
}
}
}
return;
}
bool check_blind (CHAR_DATA * ch)
{
if (!IS_NPC (ch) && IS_SET (ch->act, PLR_HOLYLIGHT))
return TRUE;
if (IS_AFFECTED (ch, AFF_BLIND))
{
send_to_char ("You can't see a thing!\n\r", ch);
return FALSE;
}
return TRUE;
}
/* changes your scroll */
void do_scroll (CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
char buf[100];
int lines;
one_argument (argument, arg);
if (arg[0] == '\0')
{
if (ch->lines == 0)
send_to_char ("You do not page long messages.\n\r", ch);
else
{
sprintf (buf, "You currently display %d lines per page.\n\r",
ch->lines + 2);
send_to_char (buf, ch);
}
return;
}
if (!is_number (arg))
{
send_to_char ("You must provide a number.\n\r", ch);
return;
}
lines = atoi (arg);
if (lines == 0)
{
send_to_char ("Paging disabled.\n\r", ch);
ch->lines = 0;
return;
}
if (lines < 10 || lines > 100)
{
send_to_char ("You must provide a reasonable number.\n\r", ch);
return;
}
sprintf (buf, "Scroll set to %d lines.\n\r", lines);
send_to_char (buf, ch);
ch->lines = lines - 2;
}
/* RT does socials */
void do_socials (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
int iSocial;
int col;
col = 0;
for (iSocial = 0; social_table[iSocial].name[0] != '\0'; iSocial++)
{
sprintf (buf, "%-12s", social_table[iSocial].name);
send_to_char (buf, ch);
if (++col % 6 == 0)
send_to_char ("\n\r", ch);
}
if (col % 6 != 0)
send_to_char ("\n\r", ch);
return;
}
/* RT Commands to replace news, motd, imotd, etc from ROM */
void do_motd (CHAR_DATA * ch, char *argument)
{
do_help (ch, "motd");
}
void do_imotd (CHAR_DATA * ch, char *argument)
{
do_help (ch, "imotd");
}
void do_rules (CHAR_DATA * ch, char *argument)
{
do_help (ch, "rules");
}
void do_story (CHAR_DATA * ch, char *argument)
{
do_help (ch, "story");
}
void do_wizlist (CHAR_DATA * ch, char *argument)
{
do_help (ch, "wizlist");
}
/* RT this following section holds all the auto commands from ROM, as well as
replacements for config */
void do_autolist (CHAR_DATA * ch, char *argument)
{
/* lists most player flags */
if (IS_NPC (ch))
return;
send_to_char (" action status\n\r", ch);
send_to_char ("---------------------\n\r", ch);
send_to_char ("autoassist ", ch);
if (IS_SET (ch->act, PLR_AUTOASSIST))
{
send_to_char ("ON ", ch);
switch (ch->pcdata->autoassist_level)
{
case AASSIST_MOBS:
send_to_char ("(Mobs)\n\r", ch);
break;
case AASSIST_NONE:
send_to_char ("(OFF)\n\r", ch);
break;
}
}
else
send_to_char ("OFF\n\r", ch);
send_to_char ("autoexit ", ch);
if (IS_SET (ch->act, PLR_AUTOEXIT))
send_to_char ("ON\n\r", ch);
else
send_to_char ("OFF\n\r", ch);
send_to_char ("autogold ", ch);
if (IS_SET (ch->act, PLR_AUTOGOLD))
send_to_char ("ON\n\r", ch);
else
send_to_char ("OFF\n\r", ch);
send_to_char ("autoloot ", ch);
if (IS_SET (ch->act, PLR_AUTOLOOT))
send_to_char ("ON\n\r", ch);
else
send_to_char ("OFF\n\r", ch);
send_to_char ("autoreturn ", ch);
if (!IS_SET (ch->act, PLR_AUTORETURN))
send_to_char ("ON\n\r", ch);
else
send_to_char ("OFF\n\r", ch);
send_to_char ("autosac ", ch);
if (IS_SET (ch->act, PLR_AUTOSAC))
send_to_char ("ON\n\r", ch);
else
send_to_char ("OFF\n\r", ch);
send_to_char ("autosplit ", ch);
if (IS_SET (ch->act, PLR_AUTOSPLIT))
send_to_char ("ON\n\r", ch);
else
send_to_char ("OFF\n\r", ch);
if (ch->pcdata->learned[gsn_butcher] > 0)
{
send_to_char ("autobutcher ", ch);
if (IS_SET (ch->act, PLR_AUTOBUTCHER))
send_to_char ("ON\n\r", ch);
else
send_to_char ("OFF\n\r", ch);
}
send_to_char ("compact mode ", ch);
if (IS_SET (ch->comm, COMM_COMPACT))
send_to_char ("ON\n\r", ch);
else
send_to_char ("OFF\n\r", ch);
send_to_char ("prompt ", ch);
if (IS_SET (ch->comm, COMM_PROMPT))
send_to_char ("ON\n\r", ch);
else
send_to_char ("OFF\n\r", ch);
send_to_char ("combine items ", ch);
if (IS_SET (ch->comm, COMM_COMBINE))
send_to_char ("ON\n\r", ch);
else
send_to_char ("OFF\n\r", ch);
send_to_char ("cardkill ", ch);
if (IS_SET (ch->act, PLR_CARDKILL))
send_to_char ("ON\n\r",ch);
else send_to_char ("OFF\n\r",ch);
/* if (!IS_SET(ch->act, PLR_CANLOOT))
send_to_char("Your corpse is safe from thieves.\n\r", ch);
else
send_to_char("Your corpse may be looted.\n\r", ch);
if (IS_SET(ch->act, PLR_NOSUMMON))
send_to_char("You cannot be summoned.\n\r", ch);
else
send_to_char("You can be summoned.\n\r", ch);
*/
if (IS_SET (ch->act, PLR_NOFOLLOW))
send_to_char ("You do not welcome followers.\n\r", ch);
else
send_to_char ("You accept followers.\n\r", ch);
}
void
do_autoassist (CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
if (IS_NPC (ch))
return;
one_argument (argument, arg);
if (!IS_CLASS(ch,PC_CLASS_CLERIC))
{
send_to_char("You must autoassist all mobs, and no players, so you don't need this command.\n\r",ch);
return;
}
if ((ch->level > 61 && (ch->class != ch->class2 || ch->class != ch->class3)) || (ch->level > 31 && (ch->class != ch->class2)))
{
send_to_char("You must autoassist all mobs, and no players, so you don't need this command!\n\r",ch);
return;
}
if (arg[0] == '\0')
// Minax 12-20-02 Everyone must autoassist.
// Iblis 10-20-03 But not clerics
{
send_to_char
("You must specify an autoassist mode. Valid modes are:\n\r",
ch);
send_to_char
(" mobs : Assist group members only when fighting mobiles.\n\r",
ch);
send_to_char
(" none : Do not assist group members.\n\r",
ch);
if (ch->pcdata->autoassist_level == AASSIST_MOBS)
{
send_to_char ("\n\rYou currently assist against mobiles.\n\r", ch);
}
else if (ch->pcdata->autoassist_level == AASSIST_NONE)
{
send_to_char ("\n\rYou currently do not autoassist.\n\r", ch);
}
else
return;
return;
}
if (!str_cmp (arg, "mobs"))
{
send_to_char ("You will now assist against mobiles when needed.\n\r",
ch);
SET_BIT (ch->act, PLR_AUTOASSIST);
ch->pcdata->autoassist_level = AASSIST_MOBS;
}
else if (!str_cmp (arg, "none"))
{
send_to_char ("You will no longer auto assist.\n\r",
ch);
REMOVE_BIT (ch->act, PLR_AUTOASSIST);
ch->pcdata->autoassist_level = AASSIST_NONE;
}
else
{
send_to_char
("You must specify an autoassist mode. Valid modes are:\n\r", ch);
send_to_char
(" none : Do not assist group members.\n\r",
ch);
send_to_char
(" mobs : Assist group members only when fighting mobiles.\n\r",
ch);
}
}
void do_autobutcher (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (ch->pcdata->learned[gsn_butcher] < 1)
{
send_to_char
("You can't set autobutcher without the butcher skill!", ch);
return;
}
if (IS_SET (ch->act, PLR_AUTOBUTCHER))
{
send_to_char ("Autobutcher removed.\n\r", ch);
REMOVE_BIT (ch->act, PLR_AUTOBUTCHER);
}
else
{
send_to_char ("Automatic butchering set.\n\r", ch);
SET_BIT (ch->act, PLR_AUTOBUTCHER);
}
}
void do_autoexit (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (IS_SET (ch->act, PLR_AUTOEXIT))
{
send_to_char ("Exits will no longer be displayed.\n\r", ch);
REMOVE_BIT (ch->act, PLR_AUTOEXIT);
}
else
{
send_to_char ("Exits will now be displayed.\n\r", ch);
SET_BIT (ch->act, PLR_AUTOEXIT);
}
}
void do_autogold (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (IS_SET (ch->act, PLR_AUTOGOLD))
{
send_to_char ("Autogold removed.\n\r", ch);
REMOVE_BIT (ch->act, PLR_AUTOGOLD);
}
else
{
send_to_char ("Automatic gold looting set.\n\r", ch);
SET_BIT (ch->act, PLR_AUTOGOLD);
}
}
void do_autoreturn (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (IS_SET (ch->act, PLR_AUTORETURN))
{
send_to_char ("Autoreturn added.\n\r", ch);
REMOVE_BIT (ch->act, PLR_AUTORETURN);
}
else
{
send_to_char ("Autoreturn removed.\n\r", ch);
SET_BIT (ch->act, PLR_AUTORETURN);
}
}
void do_autoloot (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (IS_SET (ch->act, PLR_AUTOLOOT))
{
send_to_char ("Autolooting removed.\n\r", ch);
REMOVE_BIT (ch->act, PLR_AUTOLOOT);
}
else
{
send_to_char ("Automatic corpse looting set.\n\r", ch);
SET_BIT (ch->act, PLR_AUTOLOOT);
}
}
void do_autosac (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (IS_SET (ch->act, PLR_AUTOSAC))
{
send_to_char ("Autosacrificing removed.\n\r", ch);
REMOVE_BIT (ch->act, PLR_AUTOSAC);
}
else
{
send_to_char ("Automatic corpse sacrificing set.\n\r", ch);
SET_BIT (ch->act, PLR_AUTOSAC);
}
}
void do_autosplit (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (IS_SET (ch->act, PLR_AUTOSPLIT))
{
send_to_char ("Autosplitting removed.\n\r", ch);
REMOVE_BIT (ch->act, PLR_AUTOSPLIT);
}
else
{
send_to_char ("Automatic gold splitting set.\n\r", ch);
SET_BIT (ch->act, PLR_AUTOSPLIT);
}
}
void do_brief (CHAR_DATA * ch, char *argument)
{
if (IS_SET (ch->comm, COMM_BRIEF))
{
send_to_char ("Full descriptions activated.\n\r", ch);
REMOVE_BIT (ch->comm, COMM_BRIEF);
}
else
{
send_to_char ("Short descriptions activated.\n\r", ch);
SET_BIT (ch->comm, COMM_BRIEF);
}
}
void do_compact (CHAR_DATA * ch, char *argument)
{
if (IS_SET (ch->comm, COMM_COMPACT))
{
send_to_char ("Compact mode removed.\n\r", ch);
REMOVE_BIT (ch->comm, COMM_COMPACT);
}
else
{
send_to_char ("Compact mode set.\n\r", ch);
SET_BIT (ch->comm, COMM_COMPACT);
}
}
void send_color_status (CHAR_DATA * ch, char *a, char *c, byte b)
{
sprintf (c, "%s %s %s\n\r", color_table[b], a, ANSI_NORMAL);
send_to_char (c, ch);
}
void color_usage (CHAR_DATA * ch)
{
char oneline[MAX_STRING_LENGTH];
send_to_char
("Color Usage:\n\r'color on'\t'color off'\t'color default'\t'color <color> <option>'\n\r\n\r",
ch);
send_to_char ("Colors:\n\r\n\r", ch);
sprintf (oneline, "`a%-18s`b%-18s`c%-18s`d%-18s\n\r", "GREY``",
"RED``", "GREEN``", "YELLOW``");
send_to_char (oneline, ch);
sprintf (oneline, "`e%-18s`f%-18s`g%-18s`h%-18s\n\r", "BLUE``",
"PURPLE``", "CYAN``", "WHITE``");
send_to_char (oneline, ch);
sprintf (oneline, "`i%-18s`j%-18s`k%-18s`l%-18s\n\r", "BOLD RED``",
"BOLD GREEN``", "BOLD YELLOW``", "BOLD BLUE``");
send_to_char (oneline, ch);
sprintf (oneline, "`m%-18s`n%-18s`o%-18s\n\r\n\r", "BOLD PURPLE``",
"BOLD CYAN``", "BOLD WHITE``");
send_to_char (oneline, ch);
send_to_char ("``Options:\n\r\n\r", ch);
sprintf (oneline, "`A%-18s`B%-18s`C%-18s`D%-18s\n\r", "COMBAT SELF``",
"COMBAT OPPONENT``", "CONDITION SELF``", "CONDITION OPPONENT``");
send_to_char (oneline, ch);
sprintf (oneline, "`E%-18s`F%-18s`G%-18s`H%-18s\n\r", "INVIS``",
"HP``", "HIDDEN``", "CHARMED``");
send_to_char (oneline, ch);
sprintf (oneline, "`I%-18s`J%-18s`K%-18s`L%-18s\n\r", "MANA``",
"MOVE``", "SAY``", "TELL``");
send_to_char (oneline, ch);
sprintf (oneline, "`Q%-18s`O%-18s`P%-18s`N%-18s\n\r", "MUSIC``",
"GUILD TALK``", "GROUP TELL``", "AUCTION``");
send_to_char (oneline, ch);
if (ch->level > 99)
sprintf (oneline, "`M%-18s`R%-18s`S%-18s\n\r", "GOSSIP``",
"IMMTALK``", "ADMIN``");
else if (ch->level > 91)
sprintf (oneline, "`M%-18s`R%-18s\n\r", "GOSSIP``", "IMMTALK``");
else
sprintf (oneline, "`M%-18s\n\r", "GOSSIP``");
send_to_char (oneline, ch);
send_to_char ("```\n\r\n\r", ch);
return;
}
void do_color (CHAR_DATA * ch, char *argument)
{
char cbuf[MAX_INPUT_LENGTH];
byte scolor;
if (IS_NPC (ch))
{
send_to_char ("NPC's can't see colors!\n", ch);
return;
}
if (argument[0] == 0)
{
color_usage (ch);
return;
}
else
{
argument = one_argument (argument, cbuf);
if (strcasecmp (cbuf, "default") == 0)
{
send_to_char ("Reverting Ansi colors to defaults.\n\r", ch);
ch->pcdata->color_combat_s = 7;
ch->pcdata->color_combat_o = 1;
ch->pcdata->color_combat_condition_s = 23;
ch->pcdata->color_combat_condition_o = 3;
ch->pcdata->color_invis = 14;
ch->pcdata->color_hp = 6;
ch->pcdata->color_hidden = 0;
ch->pcdata->color_charmed = 12;
ch->pcdata->color_mana = 6;
ch->pcdata->color_move = 6;
ch->pcdata->color_say = 10;
ch->pcdata->color_tell = 2;
ch->pcdata->color_guild_talk = 12;
ch->pcdata->color_group_tell = 5;
ch->pcdata->color_music = 8;
ch->pcdata->color_gossip = 5;
ch->pcdata->color_auction = 13;
ch->pcdata->color_immtalk = 10;
ch->pcdata->color_admtalk = 5;
return;
}
if (strcasecmp (cbuf, "on") == 0)
{
ch->color = 1;
send_to_char ("Ansi color turned on.\n\r", ch);
return;
}
else if (strcasecmp (cbuf, "off") == 0)
{
ch->color = 0;
send_to_char ("Ansi color turned off.\n\r", ch);
return;
}
if (str_cmp ("bold", cbuf) != 0)
{
if (!str_cmp (cbuf, "grey"))
scolor = 0;
else if (!str_cmp (cbuf, "red"))
scolor = 1;
else if (!str_cmp (cbuf, "green"))
scolor = 2;
else if (!str_cmp (cbuf, "yellow"))
scolor = 3;
else if (!str_cmp (cbuf, "blue"))
scolor = 4;
else if (!str_cmp (cbuf, "purple"))
scolor = 5;
else if (!str_cmp (cbuf, "cyan"))
scolor = 6;
else if (!str_cmp (cbuf, "white"))
scolor = 7;
else
{
color_usage (ch);
return;
}
}
else
{
argument = one_argument (argument, cbuf);
if (!str_cmp (cbuf, "red"))
scolor = 8;
else if (!str_cmp (cbuf, "green"))
scolor = 9;
else if (!str_cmp (cbuf, "yellow"))
scolor = 10;
else if (!str_cmp (cbuf, "blue"))
scolor = 11;
else if (!str_cmp (cbuf, "purple"))
scolor = 12;
else if (!str_cmp (cbuf, "cyan"))
scolor = 13;
else if (!str_cmp (cbuf, "white"))
scolor = 14;
else
{
color_usage (ch);
return;
}
}
argument = one_argument (argument, cbuf);
if (!str_cmp (cbuf, "combat"))
{
argument = one_argument (argument, cbuf);
if (!str_cmp (cbuf, "self"))
{
ch->pcdata->color_combat_s = scolor;
send_to_char ("`ACOMBAT SELF ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "opponent"))
{
ch->pcdata->color_combat_o = scolor;
send_to_char ("`BCOMBAT OPPONENT ``color changed.\n\r", ch);
}
else
{
color_usage (ch);
return;
}
}
else if (!str_cmp (cbuf, "condition"))
{
argument = one_argument (argument, cbuf);
if (!str_cmp (cbuf, "self"))
{
ch->pcdata->color_combat_condition_s = scolor;
send_to_char ("'CCONDITION SELF ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "opponent"))
{
ch->pcdata->color_combat_condition_o = scolor;
send_to_char ("`DCONDITION OPPONENT ``color changed.\n\r", ch);
}
else
{
color_usage (ch);
return;
}
}
else if (!str_cmp (cbuf, "guild"))
{
argument = one_argument (argument, cbuf);
if (!str_cmp (cbuf, "talk"))
{
ch->pcdata->color_guild_talk = scolor;
send_to_char ("`OGUILD TALK ``color changed.\n\r", ch);
}
else
{
color_usage (ch);
return;
}
}
else if (!str_cmp (cbuf, "group"))
{
argument = one_argument (argument, cbuf);
if (!str_cmp (cbuf, "tell"))
{
ch->pcdata->color_group_tell = scolor;
send_to_char ("`OGROUP TELL ``color changed.\n\r", ch);
}
else
{
color_usage (ch);
return;
}
}
else if (!str_cmp (cbuf, "invis"))
{
ch->pcdata->color_invis = scolor;
send_to_char ("`EINVIS ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "hp"))
{
ch->pcdata->color_hp = scolor;
send_to_char ("`FHP ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "hidden"))
{
ch->pcdata->color_hidden = scolor;
send_to_char ("`GHIDDEN ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "charmed"))
{
ch->pcdata->color_charmed = scolor;
send_to_char ("`HCHARMED ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "mana"))
{
ch->pcdata->color_mana = scolor;
send_to_char ("`IMANA ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "move"))
{
ch->pcdata->color_move = scolor;
send_to_char ("`JMOVE ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "say"))
{
ch->pcdata->color_say = scolor;
send_to_char ("`KSAY ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "tell"))
{
ch->pcdata->color_tell = scolor;
send_to_char ("`LTELL ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "music"))
{
ch->pcdata->color_music = scolor;
send_to_char ("`QMUSIC ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "gossip"))
{
ch->pcdata->color_gossip = scolor;
send_to_char ("`MGOSSIP ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "auction"))
{
ch->pcdata->color_auction = scolor;
send_to_char ("`NAUCTION ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "immtalk") && ch->level > 91)
{
ch->pcdata->color_immtalk = scolor;
send_to_char ("`NIMMTALK ``color changed.\n\r", ch);
}
else if (!str_cmp (cbuf, "admin") && ch->level > 99)
{
ch->pcdata->color_admtalk = scolor;
send_to_char ("`NADMIN ``color changed.\n\r", ch);
}
else
{
color_usage (ch);
return;
}
}
}
void do_show (CHAR_DATA * ch, char *argument)
{
if (IS_SET (ch->comm, COMM_SHOW_AFFECTS))
{
send_to_char ("Affects will no longer be shown in score.\n\r", ch);
REMOVE_BIT (ch->comm, COMM_SHOW_AFFECTS);
}
else
{
send_to_char ("Affects will now be shown in score.\n\r", ch);
SET_BIT (ch->comm, COMM_SHOW_AFFECTS);
}
}
void do_prompt (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
if (argument[0] == '\0')
{
if (IS_SET (ch->comm, COMM_PROMPT))
{
send_to_char ("You will no longer see prompts.\n\r", ch);
REMOVE_BIT (ch->comm, COMM_PROMPT);
}
else
{
send_to_char ("You will now see prompts.\n\r", ch);
SET_BIT (ch->comm, COMM_PROMPT);
}
return;
}
if (!strcmp (argument, "all"))
strcpy (buf, "`a<`lHP`a:`F%h `lMA`a:`I%m `lMV`a:`J%v`a>`` %S ");
else
{
if (strlen (argument) > 50)
argument[50] = '\0';
strcpy (buf, argument);
smash_tilde (buf);
if (str_suffix ("%c", buf))
strcat (buf, " ");
}
free_string (ch->prompt);
ch->prompt = str_dup (buf);
sprintf (buf, "Prompt set to %s\n\r", ch->prompt);
send_to_char (buf, ch);
return;
}
void do_combine (CHAR_DATA * ch, char *argument)
{
if (IS_SET (ch->comm, COMM_COMBINE))
{
send_to_char ("Long inventory selected.\n\r", ch);
REMOVE_BIT (ch->comm, COMM_COMBINE);
}
else
{
send_to_char ("Combined inventory selected.\n\r", ch);
SET_BIT (ch->comm, COMM_COMBINE);
}
}
void do_noloot (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (IS_SET (ch->act, PLR_CANLOOT))
{
send_to_char ("Your corpse is now safe from thieves.\n\r", ch);
REMOVE_BIT (ch->act, PLR_CANLOOT);
}
else
{
send_to_char ("Your corpse may now be looted.\n\r", ch);
SET_BIT (ch->act, PLR_CANLOOT);
}
}
void do_disband (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (IS_AFFECTED (ch, AFF_CHARM))
{
send_to_char ("Sorry, you can't do that right now.\n\r", ch);
return;
}
if (disband_follower (ch))
send_to_char ("You disband your group.\n\r", ch);
else
send_to_char ("There is no one in your group.\n\r", ch);
}
void do_nofollow (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (IS_SET (ch->act, PLR_NOFOLLOW))
{
send_to_char ("You now accept followers.\n\r", ch);
REMOVE_BIT (ch->act, PLR_NOFOLLOW);
}
else
{
if (ch->master != NULL && IS_AFFECTED (ch, AFF_CHARM))
{
send_to_char
("But you don't want to leave your master right now!\n\r", ch);
return;
}
send_to_char ("You no longer accept followers.\n\r", ch);
SET_BIT (ch->act, PLR_NOFOLLOW);
die_follower (ch);
}
}
//
// Akamai 4/5/99 -- Players that are lonered, or in a clan cannot
// 'nosummon' this is affiliated with changes to spell_summon
//
void do_nosummon (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
{
// we have a mob thing
if (IS_SET (ch->imm_flags, IMM_SUMMON))
{
send_to_char ("You are no longer immune to summon.\n\r", ch);
REMOVE_BIT (ch->imm_flags, IMM_SUMMON);
}
else
{
send_to_char ("You are now immune to summoning.\n\r", ch);
SET_BIT (ch->imm_flags, IMM_SUMMON);
}
}
else
{
// we have a player
if ((ch->clan == CLAN_BOGUS) && (ch->pcdata->loner == FALSE))
{
if (IS_SET (ch->act, PLR_NOSUMMON))
{
send_to_char ("You are no longer immune to summon.\n\r", ch);
REMOVE_BIT (ch->act, PLR_NOSUMMON);
}
else
{
send_to_char ("You are now immune to summoning.\n\r", ch);
SET_BIT (ch->act, PLR_NOSUMMON);
}
}
else
{
send_to_char
("Clan members and loners can always be summoned.\n\r", ch);
REMOVE_BIT (ch->act, PLR_NOSUMMON);
}
}
}
void do_look (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
char arg3[MAX_INPUT_LENGTH];
char tcbuf[MAX_INPUT_LENGTH];
EXIT_DATA *pexit;
CHAR_DATA *victim;
OBJ_DATA *obj;
char *pdesc, *pname;
int door = -1;
int number, count;
ROOM_INDEX_DATA *location;
if (ch->desc == NULL)
return;
if (ch->position < POS_SLEEPING && !battle_royale)
{
send_to_char ("You can't see anything but stars!\n\r", ch);
return;
}
if (get_position(ch) == POS_SLEEPING)
{
send_to_char ("You can't see anything, you're sleeping!\n\r", ch);
return;
}
if (!check_blind (ch))
{
OBJ_DATA *tobj;
sense_life (ch);
for (tobj = ch->in_room->contents;tobj != NULL;tobj = tobj->next_content)
{
if (IS_SET(tobj->extra_flags[1],ITEM_PULSATING))
show_list_to_char (tobj, ch, FALSE, FALSE);
}
return;
}
if (!IS_NPC (ch)
&& !IS_SET (ch->act, PLR_HOLYLIGHT) && room_is_dark (ch->in_room) && ch->race != PC_RACE_KALIAN)
{
OBJ_DATA *tobj;
send_to_char ("`aIt is pitch black ... ``\n\r", ch);
for (tobj = ch->in_room->contents;tobj != NULL;tobj = tobj->next_content)
{
if (IS_SET(tobj->extra_flags[1],ITEM_PULSATING))
show_list_to_char (tobj, ch, FALSE, FALSE);
}
show_char_to_char (ch->in_room->people, ch);
sense_life (ch);
return;
}
argument = one_argument (argument, arg1);
argument = one_argument (argument, arg2);
number = number_argument (arg1, arg3);
count = 0;
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;
if (door != -1)
{
if ((pexit = ch->in_room->exit[door]) == NULL)
{
send_to_char ("Nothing special there.\n\r", ch);
return;
}
if (is_affected(ch,skill_lookup("nearsight")) || ch->race == PC_RACE_SWARM)
{
send_to_char ("You can't make out that room from here.\n\r",ch);
return;
}
if (IS_SET (pexit->exit_info, EX_CLOSED))
{
if (pexit->description != NULL && pexit->description[0] != '\0')
send_to_char (pexit->description, ch);
}
else
{
int counter = 0;
ROOM_INDEX_DATA *pRoomIndex = pexit->u1.to_room;
sprintf (tcbuf, "Looking %s, you see...``\n\r", dir_name[door]);
send_to_char (tcbuf, ch);
if (ch->class == PC_CLASS_CHAOS_JESTER)
{
pRoomIndex = get_random_room (ch);
while
((IS_SET(pRoomIndex->area->area_flags,AREA_IMP_ONLY) && get_trust(ch) < MAX_LEVEL)
// || (pRoomIndex->area != ch->in_room->area)
|| IS_SET (pRoomIndex->room_flags, ROOM_ARENA)
|| pRoomIndex->area->construct
|| pRoomIndex->sector_type == SECT_WATER_OCEAN
|| (!can_move_char(ch,pRoomIndex,FALSE,FALSE))
)
{
pRoomIndex = get_random_room (ch);
if (++counter > 10000)
{
send_to_char("nothing.\n\r",ch);
return;
}
}
}
if (IS_SET(pRoomIndex->room_flags2,ROOM_ALWAYS_DARK)
&& !(ch->race == PC_RACE_KALIAN)
&& !(IS_IMMORTAL(ch) && IS_SET(ch->act,PLR_HOLYLIGHT)))
{
if (is_affected(ch,skill_lookup("infravision")))
{
show_char_to_char(pRoomIndex->people,ch);
}
else send_to_char("You see nothing but darkness.\n\r",ch);
return;
}
if (pRoomIndex != NULL
&& pRoomIndex != ch->in_room
&& can_see_room (ch, pRoomIndex))
{
char sub_string[32];
send_to_char ("``\n\r ", ch);
strncpy (sub_string, pRoomIndex->description, 32);
if (!strncmp (sub_string, "AG_O ", 5))
send_to_char (ocean_desc[atoi (sub_string + 5)], ch);
else
send_to_char (pRoomIndex->description, ch);
send_to_char ("\n\r", ch);
show_list_to_char (pRoomIndex->contents, ch, FALSE,
FALSE);
show_char_to_char (pRoomIndex->people, ch);
sense_life (ch);
}
else
send_to_char ("Nothing.\n\r", ch);
}
if (pexit->keyword != NULL
&& pexit->keyword[0] != '\0' && pexit->keyword[0] != ' ' && ch->class != PC_CLASS_CHAOS_JESTER)
{
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;
}
if (arg1[0] == '\0' || !str_cmp (arg1, "auto"))
{
/* 'look' or 'look auto' */
if (!IS_NPC (ch))
{
if (getbit (ch->pcdata->explored, ch->in_room->vnum) == 0)
{
gain_exp (ch, 100 * 4);
}
setbit (ch->pcdata->explored, ch->in_room->vnum);
}
send_to_char ("`k", ch);
send_to_char (ch->in_room->name, ch);
send_to_char ("``", ch);
if (IS_IMMORTAL (ch)
&& (IS_NPC (ch) || IS_SET (ch->act, PLR_HOLYLIGHT)))
{
sprintf (buf, " [Room %d]", ch->in_room->vnum);
send_to_char (buf, ch);
}
send_to_char ("\n\r", ch);
if (arg1[0] == '\0' || (!IS_NPC (ch) && !IS_SET (ch->comm, COMM_BRIEF)))
{
send_to_char (" ", ch);
/* STUFF ADDED FOR COLORS */
switch (ch->in_room->sector_type)
{
case SECT_UNDERWATER:
send_to_char ("`e", ch);
break;
case SECT_WATER_SWIM:
case SECT_WATER_NOSWIM:
case SECT_WATER_OCEAN:
send_to_char ("`g", ch);
break;
case SECT_FIELD:
case SECT_FOREST:
case SECT_GRASSLAND:
send_to_char ("`c", ch);
break;
case SECT_SHORE:
send_to_char ("`d", ch);
break;
case SECT_HILLS:
case SECT_DESERT:
send_to_char ("`d", ch);
break;
case SECT_MOUNTAIN:
send_to_char ("`h", ch);
break;
case SECT_AIR:
send_to_char ("`n", ch);
break;
case SECT_TUNDRA:
send_to_char ("`o", ch);
break;
case SECT_WASTELAND:
case SECT_UNDERGROUND:
case SECT_SWAMP:
send_to_char ("`a", ch);
break;
default:
send_to_char ("`l", ch);
break;
}
{
char sub_string[32];
strncpy (sub_string, ch->in_room->description, 32);
if (!strncmp (sub_string, "AG_O ", 5))
send_to_char (ocean_desc[atoi (sub_string + 5)], ch);
else
send_to_char (ch->in_room->description, ch);
send_to_char ("``", ch);
}
}
if (!IS_NPC (ch) && IS_SET (ch->act, PLR_AUTOEXIT))
{
send_to_char ("\n\r", ch);
do_exits (ch, "auto");
}
show_list_to_char (ch->in_room->contents, ch, FALSE, FALSE);
show_char_to_char (ch->in_room->people, ch);
send_to_char ("``", ch);
sense_life (ch);
if (detect_room_trap(ch,ch->in_room))
send_to_char("`bYou detect a trap in this room!``\n\r",ch);
return;
}
if (!str_cmp (arg1, "o") || !str_cmp (arg1, "out"))
{
/* 'look out' */
if (IS_SET (ch->in_room->room_flags, ROOM_ELEVATOR))
{
OBJ_DATA *eObj;
for (eObj = object_list; eObj; eObj = eObj->next)
{
if (eObj->item_type != ITEM_ELEVATOR)
continue;
if (!is_name (arg2, eObj->name))
continue;
if (eObj->value[0] == ch->in_room->vnum)
{
location = eObj->in_room;
if (location == NULL)
continue;
if (location->vnum == ROOM_VNUM_ELIMBO)
{
act ("You can't currently see out of $p.", ch,
eObj, NULL, TO_CHAR);
return;
}
if (location != NULL && location != ch->in_room
&& can_see_room (ch, location))
{
act ("Looking out of $p, you see...", ch, eObj,
NULL, TO_CHAR);
{
char sub_string[32];
switch (location->sector_type)
{
case SECT_UNDERWATER:
send_to_char ("`e", ch);
break;
case SECT_WATER_SWIM:
case SECT_WATER_NOSWIM:
case SECT_WATER_OCEAN:
send_to_char ("`g", ch);
break;
case SECT_FIELD:
case SECT_FOREST:
case SECT_GRASSLAND:
send_to_char ("`c", ch);
break;
case SECT_HILLS:
case SECT_DESERT:
send_to_char ("`d", ch);
break;
case SECT_SHORE:
send_to_char ("`d",ch);
break;
case SECT_MOUNTAIN:
send_to_char ("`h", ch);
break;
case SECT_AIR:
send_to_char ("`n", ch);
break;
case SECT_TUNDRA:
send_to_char ("`o", ch);
break;
case SECT_UNDERGROUND:
case SECT_WASTELAND:
case SECT_SWAMP:
send_to_char ("`a", ch);
break;
default:
send_to_char ("`l", ch);
break;
}
strncpy (sub_string, location->description, 32);
if (!strncmp (sub_string, "AG_O ", 5))
send_to_char (ocean_desc
[atoi (sub_string + 5)], ch);
else
send_to_char (location->description, ch);
send_to_char ("``\n\r", ch);
}
show_list_to_char (location->contents, ch, FALSE,
FALSE);
show_char_to_char (location->people, ch);
sense_life (ch);
return;
}
else
{
act ("You can't currently see out of $p.", ch,
eObj, NULL, TO_CHAR);
return;
}
}
}
}
if (IS_SET (ch->in_room->room_flags, ROOM_TRANSPORT))
{
OBJ_DATA *eObj;
for (eObj = object_list; eObj; eObj = eObj->next)
{
if (eObj->item_type != ITEM_CTRANSPORT)
continue;
if (eObj->value[3] == ch->in_room->vnum)
{
location = eObj->in_room;
if (location == NULL)
continue;
if (location != NULL && location != ch->in_room
&& can_see_room (ch, location))
{
act ("Looking out of $p, you see...", ch, eObj,
NULL, TO_CHAR);
{
char sub_string[32];
switch (location->sector_type)
{
case SECT_UNDERWATER:
send_to_char ("`e", ch);
break;
case SECT_WATER_SWIM:
case SECT_WATER_NOSWIM:
case SECT_WATER_OCEAN:
send_to_char ("`g", ch);
break;
case SECT_FIELD:
case SECT_FOREST:
case SECT_GRASSLAND:
send_to_char ("`c", ch);
break;
case SECT_HILLS:
case SECT_DESERT:
send_to_char ("`d", ch);
break;
case SECT_SHORE:
send_to_char ("`d",ch);
break;
case SECT_MOUNTAIN:
send_to_char ("`h", ch);
break;
case SECT_AIR:
send_to_char ("`n", ch);
break;
case SECT_TUNDRA:
send_to_char ("`o", ch);
break;
case SECT_UNDERGROUND:
case SECT_WASTELAND:
case SECT_SWAMP:
send_to_char ("`a", ch);
break;
default:
send_to_char ("`l", ch);
break;
}
strncpy (sub_string, location->description, 32);
if (!strncmp (sub_string, "AG_O ", 5))
send_to_char (ocean_desc
[atoi (sub_string + 5)], ch);
else
send_to_char (location->description, ch);
}
send_to_char ("``\n\r", ch);
do_exits (ch, "rrcar");
show_list_to_char_but (location->contents, ch,
FALSE, FALSE, eObj);
show_char_to_char (location->people, ch);
sense_life (ch);
return;
}
else
{
act ("You can't currently see out of $p.", ch,
eObj, NULL, TO_CHAR);
return;
}
}
}
}
if (arg2[0] == '\0')
{
send_to_char ("Look out of what?\n\r", ch);
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 an exit.\n\r", ch);
return;
case ITEM_PORTAL:
if (!IS_SET (obj->value[4], PACT_EXIT))
{
send_to_char ("That is not an exit.\n\r", ch);
return;
}
if (IS_SET (obj->value[1], EX_CLOSED))
{
send_to_char ("It is closed.\n\r", ch);
return;
}
location = get_room_index (obj->value[3]);
sprintf (tcbuf, "Looking out of %s, you see...\n\r",
obj->short_descr);
send_to_char (tcbuf, ch);
if (location != NULL && location != ch->in_room
&& can_see_room (ch, location))
{
send_to_char ("\n\r", ch);
{
char sub_string[32];
strncpy (sub_string, location->description, 32);
if (!strncmp (sub_string, "AG_O ", 5))
send_to_char (ocean_desc[atoi (sub_string + 5)], ch);
else
send_to_char (location->description, ch);
}
send_to_char ("\n\r", ch);
show_list_to_char (location->contents, ch, FALSE, FALSE);
show_char_to_char (location->people, ch);
sense_life (ch);
}
else
act ("$p doesn't seem to go anywhere.", ch, obj, NULL, TO_CHAR);
break;
}
return;
}
if (!str_cmp (arg1, "i") || !str_cmp (arg1, "in") || !str_cmp (arg1, "on"))
{
/* 'look in' */
if (arg2[0] == '\0')
{
send_to_char ("Look in what?\n\r", ch);
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_ELEVATOR:
location = get_room_index (obj->value[0]);
act ("Looking into $p, you see...", ch, obj, NULL, TO_CHAR);
if (location != NULL && location != ch->in_room
&& can_see_room (ch, location))
{
send_to_char ("\n\r", ch);
{
char sub_string[32];
strncpy (sub_string, location->description, 32);
if (!strncmp (sub_string, "AG_O ", 5))
send_to_char (ocean_desc[atoi (sub_string + 5)], ch);
else
send_to_char (location->description, ch);
}
send_to_char ("\n\r", ch);
show_list_to_char (location->contents, ch, FALSE, FALSE);
show_char_to_char (location->people, ch);
sense_life (ch);
}
else
act ("$p doesn't seem to go anywhere.", ch, obj, NULL, TO_CHAR);
break;
case ITEM_PORTAL:
if (obj->value[3] == PORTAL_FUCKED)
{
send_to_char
("You are unable to see what lies beyond.\n\r", ch);
return;
}
if (IS_SET (obj->value[1], EX_CLOSED))
{
send_to_char ("It is closed.\n\r", ch);
return;
}
if (IS_SET (obj->value[4], PACT_PLAY))
{
send_to_char
("You can't see the virtual game world without playing.\n\r",
ch);
return;
}
if (IS_SET (obj->value[4], PACT_EXIT))
{
sprintf (tcbuf, "Try looking OUT of the %s.\n\r",
obj->short_descr);
send_to_char (tcbuf, ch);
return;
}
if (IS_SET (obj->value[4], PACT_CLIMB)
|| IS_SET (obj->value[4], PACT_DESCEND)
|| IS_SET (obj->value[4], PACT_CRAWL)
|| IS_SET (obj->value[4], PACT_SCALE)
|| IS_SET (obj->value[4], PACT_JUMP))
{
send_to_char
("You don't see anything interesting there.\n\r", ch);
return;
}
location = get_room_index (obj->value[3]);
sprintf (tcbuf, "Looking into %s, you see...\n\r",
obj->short_descr);
send_to_char (tcbuf, ch);
if (location != NULL && location != ch->in_room
&& can_see_room (ch, location))
{
send_to_char (" ", ch);
{
char sub_string[32];
strncpy (sub_string, location->description, 32);
if (!strncmp (sub_string, "AG_O ", 5))
send_to_char (ocean_desc[atoi (sub_string + 5)], ch);
else
send_to_char (location->description, ch);
}
send_to_char ("\n\r", ch);
show_list_to_char (location->contents, ch, FALSE, FALSE);
show_char_to_char (location->people, ch);
sense_life (ch);
}
else
act ("$p doesn't seem to go anywhere.", ch, obj, NULL, TO_CHAR);
break;
case ITEM_DRINK_CON:
if (obj->value[1] <= 0)
{
send_to_char ("It is empty.\n\r", ch);
break;
}
if (obj->value[2] >= 0)
sprintf (buf, "It's %sfilled with a %s liquid.\n\r",
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);
else
sprintf (buf, "It's %sfilled with an unknown liquid.\n\r",
obj->value[1] <
obj->value[0] /
4 ? "less than half-" : obj->value[1] <
3 * obj->value[0] /
4 ? "about half-" : "more than half-");
send_to_char (buf, ch);
break;
case ITEM_CLAN_DONATION:
case ITEM_NEWCLANS_DBOX:
case ITEM_PLAYER_DONATION:
act ("$p holds:", ch, obj, NULL, TO_CHAR);
show_list_to_char (obj->contains, ch, TRUE, TRUE);
break;
case ITEM_PACK:
case ITEM_QUIVER:
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 holds:", ch, obj, NULL, TO_CHAR);
show_list_to_char (obj->contains, ch, TRUE, TRUE);
break;
}
return;
}
if ((!str_cmp (arg1, "book"))
&& IS_SET (ch->in_room->room_flags, ROOM_ARENA_REGISTRATION))
{
show_duel_record (ch);
act ("$n studies the leather bound book intently.", ch, NULL,
argument, TO_ROOM);
return;
}
if ((victim = get_char_room (ch, arg1)) != NULL)
{
show_char_to_char_1 (victim, ch);
return;
}
pdesc = get_extra_descr (arg3, ch->in_room->extra_descr);
pname = get_extra_name (arg3, ch->in_room->extra_descr);
if (pdesc != NULL && pname != NULL)
{
if (++count == number)
{
page_to_char (pdesc, ch);
switch (number_range (0, 2))
{
case 0:
sprintf (buf, "$n looks at the %s.", pname);
act (buf, ch, NULL, NULL, TO_ROOM);
break;
case 1:
sprintf (buf, "$n examines the %s closely.", pname);
act (buf, ch, NULL, NULL, TO_ROOM);
break;
case 2:
sprintf (buf, "$n studies the %s intently.", pname);
act (buf, ch, NULL, NULL, TO_ROOM);
break;
}
return;
}
}
for (obj = ch->carrying; obj != NULL; obj = obj->next_content)
{
if (can_see_obj (ch, obj))
{ /* player can see object */
pdesc = get_extra_descr (arg3, obj->extra_descr);
if (pdesc != NULL)
{
if (++count == number)
{
page_to_char (pdesc, ch);
return;
}
else
continue;
}
pdesc = get_extra_descr (arg3, obj->pIndexData->extra_descr);
if (pdesc != NULL)
{
if (++count == number)
{
page_to_char (pdesc, ch);
return;
}
else
continue;
}
if (is_name (arg3, obj->name))
if (++count == number)
{
char *cptr;
if (obj->item_type == ITEM_WRITING_PAPER)
{
if ((cptr =
get_extra_descr ("papermsg",
obj->extra_descr)) == NULL)
{
act ("$p is blank.", ch, obj, NULL, TO_CHAR);
return;
}
else
{
page_to_char (cptr, ch);
return;
}
}
else if (obj->item_type == ITEM_MAP)
{
if ((cptr =
get_extra_descr ("maptxt",
obj->extra_descr)) == NULL)
{
act ("$p is blank.", ch, obj, NULL, TO_CHAR);
return;
}
else
{
send_to_char (cptr, ch);
return;
}
}
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 (can_see_obj (ch, obj))
{
pdesc = get_extra_descr (arg3, obj->extra_descr);
if (pdesc != NULL)
if (++count == number)
{
send_to_char (pdesc, ch);
return;
}
pdesc = get_extra_descr (arg3, obj->pIndexData->extra_descr);
if (pdesc != NULL)
if (++count == number)
{
page_to_char (pdesc, ch);
switch (number_range (0, 2))
{
case 0:
act ("$n looks at $p.", ch, obj, NULL, TO_ROOM);
break;
case 1:
act ("$n examines $p closely.", ch, obj, NULL, TO_ROOM);
break;
case 2:
act ("$n studies $p intently.", ch, obj, NULL, TO_ROOM);
break;
}
return;
}
}
if (is_name (arg3, obj->name))
if (++count == number)
{
char buf[MAX_STRING_LENGTH];
if (obj->pIndexData->vnum == OBJ_VNUM_CLAN_SYMBOL)
{
sprintf (buf, obj->description,
get_clan_symbol (ch->in_room->area->clan));
}
else
{
if (obj->description[0] != '\0')
{
strcpy (buf, obj->description);
send_to_char (buf, ch);
send_to_char ("\n\r", ch);
}
}
switch (number_range (0, 2))
{
case 0:
act ("$n looks at $p.", ch, obj, NULL, TO_ROOM);
break;
case 1:
act ("$n examines $p closely.", ch, obj, NULL, TO_ROOM);
break;
case 2:
act ("$n studies $p intently.", ch, obj, NULL, TO_ROOM);
break;
}
return;
}
}
pdesc = get_extra_descr (arg3, ch->in_room->extra_descr);
if (pdesc != NULL)
{
if (++count == number)
{
send_to_char (pdesc, ch);
return;
}
}
if (count > 0 && count != number)
{
if (count == 1)
sprintf (buf, "You only see one %s here.\n\r", arg3);
else
sprintf (buf, "You only see %d of those here.\n\r", count);
send_to_char (buf, ch);
return;
}
send_to_char ("You do not see that here.\n\r", ch);
return;
}
void do_glance (CHAR_DATA * ch, char *argument)
{
char arg1[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
if (ch->desc == NULL)
return;
if (ch->position < POS_SLEEPING)
{
send_to_char ("You can't see anything but stars!\n\r", ch);
return;
}
if (get_position(ch) == POS_SLEEPING)
{
send_to_char ("You can't see anything, you're sleeping!\n\r", ch);
return;
}
if (!check_blind (ch))
return;
if (!IS_NPC (ch)
&& !IS_SET (ch->act, PLR_HOLYLIGHT) && room_is_dark (ch->in_room) && ch->race != PC_RACE_KALIAN)
{
send_to_char ("`aIt is pitch black ... ``\n\r", ch);
show_char_to_char (ch->in_room->people, ch);
return;
}
argument = one_argument (argument, arg1);
if (arg1[0] != '\0')
if ((victim = get_char_room (ch, arg1)) != NULL)
{
show_char_to_char_2 (victim, ch);
return;
}
send_to_char ("You do not see that here.\n\r", ch);
return;
}
/* RT added back for the hell of it */
void do_read (CHAR_DATA * ch, char *argument)
{
do_look (ch, argument);
}
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)
{
switch (obj->item_type)
{
default:
break;
case ITEM_JUKEBOX:
do_play (ch, "list");
break;
case ITEM_MONEY:
if (obj->value[0] == 0)
{
if (obj->value[1] == 0)
sprintf (buf, "Odd...there are no coins in the pile.\n\r");
else if (obj->value[1] == 1)
sprintf (buf, "Wow. One gold coin.\n\r");
else
sprintf (buf,
"There are %d gold coins in the pile.\n\r",
obj->value[1]);
}
else if (obj->value[1] == 0)
{
if (obj->value[0] == 1)
sprintf (buf, "Wow. One silver coin.\n\r");
else
sprintf (buf,
"There are %d silver coins in the pile.\n\r",
obj->value[0]);
}
else
sprintf (buf,
"There are %d gold and %d silver coins in the pile.\n\r",
obj->value[1], obj->value[0]);
send_to_char (buf, ch);
break;
case ITEM_PACK:
case ITEM_DRINK_CON:
case ITEM_CONTAINER:
case ITEM_QUIVER:
case ITEM_CORPSE_NPC:
case ITEM_CORPSE_PC:
case ITEM_CLAN_DONATION:
case ITEM_NEWCLANS_DBOX:
case ITEM_PLAYER_DONATION:
sprintf (buf, "in %s", argument);
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];
char onename[MAX_STRING_LENGTH], *cptr;
OBJ_DATA *obj;
EXIT_DATA *pexit;
bool found;
bool fAuto, fCar;
int door, room_vnum;
ROOM_INDEX_DATA *endloc, *location, *theroom;
if (str_cmp (argument, "auto") != 0 && argument[0] != '\0'
&& str_cmp (argument, "rrcar") != 0)
{
do_pexit (ch, argument);
return;
}
theroom = ch->in_room;
fAuto = !str_cmp (argument, "auto");
fCar = !str_cmp (argument, "rrcar");
if (fCar)
{
OBJ_DATA *eObj;
fAuto = TRUE;
for (eObj = object_list; eObj; eObj = eObj->next)
{
if (eObj->item_type != ITEM_CTRANSPORT || eObj->in_room == NULL)
continue;
if (eObj->value[3] == ch->in_room->vnum)
theroom = eObj->in_room;
}
}
if (!check_blind (ch))
return;
if (!is_affected (ch, gsn_disorientation))
{
if (fAuto)
sprintf (buf, "[Exits:");
else if (IS_IMMORTAL (ch))
sprintf (buf, "Obvious exits from room %d:\n\r", theroom->vnum);
else
sprintf (buf, "Obvious exits:\n\r");
found = FALSE;
for (door = 0; door <= 5; door++)
{
if ((pexit = theroom->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, "`b ");
strcat (buf, dir_name[door]);
}
else
{
sprintf (buf + strlen (buf), "%-5s - %s",
capitalize (dir_name[door]),
(room_is_dark (pexit->
u1.to_room) && ch->race != PC_RACE_KALIAN) ?
"Too dark to tell" : pexit->u1.to_room->name);
if (IS_IMMORTAL (ch))
sprintf (buf + strlen (buf), " (room %d)\n\r",
pexit->u1.to_room->vnum);
else
sprintf (buf + strlen (buf), "\n\r");
}
}
}
if (!found && fAuto)
strcat (buf, " none");
if (fAuto)
strcat (buf, "``]");
if (IS_SET (theroom->room_flags, ROOM_ELEVATOR) && !fCar)
{
OBJ_DATA *eObj;
for (eObj = object_list; eObj; eObj = eObj->next)
{
if (eObj->item_type != ITEM_ELEVATOR)
continue;
if (eObj->value[0] == theroom->vnum)
{
location = eObj->in_room;
if (location == NULL)
continue;
if (location->vnum != ROOM_VNUM_ELIMBO)
{
strcpy (onename, eObj->name);
if ((cptr = strchr (onename, ' ')) != NULL)
*cptr = '\0';
if (fAuto)
sprintf (buf + strlen (buf), " [`bexit %s``]",
onename);
else
sprintf (buf + strlen (buf), "Exit %s - %s",
onename,
(room_is_dark (location) && ch->race != PC_RACE_KALIAN) ?
"Too dark to tell" : location->name);
found = TRUE;
if (!fAuto)
{
if (IS_IMMORTAL (ch))
sprintf (buf + strlen (buf),
" (room %d)\n\r", location->vnum);
else
sprintf (buf + strlen (buf), "\n\r");
}
}
}
}
}
if (IS_SET (theroom->room_flags, ROOM_TRANSPORT) && !fCar)
{
OBJ_DATA *eObj;
for (eObj = object_list; eObj; eObj = eObj->next)
{
if (eObj->item_type != ITEM_CTRANSPORT)
continue;
if (IS_SET (eObj->value[5], CONT_CLOSED))
continue;
if (eObj->value[2] == theroom->vnum)
{
location = eObj->in_room;
if (location == NULL)
continue;
strcpy (onename, eObj->name);
if ((cptr = strchr (onename, ' ')) != NULL)
*cptr = '\0';
if (fAuto)
sprintf (buf + strlen (buf), " [`bexit %s``]", onename);
else
sprintf (buf + strlen (buf), "Exit %s - %s",
onename,
(room_is_dark (location) && ch->race != PC_RACE_KALIAN)?
"Too dark to tell" : location->name);
found = TRUE;
if (!fAuto)
{
if (IS_IMMORTAL (ch))
sprintf (buf + strlen (buf), " (room %d)\n\r",
location->vnum);
else
sprintf (buf + strlen (buf), "\n\r");
}
}
}
}
for (obj = theroom->contents; obj; obj = obj->next_content)
{
if (obj->item_type != ITEM_PORTAL
&& obj->item_type != ITEM_ELEVATOR
&& obj->item_type != ITEM_CTRANSPORT)
continue;
if (obj->item_type == ITEM_CTRANSPORT
&& IS_SET (obj->value[5], CONT_CLOSED))
continue;
if (obj->item_type == ITEM_PORTAL
&& !IS_SET (obj->value[2], GATE_SHOWEXIT))
continue;
if (!can_see_obj(ch,obj))
continue;
strcpy (onename, obj->name);
if ((cptr = strchr (onename, ' ')) != NULL)
*cptr = '\0';
if (obj->item_type == ITEM_PORTAL)
room_vnum = obj->value[3];
else if (obj->item_type == ITEM_ELEVATOR)
room_vnum = obj->value[0];
else /* Ctransport */
room_vnum = obj->value[2];
endloc = get_room_index (room_vnum);
if (endloc == NULL)
continue;
if (((obj->item_type
== ITEM_PORTAL && IS_SET (obj->value[4], PACT_ENTER))
|| obj->item_type == ITEM_ELEVATOR
|| obj->item_type == ITEM_CTRANSPORT) && !fCar)
{
if (fAuto)
{
if (obj->item_type == ITEM_CTRANSPORT &&
(IS_SET (obj->value[4], TACT_SAIL)
|| IS_SET (obj->value[4], TACT_PADDLE)
|| IS_SET (obj->value[4], TACT_ROW)))
sprintf (buf + strlen (buf), " [`bboard %s``]", onename);
else
sprintf (buf + strlen (buf), " [`benter %s``]", onename);
}
else
{
if (obj->item_type == ITEM_CTRANSPORT &&
(IS_SET (obj->value[4], TACT_SAIL)
|| IS_SET (obj->value[4], TACT_PADDLE)
|| IS_SET (obj->value[4], TACT_ROW)))
sprintf (buf + strlen (buf), "Board %s - %s",
onename,
(room_is_dark (endloc) && ch->race != PC_RACE_KALIAN)?
"Too dark to tell" : endloc->name);
else
sprintf (buf + strlen (buf), "Enter %s - %s",
onename,
(room_is_dark (endloc) && ch->race != PC_RACE_KALIAN)?
"Too dark to tell" : endloc->name);
}
found = TRUE;
}
if (obj->item_type == ITEM_PORTAL
&& IS_SET (obj->value[4], PACT_EXIT))
{
if (fAuto)
sprintf (buf + strlen (buf), " [`bexit %s``]", onename);
else
sprintf (buf + strlen (buf), "Exit %s - %s", onename,
(room_is_dark (endloc) && ch->race != PC_RACE_KALIAN)? "Too dark to tell" :
endloc->name);
found = TRUE;
}
if (obj->item_type == ITEM_PORTAL
&& IS_SET (obj->value[4], PACT_JUMP))
{
if (fAuto)
sprintf (buf + strlen (buf), " [`bjump %s``]", onename);
else
sprintf (buf + strlen (buf), "Jump %s - %s", onename,
(room_is_dark (endloc) && ch->race != PC_RACE_KALIAN)? "Too dark to tell" :
endloc->name);
found = TRUE;
}
if (obj->item_type == ITEM_PORTAL
&& IS_SET (obj->value[4], PACT_CLIMB))
{
if (fAuto)
sprintf (buf + strlen (buf), " [`bclimb %s``]", onename);
else
sprintf (buf + strlen (buf), "Climb %s - %s", onename,
(room_is_dark (endloc) && ch->race != PC_RACE_KALIAN)? "Too dark to tell" :
endloc->name);
found = TRUE;
}
if (obj->item_type == ITEM_PORTAL
&& IS_SET (obj->value[4], PACT_PLAY))
{
if (fAuto)
sprintf (buf + strlen (buf), " [`bplay %s``]", onename);
else
sprintf (buf + strlen (buf), "Play %s - %s", onename,
(room_is_dark (endloc) && ch->race != PC_RACE_KALIAN)? "Too dark to tell" :
endloc->name);
found = TRUE;
}
if (obj->item_type == ITEM_PORTAL
&& IS_SET (obj->value[4], PACT_DESCEND))
{
if (fAuto)
sprintf (buf + strlen (buf), " [`bdescend %s``]", onename);
else
sprintf (buf + strlen (buf), "Descend %s - %s",
onename,
(room_is_dark (endloc) && ch->race != PC_RACE_KALIAN)? "Too dark to tell" :
endloc->name);
found = TRUE;
}
if (obj->item_type == ITEM_PORTAL
&& IS_SET (obj->value[4], PACT_CRAWL))
{
if (fAuto)
sprintf (buf + strlen (buf), " [`bcrawl %s``]", onename);
else
sprintf (buf + strlen (buf), "Crawl %s - %s", onename,
(room_is_dark (endloc) && ch->race != PC_RACE_KALIAN)? "Too dark to tell" :
endloc->name);
found = TRUE;
}
if (obj->item_type == ITEM_PORTAL
&& IS_SET (obj->value[4], PACT_SCALE))
{
if (fAuto)
sprintf (buf + strlen (buf), " [`bscale %s``]", onename);
else
sprintf (buf + strlen (buf), "Scale %s - %s", onename,
(room_is_dark (endloc) && ch->race != PC_RACE_KALIAN)? "Too dark to tell" :
endloc->name);
found = TRUE;
}
if (!fAuto)
{
if (IS_IMMORTAL (ch))
sprintf (buf + strlen (buf), " (room %d)\n\r", room_vnum);
else
sprintf (buf + strlen (buf), "\n\r");
}
}
if (!found && !fAuto)
strcat (buf, "`bNone``.\n\r");
send_to_char (buf, ch);
if (fAuto)
send_to_char ("\n\r", ch);
}
else if (fAuto)
send_to_char
("You are too disoriented to notice where the exits are.\n\r", ch);
return;
}
void do_worth (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
if (IS_NPC (ch))
{
sprintf (buf, "You have %ld gold and %ld silver.\n\r", ch->gold,
ch->silver);
send_to_char (buf, ch);
return;
}
sprintf (buf,
"You have %ld gold, %ld silver, and %lu experience (%ld exp to level).\n\r",
ch->gold, ch->silver, ch->exp, level_cost (ch->level));
send_to_char (buf, ch);
return;
}
void do_score (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH], bigbuf[MAX_STRING_LENGTH], *cptr;
int tcnt = 0;
send_to_char
("`b+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+``\n\r",
ch);
send_to_char
("`b|`d _____________________________________ `b|``\n\r",
ch);
send_to_char
("`b|`d ________| |_______ `b|``\n\r",
ch);
sprintf (buf,
"`b|`d \\ |" " `o%-13s "
" `d| / `b|``\n\r", ch->name);
send_to_Showing the first 100 KB of 193.7 KB. Download the archive for the full file.