act_info.c
legend/src/act_info.c · 257.8 KB
From the archive LoCRelease.tgz
Download the archive « Back to the archive contents
/***************************************************************************
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* *
* Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* *
* In order to use any part of this Merc Diku Mud, you must comply with *
* both the original Diku license in 'license.doc' as well the Merc *
* license in 'license.txt'. In particular, you may not remove either of *
* these copyright notices. *
* *
* Much time and thought has gone into this software and you are *
* benefitting. We hope that you share your changes too. What goes *
* around, comes around. *
***************************************************************************/
/***************************************************************************
* God Wars Mud copyright (C) 1994, 1995, 1996 by Richard Woolcock *
* *
* Legend of Chrystancia copyright (C) 1999, 2000, 2001 by Matthew Little *
* This mud is NOT to be copied in whole or in part, or to be run without *
* the permission of Matthew Little. Nobody else has permission to *
* authorise the use of this code. *
***************************************************************************/
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
#include <time.h>
#include "merc.h"
#include "bastet.h"
NCLANS_DATA *nclans_table;
char *const where_name[] = {
"#w[#cL#Cight#w ] #n",
"#w[#cO#Cn #cF#Cinger #w] #n",
"#w[#cO#Cn #cF#Cinger #w] #n",
"#w[#cA#Cround #cN#Ceck #w] #n",
"#w[#cA#Cround #cN#Ceck #w] #n",
"#w[#cO#Cn #cB#Cody #w] #n",
"#w[#cO#Cn #cH#Cead #w] #n",
"#w[#cO#Cn #cL#Cegs #w] #n",
"#w[#cO#Cn #cF#Ceet #w] #n",
"#w[#cO#Cn #cH#Cands #w] #n",
"#w[#cO#Cn #cA#Crms #w] #n",
"#w[#cO#Cff #cH#Cand #w] #n",
"#w[#cA#Cround #cB#Cody #w] #n",
"#w[#cA#Cround #cW#Caist #w] #n",
"#w[#cA#Cround #cW#Crist #w] #n",
"#w[#cA#Cround #cW#Crist #w] #n",
"#w[#cR#Cight #cH#Cand #w] #n",
"#w[#cL#Ceft #cH#Cand #w] #n",
"#w[#cT#Chird #cH#Cand #w] #n",
"#w[#cF#Courth #cH#Cand #w] #n",
"#w[#cO#Cn #cF#Cace #w] #n",
"#w[#cL#Ceft #cS#Ccabbard #w] #n",
"#w[#cR#Cight #cS#Ccabbard#w] #n",
"#w[#cI#Cnside #cC#Cloak #w] #n",
"#w[#cB#Coth #cH#Cands #w] #n",
};
/*
* Local functions.
*/
void reformat_desc( char *desc, bool map );
char *set_comma (long long int init);
char *show_char_to_char_0 (CHAR_DATA * victim, CHAR_DATA * ch);
char *format_obj_to_char args ((OBJ_DATA * obj, CHAR_DATA * ch, bool fShort));
void show_char_to_char_1 args ((CHAR_DATA * victim, CHAR_DATA * ch));
void show_char_to_char args ((CHAR_DATA * list, CHAR_DATA * ch));
bool check_blind args ((CHAR_DATA * ch));
void evil_eye args ((CHAR_DATA * victim, CHAR_DATA * ch));
void check_left_arm args ((CHAR_DATA * ch, CHAR_DATA * victim));
void check_right_arm args ((CHAR_DATA * ch, CHAR_DATA * victim));
void check_left_leg args ((CHAR_DATA * ch, CHAR_DATA * victim));
void check_right_leg args ((CHAR_DATA * ch, CHAR_DATA * victim));
void kingdom2 (CHAR_DATA * ch, char *kname);
void obj_score args ((CHAR_DATA * ch, OBJ_DATA * obj));
int col_str_len (char *txt);
char *centerjob(char *fill, const char *txt, int maxlen);
sh_int str_similar (const char *astr, const char *bstr)
{
sh_int matches = 0;
if (!astr || !bstr)
return matches;
for (; *astr; astr++)
{
if (LOWER (*astr) == LOWER (*bstr))
matches++;
if (++bstr == '\0')
return matches;
}
return matches;
}
char *format_obj_to_char (OBJ_DATA * obj, CHAR_DATA * ch, bool fShort)
{
static char buf[MAX_STRING_LENGTH];
if (!IS_NPC (ch) && IS_SET (ch->extra2, MINIFLAGS))
{
sprintf (buf, "#w[#c.#e.#b.#R.#g.#y.#e.#n.#w]#n ");
if (IS_SET (obj->quest, QUEST_ARTIFACT))
buf[5] = 'A';
else if (IS_SET (obj->quest, QUEST_RELIC))
buf[5] = 'R';
else if (obj->points > 0)
{
if (IS_SET (obj->quest, QUEST_IMPROVED))
buf[5] = 'M';
else
buf[5] = 'L';
}
else if (obj->item_type == ITEM_QPRIZE)
buf[5] = 'p';
else if (IS_SET (obj->quest, ITEM_EQUEST))
buf[5] = 'P';
if (IS_OBJ_STAT (obj, ITEM_INVIS))
buf[8] = 'I';
if (IS_AFFECTED (ch, AFF_DETECT_EVIL)
&& !IS_OBJ_STAT (obj, ITEM_ANTI_GOOD)
&& IS_OBJ_STAT (obj, ITEM_ANTI_EVIL))
buf[11] = 'B';
else if (IS_AFFECTED (ch, AFF_DETECT_EVIL)
&& IS_OBJ_STAT (obj, ITEM_ANTI_GOOD)
&& !IS_OBJ_STAT (obj, ITEM_ANTI_EVIL))
buf[11] = 'r';
else if (IS_AFFECTED (ch, AFF_DETECT_EVIL)
&& IS_OBJ_STAT (obj, ITEM_ANTI_GOOD)
&& !IS_OBJ_STAT (obj, ITEM_ANTI_NEUTRAL)
&& IS_OBJ_STAT (obj, ITEM_ANTI_EVIL))
buf[11] = 'Y';
if (IS_AFFECTED (ch, AFF_DETECT_MAGIC) && IS_OBJ_STAT (obj, ITEM_MAGIC))
buf[14] = 'm';
if (IS_OBJ_STAT (obj, ITEM_GLOW))
buf[17] = 'G';
if (IS_OBJ_STAT (obj, ITEM_HUM))
buf[20] = 'H';
if (IS_OBJ_STAT (obj, ITEM_SHADOWPLANE) && obj->in_room != NULL
&& !IS_AFFECTED (ch, AFF_SHADOWPLANE))
buf[23] = 'S';
if (!IS_OBJ_STAT (obj, ITEM_SHADOWPLANE) && obj->in_room != NULL
&& IS_AFFECTED (ch, AFF_SHADOWPLANE))
buf[26] = 'N';
if (!str_cmp (buf, "#w[#c.#e.#b.#R.#g.#y.#e.#n.#w]#n "))
buf[0] = '\0';
if (obj->item_type == ITEM_QUESTCARD)
{
if ((obj->value[0] == -1)
&& (obj->value[1] == -1)
&& (obj->value[2] == -1)
&& (obj->value[3] == -1))
strcat(buf, "#r(Completed)#n ");
}
strcat (buf, "#e");
if (fShort)
{
if (obj->short_descr != NULL)
strcat (buf, obj->short_descr);
if (obj->condition < 100)
strcat (buf, " #w[#r#FD#n#w]#n");
}
else
{
if (obj->description != NULL)
strcat (buf, obj->description);
}
}
else
{
buf[0] = '\0';
if (IS_SET (obj->quest, QUEST_ARTIFACT))
strcat (buf, "#w(#CArtifact#w)#n ");
else if (IS_SET (obj->quest, QUEST_RELIC))
strcat (buf, "#w(#oRelic#w)#n ");
else if (obj->item_ver == IV_MAGIC)
strcat (buf, "#w(#RMagical#w)#n ");
else if (obj->item_ver == IV_RARE)
strcat (buf, "#w(#cRare#w)#n ");
else if (obj->points > 0)
{
if (IS_SET (obj->quest, QUEST_IMPROVED))
strcat (buf, "#w(#cMythical#w)#n ");
else
strcat (buf, "#w(#pLegendary#w)#n ");
}
if (IS_SET (obj->quest, ITEM_EQUEST) || obj->item_type == ITEM_QPRIZE)
strcat (buf, "#w(#yPriceless#w)#n ");
if (IS_OBJ_STAT (obj, ITEM_INVIS))
strcat (buf, "#w(#eI#wn#ev#wi#es#w)#n ");
if (IS_AFFECTED (ch, AFF_DETECT_EVIL)
&& !IS_OBJ_STAT (obj, ITEM_ANTI_GOOD)
&& IS_OBJ_STAT (obj, ITEM_ANTI_EVIL))
strcat (buf, "#w(#bBlue Aura#w)#n ");
else if (IS_AFFECTED (ch, AFF_DETECT_EVIL)
&& IS_OBJ_STAT (obj, ITEM_ANTI_GOOD)
&& !IS_OBJ_STAT (obj, ITEM_ANTI_EVIL))
strcat (buf, "#w(#rRed Aura#w)#n ");
else if (IS_AFFECTED (ch, AFF_DETECT_EVIL)
&& IS_OBJ_STAT (obj, ITEM_ANTI_GOOD)
&& !IS_OBJ_STAT (obj, ITEM_ANTI_NEUTRAL)
&& IS_OBJ_STAT (obj, ITEM_ANTI_EVIL))
strcat (buf, "#w(#yYellow Aura#w)#n ");
if (IS_AFFECTED (ch, AFF_DETECT_MAGIC) && IS_OBJ_STAT (obj, ITEM_MAGIC))
strcat (buf, "#w(#RMagical#w)#n ");
if (IS_SET (obj->specxtype, XITEM_AOP))
strcat( buf, "#r(#RAOP#r)#n ");
if (IS_OBJ_STAT (obj, ITEM_GLOW))
strcat (buf, "#w(#gGlowing#w)#n ");
if (IS_OBJ_STAT (obj, ITEM_HUM))
strcat (buf, "#w(#yHumming#w)#n ");
if (IS_OBJ_STAT (obj, ITEM_APPLYT))
strcat (buf, "#C(#eAPPLY#C)#n ");
if (IS_OBJ_STAT (obj, ITEM_SHADOWPLANE) && obj->in_room != NULL
&& !IS_AFFECTED (ch, AFF_SHADOWPLANE))
strcat (buf, "#w(#eShadowplane#w)#n ");
if (!IS_OBJ_STAT (obj, ITEM_SHADOWPLANE) && obj->in_room != NULL
&& IS_AFFECTED (ch, AFF_SHADOWPLANE))
strcat (buf, "#w(Normal plane)#n ");
if (obj->item_type == ITEM_QUESTCARD)
{
if ((obj->value[0] == -1)
&& (obj->value[1] == -1)
&& (obj->value[2] == -1)
&& (obj->value[3] == -1))
strcat(buf, "#r(Completed)#n ");
}
strcat (buf, "#e");
if (fShort)
{
if (obj->short_descr != NULL)
strcat (buf, obj->short_descr);
}
else
{
if (obj->description != NULL)
strcat (buf, obj->description);
}
strcat (buf, "#n");
}
return buf;
}
int char_hitroll (CHAR_DATA * ch)
{
float hr = GET_HITROLL (ch);
int rage = .25 * ch->max_hit;
int sn;
if (!IS_NPC (ch))
{
if (WORN_ARTIFACT (ch, ARTI_GREENLEAF_CLOAK) && (IS_SET (ch->flag2, AFF2_INARENA) ||
(ch->in_room != NULL && (ch->in_room->sector_type == SECT_INSIDE || ch->in_room->sector_type == SECT_CITY))))
hr -= 50;
if (IS_CLASS (ch, CLASS_MONK) && ch->monkab[COMBAT] > 0)
hr += (ch->monkab[COMBAT] * 35);
if (IS_CLASS (ch, CLASS_VAMPIRE) && get_disc(ch, VAM_CELE) > 0)
hr += (get_disc(ch, VAM_CELE) * 30);
if ( IS_CLASS( ch, CLASS_WRAITH ))
{
if ( IS_WRATED( ch, WRAT_DEATHPLANE ))
hr += 100;
if ( ch->arcanoi[WFATL] == 5 )
hr += 600;
else if ( ch->arcanoi[WFATL] == 4 )
hr += 500;
else if ( ch->arcanoi[WFATL] == 3 )
hr += 250;
else if ( ch->arcanoi[WFATL] == 2 )
hr += 100;
else if ( ch->arcanoi[WFATL] == 1 )
hr += 50;
}
if (!IS_CLASS( ch, CLASS_WRAITH ) && IS_WRATED( ch, WRAT_DEATHPLANE ) )
hr -= 100;
if (IS_SET(ch->wbits, WRAT_BALLAD))
hr += 250;
if (IS_CLASS (ch, CLASS_VAMPIRE) && ch->pcdata->stats[UNI_RAGE] > 0)
hr += ch->pcdata->stats[UNI_RAGE];
if (IS_CLASS (ch, CLASS_NINJA) && ch->pcdata->stats[UNI_RAGE] > 0)
hr += ch->pcdata->stats[UNI_RAGE];
if (IS_CLASS (ch, CLASS_FAE) && IS_SET (ch->special, SPC_SEEMING))
hr += 250;
if (IS_CLASS (ch, CLASS_MAGE) && IS_SET (ch->mflags, MAGE_BETTERBODY))
hr += 115;
if ((IS_CLASS(ch, CLASS_DROW) && IS_SET (ch->special, SPC_DROW_WAR) && rage >= ch->hit))
hr += 500;
/*
* Werewolves get a hitroll bonus from Moon phase at night.
*/
if (IS_CLASS (ch, CLASS_WEREWOLF))
{
if (weather_info.moonphase == MOON_HALF
&& weather_info.time_of_day == NIGHT)
hr += 25;
if (weather_info.moonphase == MOON_FULL
&& weather_info.time_of_day == NIGHT)
hr += 75;
}
if (IS_CLASS (ch, CLASS_NINJA) && ch->pcdata->powers[NPOWER_CHIKYU] >= 6
&& ch->pcdata->powers[HARA_KIRI] > 0)
hr += 100;
if (IS_SET (ch->special, SPC_WOLFMAN)
&& ch->pcdata->stats[UNI_RAGE] > 0)
hr += ch->pcdata->stats[UNI_RAGE];
if (IS_CLASS (ch, CLASS_DEMON) && ch->pcdata->stats[DEMON_POWER] > 0)
hr +=
((ch->pcdata->stats[DEMON_POWER] *
ch->pcdata->stats[DEMON_POWER]) << 1);
if (IS_CLASS (ch, CLASS_DRAGON))
{
hr += GET_AGE(ch) * 20;
}
if (IS_CLASS (ch, CLASS_HIGHLANDER)
&& (get_eq_char (ch, WEAR_DUAL) != NULL))
{
int wpn = ch->wpn[1];
if (wpn >= 500 && wpn < 1000)
hr += 500;
else if (wpn == 1000)
hr += 1000;
else
hr += wpn;
}
}
if (IS_CLASS (ch, CLASS_DROW) && IS_POLYAFF(ch, POLY_SPIDERFORM))
hr += 400;
if (IS_CLASS (ch, CLASS_FAE) && IS_SET (ch->extra2, EXTRA2_WYRM))
hr += 200;
if (IS_CLASS (ch, CLASS_WRAITH) && IS_POLYAFF (ch, POLY_ZULO))
hr += 300;
if (IS_CLASS (ch, CLASS_DROW) && IS_POLYAFF (ch, POLY_ZULO))
hr += 200;
if (IS_CLASS (ch, CLASS_DEMON) && IS_POLYAFF (ch, POLY_ZULO))
hr += 200;
if (IS_CLASS (ch, CLASS_VAMPIRE) && IS_POLYAFF (ch, POLY_ZULO))
hr += 200;
if (IS_CLASS (ch, CLASS_DRAGON) && IS_POLYAFF (ch, POLY_DRAGON))
hr += GET_AGE(ch) * 18;
if (IS_SET (ch->newbits, NEW_POWER))
hr += 150;
if (IS_EXTRA2 (ch, EXTRA2_INFECTED) && IS_PARA (3))
hr *= 1.5;
hr += ch->xhitroll;
if (!IS_SET (ch->newbits, NEW_NOPAIN)
&& ch->hit < ch->max_hit && ch->max_hit > 0 &&
!(IS_CLASS (ch, CLASS_DRAGON) && IS_SET (ch->pcdata->dragonaff, DRA_TOUGHNESS)) &&
!(IS_CLASS (ch, CLASS_FAE) && IS_SET (ch->garou1, WW_GRANITE)) &&
!(IS_CLASS (ch, CLASS_HIGHLANDER) && ch->quickening[0] > 0) &&
!(IS_CLASS (ch, CLASS_MAGE) && is_affected (ch, (sn = skill_lookup ("spirit kiss"))) &&
!(IS_CLASS (ch, CLASS_MONK) && ch->chi[CURRENT] > 0) &&
!(ch->pcdata->stats[UNI_RAGE] > 0) &&
!(ch->in_room != NULL &&
(((IS_CLASS (ch, CLASS_DEMON) || IS_SET (ch->special, SPC_CHAMPION)) && ch->in_room->vnum == 30000) ||
(IS_CLASS (ch, CLASS_DROW) && ((ch->in_room->vnum == 29701) || (ch->in_room->vnum == 29702)))))
))
{
hr = ((hr * ch->hit) / (2 * ch->max_hit)) + ((hr) / 2);
}
return hr;
}
int char_damroll (CHAR_DATA * ch)
{
float dr = GET_DAMROLL (ch);
int rage = .25 * ch->max_hit;
int sn;
if (!IS_NPC (ch))
{
if (WORN_ARTIFACT (ch, ARTI_GREENLEAF_CLOAK) && (IS_SET (ch->flag2, AFF2_INARENA) ||
(ch->in_room != NULL && (ch->in_room->sector_type == SECT_INSIDE || ch->in_room->sector_type == SECT_CITY))))
dr -= 50;
if ( IS_CLASS( ch, CLASS_WRAITH ))
{
if (IS_WRATED( ch, WRAT_DEATHPLANE ) )
dr += 100;
if ( ch->arcanoi[WFATL] == 5 )
dr += 600;
else if ( ch->arcanoi[WFATL] == 4 )
dr += 500;
else if ( ch->arcanoi[WFATL] == 3 )
dr += 250;
else if ( ch->arcanoi[WFATL] == 2 )
dr += 100;
else if ( ch->arcanoi[WFATL] == 1 )
dr += 50;
}
if (!IS_CLASS( ch, CLASS_WRAITH ) && IS_WRATED( ch, WRAT_DEATHPLANE ) )
dr -= 100;
if (IS_SET(ch->wbits, WRAT_BALLAD))
dr += 250;
if (IS_CLASS (ch, CLASS_VAMPIRE) && get_disc(ch, VAM_POTE) > 0)
dr += (get_disc(ch, VAM_POTE) * 30);
if (IS_CLASS (ch, CLASS_MONK) && ch->monkab[COMBAT] > 0)
dr += (ch->monkab[COMBAT] * 35);
if (IS_CLASS (ch, CLASS_VAMPIRE) && ch->pcdata->stats[UNI_RAGE] > 0)
dr += ch->pcdata->stats[UNI_RAGE];
else if (IS_CLASS (ch, CLASS_NINJA) && ch->pcdata->stats[UNI_RAGE] > 0)
dr += ch->pcdata->stats[UNI_RAGE];
else if (IS_SET (ch->special, SPC_WOLFMAN)
&& ch->pcdata->stats[UNI_RAGE] > 0)
dr += ch->pcdata->stats[UNI_RAGE];
else if (IS_CLASS (ch, CLASS_DEMON)
&& ch->pcdata->stats[DEMON_POWER] > 0)
dr +=
((ch->pcdata->stats[DEMON_POWER] *
ch->pcdata->stats[DEMON_POWER]) << 1);
if (IS_CLASS (ch, CLASS_MAGE) && IS_SET (ch->mflags, MAGE_BETTERBODY))
dr += 200;
if ((IS_CLASS(ch, CLASS_DROW) && IS_SET (ch->special, SPC_DROW_WAR) && rage >= ch->hit))
dr += 500;
if (IS_CLASS (ch, CLASS_FAE) && IS_SET (ch->special, SPC_SEEMING))
dr += 250;
if (IS_CLASS (ch, CLASS_WEREWOLF))
{
if (weather_info.moonphase == MOON_HALF
&& weather_info.time_of_day == NIGHT)
dr += 25;
if (weather_info.moonphase == MOON_FULL
&& weather_info.time_of_day == NIGHT)
dr += 75;
}
if (IS_CLASS (ch, CLASS_NINJA) && ch->pcdata->powers[NPOWER_CHIKYU] >= 6
&& ch->pcdata->powers[HARA_KIRI] > 0)
dr += 50;
}
if (IS_CLASS (ch, CLASS_DRAGON))
{
dr += GET_AGE(ch) * 20;
}
if (IS_CLASS (ch, CLASS_HIGHLANDER)
&& (get_eq_char (ch, WEAR_DUAL) != NULL))
{
int wpn = ch->wpn[1];
if (wpn >= 500 && wpn < 1000)
dr += 500;
else if (wpn == 1000)
dr += 1000;
else
dr += wpn;
}
if (IS_CLASS (ch, CLASS_DROW) && IS_POLYAFF(ch, POLY_SPIDERFORM))
dr += 400;
if (IS_CLASS (ch, CLASS_FAE) && IS_SET (ch->extra2, EXTRA2_WYRM))
dr += 400;
if (IS_CLASS (ch, CLASS_WRAITH) && IS_POLYAFF (ch, POLY_ZULO))
dr += 300;
if (IS_CLASS (ch, CLASS_VAMPIRE) && IS_POLYAFF (ch, POLY_ZULO))
dr += 200;
if (IS_CLASS (ch, CLASS_DROW) && IS_POLYAFF (ch, POLY_ZULO))
dr += 200;
if (IS_CLASS (ch, CLASS_DEMON) && IS_POLYAFF (ch, POLY_ZULO))
dr += 200;
if (IS_CLASS (ch, CLASS_DRAGON) && IS_POLYAFF (ch, POLY_DRAGON))
dr += GET_AGE(ch) * 18;
if (IS_SET (ch->newbits, NEW_POWER))
dr += 150;
if (IS_EXTRA2 (ch, EXTRA2_INFECTED) && IS_PARA (3))
dr *= 1.5;
dr += ch->xdamroll;
if (!IS_SET (ch->newbits, NEW_NOPAIN)
&& ch->hit < ch->max_hit && ch->max_hit > 0 &&
!(IS_CLASS (ch, CLASS_DRAGON) && IS_SET (ch->pcdata->dragonaff, DRA_TOUGHNESS)) &&
!(IS_CLASS (ch, CLASS_FAE) && IS_SET (ch->garou1, WW_GRANITE)) &&
!(IS_CLASS (ch, CLASS_HIGHLANDER) && ch->quickening[0] > 0) &&
!(IS_CLASS (ch, CLASS_MAGE) && is_affected (ch, (sn = skill_lookup ("spirit kiss"))) &&
!(IS_CLASS (ch, CLASS_MONK) && ch->chi[CURRENT] > 0) &&
!(ch->pcdata->stats[UNI_RAGE] > 0) &&
!(ch->in_room != NULL &&
(((IS_CLASS (ch, CLASS_DEMON) || IS_SET (ch->special, SPC_CHAMPION)) && ch->in_room->vnum == 30000) ||
(IS_CLASS (ch, CLASS_DROW) && ((ch->in_room->vnum == 29701) || (ch->in_room->vnum == 29702)))))
))
{
dr = ((dr * ch->hit) / (2 * ch->max_hit)) + ((dr) / 2);
}
return dr;
}
int char_ac (CHAR_DATA * ch)
{
float a_c = GET_AC (ch);
int rage = .25 * ch->max_hit;
int sn;
if (!IS_NPC (ch))
{
if (IS_CLASS (ch, CLASS_HIGHLANDER))
a_c -= 300;
if (IS_CLASS (ch, CLASS_VAMPIRE) && get_disc(ch, VAM_FORT) > 0)
a_c -= (get_disc(ch, VAM_FORT) * 30);
if (IS_CLASS (ch, CLASS_DRAGON))
{
a_c -= GET_AGE(ch) * 40;
}
if ((IS_CLASS(ch, CLASS_DROW) && IS_SET (ch->special, SPC_DROW_WAR) && rage >= ch->hit))
a_c -= 500;
if (IS_CLASS (ch, CLASS_HIGHLANDER)
&& (get_eq_char (ch, WEAR_DUAL) != NULL))
{
int wpn = ch->wpn[1];
a_c -= wpn;
}
if (IS_CLASS (ch, CLASS_FAE) && IS_SET (ch->extra2, EXTRA2_WYRM))
a_c -= 200;
else if (IS_POLYAFF (ch, POLY_ZULO))
{
a_c -= 200;
}
else if (IS_POLYAFF (ch, POLY_DRAGON))
{
a_c -= 200;
}
}
if (IS_EXTRA2 (ch, EXTRA2_INFECTED) && IS_PARA (6))
a_c *= 1.5;
a_c -= ch->xac;
if (IS_CLASS(ch, CLASS_WRAITH) && IS_WRATED( ch, WRAT_DEATHPLANE ) )
a_c -= 150;
if (!IS_CLASS(ch, CLASS_WRAITH) && IS_WRATED( ch, WRAT_DEATHPLANE ) )
a_c += 50;
if (IS_SET(ch->wbits, WRAT_BALLAD))
a_c -= 100;
if (!IS_SET (ch->newbits, NEW_NOPAIN)
&& ch->hit < ch->max_hit && ch->max_hit > 0 &&
!(IS_CLASS (ch, CLASS_DRAGON) && IS_SET (ch->pcdata->dragonaff, DRA_TOUGHNESS)) &&
!(IS_CLASS (ch, CLASS_FAE) && IS_SET (ch->garou1, WW_GRANITE)) &&
!(IS_CLASS (ch, CLASS_HIGHLANDER) && ch->quickening[0] > 0) &&
!(IS_CLASS (ch, CLASS_MAGE) && is_affected (ch, (sn = skill_lookup ("spirit kiss"))) &&
!(IS_CLASS (ch, CLASS_MONK) && ch->chi[CURRENT] > 0) &&
!(ch->pcdata->stats[UNI_RAGE] > 0) &&
!(ch->in_room != NULL &&
(((IS_CLASS (ch, CLASS_DEMON) || IS_SET (ch->special, SPC_CHAMPION)) && ch->in_room->vnum == 30000) ||
(IS_CLASS (ch, CLASS_DROW) && ((ch->in_room->vnum == 29701) || (ch->in_room->vnum == 29702)))))
))
{
a_c = ((a_c * ch->hit) / (2 * ch->max_hit)) + ((a_c) / 2);
}
if (a_c < -7500)
{
return -7500;
}
return a_c;
}
/*
* Show a list to a character.
* Can coalesce duplicated items.
*/
void show_list_to_char (OBJ_DATA * list, CHAR_DATA * ch, bool fShort,
bool fShowNothing)
{
char buf[MAX_STRING_LENGTH];
char **prgpstrShow;
int *prgnShow;
char *pstrShow;
OBJ_DATA *obj;
int nShow;
int iShow;
int count;
bool fCombine;
if (ch->desc == NULL)
return;
/*
* Alloc space for output lines.
*/
count = 0;
for (obj = list; obj != NULL; obj = obj->next_content)
count++;
prgpstrShow = alloc_mem (count * sizeof (char *));
prgnShow = alloc_mem (count * sizeof (int));
nShow = 0;
/*
* Format the list of objects.
*/
for (obj = list; obj != NULL; obj = obj->next_content)
{
if (!IS_NPC (ch) && ch->pcdata->chobj != NULL && obj->chobj != NULL
&& obj->chobj == ch)
continue;
if (obj->wear_loc == WEAR_NONE && can_see_obj (ch, obj))
{
pstrShow = format_obj_to_char (obj, ch, fShort);
fCombine = FALSE;
if (IS_NPC (ch) || IS_SET (ch->act, PLR_COMBINE))
{
/*
* Look for duplicates, case sensitive.
* Matches tend to be near end so run loop backwords.
*/
for (iShow = nShow - 1; iShow >= 0; iShow--)
{
if (!strcmp (prgpstrShow[iShow], pstrShow))
{
prgnShow[iShow]++;
fCombine = TRUE;
break;
}
}
}
/*
* Couldn't combine, or didn't want to.
*/
if (!fCombine)
{
prgpstrShow[nShow] = str_dup (pstrShow);
prgnShow[nShow] = 1;
nShow++;
}
}
}
/*
* Output the formatted list.
*/
for (iShow = 0; iShow < nShow; iShow++)
{
if (IS_NPC (ch) || IS_SET (ch->act, PLR_COMBINE))
{
if (prgnShow[iShow] != 1)
{
sprintf (buf, "#e(#w%2d#e) ", prgnShow[iShow]);
send_to_char (buf, ch);
}
else
{
send_to_char (" ", ch);
}
}
send_to_char (prgpstrShow[iShow], ch);
send_to_char ("\n\r", ch);
free_string (prgpstrShow[iShow]);
}
if (fShowNothing && nShow == 0)
{
if (IS_NPC (ch) || IS_SET (ch->act, PLR_COMBINE))
send_to_char (" ", ch);
send_to_char ("#CNothing.#n\n\r", ch);
}
/*
* Clean up.
*/
free_mem (prgpstrShow, count * sizeof (char *));
free_mem (prgnShow, count * sizeof (int));
return;
}
char *show_char_to_char_0 (CHAR_DATA * victim, CHAR_DATA * ch)
{
static char buf[MSL];
char buf2[MSL], spacer[MSL], mount2[MSL], name[MSL], wizi[MSL];
CHAR_DATA *mount;
buf[0] = '\0';
buf2[0] = '\0';
name[0] = '\0';
sprintf (spacer, " ");
if (!IS_NPC (victim) && victim->pcdata->chobj != NULL)
return buf;
if ((mount = victim->mount) != NULL && IS_SET (victim->mounted, IS_MOUNT))
return buf;
/*
if (!IS_NPC (victim) && IS_SET (victim->flag2, VAMP_OBJMASK))
{
sprintf (buf, "%s\n\r", victim->objdesc);
return buf;
}
*/
if (IS_HEAD (victim, LOST_HEAD) && IS_AFFECTED (victim, AFF_POLYMORPH))
{
sprintf (buf, "%s is lying here\n\r", PERS (victim, ch));
return buf;
}
else
{
char aff[MSL];
aff[0] = '\0';
if (!IS_NPC (ch) && IS_SET (ch->extra2, MINIFLAGS))
{
sprintf (aff, "#w[#C.#w.#c.#g.#p.#w.#r.#P.#p.#R.#w.#e.#w]#n ");
if (!IS_NPC (victim) && victim->desc == NULL
&& victim->pcdata->login_timer == 0)
aff[5] = 'L';
if (IS_SET (victim->newbits, NEW_NOTEWRITE))
aff[8] = 'N';
if (IS_AFFECTED (victim, AFF_INVISIBLE))
aff[11] = 'I';
if (IS_AFFECTED (victim, AFF_HIDE))
aff[14] = 'H';
if (IS_AFFECTED (victim, AFF_CHARM))
aff[17] = 'C';
if (IS_AFFECTED (victim, AFF_PASS_DOOR)
|| IS_AFFECTED (victim, AFF_ETHEREAL))
aff[20] = 'T';
if (IS_SET (victim->flag2, EXTRA_AFK))
aff[23] = 'A';
if (IS_SET (victim->extra2, EXTRA2_INFECTED))
aff[26] = 'p';
if (IS_AFFECTED (victim, AFF_FAERIE_FIRE))
aff[29] = 'P';
if (IS_EVIL (victim) && IS_AFFECTED (ch, AFF_DETECT_EVIL))
aff[32] = 'R';
if (IS_AFFECTED (victim, AFF_SANCTUARY))
aff[35] = 'W';
if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
&& !IS_AFFECTED (victim, AFF_SHADOWPLANE))
aff[38] = 'n';
else if (!IS_AFFECTED (ch, AFF_SHADOWPLANE)
&& IS_AFFECTED (victim, AFF_SHADOWPLANE))
aff[38] = 'S';
if (IS_WRATED( ch, WRAT_DEATHPLANE)
&& !IS_WRATED(victim, WRAT_DEATHPLANE))
aff[38] = 'm';
else if (!IS_WRATED(ch, WRAT_DEATHPLANE)
&& IS_WRATED(victim, WRAT_DEATHPLANE))
aff[38] = 'D';
if (!str_cmp (aff, "#w[#C.#w.#c.#g.#p.#w.#r.#P.#p.#R.#w.#e.#w]#n "))
aff[0] = '\0';
if (!IS_NPC (victim) && victim->desc)
{
if (victim->desc->pString)
strcat (aff, "#w[#gString #bEditor#w]#n ");
if (victim->desc->connected < 0)
strcat (aff, "#g[#bO#BL#bC#g] #n");
}
if (IS_IMMORTAL (victim) && IS_SET (victim->act, PLR_WIZINVIS)
&& victim->pcdata->wizinvis >= 7)
{
sprintf (wizi, "#e[#wINVIS %d#e]#n ", victim->pcdata->wizinvis);
strcat (aff, wizi);
}
if (!IS_NPC (victim) && IS_SET (victim->extra2, WHINER))
strcat (aff, "#w->#F#rWHINER#n#w<-#n ");
if (!IS_NPC (victim) && IS_SET (victim->extra2, DEMENTED))
strcat (aff, "#r-#F#wDEMENTED#n#r-#n");
if (IS_IMMORTAL (victim) && IS_SET (victim->act, PLR_INCOG))
strcat (aff, "#e[#wINCOG#e]#n ");
}
else
{
if (!IS_NPC (victim) && victim->desc == NULL)
strcat (aff, "#C(Link-Dead)#n ");
if (!IS_NPC (victim) && victim->desc)
{
if (victim->desc->pString)
strcat (aff, "#w(#gString #bEditor#w)#n ");
if (victim->desc->connected < 0)
strcat (aff, "#g(#bO#BL#bC#g) #n");
}
if (IS_SET (victim->newbits, NEW_NOTEWRITE))
strcat (aff, "#w(Writing Note)#n ");
if (IS_IMMORTAL (victim) && IS_SET (victim->act, PLR_WIZINVIS)
&& victim->pcdata->wizinvis >= 7)
{
sprintf (wizi, "#e(#wINVIS %d#e)#n ", victim->pcdata->wizinvis);
strcat (aff, wizi);
}
if (IS_IMMORTAL (victim) && IS_SET (victim->act, PLR_INCOG))
strcat (aff, "#e(#wINCOG#e)#n ");
if (IS_AFFECTED (victim, AFF_INVISIBLE))
strcat (aff, "#c(Invis)#n ");
if (IS_AFFECTED (victim, AFF_HIDE))
strcat (aff, "#g(Hide)#n ");
if (IS_AFFECTED (victim, AFF_CHARM))
strcat (aff, "#p(Charmed)#n ");
if (IS_AFFECTED (victim, AFF_PASS_DOOR))
strcat (aff, "#w(Translucent)#n ");
if (IS_AFFECTED (victim, AFF_ETHEREAL))
strcat (aff, "#w(Ethereal)#n ");
if (IS_SET (victim->flag2, EXTRA_AFK))
strcat (aff, "(#r->AFK<-#n) ");
if (IS_SET (victim->extra2, WHINER))
strcat (aff, "#w->#F#rWHINER#n#w<-#n ");
if (IS_SET (victim->extra2, DEMENTED))
strcat (aff, "#r-#F#wDEMENTED#n#r-#n ");
if (IS_SET (victim->extra2, EXTRA2_INFECTED))
strcat (aff, "(#pPaRaSiTe#n) ");
if (IS_AFFECTED (victim, AFF_FAERIE_FIRE))
strcat (aff, "#p(Pink Aura)#n ");
if (IS_EVIL (victim) && IS_AFFECTED (ch, AFF_DETECT_EVIL))
strcat (buf, "#r(Red Aura)#n ");
if (IS_AFFECTED (victim, AFF_SANCTUARY))
strcat (buf, "#w(White Aura)#n ");
if (IS_AFFECTED (victim, AFF_STEELSHIELD))
strcat (aff, "#b(Majesty)#n ");
if (IS_WRATED(ch, WRAT_DEATHPLANE)
&& !IS_WRATED (victim, WRAT_DEATHPLANE))
strcat (aff, "#w(Material Plane)#n ");
else if (!IS_WRATED(ch, WRAT_DEATHPLANE)
&& IS_WRATED(victim, WRAT_DEATHPLANE))
strcat (aff, "#e(Death Plane)#n ");
if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
&& !IS_AFFECTED (victim, AFF_SHADOWPLANE))
strcat (aff, "#e(Normal plane)#n ");
else if (!IS_AFFECTED (ch, AFF_SHADOWPLANE)
&& IS_AFFECTED (victim, AFF_SHADOWPLANE))
strcat (aff, "#e(Shadowplane)#n ");
if (IS_NPC(victim) &&ch->questmob > 0 && victim->pIndexData->vnum == ch->questmob)
strcat( aff, "#R[#rTARGET#R] #n");
}
strcat (buf, aff);
}
if (ch->class > 0)
{
if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_VAMPIRE))
strcat (buf, "#r(Vampire)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_WEREWOLF))
strcat (buf, "#o(Werewolf)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_DEMON))
strcat (buf, "#y(Demon)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_MAGE))
strcat (buf, "#b(Mage)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_HIGHLANDER))
strcat (buf, "#C(Highlander)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_DROW))
strcat (buf, "#g(Ilythiiri)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_NINJA))
strcat (buf, "#p(Ninja)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_MONK))
strcat (buf, "#g(Monk)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_PHOENIX))
strcat (buf, "#r(Phoenix)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_FAE))
strcat (buf, "#b(F#ca#be)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_WRAITH))
strcat (buf, "#w(#eW#wr#ea#wi#et#wh)#n ");
else if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_DRAGON))
strcat (buf, "#g(Dr#wag#gon)#n ");
}
if (!IS_NPC (ch) && IS_VAMPAFF (ch, VAM_AUSPEX) &&
!IS_NPC (victim) && IS_CLASS (victim, CLASS_VAMPIRE) &&
IS_VAMPAFF (victim, VAM_DISGUISED))
{
strcat (buf, "#w(#r");
strcat (buf, victim->name);
strcat (buf, "#w) #n");
}
if (IS_NPC (victim))
strcat (buf, "#o");
else if (IS_IMMORTAL (victim))
strcat (buf, "#c");
else
strcat (buf, "#w");
if (victim->position == POS_STANDING
&& victim->long_descr[0] != '\0'
&& strlen (victim->long_descr) > 3
&& !(mount = victim->mount) && victim->stance[0] < 1)
{
strcpy (name, victim->long_descr);
name[strlen (name) - 2] = '\0';
}
else if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_POLYMORPH))
strcat (name, victim->morph);
else
strcat (name, PERS (victim, ch));
strcat (buf, name);
if ((mount = victim->mount) != NULL && victim->mounted == IS_RIDING)
{
sprintf (mount2, " is here riding %s", PERS (mount, ch));
strcat (buf, mount2);
if (victim->position == POS_FIGHTING)
{
strcat (buf, ", fighting ");
if (victim->fighting == NULL)
strcat (buf, "thin air");
else if (victim->fighting == ch)
strcat (buf, "YOU");
else if (victim->in_room == victim->fighting->in_room)
{
strcat (buf, PERS (victim->fighting, ch));
}
else
strcat (buf, "someone who left");
}
}
else
{
switch (victim->position)
{
case POS_DEAD:
strcat (buf, " is DEAD!!");
break;
case POS_MORTAL:
strcat (buf, " is #Rmortally wounded#n.");
break;
case POS_INCAP:
strcat (buf, " is #rincapacitated#n.");
break;
case POS_STUNNED:
strcat (buf, " is lying here #Cstunned#n.");
break;
case POS_SLEEPING:
strcat (buf, " is sleeping here");
break;
case POS_RESTING:
strcat (buf, " is resting here");
break;
case POS_MEDITATING:
strcat (buf, " is meditating here");
break;
case POS_SITTING:
strcat (buf, " is sitting here");
break;
case POS_STANDING:
if (victim->stance[0] == STANCE_NORMAL)
strcat (buf, " is here, crouched in a fighting stance.");
else if ( victim->stance[0] == STANCE_VIPER)
strcat (buf, " is here, crouched in a viper fighting stance.");
else if (victim->stance[0] == STANCE_CRANE)
strcat (buf, " is here, crouched in a crane fighting stance.");
else if (victim->stance[0] == STANCE_CRAB)
strcat (buf, " is here, crouched in a crab fighting stance.");
else if (victim->stance[0] == STANCE_MONGOOSE)
strcat (buf, " is here, crouched in a mongoose fighting stance.");
else if (victim->stance[0] == STANCE_BULL)
strcat (buf, " is here, crouched in a bull fighting stance.");
else if (victim->stance[0] == STANCE_MANTIS)
strcat (buf, " is here, crouched in a mantis fighting stance.");
else if (victim->stance[0] == STANCE_DRAGON)
strcat (buf, " is here, crouched in a dragon fighting stance.");
else if (victim->stance[0] == STANCE_TIGER)
strcat (buf, " is here, crouched in a tiger fighting stance.");
else if (victim->stance[0] == STANCE_MONKEY)
strcat (buf, " is here, crouched in a monkey fighting stance.");
else if (victim->stance[0] == STANCE_SWALLOW)
strcat (buf, " is here, crouched in a swallow fighting stance.");
else if (victim->position == POS_STANDING && !IS_IMMORTAL (victim)
&& IS_AFFECTED (victim, AFF_FLYING))
strcat (buf, " is hovering here");
else if (victim->position == POS_STANDING
&& (!IS_NPC (victim) && (IS_VAMPAFF (victim, VAM_FLYING))))
strcat (buf, " is hovering here");
else if (victim->position == POS_STANDING
&& (!IS_NPC (victim) && IS_CLASS (victim, CLASS_DROW)
&& IS_SET (victim->pcdata->powers[1],
DPOWER_LEVITATION)))
strcat (buf, " is hovering here");
else if (victim->position == POS_STANDING
&& (!IS_NPC (victim) && IS_CLASS (victim, CLASS_DRAGON)
&& IS_SET (victim->pcdata->dragonaff, DRA_WINGS)))
strcat (buf, " is hovering here");
else if (!IS_NPC (victim))
strcat (buf, " is here.");
break;
case POS_FIGHTING:
strcat (buf, " is here, fighting ");
if (victim->fighting == NULL)
strcat (buf, "thin air");
else if (victim->fighting == ch)
strcat (buf, "YOU");
else if (victim->in_room == victim->fighting->in_room)
{
strcat (buf, PERS (victim->fighting, ch));
}
else
strcat (buf, "someone who left");
break;
}
}
if (IS_SET (victim->war, TEAM_RED))
{
sprintf (buf2, "\n\r#n%s.....is in the war on the #rRED#n Team.", spacer);
strcat (buf, buf2);
}
if (IS_SET (victim->war, TEAM_BLUE))
{
sprintf (buf2, "\n\r#n%s.....is in the war on the #bBLUE#n Team.",
spacer);
strcat (buf, buf2);
}
if (victim->embracing != NULL)
{
sprintf (buf2, "\n\r#n%s.....is holding %s in a stern embrace!", spacer,
PERS (victim->embracing, ch));
strcat (buf, buf2);
}
else if (victim->embraced != NULL)
{
sprintf (buf2, "\n\r#n%s.....is being embraced by %s!", spacer,
PERS (victim->embraced, ch));
strcat (buf, buf2);
}
if (IS_SET (victim->flag2, AFF2_ROT))
{
sprintf (buf2, "\n\r#n%s.....is coated with a layer of rotten skin!",
spacer);
strcat (buf, buf2);
}
if (IS_AFFECTED (victim, AFF_FLAMING))
{
sprintf (buf2, "\n\r#n%s.....is engulfed in #rblazing flames!#n", spacer);
strcat (buf, buf2);
}
if (IS_EXTRA (victim, TIED_UP))
{
sprintf (buf2, "\n\r#n%s.....is tied up", spacer);
if (IS_EXTRA (victim, GAGGED) && IS_EXTRA (victim, BLINDFOLDED))
strcat (buf2, ", gagged and blindfolded!");
else if (IS_EXTRA (victim, GAGGED))
strcat (buf2, " and gagged!");
else if (IS_EXTRA (victim, BLINDFOLDED))
strcat (buf2, " and blindfolded!");
else
strcat (buf2, "!");
strcat (buf, buf2);
}
if (IS_AFFECTED (victim, AFF_ENTRAILS))
{
sprintf (buf2, "\n\r#n%s.....is covered with entrails.", spacer);
strcat (buf, buf2);
}
if (IS_AFFECTED (victim, AFF_WEBBED))
{
sprintf (buf2, "\n\r#n%s.....is coated in a sticky web.", spacer);
strcat (buf, buf2);
}
if (IS_NPC (ch) || !IS_SET (ch->act, PLR_BRIEF))
{
if (IS_ITEMAFF (victim, ITEMA_SHOCKSHIELD))
{
sprintf (buf2,
"\n\r#n%s.....is surrounded by a shield of #ylightning#n.",
spacer);
strcat (buf, buf2);
}
if (IS_ITEMAFF (victim, ITEMA_FIRESHIELD))
{
sprintf (buf2, "\n\r#n%s.....is surrounded by a shield of #rfire#n.",
spacer);
strcat (buf, buf2);
}
if (IS_ITEMAFF (victim, ITEMA_ICESHIELD))
{
sprintf (buf2, "\n\r#n%s.....is surrounded by a shield of #cice#n.",
spacer);
strcat (buf, buf2);
}
if (IS_ITEMAFF (victim, ITEMA_ACIDSHIELD))
{
sprintf (buf2, "\n\r#n%s.....is surrounded by a shield of #oacid#n.",
spacer);
strcat (buf, buf2);
}
if (IS_ITEMAFF (victim, ITEMA_SOLARSHIELD))
{
sprintf (buf2, "\n\r#n%s.....is surrounded by a shield of #ysolar energy#n.",
spacer);
strcat (buf, buf2);
}
if (IS_ITEMAFF (victim, ITEMA_CHAOSSHIELD))
{
sprintf (buf2,
"\n\r#n%s.....is surrounded by a shield of #.c#.h#.a#.o#.s#n.",
spacer);
strcat (buf, buf2);
}
if (IS_ITEMAFF (victim, ITEMA_REFLECT))
{
sprintf (buf2,
"\n\r#n%s.....is surrounded by a shield of #0darkness#n.",
spacer);
strcat (buf, buf2);
}
if (IS_ITEMAFF (victim, ITEMA_SUNSHIELD))
{
sprintf (buf2,
"\n\r#n%s.....is surrounded by a glowing halo of #ysun#n.",
spacer);
strcat (buf, buf2);
}
if (IS_SET (victim->extra2, AURA_NO_MAGIC))
{
sprintf (buf2, "\n\r#n%s.....is surrounded by a #pMagickal Aura#n.",
spacer);
strcat (buf, buf2);
}
}
strcat (buf, "#n");
return buf;
}
void evil_eye (CHAR_DATA * victim, CHAR_DATA * ch)
{
char buf[MAX_STRING_LENGTH];
int tabletype;
return;
if (IS_NPC (victim))
return;
if (victim == ch)
return;
if (ch->level != 3 || victim->level != 3)
return;
if (!IS_VAMPAFF (victim, VAM_DOMINATE))
return;
if (victim->powertype != NULL && strlen (victim->powertype) > 1)
{
sprintf (buf, "\n\r%s\n\r", victim->powertype);
send_to_char (buf, ch);
}
if (IS_SET (victim->spectype, EYE_SELFACTION)
&& victim->poweraction != NULL)
interpret (victim, victim->poweraction);
if (IS_SET (victim->spectype, EYE_ACTION) && victim->poweraction != NULL)
interpret (ch, victim->poweraction);
if (IS_SET (victim->spectype, EYE_SPELL) && victim->specpower > 0)
{
tabletype = skill_table[victim->specpower].target;
(*skill_table[victim->specpower].spell_fun) (victim->specpower,
victim->spl[tabletype],
victim, ch);
}
return;
}
void show_char_to_char_1 (CHAR_DATA * victim, CHAR_DATA * ch)
{
char buf[MAX_STRING_LENGTH];
OBJ_DATA *obj;
int iWear;
int percent;
bool found;
if (!IS_NPC (ch) && (ch->lstatus > 1) && (number_range (1, 100) <= 80)
&& !IS_IMMORTAL (ch))
{
act ("You glance at $N.", ch, NULL, victim, TO_CHAR);
}
else if (IS_NPC (ch)
|| (can_see (victim, ch)
&& (ch->pcdata->wizinvis <= victim->level)))
{
act ("$n looks at you.", ch, NULL, victim, TO_VICT);
act ("$n looks at $N.", ch, NULL, victim, TO_NOTVICT);
}
if (!IS_NPC (ch) && IS_HEAD (victim, LOST_HEAD))
{
act ("$N is lying here.", ch, NULL, victim, TO_CHAR);
return;
}
if (victim->description[0] != '\0')
{
send_to_char (victim->description, ch);
}
/*
else
{
act ("You see nothing special about $M.", ch, NULL, victim, TO_CHAR);
}
*/
if (victim->max_hit > 0)
percent = (100 * victim->hit) / victim->max_hit;
else
percent = -1;
strcpy (buf, PERS (victim, ch));
if (percent >= 100)
strcat (buf, " is in perfect health.\n\r");
else if (percent >= 90)
strcat (buf, " is slightly scratched.\n\r");
else if (percent >= 80)
strcat (buf, " has a few bruises.\n\r");
else if (percent >= 70)
strcat (buf, " has some cuts.\n\r");
else if (percent >= 60)
strcat (buf, " has several wounds.\n\r");
else if (percent >= 50)
strcat (buf, " has many nasty wounds.\n\r");
else if (percent >= 40)
strcat (buf, " is bleeding freely.\n\r");
else if (percent >= 30)
strcat (buf, " is covered in blood.\n\r");
else if (percent >= 20)
strcat (buf, " is leaking guts.\n\r");
else if (percent >= 10)
strcat (buf, " is almost dead.\n\r");
else
strcat (buf, " is DYING.\n\r");
buf[0] = UPPER (buf[0]);
send_to_char (buf, ch);
if (!IS_NPC (victim))
{
if (IS_CLASS (victim, CLASS_DRAGON))
{
if (IS_SET (victim->pcdata->dragonaff, DRA_FANGS))
act ("$N has many sharp pointed teeth.", ch, NULL, victim,
TO_CHAR);
if (IS_SET (victim->pcdata->dragonaff, DRA_WINGS))
act ("$N has a pair of huge leathery wings extending from $S back.", ch, NULL, victim, TO_CHAR);
if (IS_SET (victim->pcdata->dragonaff, DRA_TAIL))
{
switch (GET_AGE(victim))
{
case 1:
act ("$N has a tail 16 feet long.", ch, NULL, victim, TO_CHAR);
break;
case 2:
act ("$N has a tail 28 feet long.", ch, NULL, victim, TO_CHAR);
break;
case 3:
act ("$N has a tail 38 feet long.", ch, NULL, victim, TO_CHAR);
break;
case 4:
act ("$N has a tail 50 feet long.", ch, NULL, victim, TO_CHAR);
break;
case 5:
act ("$N has a tail 60 feet long.", ch, NULL, victim, TO_CHAR);
break;
case 6:
act ("$N has a tail 70 feet long.", ch, NULL, victim, TO_CHAR);
break;
case 7:
act ("$N has a tail 84 feet long.", ch, NULL, victim, TO_CHAR);
break;
case 8:
act ("$N has a tail 95 feet long.", ch, NULL, victim, TO_CHAR);
break;
case 9:
act ("$N has a tail 108 feet long.", ch, NULL, victim,
TO_CHAR);
break;
case 10:
act ("$N has a tail 120 feet long.", ch, NULL, victim,
TO_CHAR);
break;
case 11:
act ("$N has a tail 150 feet long.", ch, NULL, victim,
TO_CHAR);
break;
case 12:
act ("$N has a tail 200 feet long.", ch, NULL, victim,
TO_CHAR);
break;
default:
act ("$N has a tail over 200 feet long.", ch, NULL, victim,
TO_CHAR);
}
}
}
if (IS_CLASS (victim, CLASS_VAMPIRE)
&& IS_SET (victim->newbits, NEW_OBEAH))
{
if (victim->pcdata->obeah > 0)
act ("$N has a brightly glowing eye in the centre of $S forehead.", ch, NULL, victim, TO_CHAR);
else
act ("$N has an eye in the centre of $S forehead.", ch, NULL,
victim, TO_CHAR);
}
if (IS_AFFECTED (victim, AFF_INFRARED)
|| IS_VAMPAFF (victim, VAM_NIGHTSIGHT))
act ("$N's eyes are glowing bright red.", ch, NULL, victim, TO_CHAR);
if (IS_AFFECTED (victim, AFF_FLYING))
act ("$N is hovering in the air.", ch, NULL, victim, TO_CHAR);
if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_DROW)
&& IS_SET (victim->pcdata->powers[1], DPOWER_LEVITATION))
act ("$N is hovering in the air.", ch, NULL, victim, TO_CHAR);
if (IS_VAMPAFF (victim, VAM_FANGS))
act ("$N has a pair of long, pointed fangs.", ch, NULL, victim,
TO_CHAR);
if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_VAMPIRE)
&& IS_VAMPAFF (victim, VAM_CLAWS))
act ("$N has razer sharp claws protruding from under $S finger nails.", ch, NULL, victim, TO_CHAR);
else if (!IS_NPC (victim) && IS_VAMPAFF (victim, VAM_CLAWS))
act ("$N has razer sharp talons extending from $S fingers.", ch,
NULL, victim, TO_CHAR);
if (!IS_NPC (victim ) && IS_DEMAFF (victim, DEM_HORNS))
act ("$N has a pair of pointed horns extending from $S head.", ch,
NULL, victim, TO_CHAR);
if (!IS_NPC (victim)
&& (IS_CLASS (victim, CLASS_DEMON)
|| IS_SET (victim->special, SPC_CHAMPION)))
{
if (IS_DEMAFF (victim, DEM_HOOVES))
act ("$N has a huge pair of hooves in place of $S feet.", ch,
NULL, victim, TO_CHAR);
if (IS_DEMAFF (victim, DEM_TAIL))
act ("$N has a huge tail extended from $S backside.", ch, NULL,
victim, TO_CHAR);
if (IS_CLASS (ch, CLASS_DEMON) && IS_SET (ch->warp, WARP_KNIFE))
act ("$N has a knife stuck in $S head.", ch, NULL, victim,
TO_CHAR);
if (IS_CLASS (ch, CLASS_DEMON) && IS_SET (ch->warp, WARP_SPOON))
act ("$N has a spoon stuck on $S ear.", ch, NULL, victim,
TO_CHAR);
if (IS_CLASS (ch, CLASS_DEMON) && IS_SET (ch->warp, WARP_FORK))
act ("$N has a fork stuck in $S nose", ch, NULL, victim, TO_CHAR);
}
if (IS_DEMAFF (victim, DEM_WINGS))
{
if (IS_DEMAFF (victim, DEM_UNFOLDED))
act ("$N has a pair of batlike wings spread out from behind $S back.", ch, NULL, victim, TO_CHAR);
else
act ("$N has a pair of batlike wings folded behind $S back.",
ch, NULL, victim, TO_CHAR);
}
else if (IS_VAMPAFF (victim, VAM_WINGS))
act ("$N has large wings protruding from $S back.", ch, NULL, victim, TO_CHAR);
}
found = FALSE;
for (iWear = 0; iWear < MAX_WEAR; iWear++)
{
if (iWear == WEAR_CLOAK && !WORN_ARTIFACT(victim, ARTI_CLOAK_OF_THE_ARCHMAGI)) continue;
if ((obj = get_eq_char (victim, iWear)) != NULL
&& can_see_obj (ch, obj))
{
if (!found)
{
send_to_char ("\n\r", ch);
act ("$N is using:", ch, NULL, victim, TO_CHAR);
found = TRUE;
}
send_to_char (where_name[iWear], ch);
if (IS_NPC (ch) || ch->pcdata->chobj == NULL
|| ch->pcdata->chobj != obj)
{
send_to_char (format_obj_to_char (obj, ch, TRUE), ch);
send_to_char ("\n\r", ch);
}
else
send_to_char ("you\n\r", ch);
}
}
if (victim != ch && !IS_NPC (ch) && !IS_HEAD (victim, LOST_HEAD)
&& number_percent () < ch->pcdata->learned[gsn_peek])
{
send_to_char ("\n\rYou peek at the inventory:\n\r", ch);
show_list_to_char (victim->carrying, ch, TRUE, TRUE);
}
return;
}
void show_char_to_char (CHAR_DATA * list, CHAR_DATA * ch)
{
CHAR_DATA *rch;
char **prgpstrShow, *pstrShow, buf[MSL];
int *prgnShow, nShow, iShow, count;
CHAR_DATA *mount;
bool fCombine;
if (ch->desc == NULL)
return;
count = 0;
for (rch = list; rch; rch = rch->next_in_room)
{
if (rch == list && count > 0) break;
count++;
}
prgpstrShow = alloc_mem (count * sizeof (char *));
prgnShow = alloc_mem (count * sizeof (int));
nShow = 0;
for (rch = list; rch != NULL; rch = rch->next_in_room)
{
if (rch == ch)
continue;
if (IS_IMMORTAL (ch) || IS_IMMORTAL (rch))
{
if (!IS_NPC (rch) && IS_SET (rch->act, PLR_WIZINVIS)
&& get_trust (ch) < rch->pcdata->wizinvis && ch->level < 12 && ch->trust < 12)
continue;
}
else
{
if (!IS_NPC (rch)
&& (IS_SET (rch->act, PLR_WIZINVIS)
|| IS_ITEMAFF (rch, ITEMA_VANISH))
&& !IS_SET (ch->act, PLR_HOLYLIGHT)
&& !IS_ITEMAFF (ch, ITEMA_VISION)
&& !IS_SET (rch->tag_flags, TAG_PLAYING))
continue;
}
if (!IS_NPC (rch))
{
if (IS_HEAD (rch, LOST_HEAD))
continue;
if (IS_EXTRA (rch, EXTRA_OSWITCH))
continue;
}
if (IS_SET (rch->mounted, IS_MOUNT))
continue;
if (can_see (ch, rch))
{
pstrShow = show_char_to_char_0 (rch, ch);
fCombine = FALSE;
if (IS_NPC (ch) || IS_SET (ch->act, PLR_COMBINE))
{
for (iShow = nShow - 1; iShow >= 0; iShow--)
{
// if ((mount = rch->mount) != NULL && IS_SET (rch->mounted, IS_MOUNT))
// break;
if (!strcmp (prgpstrShow[iShow], pstrShow))
{
prgnShow[iShow]++;
fCombine = TRUE;
break;
}
}
}
if (!fCombine)
{
prgpstrShow[nShow] = str_dup (pstrShow);
prgnShow[nShow] = 1;
nShow++;
}
}
}
for (iShow = 0; iShow < nShow; iShow++)
{
if (IS_NPC (ch) || IS_SET (ch->act, PLR_COMBINE))
{
if (prgnShow[iShow] != 1)
{
sprintf (buf, "#e(#w%2d#e)#w ", prgnShow[iShow]);
send_to_char (buf, ch);
}
else
send_to_char (" #w", ch);
}
send_to_char (prgpstrShow[iShow], ch);
send_to_char ("#n\n\r", ch);
free_string (prgpstrShow[iShow]);
}
for (rch = list; rch != NULL; rch = rch->next_in_room)
{
if (rch == ch)
continue;
if ((mount = rch->mount) != NULL && IS_SET (rch->mounted, IS_MOUNT))
continue;
if (IS_IMMORTAL (ch) || IS_IMMORTAL (rch))
{
if (!IS_NPC (rch) &&
IS_SET (rch->act, PLR_WIZINVIS) &&
get_trust (ch) < get_trust (rch))
continue;
}
else
{
if (!IS_NPC (rch) &&
(IS_SET (rch->act, PLR_WIZINVIS) ||
IS_ITEMAFF (rch, ITEMA_VANISH)) &&
!IS_SET (ch->act, PLR_HOLYLIGHT) &&
!IS_ITEMAFF (ch, ITEMA_VISION))
continue;
}
if (!IS_NPC (rch))
{
if (IS_HEAD (rch, LOST_HEAD))
continue;
if (IS_EXTRA (rch, EXTRA_OSWITCH))
continue;
}
if (!can_see (ch, rch))
{
if (room_is_dark (rch->in_room))
{
if (IS_AFFECTED (rch, AFF_INFRARED) ||
(!IS_NPC (rch) && IS_VAMPAFF (rch, VAM_NIGHTSIGHT)))
{
if (IS_NPC (ch) || IS_SET (ch->act, PLR_COMBINE))
send_to_char (" ", ch);
stc ("You see a pair of glowing #Rred#n eyes watching you!\n\r", ch);
}
}
}
}
/* Clean up. */
free_mem (prgpstrShow, count * sizeof (char *));
free_mem (prgnShow, count * sizeof (int));
}
bool check_blind (CHAR_DATA * ch)
{
if (!IS_NPC (ch) && IS_SET (ch->act, PLR_HOLYLIGHT)
&& !IS_AFFECTED (ch, AFF_TOTALBLIND))
return TRUE;
if (IS_ITEMAFF (ch, ITEMA_VISION) && !IS_AFFECTED (ch, AFF_TOTALBLIND))
return TRUE;
if (IS_HEAD (ch, LOST_EYE_L) && IS_HEAD (ch, LOST_EYE_R))
{
send_to_char ("You have no eyes to see with!\n\r", ch);
return FALSE;
}
if (IS_EXTRA (ch, BLINDFOLDED))
{
send_to_char ("You can't see a thing through the blindfold!\n\r", ch);
return FALSE;
}
if (IS_AFFECTED (ch, AFF_BLIND) && !IS_AFFECTED (ch, AFF_SHADOWSIGHT))
{
send_to_char ("You can't see a thing!\n\r", ch);
return FALSE;
}
if (IS_AFFECTED (ch, AFF_TOTALBLIND) && !IS_IMMORTAL (ch))
{
send_to_char ("You can't see through this shroud of darkness!\n\r", ch);
return FALSE;
}
return TRUE;
}
void do_look (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
EXIT_DATA *pexit;
CHAR_DATA *victim;
CHAR_DATA *vch;
CHAR_DATA *vch_next;
CHAR_DATA *wizard;
OBJ_DATA *obj;
OBJ_DATA *portal;
OBJ_DATA *portal_next;
ROOM_INDEX_DATA *pRoomIndex;
ROOM_INDEX_DATA *location;
char *pdesc;
int door;
bool found;
if (ch->desc == NULL && (wizard = ch->wizard) == NULL)
return;
if (ch->in_room == NULL)
return;
if (IS_SET (ch->war, WARRING))
{
if (ch->in_room->vnum > WHVNUM || ch->in_room->vnum < WLVNUM)
{
putbackinwar (ch);
return;
}
}
if (!IS_SET (ch->war, WARRING) && war->bits != 0)
{
if (ch->in_room->vnum > WLVNUM && ch->in_room->vnum < WHVNUM
&& !IS_IMMORTAL (ch))
{
smackdown (ch);
stc ("Stay out of the war!\n\r", ch);
return;
}
}
ch->last_room = ch->in_room;
if (ch->position < POS_SLEEPING)
{
send_to_char ("You can't see anything but stars!\n\r", ch);
return;
}
if (ch->position == POS_SLEEPING)
{
send_to_char ("You can't see anything, you're sleeping!\n\r", ch);
return;
}
if (!check_blind (ch))
return;
if (!IS_NPC (ch) && IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS)
&& !IS_ITEMAFF (ch, ITEMA_VISION) && !IS_IMMORTAL (ch) && (!IS_CLASS (ch, CLASS_DROW))
&& !(IS_CLASS(ch, CLASS_FAE) && IS_KITH (ch, KITH_SLUAGH))
&& !WORN_ARTIFACT (ch, ARTI_HEART_OF_DARKNESS) && !WORN_ARTIFACT (ch, ARTI_MASK_OF_THE_SUN))
{
send_to_char ("It is pitch black ... \n\r", ch);
return;
}
if (!IS_NPC (ch)
&& !IS_SET (ch->act, PLR_HOLYLIGHT)
&& !IS_ITEMAFF (ch, ITEMA_VISION)
&& !IS_VAMPAFF (ch, VAM_NIGHTSIGHT)
&& !IS_AFFECTED (ch, AFF_SHADOWPLANE)
&& !(ch->in_room != NULL && ch->in_room->vnum == ROOM_VNUM_IN_OBJECT
&& !IS_NPC (ch) && ch->pcdata->chobj != NULL
&& ch->pcdata->chobj->in_obj != NULL)
&& room_is_dark (ch->in_room))
{
send_to_char ("It is pitch black ... \n\r", ch);
show_char_to_char (ch->in_room->people, ch);
return;
}
argument = one_argument (argument, arg1);
argument = one_argument (argument, arg2);
if (arg1[0] == '\0' || !str_cmp (arg1, "auto"))
{
/* 'look' or 'look auto' */
if (IS_SET (ch->extra2, MAP) && IS_SET (ch->more, MORE_NODESC))
REMOVE_BIT (ch->extra2, MAP);
if (ch->in_room != NULL && ch->in_room->vnum == ROOM_VNUM_IN_OBJECT
&& !IS_NPC (ch) && ch->pcdata->chobj != NULL
&& ch->pcdata->chobj->in_obj != NULL)
act ("$p", ch, ch->pcdata->chobj->in_obj, NULL, TO_CHAR);
else if (IS_AFFECTED (ch, AFF_SHADOWPLANE) && !IS_SET (ch->extra2, MAP))
stc ("#eThe Shadow Plane#n\n\r", ch);
else if (IS_WRATED (ch, WRAT_DEATHPLANE)
&& !IS_SET (ch->extra2, MAP) && !IS_CLASS (ch, CLASS_WRAITH))
stc ("#eThe Death Plane#n\n\r", ch);
else if (IS_WRATED (ch, WRAT_DEATHPLANE)
&& !IS_SET (ch->extra2, MAP) && IS_CLASS (ch, CLASS_WRAITH))
stcprintf (ch, "#eThe Death Plane #w(%s)#n\n\r", ch->in_room->name);
else if (!IS_SET (ch->extra2, MAP)
&& !IS_WRATED(ch, WRAT_DEATHPLANE))
{
if (IS_IMMORTAL (ch) && IS_SET (ch->more, MORE_ROOMFLAGS))
{
sprintf (buf, "#g[%5d] #w%s #g[%s] [%s]#n\n\r", ch->in_room->vnum,
ch->in_room->name,
room_bit_name (ch->in_room->room_flags),
sector_name (ch->in_room->sector_type));
}
else
{
sprintf (buf, "#w%s\n\r", ch->in_room->name);
}
send_to_char (buf, ch);
}
if (!IS_NPC (ch) && IS_SET (ch->act, PLR_AUTOEXIT)
&& !IS_SET (ch->extra2, MAP))
do_exits (ch, "auto");
if (ch->in_room != NULL && ch->in_room->vnum == ROOM_VNUM_IN_OBJECT
&& !IS_NPC (ch) && ch->pcdata->chobj != NULL
&& ch->pcdata->chobj->in_obj != NULL)
{
act ("You are inside $p.", ch, ch->pcdata->chobj->in_obj, NULL,
TO_CHAR);
show_list_to_char (ch->pcdata->chobj->in_obj->contains, ch, FALSE,
FALSE);
}
else if ((arg1[0] == '\0' || !str_cmp (arg1, "auto"))
&& IS_AFFECTED (ch, AFF_SHADOWPLANE)
&& !IS_SET (ch->extra2, MAP))
send_to_char ("You are standing in complete darkness.\n\r", ch);
else if ((arg1[0] == '\0' || !str_cmp (arg1, "auto"))
&& IS_WRATED (ch, WRAT_DEATHPLANE)
&& !IS_SET (ch->extra2, MAP) && !IS_CLASS (ch, CLASS_WRAITH))
send_to_char( "Stenches of death and decay arise from around you.\n\r", ch );
else if ((!IS_NPC (ch) && !IS_SET (ch->more, MORE_NODESC))
&& (arg1[0] == '\0' || !str_cmp (arg1, "auto")))
{
if (IS_SET (ch->extra2, MAP))
{
char dbuf[MSL];
sprintf (dbuf, "#C%s#n", ch->in_room->description);
draw_map (ch, dbuf);
}
else if (ch->in_room->vnum == 2700 || ch->in_room->vnum == 3 || ch->in_room->vnum == 31000)
{
char dbuf[MSL];
sprintf (dbuf, "#C%s", ch->in_room->description);
stc (dbuf, ch);
}
else
{
char roombuf[MSL];
sprintf(roombuf, "#C%s#n", ch->in_room->description );
reformat_desc( roombuf, FALSE );
send_to_char(roombuf, ch);
//}
if (ch->in_room->sector_type != SECT_INSIDE && IS_OUTSIDE (ch))
{
if (number_range (0, 10) < 5)
{
if (weather_info.sky == SKY_RAINING)
send_to_char
("#cA cool wind howls and brings a light rain.#n\n\r",
ch);
else if (weather_info.sky == SKY_CLOUDY)
send_to_char ("#cA cold wind is blowing.#n\n\r", ch);
}
}
}
if (ch->in_room->blood == 1000)
sprintf (buf,
"You notice that the room is completely drenched in blood.\n\r");
else if (ch->in_room->blood > 750)
sprintf (buf,
"You notice that there is a very large amount of blood around the room.\n\r");
else if (ch->in_room->blood > 500)
sprintf (buf,
"You notice that there is a large quantity of blood around the room.\n\r");
else if (ch->in_room->blood > 250)
sprintf (buf,
"You notice a fair amount of blood on the floor.\n\r");
else if (ch->in_room->blood > 100)
sprintf (buf,
"You notice several blood stains on the floor.\n\r");
else if (ch->in_room->blood > 50)
sprintf (buf, "You notice a few blood stains on the floor.\n\r");
else if (ch->in_room->blood > 25)
sprintf (buf,
"You notice a couple of blood stains on the floor.\n\r");
else if (ch->in_room->blood > 0)
sprintf (buf,
"You notice a few drops of blood on the floor.\n\r");
else
sprintf (buf, "You notice nothing special in the room.\n\r");
ADD_COLOUR (ch, buf, L_RED);
if (ch->in_room->blood > 0)
send_to_char (buf, ch);
}
show_list_to_char (ch->in_room->contents, ch, FALSE, FALSE);
show_char_to_char (ch->in_room->people, ch);
return;
}
if (!str_cmp (arg1, "i") || !str_cmp (arg1, "in"))
{
/* 'look in' */
if (arg2[0] == '\0')
{
send_to_char ("Look in what?\n\r", ch);
return;
}
if ((obj = get_obj_here (ch, arg2)) == NULL)
{
send_to_char ("You do not see that here.\n\r", ch);
return;
}
switch (obj->item_type)
{
default:
send_to_char ("That is not a container.\n\r", ch);
break;
case ITEM_PORTAL:
case ITEM_WGATE:
pRoomIndex = get_room_index (obj->value[0]);
location = ch->in_room;
if (pRoomIndex == NULL)
{
send_to_char ("It doesn't seem to lead anywhere.\n\r", ch);
return;
}
if ((obj->value[2] == 1 || obj->value[2] == 3)
&& obj->item_type == ITEM_PORTAL)
{
send_to_char ("It seems to be closed.\n\r", ch);
return;
}
if (obj->item_type == ITEM_WGATE && !IS_CLASS (ch, CLASS_MAGE))
{
stc ("You gaze into the rift, but can see nothing.\n\r", ch);
return;
}
char_from_room (ch);
char_to_room (ch, pRoomIndex);
found = FALSE;
for (portal = ch->in_room->contents; portal != NULL;
portal = portal_next)
{
portal_next = portal->next_content;
if ((obj->value[0] == portal->value[3])
&& (obj->value[3] == portal->value[0]))
{
found = TRUE;
if (obj->item_type == ITEM_WGATE)
{
stc ("You peer through the magical rift...\n\r", ch);
}
if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
&& !IS_SET (portal->extra_flags, ITEM_SHADOWPLANE))
{
REMOVE_BIT (ch->affected_by, AFF_SHADOWPLANE);
do_look (ch, "auto");
SET_BIT (ch->affected_by, AFF_SHADOWPLANE);
break;
}
else if (!IS_AFFECTED (ch, AFF_SHADOWPLANE)
&& IS_SET (portal->extra_flags, ITEM_SHADOWPLANE))
{
SET_BIT (ch->affected_by, AFF_SHADOWPLANE);
do_look (ch, "auto");
REMOVE_BIT (ch->affected_by, AFF_SHADOWPLANE);
break;
}
else
{
do_look (ch, "auto");
break;
}
}
}
char_from_room (ch);
char_to_room (ch, location);
break;
case ITEM_DRINK_CON:
if (obj->value[1] <= 0)
{
send_to_char ("It is empty.\n\r", ch);
break;
}
if (obj->value[1] < obj->value[0] / 5)
sprintf (buf, "There is a little %s liquid left in it.\n\r",
liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0] / 4)
sprintf (buf, "It contains a small about of %s liquid.\n\r",
liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0] / 3)
sprintf (buf, "It's about a third full of %s liquid.\n\r",
liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0] / 2)
sprintf (buf, "It's about half full of %s liquid.\n\r",
liq_table[obj->value[2]].liq_color);
else if (obj->value[1] < obj->value[0])
sprintf (buf, "It is almost full of %s liquid.\n\r",
liq_table[obj->value[2]].liq_color);
else if (obj->value[1] == obj->value[0])
sprintf (buf, "It's completely full of %s liquid.\n\r",
liq_table[obj->value[2]].liq_color);
else
sprintf (buf, "Somehow it is MORE than full of %s liquid.\n\r",
liq_table[obj->value[2]].liq_color);
send_to_char (buf, ch);
break;
case ITEM_CONTAINER:
case ITEM_CORPSE_NPC:
case ITEM_CORPSE_PC:
if (IS_SET (obj->value[1], CONT_CLOSED))
{
send_to_char ("It is closed.\n\r", ch);
break;
}
act ("$p contains:", ch, obj, NULL, TO_CHAR);
show_list_to_char (obj->contains, ch, TRUE, TRUE);
break;
}
return;
}
if ((victim = get_char_room (ch, arg1)) != NULL)
{
show_char_to_char_1 (victim, ch);
if (IS_CLASS (victim, CLASS_DEMON)
&& IS_SET (victim->warp, WARP_TERROR))
{
send_to_char
("You scream in terror and run in a panic from what you just saw!\n\r",
ch);
if (ch->position == POS_FIGHTING)
do_flee (ch, "");
}
else
evil_eye (victim, ch);
return;
}
for (vch = char_list; vch != NULL; vch = vch_next)
{
vch_next = vch->next;
if (vch->in_room == NULL)
continue;
if (vch->in_room == ch->in_room)
{
if (!IS_NPC (vch) && !str_cmp (arg1, vch->morph))
{
show_char_to_char_1 (vch, ch);
evil_eye (vch, ch);
return;
}
continue;
}
}
if (!IS_NPC (ch) && ch->pcdata->chobj != NULL
&& ch->pcdata->chobj->in_obj != NULL)
{
obj = get_obj_in_obj (ch, arg1);
if (obj != NULL)
{
send_to_char (obj->description, ch);
send_to_char ("\n\r", ch);
return;
}
}
for (obj = ch->carrying; obj != NULL; obj = obj->next_content)
{
if (!IS_NPC (ch) && ch->pcdata->chobj != NULL && obj->chobj != NULL
&& obj->chobj == ch)
continue;
if (can_see_obj (ch, obj))
{
pdesc = get_extra_descr (arg1, obj->extra_descr);
if (pdesc != NULL)
{
send_to_char (pdesc, ch);
return;
}
pdesc = get_extra_descr (arg1, obj->pIndexData->extra_descr);
if (pdesc != NULL)
{
send_to_char (pdesc, ch);
return;
}
}
if (is_name (arg1, obj->name))
{
send_to_char (obj->description, ch);
send_to_char ("\n\r", ch);
return;
}
}
for (obj = ch->in_room->contents; obj != NULL; obj = obj->next_content)
{
if (!IS_NPC (ch) && ch->pcdata->chobj != NULL && obj->chobj != NULL
&& obj->chobj == ch)
continue;
if (can_see_obj (ch, obj))
{
pdesc = get_extra_descr (arg1, obj->extra_descr);
if (pdesc != NULL)
{
send_to_char (pdesc, ch);
return;
}
pdesc = get_extra_descr (arg1, obj->pIndexData->extra_descr);
if (pdesc != NULL)
{
send_to_char (pdesc, ch);
return;
}
}
if (is_name (arg1, obj->name))
{
send_to_char (obj->description, ch);
send_to_char ("\n\r", ch);
return;
}
}
pdesc = get_extra_descr (arg1, ch->in_room->extra_descr);
if (pdesc != NULL)
{
send_to_char (pdesc, ch);
return;
}
if (!str_cmp (arg1, "n") || !str_cmp (arg1, "north"))
door = 0;
else if (!str_cmp (arg1, "e") || !str_cmp (arg1, "east"))
door = 1;
else if (!str_cmp (arg1, "s") || !str_cmp (arg1, "south"))
door = 2;
else if (!str_cmp (arg1, "w") || !str_cmp (arg1, "west"))
door = 3;
else if (!str_cmp (arg1, "u") || !str_cmp (arg1, "up"))
door = 4;
else if (!str_cmp (arg1, "d") || !str_cmp (arg1, "down"))
door = 5;
else
{
send_to_char ("You do not see that here.\n\r", ch);
return;
}
/* 'look direction' */
if ((pexit = ch->in_room->exit[door]) == NULL)
{
send_to_char ("Nothing special there.\n\r", ch);
return;
}
/*
if ( pexit->description != NULL && pexit->description[0] != '\0' )
send_to_char( pexit->description, ch );
else
send_to_char( "Nothing special there.\n\r", ch );
*/
if (pexit->keyword != NULL && pexit->keyword[0] != '\0'
&& pexit->keyword[0] != ' ')
{
if (IS_SET (pexit->exit_info, EX_CLOSED))
{
act ("The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR);
}
else if (IS_SET (pexit->exit_info, EX_ISDOOR))
{
act ("The $d is open.", ch, NULL, pexit->keyword, TO_CHAR);
if ((pexit = ch->in_room->exit[door]) == NULL)
return;
if ((pRoomIndex = pexit->to_room) == NULL)
return;
location = ch->in_room;
char_from_room (ch);
char_to_room (ch, pRoomIndex);
do_look (ch, "auto");
char_from_room (ch);
char_to_room (ch, location);
}
else
{
if ((pexit = ch->in_room->exit[door]) == NULL)
return;
if ((pRoomIndex = pexit->to_room) == NULL)
return;
location = ch->in_room;
char_from_room (ch);
char_to_room (ch, pRoomIndex);
do_look (ch, "auto");
char_from_room (ch);
char_to_room (ch, location);
}
}
else
{
if ((pexit = ch->in_room->exit[door]) == NULL)
return;
if ((pRoomIndex = pexit->to_room) == NULL)
return;
location = ch->in_room;
char_from_room (ch);
char_to_room (ch, pRoomIndex);
do_look (ch, "auto");
char_from_room (ch);
char_to_room (ch, location);
}
return;
}
void do_examine (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
OBJ_DATA *obj;
one_argument (argument, arg);
if (arg[0] == '\0')
{
send_to_char ("Examine what?\n\r", ch);
return;
}
do_look (ch, arg);
if ((obj = get_obj_here (ch, arg)) != NULL)
{
if (obj->condition >= 100)
sprintf (buf, "You notice that %s is in perfect condition.\n\r",
obj->short_descr);
else if (obj->condition >= 75)
sprintf (buf, "You notice that %s is in good condition.\n\r",
obj->short_descr);
else if (obj->condition >= 50)
sprintf (buf, "You notice that %s is in average condition.\n\r",
obj->short_descr);
else if (obj->condition >= 25)
sprintf (buf, "You notice that %s is in poor condition.\n\r",
obj->short_descr);
else
sprintf (buf, "You notice that %s is in awful condition.\n\r",
obj->short_descr);
send_to_char (buf, ch);
switch (obj->item_type)
{
default:
break;
case ITEM_DRINK_CON:
case ITEM_CONTAINER:
case ITEM_CORPSE_NPC:
case ITEM_CORPSE_PC:
send_to_char ("When you look inside, you see:\n\r", ch);
sprintf (buf, "in %s", arg);
do_look (ch, buf);
}
}
return;
}
/*
* Thanks to Zrin for auto-exit part.
*/
void do_exits (CHAR_DATA * ch, char *argument)
{
extern char *const dir_name[];
char buf[MAX_STRING_LENGTH];
char tempbuf[MSL];
EXIT_DATA *pexit;
bool found;
bool fAuto;
int door;
buf[0] = '\0';
fAuto = !str_cmp (argument, "auto");
if (!check_blind (ch))
return;
strcpy (buf, fAuto ? "#w[Exits:#n" : "Obvious exits:\n\r");
found = FALSE;
for (door = 0; door <= 5; door++)
{
if ((pexit = ch->in_room->exit[door]) != NULL && pexit->to_room != NULL)
// && !IS_SET (pexit->exit_info, EX_CLOSED))
{
found = TRUE;
if (fAuto)
{
strcat (buf, "#w ");
if (IS_SET (pexit->exit_info, EX_CLOSED))
{
sprintf (tempbuf, "<SEND href=\"%s\">(%s)</SEND>",
exit_name[door], dir_name[door]);
strcat (buf, tempbuf);
}
else if (!IS_SET (pexit->exit_info, EX_CLOSED))
{
sprintf (tempbuf, "<SEND href=\"%s\">%s</SEND>",
exit_name[door], dir_name[door]);
strcat (buf, tempbuf);
}
}
else
{
if (!IS_NPC (ch) && IS_IMMORTAL (ch))
{
sprintf (buf + strlen (buf), "%-5s #w- %s #w(#g%d#w)#n\n\r",
dir_name2[door], pexit->to_room->name,
pexit->to_room->vnum);
}
else if (IS_SET (pexit->exit_info, EX_CLOSED))
{
sprintf (buf + strlen (buf), "#w%-5s - %s (Closed door)\n\r",
dir_name2[door], pexit->to_room->name);
}
else if (IS_SET (world_affects, WORLD_FOG))
{
sprintf (buf + strlen (buf),
"#w%-5s - Too foggy to tell.#n\n\r", dir_name2[door]);
}
else if (!IS_NPC (ch) && IS_VAMPAFF (ch, VAM_NIGHTSIGHT))
{
sprintf (buf + strlen (buf), "%-5s #w- %s\n\r",
dir_name2[door], pexit->to_room->name);
}
else
sprintf (buf + strlen (buf), "#w%-5s - %s#n\n\r",
dir_name2[door],
room_is_dark (pexit->to_room) ? "#wToo dark to tell#n"
: pexit->to_room->name);
}
}
}
if (!found)
strcat (buf, fAuto ? " #wnone#n" : "#wNone.#n\n\r");
if (fAuto)
strcat (buf, "#w]#n\n\r");
mxp_to_char (ch, buf, MXP_ALL);
return;
}
void do_applytokens( CHAR_DATA *ch, char *argument )
{
OBJ_DATA *obj = NULL;
char arg1[MIL];
char arg2[MIL];
int apply;
argument = one_argument(argument, arg1);
argument = one_argument(argument, arg2);
if (IS_NPC(ch)) return;
if ( arg1[0] == '\0' || arg2[0] == '\0' )
{
send_to_char("Syntax : applytoken <hitroll/damroll/ac/hp/mana/move> <item>\n\r",ch);
return;
}
if (!(obj = get_obj_carry(ch, arg2)))
{
send_to_char( "You are not carrying that item.\n\r", ch );
return;
}
if (obj->item_type != ITEM_WEAPON && obj->item_type != ITEM_ARMOR)
{
send_to_char("You can only apply tokens to weapons and armor.\n\r", ch);
return;
}
if (IS_OBJ_STAT (obj, ITEM_APPLYT))
{
stc("A token has already been applied to that item.\n\r",ch);
return;
}
if (!str_cmp(arg1,"hitroll")) apply = 0;
else if (!str_cmp(arg1,"damroll")) apply = 1;
else if (!str_cmp(arg1,"ac")) apply = 2;
else if (!str_cmp(arg1,"hp")) apply = 3;
else if (!str_cmp(arg1,"mana")) apply = 4;
else if (!str_cmp(arg1,"move")) apply = 5;
else { stc("Not a valid apply.\n\r",ch); return; }
if (ch->tokens[apply] < 1) { send_to_char("You don't have a token to cover that.\n\r",ch); return; }
if (apply == 0) affect_to_obj (obj, -1, APPLY_HITROLL, 20);
else if (apply == 1) affect_to_obj (obj, -1, APPLY_DAMROLL, 20);
else if (apply == 2) affect_to_obj (obj, -1, APPLY_AC, -100);
else if (apply == 3) affect_to_obj (obj, -1, APPLY_HIT, -100);
else if (apply == 4) affect_to_obj (obj, -1, APPLY_MANA, -100);
else if (apply == 5) affect_to_obj (obj, -1, APPLY_MOVE, -100);
else {
stc("You cannot apply that token.\n\rYou most likely need an immortal to redeem that token.\n\r",ch);
return;
}
SET_BIT(obj->extra_flags, ITEM_APPLYT);
ch->tokens[apply] -= 1;
stc("You have applied a token to an object!\n\r",ch);
return;
}
void do_tokens (CHAR_DATA * ch, char *argument)
{
char buf[MSL];
stc("#r[#w Tokens #r]#n\n\r",ch);
stc("#r[#e-=-=-=-=-=-=-=-#r]#n\n\r",ch);
sprintf(buf,"#r[#o Hitroll#C:#G %-3d #r]#n\n\r",ch->tokens[0]);
stc(buf,ch);
sprintf(buf,"#r[#o Damroll#C:#G %-3d #r]#n\n\r",ch->tokens[1]);
stc(buf,ch);
sprintf(buf,"#r[#o AC#C:#G %-3d #r]#n\n\r",ch->tokens[2]);
stc(buf,ch);
sprintf(buf,"#r[#o -Hp#C:#G %-3d #r]#n\n\r",ch->tokens[3]);
stc(buf,ch);
sprintf(buf,"#r[#o -Mana#C:#G %-3d #r]#n\n\r",ch->tokens[4]);
stc(buf,ch);
sprintf(buf,"#r[#o -Move#C:#G %-3d #r]#n\n\r",ch->tokens[5]);
stc(buf,ch);
sprintf(buf,"#r[#o Wear#C:#G %-3d #r]#n\n\r",ch->tokens[6]);
stc(buf,ch);
sprintf(buf,"#r[#o Rename#C:#G %-3d #r]#n\n\r",ch->tokens[7]);
stc(buf,ch);
stc("#r[#e-=-=-=-=-=-=-=-#r]#n\n\r",ch);
sprintf(buf,"#r[#G Owner#C:#R %-3d #r]#n\n\r",ch->tokens[8]);
stc(buf,ch);
sprintf(buf,"#r[#G Imp#C:#P %-3d #r]#n\n\r",ch->tokens[9]);
stc(buf,ch);
sprintf(buf,"#r[#G HJ#C:#o %-3d #r]#n\n\r",ch->tokens[10]);
stc(buf,ch);
stc("#r[#e-=-=-=-=-=-=-=-#r]#n\n\r",ch);
return;
}
DO_COM (do_tokencount)
{
OBJ_DATA *obj;
char buf[MAX_STRING_LENGTH];
int num=0;
int owner=0,imp=0,hj=0, stat=0;
if (IS_NPC (ch))
return;
for (obj = object_list; obj != NULL; obj = obj->next)
{
// if (obj->item_type != ITEM_NEWTOKEN) continue;
// if (obj->item_type == ITEM_NEWTOKEN) num++;
if (obj->item_type == ITEM_NEWTOKEN)
{
if ((obj->carried_by != NULL) && (!IS_NPC (obj->carried_by)) && obj->value[0] <= 8) num -= 1;
if ((obj->carried_by != NULL) && (!IS_NPC (obj->carried_by)) && obj->value[0] == 9) hj -= 1;
if ((obj->carried_by != NULL) && (!IS_NPC (obj->carried_by)) && obj->value[0] == 10) imp -= 1;
if ((obj->carried_by != NULL) && (!IS_NPC (obj->carried_by)) && obj->value[0] == 11) owner -= 1;
}
//if ((obj->carried_by != NULL) && (!IS_NPC (obj->carried_by)) && obj->item_type == ITEM_STOKEN) stat -= 1;
if (obj->item_type == ITEM_NEWTOKEN)
{
if (obj->value[0] == 9) { hj++; }
if (obj->value[0] == 10) { imp++; }
if (obj->value[0] == 11) { owner++; }
if (obj->item_type == ITEM_NEWTOKEN) { num++; }
}
if (obj->item_type == ITEM_STOKEN) { stat++; }
}
sprintf(buf,"There are %d status tokens scattered throughout the world.\n\r",stat);
stc(buf,ch);
sprintf(buf,"There are %d enhancement tokens scattered throughout the world.\n\r",num);
stc(buf,ch);
sprintf(buf,"There are %d owner tokens scattered throughout the world.\n\r",owner);
stc(buf,ch);
sprintf(buf,"There are %d implementor tokens scattered throughout the world.\n\r",imp);
stc(buf,ch);
sprintf(buf,"There are %d high judge tokens scattered throughout the world.\n\r",hj);
stc(buf,ch);
return;
}
void do_score (CHAR_DATA * ch, char *argument)
{
int online = 0;
int total = 0;
int a_c = char_ac (ch);
float chtier;
float chtierexp;
int percent;
int nexttier;
char buf[MAX_STRING_LENGTH];
char hit_str[MAX_INPUT_LENGTH];
char mana_str[MAX_INPUT_LENGTH];
char move_str[MAX_INPUT_LENGTH];
char mhit_str[MAX_INPUT_LENGTH];
char mmana_str[MAX_INPUT_LENGTH];
char mmove_str[MAX_INPUT_LENGTH];
char exp_str[MAX_INPUT_LENGTH];
int days;
int hours;
int minutes;
int seconds;
online = (int) (current_time - ch->logon);
total = ch->played + online;
sprintf (hit_str, "%d", ch->hit);
COL_SCALE (hit_str, ch, ch->hit, ch->max_hit);
sprintf (mana_str, "%d", ch->mana);
COL_SCALE (mana_str, ch, ch->mana, ch->max_mana);
sprintf (move_str, "%d", ch->move);
COL_SCALE (move_str, ch, ch->move, ch->max_move);
sprintf (exp_str, "%lli", ch->exp);
COL_SCALE (exp_str, ch, ch->exp, 1000);
sprintf (mhit_str, "%d", ch->max_hit);
ADD_COLOUR (ch, mhit_str, L_CYAN);
sprintf (mmana_str, "%d", ch->max_mana);
ADD_COLOUR (ch, mmana_str, L_CYAN);
sprintf (mmove_str, "%d", ch->max_move);
ADD_COLOUR (ch, mmove_str, L_CYAN);
if (IS_NPC (ch))
return;
if (!IS_NPC (ch)
&& (IS_EXTRA (ch, EXTRA_OSWITCH) || IS_HEAD (ch, LOST_HEAD)))
{
obj_score (ch, ch->pcdata->chobj);
return;
}
loc_to_char (ch);
sprintf (buf, " #wName:#n %s%-15s#n.\n\r", ch->name,
IS_NPC (ch) ? "" : ch->pcdata->title);
send_to_char (buf, ch);
if (!IS_NPC (ch))
{
sprintf (buf, " #wCreated:#n %s\n\r", ch->createtime);
send_to_char (buf, ch);
}
if (!IS_NPC (ch))
birth_date (ch, TRUE);
if (!IS_NPC (ch) && IS_EXTRA (ch, EXTRA_PREGNANT))
birth_date (ch, FALSE);
days = (total / 86400);
hours = ((total / 3600) % 24);
minutes = ((total / 60) % 60);
seconds = (total % 60);
sprintf (buf,
" #wPlayed:#n %d day%s, %d hour%s, %d minute%s, and %d second%s\n\r",
days, days == 1 ? "" : "s", hours, hours == 1 ? "" : "s", minutes,
minutes == 1 ? "" : "s", seconds, seconds == 1 ? "" : "s");
send_to_char (buf, ch);
hours = ((online / 3600));
minutes = ((online / 60) % 60);
seconds = (online % 60);
sprintf (buf,
" #wThis Session:#n %d hour%s, %d minute%s, and %d second%s\n\r",
hours, hours == 1 ? "" : "s", minutes, minutes == 1 ? "" : "s",
seconds, seconds == 1 ? "" : "s");
send_to_char (buf, ch);
if (get_trust (ch) != ch->level)
{
divide7_to_char (ch);
sprintf (buf, " #wTrust:#n %d.\n\r", get_trust (ch));
send_to_char (buf, ch);
}
divide7_to_char (ch);
sprintf (buf,
" #wHP:#n %s/%s. #wMANA:#n %s/%s. #wMOVE:#n %s/%s. #wPrimal:#n %d.\n\r",
hit_str, mhit_str, mana_str, mmana_str, move_str, mmove_str,
ch->practice);
send_to_char (buf, ch);
sprintf (buf,
" #wCarrying:#n %d/%d items. #wCarried Weight:#n %d/%d kg.",
ch->carry_number, can_carry_n (ch), ch->carry_weight,
can_carry_w (ch));
send_to_char (buf, ch);
stcprintf (ch, " #wPage Length: #n%d.\n\r", ch->pcdata->pagelen);
sprintf (buf,
" #wStr:#n %d (%d) #wInt: #n%d (%d) #wWis:#n %d (%d) #wDex:#n %d (%d) #wCon:#n %d (%d).\n\r",
get_curr_str (ch), ch->pcdata->perm_str, get_curr_int (ch),
ch->pcdata->perm_int, get_curr_wis (ch), ch->pcdata->perm_wis,
get_curr_dex (ch), ch->pcdata->perm_dex, get_curr_con (ch),
ch->pcdata->perm_con);
send_to_char (buf, ch);
sprintf (buf, " #wEXP:#n %lli. #wGold:#n %d. #wQuest Points: #n%d.",
ch->exp, ch->gold, ch->pcdata->quest);
send_to_char (buf, ch);
sprintf (buf, "#w Tier Points:#n %d.\n\r", ch->tpoints);
stc (buf, ch);
divide7_to_char (ch);
sprintf (buf,
" #wAutoexit:#n [%s] #wAutoloot:#n [%s] #wAutosac:#n [%s] #wAutogold#n [%s] #wShields#n [%s]\n\r",
(!IS_NPC (ch) && IS_SET (ch->act, PLR_AUTOEXIT)) ? "X" : " ",
(!IS_NPC (ch) && IS_SET (ch->act, PLR_AUTOLOOT)) ? "X" : " ",
(!IS_NPC (ch)
&& IS_SET (ch->act, PLR_AUTOSAC)) ? "X" : " ", (!IS_NPC (ch)
&&
IS_SET (ch->more,
PLR_AUTOGOLD))
? "X" : " ", (!IS_NPC (ch)
&& IS_SET (ch->more, MORE_SHIELDS)) ? "X" : " ");
send_to_char (buf, ch);
sprintf (buf,
" #wNo Summon:#n[%s] #wNo Transport:#n[%s] #wNo Desc:#n [%s] #wAnsiColor:#n [%s]\n\r",
/* #wBackup#n [%s]\n\r",*/
!IS_SET (ch->immune, IMM_SUMMON) ? "X" : " ", !IS_SET (ch->immune,
IMM_TRANSPORT)
? "X" : " ", IS_SET (ch->more, MORE_NODESC) ? "X" : " ",
IS_SET (ch->act, PLR_ANSI) ? "X" : " ");
//IS_SET (ch->act, PLR_AUTOBACKUP) ? "X" : " ");
stc (buf, ch);
sprintf (buf,
" #wMCCP:#n [%s] #wMXP:#n [%s] #wUsing MXP:#n [%s]\n\r",
ch->desc->out_compress ? "X" : " ", ch->desc->mxp ? "X" : " ",
USE_MXP (ch) ? "X" : " ");
stc (buf, ch);
if (IS_IMMORTAL (ch))
{
sprintf (buf,
" #wWizinvis:#n [%s] #wIncog:#n [%s] #wInvis Level:#n[%d].\n\r",
(!IS_NPC (ch)
&& IS_SET (ch->act, PLR_WIZINVIS)) ? "X" : " ", (!IS_NPC (ch)
&&
IS_SET
(ch->act,
PLR_INCOG))
? "X" : " ", ch->pcdata->wizinvis);
send_to_char (buf, ch);
}
if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_DRAGON))
{
divide7_to_char (ch);
sprintf (buf, "#w Dragon Points: #n %d.\n\r",
ch->pcdata->stats[DEMON_CURRENT]);
send_to_char (buf, ch);
}
if (!IS_NPC (ch)
&& (IS_CLASS (ch, CLASS_DEMON) || IS_SET (ch->special, SPC_CHAMPION)))
{
divide7_to_char (ch);
sprintf (buf,
" #wCurrent Demonic Power:#n %d. #wMax Demonic Power:#n %d.\n\r",
ch->pcdata->stats[DEMON_CURRENT],
ch->pcdata->stats[DEMON_TOTAL]);
send_to_char (buf, ch);
}
if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_DROW))
{
divide7_to_char (ch);
sprintf (buf, " #wDrow Points:#n %d.\n\r",
ch->pcdata->stats[DROW_POWER]);
send_to_char (buf, ch);
sprintf (buf, " #wMagic Resistance:#n %d.\n\r",
ch->pcdata->stats[DROW_MAGIC]);
send_to_char (buf, ch);
}
if (ch->level > 2)
{
divide7_to_char (ch);
sprintf (buf, " #w[Arena Stats] Wins: #n%d. #wLosses:#n %d.\n\r",
ch->awins, ch->alosses);
send_to_char (buf, ch);
if (ch->challenged != NULL)
{
if (IS_SET (ch->flag2, AFF2_CHALLENGED))
{
sprintf (buf, " #w[Arena]#n You have been challenged by %s.\n\r",
ch->challenged->name);
send_to_char (buf, ch);
}
if (IS_SET (ch->flag2, AFF2_CHALLENGER))
{
sprintf (buf, " #w[Arena]#n You have challenged %s.\n\r",
ch->challenged->name);
send_to_char (buf, ch);
}
}
if (ch->gladiator != NULL)
{
sprintf (buf, " #w[Arena Bet]#n You have a %d QP bet on %s\n\r",
ch->pcdata->plr_wager, ch->gladiator->name);
send_to_char (buf, ch);
}
}
switch (ch->position)
{
case POS_DEAD:
send_to_char (" #wPosition:#n DEAD!!", ch);
break;
case POS_MORTAL:
send_to_char (" #wPosition:#n MORTALLY WOUNDED.", ch);
break;
case POS_INCAP:
send_to_char (" #wPosition:#n Incapacitated.", ch);
break;
case POS_STUNNED:
send_to_char (" #wPosition:#n Stunned.", ch);
break;
case POS_SLEEPING:
send_to_char (" #wPosition:#n Sleeping.", ch);
break;
case POS_RESTING:
send_to_char (" #wPosition:#n Resting.", ch);
break;
case POS_MEDITATING:
send_to_char (" #wPosition:#n Meditating.", ch);
break;
case POS_SITTING:
send_to_char (" #wPosition:#n Sitting.", ch);
break;
case POS_STANDING:
send_to_char (" #wPosition:#n Standing.", ch);
break;
case POS_FIGHTING:
send_to_char (" #wPosition:#n Fighting.", ch);
break;
}
if ((ch->pcdata->condition[COND_DRUNK] > 10
|| ch->pcdata->condition[COND_THIRST] == 0
|| ch->pcdata->condition[COND_FULL] == 0))
send_to_char (" #wCondition:#n", ch);
if (!IS_NPC (ch) && ch->pcdata->condition[COND_DRUNK] > 10)
send_to_char (" Drunk", ch);
if (!IS_NPC (ch) && ch->pcdata->condition[COND_THIRST] == 0)
send_to_char (" Thirsty", ch);
if (!IS_NPC (ch) && ch->pcdata->condition[COND_FULL] == 0)
send_to_char (" Hungry", ch);
sprintf (buf, " #wWimpy:#n %d.", ch->wimpy);
if (!IS_NPC (ch) && IS_EXTRA (ch, EXTRA_DONE))
strcat (buf, " Non-Virgin.\n\r");
else
strcat (buf, "\n\r");
send_to_char (buf, ch);
if (!IS_NPC (ch) && ch->pcdata->stage[0] >= 100)
send_to_char (" You are feeling extremely horny.\n\r", ch);
else if (!IS_NPC (ch) && ch->pcdata->stage[0] >= 50)
send_to_char (" You are feeling pretty randy.\n\r", ch);
else if (!IS_NPC (ch) && ch->pcdata->stage[0] >= 1)
send_to_char (" You are feeling rather kinky.\n\r", ch);
divide7_to_char (ch);
if (ch->level >= 0)
{
sprintf (buf, " #wAC:#n %d ", a_c);
send_to_char (buf, ch);
}
send_to_char ("#w:#n ", ch);
if (a_c >= 101)
send_to_char ("Naked!\n\r", ch);
else if (a_c >= 80)
send_to_char ("Barely clothed.\n\r", ch);
else if (a_c >= 60)
send_to_char ("Wearing clothes.\n\r", ch);
else if (a_c >= 40)
send_to_char ("Slightly armored.\n\r", ch);
else if (a_c >= 20)
send_to_char ("Somewhat armored.\n\r", ch);
else if (a_c >= 0)
send_to_char ("Armored.\n\r", ch);
else if (a_c >= -50)
send_to_char ("Well armored.\n\r", ch);
else if (a_c >= -100)
send_to_char ("Strongly armored.\n\r", ch);
else if (a_c >= -250)
send_to_char ("Heavily armored.\n\r", ch);
else if (a_c >= -500)
send_to_char ("Superbly armored.\n\r", ch);
else if (a_c >= -749)
send_to_char ("Divinely armored.\n\r", ch);
else
send_to_char ("Ultimately armored!\n\r", ch);
sprintf (buf,
" #wHitroll:#n %d. #wDamroll:#n %d. #wDamcap:#n %d. #wSave vs Spell:#n %d.",
char_hitroll (ch), char_damroll (ch), ch->damcap[0],
ch->saving_throw);
send_to_char (buf, ch);
if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_VAMPIRE))
{
sprintf (buf, "\n\r #wBlood:#n %d.", ch->pcdata->condition[COND_THIRST]);
send_to_char (buf, ch);
sprintf (buf, " #wBeast:#n %d. ", ch->beast);
send_to_char (buf, ch);
if (ch->beast < 0)
send_to_char ("You are a cheat!\n\r", ch);
else if (ch->beast == 0)
send_to_char ("You have attained Golconda!\n\r", ch);
else if (ch->beast <= 5)
send_to_char ("You have almost reached Golconda!\n\r", ch);
else if (ch->beast <= 10)
send_to_char ("You are nearing Golconda!\n\r", ch);
else if (ch->beast <= 15)
send_to_char ("You have great control over your beast.\n\r", ch);
else if (ch->beast <= 20)
send_to_char
("Your beast has little influence over your actions.\n\r", ch);
else if (ch->beast <= 30)
send_to_char ("You are in control of your beast.\n\r", ch);
else if (ch->beast <= 40)
send_to_char ("You are able to hold back the beast.\n\r", ch);
else if (ch->beast <= 60)
send_to_char
("You are constantly struggling for control of your beast.\n\r",
ch);
else if (ch->beast <= 75)
send_to_char ("Your beast has great control over your actions.\n\r",
ch);
else if (ch->beast <= 90)
send_to_char ("The power of the beast overwhelms you.\n\r", ch);
else if (ch->beast <= 99)
send_to_char ("You have almost lost your battle with the beast!\n\r",
ch);
else
send_to_char ("The beast has taken over!\n\r", ch);
}
else if (!IS_CLASS (ch, CLASS_VAMPIRE))
send_to_char ("\n\r", ch);
if (ch->level >= 0)
{
divide7_to_char (ch);
sprintf (buf, " #wAlignment:#n %d ", ch->alignment);
send_to_char (buf, ch);
}
send_to_char ("#w:#n", ch);
if (ch->alignment > 900)
send_to_char ("Angelic.", ch);
else if (ch->alignment > 700)
send_to_char ("Saintly.", ch);
else if (ch->alignment > 350)
send_to_char ("Good.", ch);
else if (ch->alignment > 100)
send_to_char ("Kind.", ch);
else if (ch->alignment > -100)
send_to_char ("Neutral.", ch);
else if (ch->alignment > -350)
send_to_char ("Mean.", ch);
else if (ch->alignment > -700)
send_to_char ("Evil.", ch);
else if (ch->alignment > -900)
send_to_char ("Demonic.", ch);
else
send_to_char ("Satanic.", ch);
if (!IS_NPC (ch) && ch->level >= 0)
{
sprintf (buf, " #wStatus:#n %d. ", ch->race);
send_to_char (buf, ch);
}
if (!IS_NPC (ch))
send_to_char ("You are ", ch);
if (!IS_NPC (ch) && ch->level == 1)
send_to_char ("a Newbie.\n\r", ch);
else if (!IS_NPC (ch) && ch->level == 2)
send_to_char ("a Mortal.\n\r", ch);
else if (!IS_NPC (ch) && ch->level == 7)
send_to_char ("a Newbie Helper.\n\r", ch);
else if (!IS_NPC (ch) && ch->level == 8)
send_to_char ("a Builder.\n\r", ch);
else if (!IS_NPC (ch) && ch->level == 9)
send_to_char ("an Enforcer.\n\r", ch);
else if (!IS_NPC (ch) && ch->level == 10)
send_to_char ("a Judge.\n\r", ch);
else if (!IS_NPC (ch) && ch->level == 11)
send_to_char ("a High Judge.\n\r", ch);
else if (!IS_NPC (ch) && ch->level == 12)
send_to_char ("an Implementor.\n\r", ch);
else if (!IS_NPC (ch) && ch->level == 12)
send_to_char ("a Co-Owner.\n\r", ch);
else if (!str_cmp (ch->name, "Tijer"))
stc ("the Owner of the Mud.\n\r", ch);
else if (!IS_NPC (ch) && ch->race <= 0)
send_to_char ("an Avatar.\n\r", ch);
else if (ch->race <= 4)
send_to_char ("a Peasant.\n\r", ch);
else if (ch->race <= 9)
send_to_char ("a Page.\n\r", ch);
else if (ch->race <= 14)
send_to_char ("a Apprentice.\n\r", ch);
else if (ch->race <= 19)
send_to_char ("a Scout.\n\r", ch);
else if (ch->race <= 24)
send_to_char ("a Soldier.\n\r", ch);
else if (ch->race <= 29)
send_to_char ("a Lieutenant.\n\r", ch);
else if (ch->race <= 34)
send_to_char ("a Captain.\n\r", ch);
else if (ch->race <= 39)
send_to_char ("a Major.\n\r", ch);
else if (ch->race <= 44)
send_to_char ("a General.\n\r", ch);
else if (ch->race <= 49)
send_to_char ("a Knight.\n\r", ch);
else if ((ch->race <= 54) && (ch->sex == SEX_FEMALE))
send_to_char ("a Lady.\n\r", ch);
else if ((ch->race <= 54) && (ch->sex == SEX_MALE))
send_to_char ("a Lord.\n\r", ch);
else if ((ch->race <= 59) && (ch->sex == SEX_FEMALE))
send_to_char ("a Baroness.\n\r", ch);
else if ((ch->race <= 59) && (ch->sex == SEX_MALE))
send_to_char ("a Baron.\n\r", ch);
else if ((ch->race <= 64) && (ch->sex == SEX_FEMALE))
stc ("a Viscountess.\n\r", ch);
else if ((ch->race <= 64) && (ch->sex == SEX_MALE))
stc ("a Viscount.\n\r", ch);
else if ((ch->race <= 69) && (ch->sex == SEX_FEMALE))
send_to_char ("a Countess.\n\r", ch);
else if ((ch->race <= 69) && (ch->sex == SEX_MALE))
send_to_char ("an Earl.\n\r", ch);
else if ((ch->race <= 74) && (ch->sex == SEX_FEMALE))
send_to_char ("a Duchess.\n\r", ch);
else if ((ch->race <= 74) && (ch->sex == SEX_MALE))
send_to_char ("a Duke.\n\r", ch);
else if ((ch->race <= 79) && (ch->sex == SEX_FEMALE))
send_to_char ("a Princess.\n\r", ch);
else if ((ch->race <= 79) && (ch->sex == SEX_MALE))
send_to_char ("a Prince.\n\r", ch);
else if ((ch->race >= 80) && (ch->sex == SEX_FEMALE))
send_to_char ("a Queen.\n\r", ch);
else if ((ch->race >= 80) && (ch->sex == SEX_MALE))
stc ("a King.\n\r", ch);
if (!IS_NPC (ch) && (get_hours (ch) < 6))
{
sprintf (buf, " #wYou receive Newbie Experience.\n\r");
stc (buf, ch);
}
else if (!IS_NPC (ch) && (get_hours (ch) < 10)
&& !IS_SET (ch->extra2, PKREADY))
{
sprintf (buf, " #wYou are safe from Player Killing.\n\r");
stc (buf, ch);
}
if (!IS_NPC (ch))
{
if (strlen (ch->pcdata->decapped) > 3)
{
sprintf (buf, " #wLast Decap: #n%s.\n\r", ch->pcdata->decapped);
stc (buf, ch);
}
if (strlen (ch->pcdata->decappedby) > 3)
{
sprintf (buf, " #wLast Decapped by:#n %s.\n\r",
ch->pcdata->decappedby);
stc (buf, ch);
}
}
if (!IS_NPC (ch) && ch->lstatus > 0)
{
sprintf (buf, " #wLegend Status:#n %d.", ch->lstatus);
send_to_char (buf, ch);
}
if (!IS_NPC (ch))
{
chtier = ch->tier;
chtierexp = ch->tierxp;
percent = (chtierexp / (chtier * 100000.00)) * 100.00;
nexttier = (ch->tier + 1);
sprintf (buf, " #wTier Level:#n %d.", ch->tier);
stc (buf, ch);
if (nexttier > 250)
nexttier = 250;
if (ch->tier < 250)
{
sprintf (buf, " %d%% of the way to be Tier %d. \n\r", percent,
nexttier);
stc (buf, ch);
}
}
if (ch->fight_timer > 0)
{
sprintf (buf, " #wFight Timer:#n %d seconds remaining.\n\r",
ch->fight_timer);
send_to_char (buf, ch);
}
if (ch->class != 0 && ch->pcdata->gpoints > 0)
{
sprintf (buf, " #wGeneration Points: #n%d.\n\r", ch->pcdata->gpoints);
stc (buf, ch);
}
if (ch->paradox[1] > 0)
{
sprintf (buf, " #wParadox Points:#n %d.\n\r", ch->paradox[1]);
stc (buf, ch);
}
divide7_to_char (ch);
if (!IS_NPC (ch))
{
sprintf (buf, " #wMob Kills:#n %d. #wMob Deaths:#n %d.", ch->mkill,
ch->mdeath);
send_to_char (buf, ch);
sprintf (buf, " #wPlayer Kills:#n %d. #wPlayer Deaths:#n %d.\n\r",
ch->pkill, ch->pdeath);
send_to_char (buf, ch);
sprintf (buf,
"#w AQuests Completed:#n %d. #wAQuests Failed: #n%d.\n\r",
ch->questcomp,
ch->questfail);
stc (buf, ch);
sprintf (buf,
"#w Quests Completed:#n %lli. #wEarned Questpoints: #n%lli.\n\r",
ch->pcdata->score[SCORE_NUM_QUEST],
ch->pcdata->score[SCORE_QUEST]);
stc (buf, ch);
}
if (!IS_NPC (ch))
{
if (IS_CLASS (ch, CLASS_WEREWOLF)
&& ch->pcdata->powers[WPOWER_SILVER] > 0)
{
sprintf (buf, " #wSilver Tolerance:#n %d. ",
ch->pcdata->powers[WPOWER_SILVER]);
send_to_char (buf, ch);
}
if (IS_CLASS (ch, CLASS_WEREWOLF))
{
sprintf (buf, " #wGnosis:#n %d/%d\n\r", ch->gnosis[GCURRENT],
ch->gnosis[GMAXIMUM]);
send_to_char (buf, ch);
}
if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_MONK))
{
divide7_to_char (ch);
sprintf (buf,
"#w Block counter:#n %d. #wCurrent Chi:#n %d. #wMaximum Chi:#n %d. \n\r",
ch->monkblock, ch->chi[CURRENT], ch->chi[MAXIMUM]);
stc (buf, ch);
}
if (IS_CLASS (ch, CLASS_DRAGON))
{
sprintf (buf,
" #wDragon Age: #nAffecting Hitroll and Damroll by +%d.\n\r",
GET_AGE(ch) * 20);
send_to_char (buf, ch);
}
if (IS_CLASS (ch, CLASS_NINJA))
{
sprintf (buf, " #wKI:#n %d/150.\n\r", ch->pcdata->powers[NINJAKI]);
stc (buf, ch);
}
if (IS_CLASS (ch, CLASS_VAMPIRE) && ch->pcdata->stats[UNI_RAGE] > 0)
{
sprintf (buf,
" #wBeasting:#n Affecting Hitroll and Damroll by +%d.\n\r",
ch->pcdata->stats[UNI_RAGE]);
send_to_char (buf, ch);
}
else if (IS_SET (ch->special, SPC_WOLFMAN)
&& ch->pcdata->stats[UNI_RAGE] > 0)
{
sprintf (buf,
" #wWolf Rage:#n Affecting Hitroll and Damroll by +%d.\n\r",
ch->pcdata->stats[UNI_RAGE]);
send_to_char (buf, ch);
}
else if (IS_CLASS (ch, CLASS_NINJA) && ch->pcdata->stats[UNI_RAGE] > 0)
{
sprintf (buf,
" #wMichi:#n Affecting Hitroll and Damroll by +%d.\n\r",
ch->pcdata->stats[UNI_RAGE]);
send_to_char (buf, ch);
}
else if (IS_CLASS (ch, CLASS_DEMON)
&& ch->pcdata->stats[DEMON_POWER] > 0)
{
int bonus =
(ch->pcdata->stats[DEMON_POWER] *
ch->pcdata->stats[DEMON_POWER] << 1);
sprintf (buf,
" #wDemonic EQ:#n Affects Hitroll and Damroll by +%d.\n\r",
bonus);
send_to_char (buf, ch);
}
}
divide8_to_char (ch);
return;
}
/*
char *const day_name[] = {
"the Moon", "the Bull", "Reaping", "Thunder", "Freedom",
"the Great Gods", "the Master"
};
char *const month_name[] = {
"Winter", "the Winter Wolf", "the Frost Giant", "the Old Forces",
"the Grand Struggle", "the Spring", "Nature", "The Great Mistress",
"the Dragon",
"the Sun", "the Heat", "the Battle", "the Dark Shades", "the Shadows",
"the Long Shadows", "the Ancient Darkness", "the Great Evil"
};
*/
char *const day_name[] = {
"Friday", "Saturday", "Sunday", "Monday",
"Tuesday", "Wednesday", "Thursday"
};
char *const month_name[] = {
"January", "February", "March", "April",
"May", "June", "July", "August", "September",
"October", "November", "December"
};
void do_gtime (CHAR_DATA * ch, char *argument)
{
extern int bootcount;
extern int doublecount;
extern int nosafecount;
char buf[MSL];
stc ("Game Flags:\n\r\n\r", ch);
sprintf (buf, "Double Counter : %d\n\r", doublecount);
stc (buf, ch);
sprintf (buf, "No Safe Counter : %d\n\r", nosafecount);
stc (buf, ch);
sprintf (buf, "Reboot Counter : %d\n\r", bootcount);
stc (buf, ch);
sprintf (buf, "Exp Modifier : %d for %d Minutes\n\r",
WizConfig->xpbonus, WizConfig->xptimer);
stc (buf, ch);
sprintf (buf, "Qp Modifier : %d for %d Minutes\n\r",
WizConfig->qpbonus, WizConfig->qptimer);
stc (buf, ch);
return;
}
void do_timer (CHAR_DATA * ch, char *argument)
{
char buf[MSL];
int hour;
int min;
int sec;
int total;
total = ch->pcdata->get_exp;
hour = ((total / 3600) % 24);
min = ((total / 60) % 60);
sec = (total % 60);
stc ("The timers you currently have on you:\n\r\n\r", ch);
if (ch->pcdata->login_timer > 0)
{
sprintf (buf, " Login Timer : %d\n\r",
ch->pcdata->login_timer);
stc (buf, ch);
}
else
stc (" Login Timer : CLEAR\n\r", ch);
if (ch->fight_timer > 0)
{
sprintf (buf, " Fight Timer : %d\n\r", ch->fight_timer);
stc (buf, ch);
}
else
stc (" Fight Timer : CLEAR\n\r", ch);
if (ch->pcdata->pkill_timer > 0)
{
sprintf (buf, " PK Timer : %d\n\r", ch->pcdata->pkill_timer);
stc (buf, ch);
}
else
stc (" PK Timer : CLEAR\n\r", ch);
if (ch->arena_timer > 0)
{
sprintf (buf, " Arena Timer : %d\n\r", ch->arena_timer);
stc (buf, ch);
}
else
stc (" Arena Timer : CLEAR\n\r", ch);
if (ch->pcdata->schallenge > 0)
{
sprintf (buf,
" Status Challenge Timer: %d\n\r", ch->pcdata->schallenge);
stc (buf, ch);
}
else
stc (" Status Challenge Timer: CLEAR\n\r", ch);
if (ch->pcdata->jailed > 0)
{
stcprintf (ch,
" Jailed : %s.\n\r",
get_time (ch->pcdata->jailed));
}
if (ch->pcdata->silenced > 0)
{
stcprintf (ch,
" Silenced : %s.\n\r",
get_time ((ch->pcdata->silenced - current_time)));
}
/*
if (ch->pcdata->get_exp <= 0)
{
stc(" Generation Point : You have earned your gen point. Login after midnight. (Server time)\n\r",ch);
}
else
sprintf(buf," Generation Point : You will earn your generation point in %d minutes and %d seconds.\n\r", min, sec);
send_to_char(buf,ch);
*/
/*
stc("\n\rGame Timers:\n\r\n\r", ch);
if (pulse_arena > 1)
{
sprintf(buf, " Next War : %d hour(s) and %d minute(s).\n\r",
pulse_arena / 60, pulse_arena - (pulse_arena / 60) * 60);
send_to_char(buf, ch);
}
if (WizConfig->modtimer > 1)
{
sprintf(buf, " Next XP/QP Modifer : %d hour(s) and %d minute(s).\n\r", WizConfig->modtimer / 60, WizConfig->modtimer - (WizConfig->modtimer / 60) * 60);
stc(buf, ch);
}
return;
*/
}
char *get_time (int secs)
{
static char time[4096];
int temp, days, hours, minutes, seconds;
time[0] = '\0';
temp = secs;
days = (temp / 86400);
hours = ((temp / 3600) % 24);
minutes = ((temp / 60) % 60);
seconds = ((temp ) % 60);
if (days > 0)
{
sprintf (time, "#r%d #cday%s, #r%d #chour%s, #r%d#c minute%s#c and #r%d#c second%s.",
days, days == 1 ? "" : "s",
hours, hours == 1 ? "" : "s", minutes, minutes == 1 ? "" : "s",
seconds, seconds == 1 ? "" : "s");
}
else if (hours > 0)
{
sprintf (time, "#r%d #chour%s, #r%d#c minute%s#c and #r%d#c second%s.",
hours, hours == 1 ? "" : "s", minutes, minutes == 1 ? "" : "s",
seconds, seconds == 1 ? "" : "s");
}
else if (minutes > 0)
{
sprintf (time, "#r%d#c minute%s #cand #r%d#c second%s.", minutes,
minutes == 1 ? "" : "s", seconds, seconds == 1 ? "" : "s");
}
else
{
sprintf (time, "#r%d #wsecond%s.", seconds, seconds == 1 ? "" : "s");
}
return time;
}
void do_time (CHAR_DATA * ch, char *argument)
{
extern int bootcount;
extern int copycount;
extern time_t boot_time;
extern time_t hboot_time;
extern char str_boot_time[];
extern char copy_time[];
char buf[MAX_STRING_LENGTH];
char boot[MAX_STRING_LENGTH];
char tboot[MAX_STRING_LENGTH];
char *suf;
int day;
int weekday;
int days;
int hours;
int minutes;
int seconds;
int tdays;
int thours;
int tminutes;
int tseconds;
int uptime;
int tuptime;
uptime = (int) (current_time - boot_time);
tuptime = (int) (current_time - hboot_time);
days = (uptime / 86400);
hours = ((uptime / 3600) % 24);
minutes = ((uptime / 60) % 60);
seconds = (uptime % 60);
tdays = (tuptime / 86400);
thours = ((tuptime / 3600) % 24);
tminutes = ((tuptime / 60) % 60);
tseconds = (tuptime % 60);
day = time_info.day + 1;
weekday = time_info.daylist % 7;
if (day > 4 && day < 20)
suf = "th";
else if (day % 10 == 1)
suf = "st";
else if (day % 10 == 2)
suf = "nd";
else if (day % 10 == 3)
suf = "rd";
else
suf = "th";
if (days > 0)
{
sprintf (boot,
"#r%d#e day%s, #r%d#e hour%s, #r%d#e minute%s, #r%d#e second%s ago",
days, days == 1 ? "" : "s", hours, hours == 1 ? "" : "s",
minutes, minutes == 1 ? "" : "s", seconds,
seconds == 1 ? "" : "s");
}
else if (hours > 0)
{
sprintf (boot,
"#r%d#e hour%s, #r%d#e minute%s, #r%d#e second%s ago",
hours, hours == 1 ? "" : "s", minutes,
minutes == 1 ? "" : "s", seconds, seconds == 1 ? "" : "s");
}
else if (minutes > 0)
{
sprintf (boot,
"#r%d#e minute%s, #r%d#e second%s ago", minutes,
minutes == 1 ? "" : "s", seconds, seconds == 1 ? "" : "s");
}
else
{
sprintf (boot, "#r%d#e second%s ago", seconds, seconds == 1 ? "" : "s");
}
if (tdays > 0)
{
sprintf (tboot,
"#r%d#e day%s, #r%d#e hour%s, #r%d#e minute%s, #r%d#e second%s ago",
tdays, tdays == 1 ? "" : "s", thours, thours == 1 ? "" : "s",
tminutes, tminutes == 1 ? "" : "s", tseconds,
tseconds == 1 ? "" : "s");
}
else if (thours > 0)
{
sprintf (tboot,
"#r%d#e hour%s, #r%d#e minute%s, #r%d#e second%s ago",
thours, thours == 1 ? "" : "s", tminutes,
tminutes == 1 ? "" : "s", tseconds, tseconds == 1 ? "" : "s");
}
else if (tminutes > 0)
{
sprintf (tboot,
"#r%d#e minute%s, #r%d#e second%s ago", tminutes,
tminutes == 1 ? "" : "s", tseconds, tseconds == 1 ? "" : "s");
}
else
{
sprintf (tboot,
"#r%d#e second%s ago", tseconds, tseconds == 1 ? "" : "s");
}
loc_to_char (ch);
sprintf (buf,
"#wIt is #y%d:%2.2d %s#w, #y%s#w, #y%d%s %s %d#w.",
(time_info.hour % 12 == 0) ? 12 : time_info.hour % 12,
59 - (pulse_weather / (PULSE_WEATHER / 60)),
time_info.hour >= 12 ? "pm" : "am", day_name[weekday], day, suf,
month_name[time_info.month], time_info.year);
cent_to_char (buf, ch);
sprintf (buf, "#wLast Startup: #y%s (%s#y)", str_boot_time,//datestring (str_boot_time),
tboot);
cent_to_char (buf, ch);
sprintf (buf, "#wLast Copyover: #y%s (%s#y)", copy_time, //datestring (copy_time),
boot);
cent_to_char (buf, ch);
sprintf (buf, "#wSystem Time: #y%s#n", new_date (current_time));
cent_to_char (buf, ch);
if (bootcount > 0)
{
sprintf(buf, "#wThe Mud will reboot in %s", get_time(bootcount));
cent_to_char(buf, ch);
}
if (coShowing the first 100 KB of 257.8 KB. Download the archive for the full file.