act_wiz.c
src/act_wiz.c · 300.5 KB
From the archive cotn.4.2.tar.gz
Download the archive « Back to the archive contents
/***************************************************************************
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* *
* Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* *
* In order to use any part of this Merc Diku Mud, you must comply with *
* both the original Diku license in 'license.doc' as well the Merc *
* license in 'license.txt'. In particular, you may not remove either of *
* these copyright notices. *
* *
* Dystopia Mud improvements copyright (C) 2000, 2001 by Brian Graversen *
* *
* 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. *
***************************************************************************/
/***************************************************************************
* _/ _/ *
* _/_/_/ _/_/ _/_/_/ _/ _/_/ _/ _/ _/_/_/ *
* _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ *
* _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ *
* _/ _/ _/ _/_/_/ _/ _/_/ _/_/_/ _/_/_/ *
***************************************************************************
* Mindcloud Copyright 2001-2003 by Jeff Boschee (Zarius), *
* Additional credits are in the help file CODECREDITS *
* All Rights Reserved. *
***************************************************************************/
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include <time.h>
#include "merc.h"
#include "interp.h"
#include <unistd.h>
/*
* Local functions.
*/
ROOM_INDEX_DATA *find_location args((CHAR_DATA * ch, char *arg));
//char buf [MAX_STRING_LENGTH];
//char arg [MAX_INPUT_LENGTH];
void psycho_update args((void));
void init_descriptor args((DESCRIPTOR_DATA * dnew, int desc));
void do_wrlist(CHAR_DATA * ch, char *argument)
{
ROOM_INDEX_DATA *room;
ROOM_INDEX_DATA *in_room;
MOB_INDEX_DATA *mob;
OBJ_INDEX_DATA *obj;
char arg[MAX_STRING_LENGTH];
char arg1[MAX_STRING_LENGTH];
char arg2[MAX_STRING_LENGTH];
char buf[MSL];
long uvnum;
long lvnum;
long MR = 0;
int type = -1;
argument = one_argument(argument, arg);
argument = one_argument(argument, arg1);
argument = one_argument(argument, arg2);
uvnum = (is_number(arg2)) ? atoi(arg2) : 0;
lvnum = (is_number(arg1)) ? atoi(arg1) : 0;
if (!str_cmp(arg, "o"))
type = 2;
if (!str_cmp(arg, "m"))
type = 1;
if (!str_cmp(arg, "r"))
type = 0;
if (!str_cmp(arg, "n"))
type = 3;
if ((uvnum - lvnum) > 200)
{
send_to_char("{WThat range is too large.\n\r{x", ch);
return;
}
if (((uvnum == 0) && (lvnum == 0)) || (arg[0] == '\0')
|| (type == -1))
{
send_to_char("Syntax: wrlist [type] [lvnum] [uvnum]\n\r", ch);
send_to_char
("Types are (O)bjects, (M)obs, (R)esets and Room(N)ames\n\r",
ch);
return;
}
if (uvnum < 1 || lvnum < 1 || lvnum > uvnum)
{
send_to_char("#RInvalid level(s).\n\r#n", ch);
return;
}
in_room = ch->in_room;
if (type == 0)
{
char_from_room(ch);
}
for (MR = lvnum; MR <= uvnum; MR++)
{
if (type == 0)
{
if ((room = get_room_index(MR)))
{
xprintf(buf, "#R%-5d #w%-20s#n\n\r",
room->vnum, room->name);
send_to_char(buf, ch);
char_to_room(ch, room);
do_resets(ch, "");
char_from_room(ch);
}
}
if (type == 3)
{
if ((room = get_room_index(MR)))
{
xprintf(buf, "#R%-5d #w%-20s#n\n\r",
room->vnum, room->name);
send_to_char(buf, ch);
}
}
if (type == 2)
{
if ((obj = get_obj_index(MR)))
{
xprintf(buf, "#R%-5d #w%-20s#n\n\r",
obj->vnum, obj->name);
send_to_char(buf, ch);
}
}
if (type == 1)
{
if ((mob = get_mob_index(MR)))
{
xprintf(buf, "#R%-5d #w%-20s#n\n\r",
mob->vnum, mob->player_name);
send_to_char(buf, ch);
}
}
}
if (type == 0)
char_to_room(ch, in_room);
return;
}
void do_resetarea(CHAR_DATA * ch, char *argument)
{
send_to_char
("You patiently twiddle your thumbs, waiting for the reset.\n\r",
ch);
area_update();
}
void do_tick(CHAR_DATA * ch, char *argument)
{
send_to_char("TICK! Now wasn't that fun for you.\n\r", ch);
time_update();
char_update();
obj_update();
area_update();
room_update();
psycho_update();
update_pos(ch);
}
/* show linkdeads - code by Marlow, not Jobo */
void do_linkdead(CHAR_DATA * ch, char *argument)
{
CHAR_DATA *gch;
char buf[MAX_STRING_LENGTH];
bool found = FALSE;
for (gch = char_list; gch != NULL; gch = gch->next)
{
if (IS_NPC(gch) || gch->desc)
continue;
found = TRUE;
xprintf(buf, "Name: %12s. (Room: %5d)\n\r", gch->name,
gch->in_room == NULL ? : gch->in_room->vnum);
send_to_char(buf, ch);
}
if (!found)
send_to_char("No Linkdead Players found\n\r", ch);
return;
}
void do_pset(CHAR_DATA * ch, char *argument)
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
char arg3[MAX_INPUT_LENGTH];
char arg4[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
int value;
smash_tilde(argument);
argument = one_argument(argument, arg1);
argument = one_argument(argument, arg2);
argument = one_argument(argument, arg3);
strcpy(arg4, argument);
if (arg1[0] == '\0' || arg2[0] == '\0')
{
send_to_char
("#wSyntax: pset <victim> <area> <field> <value>\n\r",
ch);
send_to_char("\n\r", ch);
send_to_char("#WArea being one of:\n\r", ch);
send_to_char(" #0weapon immune beast\n\r", ch);
send_to_char(" #0blue red yellow green purple \n\r", ch);
send_to_char(" #0mongoose crane crab viper bull mantis\n\r",
ch);
send_to_char(" #0dragon tiger monkey swallow shadowpts\n\r",
ch);
send_to_char
(" #0status tks tier ghoulpts genexp shadowpts faith\n\r",
ch);
send_to_char(" #0faithpts\n\r", ch);
send_to_char("#WField being one of:\n\r", ch);
send_to_char
("#PWeapon: #0slice stab slash whip claw blast\n\r",
ch);
send_to_char
("#PWeapon: #0pound crush grep bite pierce suck ALLW\n\r",
ch);
send_to_char
("#YImmune: #0slash stab smash animal misc charm\n\r",
ch);
send_to_char("#YImmune: #0heat cold acid summon\n\r", ch);
send_to_char
("#YImmune: #0hurl backstab shielded kick disarm\n\r",
ch);
send_to_char("#YImmune: #0steal sleep drain sunlight\n\r",
ch);
send_to_char("#Y #0all#n\n\r", ch);
return;
}
if ((victim = get_char_world(ch, arg1)) == NULL)
{
send_to_char("They aren't here.\n\r", ch);
return;
}
/*
* Snarf the value (which need not be numeric).
*/
value = is_number(arg3) ? atoi(arg3) : -1;
/*
* Set something.
*/
if (!str_cmp(arg2, "status"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 300)
{
send_to_char("status range is 0 to 300.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->race = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if ( !str_cmp ( arg2, "allw" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 1000 )
{
stc( "Weapon range is 0 to 1000.\n\r", ch );
return;
}
victim->wpn[0] = value;
victim->wpn[1] = value;
victim->wpn[2] = value;
victim->wpn[3] = value;
victim->wpn[4] = value;
victim->wpn[5] = value;
victim->wpn[6] = value;
victim->wpn[7] = value;
victim->wpn[8] = value;
victim->wpn[9] = value;
victim->wpn[10] = value;
victim->wpn[11] = value;
victim->wpn[12] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "allm" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Spell range is 0 to 300.\n\r", ch );
return;
}
victim->spl[PURPLE_MAGIC] = value;
victim->spl[RED_MAGIC] = value;
victim->spl[BLUE_MAGIC] = value;
victim->spl[GREEN_MAGIC] = value;
victim->spl[YELLOW_MAGIC] = value;
// victim->spl[BLACK_MAGIC] = value;
// victim->spl[WHITE_MAGIC] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "alls" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
stc( "Stance range is 0 to 200.\n\r", ch );
return;
}
victim->stance[STANCE_VIPER] = value;
victim->stance[STANCE_CRANE] = value;
victim->stance[STANCE_CRAB] = value;
victim->stance[STANCE_MONGOOSE] = value;
victim->stance[STANCE_PITBULL] = value;
victim->stance[STANCE_HAWK] = value;
victim->stance[STANCE_BADGER] = value;
victim->stance[STANCE_COUGAR] = value;
victim->stance[STANCE_WOLVERINE] = value;
victim->stance[STANCE_GRIZZLY] = value;
stc("Ok.\n\r",ch);
return;
}
if (!str_cmp(arg2, "faith"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 1 || value > 50000)
{
send_to_char("Faith range is 1 to 50000.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->pcdata->current_faith = value;
victim->pcdata->faith = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "genexp"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 2000000000)
{
send_to_char("genexp range is 0 to 2 bill.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->genexp = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "tier"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 10)
{
send_to_char("Tier Level Range is 0 to 10.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->tier = 0;
victim->tier = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "tks"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 200)
{
send_to_char("TK Range is 0 to 200.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->tks = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "ghoulpts"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (!IS_CLASS(victim, CLASS_GHOUL))
{
send_to_char("They are not a ghoul.\n\r", ch);
return;
}
if (value < 1 || value > 1000000)
{
send_to_char("Ghoul Point range is 1 to 1000000.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
victim->pcdata->stats[GHOUL_PTS] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "faithpts"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (!IS_CLASS(victim, CLASS_PRIEST))
{
send_to_char("They are not a Priest.\n\r", ch);
return;
}
if (value < 1 || value > 1000000)
{
send_to_char("Faith Point range is 1 to 1000000.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
victim->pcdata->stats[FAITH_PTS] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "shadowpts"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (!IS_CLASS(victim, CLASS_SHADOW))
{
send_to_char("They are not a shadow.\n\r", ch);
return;
}
if (value < 1 || value > 1000000)
{
send_to_char
("Shadow Point range is 1 to 1000000.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
victim->pcdata->powers[SHADOW_POWER] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "viper"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 200)
{
send_to_char("Stance Viper range is 0 to 200.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
victim->stance[STANCE_VIPER] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "crane"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 200)
{
send_to_char("Stance Crane range is 0 to 200.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
victim->stance[STANCE_CRANE] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "crab"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 200)
{
send_to_char("Stance Crab range is 0 to 200.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
victim->stance[STANCE_CRAB] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "mongoose"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 200)
{
send_to_char("Stance Mongoose range is 0 to 200.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
victim->stance[STANCE_MONGOOSE] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if ( !str_cmp( arg2, "pitbull" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance PitBull range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_PITBULL] = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "hawk" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance hawk range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_HAWK] = value;
victim->stance[STANCE_CRANE] = 200;
victim->stance[STANCE_VIPER] = 200;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "badger" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance badger range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_BADGER] = value;
victim->stance[STANCE_CRAB] = 200;
victim->stance[STANCE_PITBULL] = 200;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "cougar" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance cougar range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_COUGAR] = value;
victim->stance[STANCE_PITBULL] = 200;
victim->stance[STANCE_VIPER] = 200;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "wolverine" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance wolverine range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_WOLVERINE] = value;
victim->stance[STANCE_MONGOOSE] = 200;
victim->stance[STANCE_CRANE] = 200;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "grizzly" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance grizzly range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_GRIZZLY] = value;
victim->stance[STANCE_CRAB] = 200;
victim->stance[STANCE_MONGOOSE] = 200;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if (!str_cmp(arg2, "ss1"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 200)
{
send_to_char("Stance ss1 range is 0 to 200.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->stance[STANCE_SS1] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "ss2"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 200)
{
send_to_char("Stance ss2 range is 0 to 200.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->stance[STANCE_SS2] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "ss3"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 200)
{
send_to_char("Stance ss3 range is 0 to 200.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->stance[STANCE_SS3] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "pizza"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 200)
{
send_to_char("Pizza stance range is 0 to 200.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
victim->stance[STANCE_SS4] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "zarius"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (value < 0 || value > 200)
{
send_to_char("Zarius stance range is 0 to 200.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
victim->stance[STANCE_SS5] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "purple"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->spl[PURPLE_MAGIC] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "stances"))
{
int i;
if (IS_NPC(victim))
return;
if (value > 200 || value < 0)
return;
for (i = 1; i < 18; i++)
victim->stance[i] = value;
return;
}
if (!str_cmp(arg2, "spells"))
{
if (IS_NPC(victim))
return;
if (!IS_CREATOR(ch))
{
do_pset(ch, "");
return;
}
if (value > 32000 || value < -32000)
return;
victim->spl[RED_MAGIC] = value;
victim->spl[PURPLE_MAGIC] = value;
victim->spl[GREEN_MAGIC] = value;
victim->spl[BLUE_MAGIC] = value;
victim->spl[YELLOW_MAGIC] = value;
return;
}
if (!str_cmp(arg2, "red"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->spl[RED_MAGIC] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "blue"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->spl[BLUE_MAGIC] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "green"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->spl[GREEN_MAGIC] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "yellow"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (IS_JUDGE(ch))
{
victim->spl[YELLOW_MAGIC] = value;
send_to_char("Ok.\n\r", ch);
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "immune"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (arg3 == '\0')
{
send_to_char("pset <victim> immune <immunity>.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
if (!str_cmp(arg3, "voodoo"))
{
if (IS_SET(victim->immune, IMM_VOODOO))
{
REMOVE_BIT(victim->immune,
IMM_VOODOO);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_VOODOO);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "slash"))
{
if (IS_SET(victim->immune, IMM_SLASH))
{
REMOVE_BIT(victim->immune, IMM_SLASH);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_SLASH);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "stab"))
{
if (IS_SET(victim->immune, IMM_STAB))
{
REMOVE_BIT(victim->immune, IMM_STAB);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_STAB);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "smash"))
{
if (IS_SET(victim->immune, IMM_SMASH))
{
REMOVE_BIT(victim->immune, IMM_SMASH);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_SMASH);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "anmial"))
{
if (IS_SET(victim->immune, IMM_ANIMAL))
{
REMOVE_BIT(victim->immune,
IMM_ANIMAL);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_ANIMAL);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "misc"))
{
if (IS_SET(victim->immune, IMM_MISC))
{
REMOVE_BIT(victim->immune, IMM_MISC);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_MISC);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "charm"))
{
if (IS_SET(victim->immune, IMM_CHARM))
{
REMOVE_BIT(victim->immune, IMM_CHARM);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_CHARM);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "heat"))
{
if (IS_SET(victim->immune, IMM_HEAT))
{
REMOVE_BIT(victim->immune, IMM_HEAT);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_HEAT);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "cold"))
{
if (IS_SET(victim->immune, IMM_COLD))
{
REMOVE_BIT(victim->immune, IMM_COLD);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_COLD);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "lightning"))
{
if (IS_SET(victim->immune, IMM_LIGHTNING))
{
REMOVE_BIT(victim->immune,
IMM_LIGHTNING);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune,
IMM_LIGHTNING);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "acid"))
{
if (IS_SET(victim->immune, IMM_ACID))
{
REMOVE_BIT(victim->immune, IMM_ACID);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_ACID);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "shield"))
{
if (IS_SET(victim->immune, IMM_SHIELDED))
{
REMOVE_BIT(victim->immune,
IMM_SHIELDED);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_SHIELDED);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "hurl"))
{
if (IS_SET(victim->immune, IMM_HURL))
{
REMOVE_BIT(victim->immune, IMM_HURL);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_HURL);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "backstab"))
{
if (IS_SET(victim->immune, IMM_BACKSTAB))
{
REMOVE_BIT(victim->immune,
IMM_BACKSTAB);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_BACKSTAB);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "kick"))
{
if (IS_SET(victim->immune, IMM_KICK))
{
REMOVE_BIT(victim->immune, IMM_KICK);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_KICK);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "disarm"))
{
if (IS_SET(victim->immune, IMM_DISARM))
{
REMOVE_BIT(victim->immune,
IMM_DISARM);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_DISARM);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "steal"))
{
if (IS_SET(victim->immune, IMM_STEAL))
{
REMOVE_BIT(victim->immune, IMM_STEAL);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_STEAL);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "sleep"))
{
if (IS_SET(victim->immune, IMM_SLEEP))
{
REMOVE_BIT(victim->immune, IMM_SLEEP);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_SLEEP);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "sunlight"))
{
if (IS_SET(victim->immune, IMM_SUNLIGHT))
{
REMOVE_BIT(victim->immune,
IMM_SUNLIGHT);
send_to_char
("Ok Immunity Removed.\n\r",
ch);
return;
}
else
{
SET_BIT(victim->immune, IMM_SUNLIGHT);
send_to_char("Ok Immunity Added.\n\r",
ch);
return;
}
}
if (!str_cmp(arg3, "all"))
{
SET_BIT(victim->immune, IMM_DRAIN);
SET_BIT(victim->immune, IMM_VOODOO);
SET_BIT(victim->immune, IMM_SLASH);
SET_BIT(victim->immune, IMM_STAB);
SET_BIT(victim->immune, IMM_SMASH);
SET_BIT(victim->immune, IMM_ANIMAL);
SET_BIT(victim->immune, IMM_MISC);
SET_BIT(victim->immune, IMM_CHARM);
SET_BIT(victim->immune, IMM_HEAT);
SET_BIT(victim->immune, IMM_COLD);
SET_BIT(victim->immune, IMM_LIGHTNING);
SET_BIT(victim->immune, IMM_ACID);
SET_BIT(victim->immune, IMM_HURL);
SET_BIT(victim->immune, IMM_BACKSTAB);
SET_BIT(victim->immune, IMM_KICK);
SET_BIT(victim->immune, IMM_DISARM);
SET_BIT(victim->immune, IMM_STEAL);
SET_BIT(victim->immune, IMM_SLEEP);
send_to_char("Ok All Immunities Added.\n\r",
ch);
return;
}
send_to_char("No such immunity exists.\n\r", ch);
return;
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
if (!str_cmp(arg2, "weapon"))
{
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
argument = one_argument(argument, arg4);
/*
* Snarf the value (which need not be numeric).
*/
value = is_number(arg4) ? atoi(arg4) : -1;
if (value < 0 || value > 2000)
{
send_to_char("Weapon skill range is 0 to 2000.\n\r",
ch);
return;
}
if (IS_JUDGE(ch))
{
if (!str_cmp(arg3, "unarmed"))
{
victim->wpn[0] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "slice"))
{
victim->wpn[1] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "stab"))
{
victim->wpn[2] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "slash"))
{
victim->wpn[3] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "whip"))
{
victim->wpn[4] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "claw"))
{
victim->wpn[5] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "blast"))
{
victim->wpn[6] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "pound"))
{
victim->wpn[7] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "crush"))
{
victim->wpn[8] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "grep"))
{
victim->wpn[9] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "bite"))
{
victim->wpn[10] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "pierce"))
{
victim->wpn[11] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "suck"))
{
victim->wpn[12] = value;
send_to_char("Ok.\n\r", ch);
return;
}
if (!str_cmp(arg3, "all"))
{
victim->wpn[0] = value;
victim->wpn[1] = value;
victim->wpn[2] = value;
victim->wpn[3] = value;
victim->wpn[4] = value;
victim->wpn[5] = value;
victim->wpn[6] = value;
victim->wpn[7] = value;
victim->wpn[8] = value;
victim->wpn[8] = value;
victim->wpn[9] = value;
victim->wpn[10] = value;
victim->wpn[11] = value;
victim->wpn[12] = value;
send_to_char("Ok.\n\r", ch);
return;
}
send_to_char("No such weapon skill exists.\n\r", ch);
return;
}
else
send_to_char("Sorry, no can do...\n\r", ch);
return;
}
/*
* Generate usage message.
*/
do_pset(ch, "");
return;
}
void do_paradox(CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
argument = one_argument(argument, arg);
if (arg[0] == '\0')
{
send_to_char("Paradox whom?\n\r", ch);
return;
}
if ((victim = get_char_world(ch, arg)) == NULL)
{
send_to_char("They aren't here.\n\r", ch);
return;
}
if (!IS_NPC(victim))
{
paradox(victim);
send_to_char("Done!\n\r", ch);
}
else
send_to_char("Not on NPCs.\n\r", ch);
return;
}
void do_unmaster(CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
argument = one_argument(argument, arg);
if (arg[0] == '\0')
{
send_to_char("UnMaster whom?\n\r", ch);
return;
}
if ((victim = get_char_world(ch, arg)) == NULL)
{
send_to_char("They aren't here.\n\r", ch);
return;
}
if (!IS_NPC(victim))
{
REMOVE_BIT(victim->newbits, NEW_MASTERY);
send_to_char("Done!\n\r", ch);
}
else
send_to_char("Not on NPCs.\n\r", ch);
return;
}
void paradox(CHAR_DATA * ch)
{
char buf[MAX_STRING_LENGTH];
send_to_char("The sins of your past strike back!\n\r", ch);
send_to_char("The paradox has come for your soul!\n\r", ch);
if (ch->sex == SEX_MALE)
xprintf(buf,
"#C%s #pscreams in agony as the #RP#Ga#RR#Ga#RD#Go#RX#p wrecks his puny mortal body#n",
ch->name);
else
xprintf(buf,
"#C%s #pscreams in agony as the #RP#Ga#RR#Ga#RD#Go#RX#p wrecks her puny mortal body#n",
ch->name);
do_info(ch, buf);
ch->hit = -10;
ch->max_move = (ch->max_move * 90) / 100;
ch->max_mana = (ch->max_mana * 90) / 100;
ch->combat = NULL;
update_pos(ch);
do_escape(ch, "");
SET_BIT(ch->extra, TIED_UP);
SET_BIT(ch->extra, GAGGED);
SET_BIT(ch->extra, BLINDFOLDED);
return;
}
void do_wizhelp(CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
int cmd;
int col;
int level;
for (level = get_trust(ch); level >= LEVEL_IMMORTAL; level--)
{
xprintf(buf,
"#r----------------------------------- #WLevel %2d #r-----------------------------------#n\n\r",
level);
send_to_char(buf, ch);
col = 0;
for (cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++)
{
if (cmd_table[cmd].level == level)
{
xprintf(buf, "%-12s", cmd_table[cmd].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;
}
void do_bamfin(CHAR_DATA * ch, char *argument)
{
if (!IS_NPC(ch))
{
smash_tilde(argument);
free_string(ch->pcdata->bamfin);
ch->pcdata->bamfin = str_dup(argument);
send_to_char("Ok.\n\r", ch);
}
return;
}
void do_bamfout(CHAR_DATA * ch, char *argument)
{
if (!IS_NPC(ch))
{
smash_tilde(argument);
free_string(ch->pcdata->bamfout);
ch->pcdata->bamfout = str_dup(argument);
send_to_char("Ok.\n\r", ch);
}
return;
}
void do_nosummon(CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
one_argument(argument, arg);
if (IS_NPC(ch))
return;
if (arg[0] == '\0')
{
send_to_char("Do you wish to switch summon ON or OFF?\n\r",
ch);
return;
}
if (IS_IMMUNE(ch, IMM_SUMMON) && !str_cmp(arg, "off"))
{
REMOVE_BIT(ch->immune, IMM_SUMMON);
send_to_char
("You now cant be the target of summon and portal.\n\r",
ch);
}
else if (!IS_IMMUNE(ch, IMM_SUMMON) && !str_cmp(arg, "off"))
{
send_to_char("But it is already off!\n\r", ch);
return;
}
else if (!IS_IMMUNE(ch, IMM_SUMMON) && !str_cmp(arg, "on"))
{
SET_BIT(ch->immune, IMM_SUMMON);
send_to_char
("You now can be the target of summon and portal.\n\r",
ch);
}
else if (IS_IMMUNE(ch, IMM_SUMMON) && !str_cmp(arg, "on"))
{
send_to_char("But it is already on!\n\r", ch);
return;
}
else
send_to_char("Do you wish to switch it ON or OFF?\n\r", ch);
return;
}
void do_transport(CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
one_argument(argument, arg);
if (IS_NPC(ch))
return;
if (arg[0] == '\0')
{
send_to_char("Do you wish to switch transport ON or OFF?\n\r",
ch);
return;
}
if (IS_IMMUNE(ch, IMM_TRANSPORT) && !str_cmp(arg, "off"))
{
REMOVE_BIT(ch->immune, IMM_TRANSPORT);
send_to_char
("You can no longer be the target of transport spells.\n\r",
ch);
}
else if (!IS_IMMUNE(ch, IMM_TRANSPORT) && !str_cmp(arg, "off"))
{
send_to_char("But it is already off!\n\r", ch);
return;
}
else if (!IS_IMMUNE(ch, IMM_TRANSPORT) && !str_cmp(arg, "on"))
{
SET_BIT(ch->immune, IMM_TRANSPORT);
send_to_char
("You can now be the target of transport spells.\n\r",
ch);
}
else if (IS_IMMUNE(ch, IMM_TRANSPORT) && !str_cmp(arg, "on"))
{
send_to_char("But it is already on!\n\r", ch);
return;
}
else
send_to_char("Do you wish to switch it ON or OFF?\n\r", ch);
return;
}
void do_deny(CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
char buf[MAX_STRING_LENGTH];
int days;
argument = one_argument(argument, arg);
one_argument(argument, arg2);
if (arg[0] == '\0')
{
send_to_char("Deny whom?\n\r", ch);
return;
}
days = atoi(arg2);
if (days < 1 || days > 10)
{
send_to_char("Between 1 and 10 days please.\n\r", ch);
return;
}
if ((victim = get_char_world(ch, arg)) == NULL)
{
send_to_char("They aren't here.\n\r", ch);
return;
}
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (get_trust(victim) >= get_trust(ch))
{
send_to_char("You failed.\n\r", ch);
return;
}
SET_BIT(victim->act, PLR_DENY);
victim->pcdata->denied = current_time + (days * 24L * 3600L);
xprintf(buf, "You have been denied access for %d days.\n\r", days);
send_to_char(buf, victim);
wiznet(buf, ch, NULL, WIZ_PENALTIES, WIZ_SECURE, 0);
send_to_char("OK.\n\r", ch);
victim->fight_timer = 0;
victim->position = POS_STANDING;
do_quit(victim, "");
return;
}
void do_wipe(CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
one_argument(argument, arg);
if (arg[0] == '\0')
{
send_to_char("Wipe whom?\n\r", ch);
return;
}
if ((victim = get_char_world(ch, arg)) == NULL)
{
send_to_char("They aren't here.\n\r", ch);
return;
}
if (IS_NPC(victim))
{
send_to_char("Not on NPC's.\n\r", ch);
return;
}
if (get_trust(victim) >= get_trust(ch))
{
send_to_char("You failed.\n\r", ch);
return;
}
SET_BIT(victim->act2, PLR_WIPED);
xprintf(buf, "$N wipes access to %s", victim->name);
wiznet(buf, ch, NULL, WIZ_PENALTIES, WIZ_SECURE, 0);
send_to_char("OK.\n\r", ch);
save_char_obj(victim);
stop_fighting(victim, TRUE);
do_disconnect(ch, victim->name);
return;
}
void do_disconnect(CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
DESCRIPTOR_DATA *d;
CHAR_DATA *victim;
one_argument(argument, arg);
if (arg[0] == '\0')
{
send_to_char("Disconnect whom?\n\r", ch);
return;
}
if ((victim = get_char_world(ch, arg)) == NULL)
{
send_to_char("They aren't here.\n\r", ch);
return;
}
if (victim->desc == NULL)
{
act("$N doesn't have a descriptor.", ch, NULL, victim,
TO_CHAR);
return;
}
for (d = descriptor_list; d != NULL; d = d->next)
{
if (d == victim->desc)
{
close_socket(d);
send_to_char("Ok.\n\r", ch);
return;
}
}
bug("Do_disconnect: desc not found.", 0);
send_to_char("Descriptor not found!\n\r", ch);
return;
}
void do_info(CHAR_DATA * ch, char *argument)
{
DESCRIPTOR_DATA *d;
char buf[MAX_STRING_LENGTH];
if (argument[0] == '\0')
{
return;
}
xprintf(buf, "#b-=#B[ #RInfo #B]#b=-#n #w%s#n\n\r", argument);
for (d = descriptor_list; d != NULL; d = d->next)
{
if (d->connected == CON_PLAYING && d->character != NULL
&& !IS_SET(d->character->deaf, CHANNEL_INFO))
{
send_to_char(buf, d->character);
}
}
return;
}
void do_ainfo(CHAR_DATA * ch, char *argument)
{
DESCRIPTOR_DATA *d;
char buf[MAX_STRING_LENGTH];
if (argument[0] == '\0')
{
return;
}
xprintf(buf, "#C@#D[#yxxx#D]#w(#W>>>#BArena#W>>#r>#R> #w%s#n\n\r",
argument);
for (d = descriptor_list; d != NULL; d = d->next)
{
if (d->connected == CON_PLAYING && d->character != NULL
&& !IS_SET(d->character->deaf, CHANNEL_INFO))
{
send_to_char(buf, d->character);
}
}
return;
}
void do_hint(CHAR_DATA * ch, char *argument)
{
DESCRIPTOR_DATA *d;
char buf[MAX_STRING_LENGTH];
if (argument[0] == '\0')
{
return;
}
xprintf(buf, "#P<- #GHint #P->#n %s\n\r", argument);
for (d = descriptor_list; d != NULL; d = d->next)
{
if (d->connected == CON_PLAYING && d->character != NULL
&& !IS_SET(d->character->deaf, CHANNEL_HINT))
{
send_to_char(buf, d->character);
}
}
return;
}
void do_echo(CHAR_DATA * ch, char *argument)
{
DESCRIPTOR_DATA *d;
if (argument[0] == '\0')
{
send_to_char("Echo what?\n\r", ch);
return;
}
for (d = descriptor_list; d != NULL; d = d->next)
{
if (d->connected == CON_PLAYING)
{
send_to_char(argument, d->character);
send_to_char("\n\r", d->character);
}
}
return;
}
void do_recho(CHAR_DATA * ch, char *argument)
{
DESCRIPTOR_DATA *d;
if (argument[0] == '\0')
{
send_to_char("Recho what?\n\r", ch);
return;
}
for (d = descriptor_list; d != NULL; d = d->next)
{
if (d->connected == CON_PLAYING
&& d->character->in_room == ch->in_room)
{
send_to_char(argument, d->character);
send_to_char("\n\r", d->character);
}
}
return;
}
ROOM_INDEX_DATA *find_location(CHAR_DATA * ch, char *arg)
{
CHAR_DATA *victim;
OBJ_DATA *obj;
if (is_number(arg))
return get_room_index(atoi(arg));
if ((victim = get_char_world(ch, arg)) != NULL)
if (can_see(ch, victim))
return victim->in_room;
if ((obj = get_obj_world(ch, arg)) != NULL && obj->in_room != NULL)
return obj->in_room;
if (obj != NULL && obj->carried_by != NULL
&& obj->carried_by->in_room != NULL)
return obj->carried_by->in_room;
if (obj != NULL && obj->in_obj != NULL
&& obj->in_obj->in_room != NULL)
return obj->in_obj->in_room;
if (obj != NULL && obj->in_obj != NULL && obj->in_obj->carried_by
&& obj->in_obj->carried_by->in_room != NULL)
return obj->in_obj->carried_by->in_room;
return NULL;
}
void do_transfer(CHAR_DATA * ch, char *argument)
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
ROOM_INDEX_DATA *location;
DESCRIPTOR_DATA *d;
CHAR_DATA *victim;
CHAR_DATA *mount;
argument = one_argument(argument, arg1);
argument = one_argument(argument, arg2);
if (arg1[0] == '\0')
{
send_to_char("Transfer whom (and where)?\n\r", ch);
return;
}
if (!str_cmp(arg1, "all"))
{
for (d = descriptor_list; d != NULL; d = d->next)
{
if (d->connected == CON_PLAYING
&& d->character != ch
&& d->character->in_room != NULL
&& can_see(ch, d->character))
{
char buf[MAX_STRING_LENGTH];
xprintf(buf, "%s %s", d->character->name,
arg2);
do_transfer(ch, buf);
}
}
return;
}
/*
* Thanks to Grodyn for the optional location parameter.
*/
if (arg2[0] == '\0')
{
location = ch->in_room;
}
else
{
if ((location = find_location(ch, arg2)) == NULL)
{
send_to_char("No such location.\n\r", ch);
return;
}
if (room_is_private(location))
{
send_to_char("That room is private right now.\n\r",
ch);
return;
}
}
if ((victim = get_char_world(ch, arg1)) == NULL)
{
send_to_char("They aren't here.\n\r", ch);
return;
}
if (victim->in_room == NULL)
{
send_to_char("They are in limbo.\n\r", ch);
return;
}
if (victim->fighting != NULL)
stop_fighting(victim, TRUE);
act("$n disappears in a mushroom cloud.", victim, NULL, NULL,
TO_ROOM);
char_from_room(victim);
char_to_room(victim, location);
act("$n arrives from a puff of smoke.", victim, NULL, NULL, TO_ROOM);
if (ch != victim)
act("$n has transferred you.", ch, NULL, victim, TO_VICT);
do_look(victim, "auto");
send_to_char("Ok.\n\r", ch);
if ((mount = victim->mount) == NULL)
return;
char_from_room(mount);
char_to_room(mount, get_room_index(victim->in_room->vnum));
if (ch != mount)
act("$n has transferred you.", ch, NULL, mount, TO_VICT);
do_look(mount, "auto");
}
void do_at(CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
ROOM_INDEX_DATA *location;
ROOM_INDEX_DATA *original;
CHAR_DATA *wch;
argument = one_argument(argument, arg);
if (arg[0] == '\0' || argument[0] == '\0')
{
send_to_char("At where what?\n\r", ch);
return;
}
if ((location = find_location(ch, arg)) == NULL)
{
send_to_char("No such location.\n\r", ch);
return;
}
if (room_is_private(location))
{
send_to_char("That room is private right now.\n\r", ch);
return;
}
original = ch->in_room;
char_from_room(ch);
char_to_room(ch, location);
interpret(ch, argument);
/*
* See if 'ch' still exists before continuing!
* Handles 'at XXXX quit' case.
*/
for (wch = char_list; wch != NULL; wch = wch->next)
{
if (wch == ch)
{
char_from_room(ch);
char_to_room(ch, original);
break;
}
}
return;
}
/*
void do_goto( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
ROOM_INDEX_DATA *location;
ROOM_INDEX_DATA *in_room;
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Goto where?\n\r", ch );
return;
}
if ( ( location = find_location( ch, arg ) ) == NULL )
{
stc("No such location.\n\r",ch);
return;
}
in_room = ch->in_room;
if ( ch->fighting )
stop_fighting( ch, TRUE );
if ( !IS_SET(ch->act, PLR_WIZINVIS) )
act( "$n $T", ch, NULL,
(ch->pcdata && ch->pcdata->bamfout[0] != '\0')
? ch->pcdata->bamfout : "leaves in a swirling mist.", TO_ROOM );
char_from_room( ch );
char_to_room( ch, location );
if ( !IS_SET(ch->act, PLR_WIZINVIS) )
act("$n $T", ch, NULL,
(ch->pcdata && ch->pcdata->bamfin[0] != '\0')
? ch->pcdata->bamfin : "appears in a swirling mist.", TO_ROOM );
do_look( ch, "auto" );
if ( ch->in_room == in_room )
return;
return;
}
*/
void do_goto(CHAR_DATA * ch, char *argument)
{
ROOM_INDEX_DATA *location;
CHAR_DATA *rch;
char arg[MAX_INPUT_LENGTH];
char buf[MSL];
int count = 0;
if ((argument[0] == '\0') && (IS_NPC(ch)))
{
send_to_char("Goto where?\n\r", ch);
return;
}
if ((argument[0] == '\0') && (!ch->home))
{
send_to_char("Goto where?\n\r", ch);
return;
}
if ((argument[0] == '\0') && (ch->home))
{
xprintf(arg, "%d", ch->home);
}
else
{
xprintf(arg, "%s", argument);
}
if ((location = find_location(ch, arg)) == NULL)
{
send_to_char("No such location.\n\r", ch);
return;
}
count = 0;
for (rch = location->people; rch != NULL; rch = rch->next_in_room)
count++;
if (room_is_private(location) && (count > 1 || ch->level < MAX_LEVEL))
{
send_to_char("That room is private right now.\n\r", ch);
return;
}
if (ch->fighting != NULL)
stop_fighting(ch, TRUE);
for (rch = ch->in_room->people; rch != NULL; rch = rch->next_in_room)
{
if ((rch->level >= ch->invis_level)
&& (rch->level >= ch->ghost_level))
{
if (ch->pcdata != NULL
&& ch->pcdata->bamfout[0] != '\0')
{
act("$t", ch, ch->pcdata->bamfout, rch,
TO_VICT);
}
else
{
if (MOUNTED(ch))
xprintf(buf,
"$n leaves in a swirling mist mounted on %s.",
MOUNTED(ch)->short_descr);
else
xprintf(buf,
"$n leaves in a swirling mist.");
act(buf, ch, NULL, rch, TO_VICT);
}
}
}
char_from_room(ch);
char_to_room(ch, location);
for (rch = ch->in_room->people; rch != NULL; rch = rch->next_in_room)
{
if ((rch->level >= ch->invis_level)
&& (rch->level >= ch->ghost_level))
{
if (ch->pcdata != NULL
&& ch->pcdata->bamfin[0] != '\0')
act("$t", ch, ch->pcdata->bamfin, rch,
TO_VICT);
else
act("$n appears in a swirling mist.", ch,
NULL, rch, TO_VICT);
}
}
if (MOUNTED(ch))
{
char_from_room(MOUNTED(ch));
char_to_room(MOUNTED(ch), location);
send_to_char
("Your rider is a god, and did a goto. You went along for the ride.\n\r",
MOUNTED(ch));
}
do_look(ch, "auto");
return;
}
void do_rstat(CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
ROOM_INDEX_DATA *location;
OBJ_DATA *obj;
CHAR_DATA *rch;
int door;
one_argument(argument, arg);
location = (arg[0] == '\0') ? ch->in_room : find_location(ch, arg);
if (location == NULL)
{
send_to_char("No such location.\n\r", ch);
return;
}
if (ch->in_room != location && room_is_private(location))
{
send_to_char("That room is private right now.\n\r", ch);
return;
}
xprintf(buf, "Name: '%s.'\n\rArea: '%s'.\n\r",
location->name, location->area->name);
send_to_char(buf, ch);
xprintf(buf,
"Vnum: %d. Sector: %d. Light: %d.\n\r",
location->vnum, location->sector_type, location->light);
send_to_char(buf, ch);
xprintf(buf,
"Room flags: %d.\n\rDescription:\n\r%s",
location->room_flags, location->description);
send_to_char(buf, ch);
if (location->extra_descr != NULL)
{
EXTRA_DESCR_DATA *ed;
send_to_char("Extra description keywords: '", ch);
for (ed = location->extra_descr; ed; ed = ed->next)
{
send_to_char(ed->keyword, ch);
if (ed->next != NULL)
send_to_char(" ", ch);
}
send_to_char("'.\n\r", ch);
}
send_to_char("Characters:", ch);
for (rch = location->people; rch; rch = rch->next_in_room)
{
send_to_char(" ", ch);
one_argument(rch->name, buf);
send_to_char(buf, ch);
}
send_to_char(".\n\rObjects: ", ch);
for (obj = location->contents; obj; obj = obj->next_content)
{
send_to_char(" ", ch);
one_argument(obj->name, buf);
send_to_char(buf, ch);
}
send_to_char(".\n\r", ch);
for (door = 0; door <= 5; door++)
{
EXIT_DATA *pexit;
if ((pexit = location->exit[door]) != NULL)
{
xprintf(buf,
"Door: %d. To: %d. Key: %d. Exit flags: %d.\n\rKeyword: '%s'. Description: %s",
door,
pexit->to_room !=
NULL ? pexit->to_room->vnum : 0, pexit->key,
pexit->exit_info, pexit->keyword,
pexit->description[0] !=
'\0' ? pexit->description : "(none).\n\r");
send_to_char(buf, ch);
}
}
return;
}
void do_ostat(CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
char nm1[40];
char nm2[40];
AFFECT_DATA *paf;
OBJ_DATA *obj;
one_argument(argument, arg);
if (arg[0] == '\0')
{
send_to_char("Ostat what?\n\r", ch);
return;
}
if ((obj = get_obj_world(ch, arg)) == NULL)
{
send_to_char
("Nothing like that in hell, earth, or heaven.\n\r",
ch);
return;
}
if (obj->questmaker != NULL && strlen(obj->questmaker) > 1)
xprintf(nm1, obj->questmaker);
else
xprintf(nm1, "None");
if (obj->questowner != NULL && strlen(obj->questowner) > 1)
xprintf(nm2, obj->questowner);
else
xprintf(nm2, "None");
xprintf(buf, "Name: %s.\n\r", obj->name);
send_to_char(buf, ch);
xprintf(buf, "Vnum: %d. Type: %s.\n\r",
obj->pIndexData->vnum, item_type_name(obj));
send_to_char(buf, ch);
xprintf(buf, "Short description: %s.\n\rLong description: %s\n\r",
obj->short_descr, obj->description);
send_to_char(buf, ch);
xprintf(buf,
"Object creator: %s. Object owner: %s. Quest points: %d.\n\r",
nm1, nm2, obj->points);
send_to_char(buf, ch);
if (obj->quest != 0)
{
send_to_char("Quest selections:", ch);
if (IS_SET(obj->quest, QUEST_STR))
send_to_char(" Str", ch);
if (IS_SET(obj->quest, QUEST_DEX))
send_to_char(" Dex", ch);
if (IS_SET(obj->quest, QUEST_INT))
send_to_char(" Int", ch);
if (IS_SET(obj->quest, QUEST_WIS))
send_to_char(" Wis", ch);
if (IS_SET(obj->quest, QUEST_CON))
send_to_char(" Con", ch);
if (IS_SET(obj->quest, QUEST_HIT))
send_to_char(" Hp", ch);
if (IS_SET(obj->quest, QUEST_MANA))
send_to_char(" Mana", ch);
if (IS_SET(obj->quest, QUEST_MOVE))
send_to_char(" Move", ch);
if (IS_SET(obj->quest, QUEST_HITROLL))
send_to_char(" Hit", ch);
if (IS_SET(obj->quest, QUEST_DAMROLL))
send_to_char(" Dam", ch);
if (IS_SET(obj->quest, QUEST_AC))
send_to_char(" Ac", ch);
send_to_char(".\n\r", ch);
}
xprintf(buf, "Wear bits: %d. Extra bits: %s.\n\r",
obj->wear_flags, extra_bit_name(obj->extra_flags));
send_to_char(buf, ch);
xprintf(buf, "Other Quest Bits: %s.\n\r", quest_bit_name(obj->quest));
send_to_char(buf, ch);
xprintf(buf, "Weight: %d/%d. OwnerID : %d.\n\r", obj->weight,
get_obj_weight(obj), obj->ownerid);
send_to_char(buf, ch);
xprintf(buf, "Cost: %d. Timer: %d. Level: %d.\n\r",
obj->cost, obj->timer, obj->level);
send_to_char(buf, ch);
xprintf(buf,
"In room: %d. In object: %s. Carried by: %s. Wear_loc: %d.\n\r",
obj->in_room == NULL ? 0 : obj->in_room->vnum,
obj->in_obj == NULL ? "(none)" : obj->in_obj->short_descr,
obj->carried_by == NULL ? "(none)" : obj->carried_by->name,
obj->wear_loc);
send_to_char(buf, ch);
xprintf(buf, "Values: %d %d %d %d %d %d %d %d %d %d %d.\n\r",
obj->value[0], obj->value[1], obj->value[2], obj->value[3],
obj->value[4], obj->value[5], obj->value[6], obj->value[7],
obj->value[8], obj->value[9], obj->value[10]);
send_to_char(buf, ch);
if (obj->item_type == ITEM_FAMILIAR)
sprintf(buf, "Char Hit Message: %s \n\r", obj->hit_msg1);
send_to_char(buf, ch);
sprintf(buf, "Vict Hit Message: %s \n\r", obj->hit_msg2);
send_to_char(buf, ch);
if (obj->spectype == SITEM_SIGIL)
send_to_char
("Sigil Affects: AtkLvl | FireLvl | WaterLvl | LightningLvl | EarthLvl\n\r",
ch);
xprintf(buf,
"Sigil Levels : %d | %d | %d | %d | %d\n\r",
obj->attack_level, obj->fire_level, obj->water_level,
obj->lightning_level, obj->earth_level);
send_to_char(buf, ch);
xprintf(buf, "Number of Sigils Applied: %d.\n\r", obj->sigil_level);
send_to_char(buf, ch);
if (obj->extra_descr != NULL || obj->pIndexData->extra_descr != NULL)
{
EXTRA_DESCR_DATA *ed;
send_to_char("Extra description keywords: '", ch);
for (ed = obj->extra_descr; ed != NULL; ed = ed->next)
{
send_to_char(ed->keyword, ch);
if (ed->next != NULL)
send_to_char(" ", ch);
}
for (ed = obj->pIndexData->extra_descr; ed != NULL;
ed = ed->next)
{
send_to_char(ed->keyword, ch);
if (ed->next != NULL)
send_to_char(" ", ch);
}
send_to_char("'.\n\r", ch);
}
for (paf = obj->affected; paf != NULL; paf = paf->next)
{
xprintf(buf, "Affects %s by %d.\n\r",
affect_loc_name(paf->location), paf->modifier);
send_to_char(buf, ch);
}
for (paf = obj->pIndexData->affected; paf != NULL; paf = paf->next)
{
xprintf(buf, "Affects %s by %d.\n\r",
affect_loc_name(paf->location), paf->modifier);
send_to_char(buf, ch);
}
return;
}
void do_mstat(CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
AFFECT_DATA *paf;
CHAR_DATA *victim;
one_argument(argument, arg);
if (arg[0] == '\0')
{
send_to_char("Mstat whom?\n\r", ch);
return;
}
if ((victim = get_char_world(ch, arg)) == NULL)
{
send_to_char("They aren't here.\n\r", ch);
return;
}
xprintf(buf, "Name: %s.\n\r", victim->name);
send_to_char(buf, ch);
xprintf(buf, "Vnum: %d. Sex: %s. Room: %d.\n\r",
IS_NPC(victim) ? victim->pIndexData->vnum : 0,
victim->sex == SEX_MALE ? "male" :
victim->sex == SEX_FEMALE ? "female" : "neutral",
victim->in_room == NULL ? 0 : victim->in_room->vnum);
send_to_char(buf, ch);
xprintf(buf, "Str: %d. Int: %d. Wis: %d. Dex: %d. Con: %d.\n\r",
get_curr_str(victim),
get_curr_int(victim),
get_curr_wis(victim),
get_curr_dex(victim), get_curr_con(victim));
send_to_char(buf, ch);
xprintf(buf,
"Hp: %d/%d. Mana: %d/%d. Move: %d/%d. Primal: %d.\n\r",
victim->hit, victim->max_hit, victim->mana, victim->max_mana,
victim->move, victim->max_move, victim->practice);
send_to_char(buf, ch);
xprintf(buf, "Lv: %d. Align: %d. AC: %d. Exp: %ld.\n\r",
victim->level, victim->alignment, char_ac(victim),
victim->exp);
send_to_char(buf, ch);
xprintf(buf, "Generation: %d. Genexp %d.\n\r", victim->generation,
victim->genexp);
stc(buf, ch);
xprintf(buf,
"Hitroll: %d. Damroll: %d. Position: %d. Wimpy: %d.\n\r",
char_hitroll(victim), char_damroll(victim), victim->position,
victim->wimpy);
send_to_char(buf, ch);
xprintf(buf, "Fighting: %s.\n\r",
victim->fighting ? victim->fighting->name : "(none)");
send_to_char(buf, ch);
if (!IS_NPC(victim))
{
xprintf(buf,
"Thirst: %d. Full: %d. Drunk: %d. Saving throw: %d.\n\r",
victim->pcdata->condition[COND_THIRST],
victim->pcdata->condition[COND_FULL],
victim->pcdata->condition[COND_DRUNK],
victim->saving_throw);
send_to_char(buf, ch);
if (IS_CLASS(victim, CLASS_VAMPIRE)
|| IS_CLASS(victim, CLASS_WEREWOLF))
{
xprintf(buf, "Rage: %d. ", victim->rage);
send_to_char(buf, ch);
if (IS_CLASS(victim, CLASS_VAMPIRE))
{
xprintf(buf, "Beast: %d. ", victim->beast);
send_to_char(buf, ch);
xprintf(buf, "Blood: %d.",
victim->pcdata->
condition[COND_THIRST]);
send_to_char(buf, ch);
}
send_to_char("\n\r", ch);
}
if (IS_CLASS(victim, CLASS_DEMON))
{
xprintf(buf, "Demonic armor: %d pieces. ",
victim->pcdata->stats[DEMON_POWER]);
send_to_char(buf, ch);
xprintf(buf, "Power: %d (%d).",
victim->pcdata->stats[DEMON_CURRENT],
victim->pcdata->stats[DEMON_TOTAL]);
send_to_char(buf, ch);
send_to_char("\n\r", ch);
}
}
xprintf(buf, "Carry number: %d. Carry weight: %d.\n\r",
victim->carry_number, victim->carry_weight);
send_to_char(buf, ch);
xprintf(buf, "Age: %d. Played: %d. Timer: %d. Act: %d.\n\r",
get_age(victim), (int) victim->played, victim->timer,
victim->act);
send_to_char(buf, ch);
xprintf(buf, "Master: %s. Leader: %s. Affected by: %s.\n\r",
victim->master ? victim->master->name : "(none)",
victim->leader ? victim->leader->name : "(none)",
affect_bit_name(victim->affected_by));
send_to_char(buf, ch);
if (!IS_NPC(victim)) /* OLC */
{
xprintf(buf, "Security: %d.\n\r", victim->pcdata->security);
send_to_char(buf, ch);
}
xprintf(buf, "Short description: %s.\n\rLong description: %s",
victim->short_descr,
victim->long_descr[0] !=
'\0' ? victim->long_descr : "(none).\n\r");
send_to_char(buf, ch);
if (IS_NPC(victim) && victim->spec_fun != 0)
send_to_char("Mobile has spec fun.\n\r", ch);
for (paf = victim->affected; paf != NULL; paf = paf->next)
{
xprintf(buf,
"Spell: '%s' modifies %s by %d for %d hours with bits %s.\n\r",
skill_table[(int) paf->type].name,
affect_loc_name(paf->location),
paf->modifier,
paf->duration, affect_bit_name(paf->bitvector));
send_to_char(buf, ch);
}
return;
}
void do_mfind(CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
MOB_INDEX_DATA *pMobIndex;
int vnum;
int nMatch;
bool fAll;
bool found;
one_argument(argument, arg);
if (arg[0] == '\0')
{
send_to_char("Mfind whom?\n\r", ch);
return;
}
fAll = FALSE;
found = FALSE;
nMatch = 0;
/*
* Yeah, so iterating over all vnum's takes 10,000 loops.
* Get_mob_index is fast, and I don't feel like threading another link.
* Do you?
* -- Furey
*/
for (vnum = 0; nMatch < top_mob_index; vnum++)
{
if ((pMobIndex = get_mob_index(vnum)) != NULL)
{
nMatch++;
if (fAll || is_name(arg, pMobIndex->player_name))
{
found = TRUE;
xprintf(buf, "[%5d] %s\n\r", pMobIndex->vnum,
capitalize(pMobIndex->short_descr));
send_to_char(buf, ch);
}
}
}
if (!found)
send_to_char
("Nothing like that in hell, earth, or heaven.\n\r",
ch);
return;
}
void do_ofind(CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
OBJ_INDEX_DATA *pObjIndex;
int vnum;
int nMatch;
bool fAll;
bool found;
one_argument(argument, arg);
if (arg[0] == '\0')
{
send_to_char("Ofind what?\n\r", ch);
return;
}
fAll = FALSE;
found = FALSE;
nMatch = 0;
/*
* Yeah, so iterating over all vnum's takes 10,000 loops.
* Get_obj_index is fast, and I don't feel like threading another link.
* Do you?
* -- Furey
*/
for (vnum = 0; nMatch < top_obj_index; vnum++)
{
if ((pObjIndex = get_obj_index(vnum)) != NULL)
{
nMatch++;
if (fAll || is_name(arg, pObjIndex->name))
{
found = TRUE;
xprintf(buf, "[%5d] %s\n\r",
pObjIndex->vnum,
capitalize(pObjIndex->short_descr));
send_to_char(buf, ch);
}
}
}
if (!found)
send_to_char
("Nothing like that in hell, earth, or heaven.\n\r",
ch);
return;
}
void do_owhere(CHAR_DATA * ch, char *argument)
{
char buf[MAX_INPUT_LENGTH];
OBJ_DATA *obj;
OBJ_DATA *in_obj;
bool found;
int number = 0, max_found;
found = FALSE;
number = 0;
max_found = 200;
if (argument[0] == '\0')
{
send_to_char("Find what?\n\r", ch);
return;
}
for (obj = object_list; obj != NULL; obj = obj->next)
{
if (!can_see_obj(ch, obj) || !is_name(argument, obj->name)
|| ch->level < obj->level
|| (obj->carried_by != NULL
&& !can_see(ch, obj->carried_by)))
continue;
found = TRUE;
number++;
for (in_obj = obj; in_obj->in_obj != NULL;
in_obj = in_obj->in_obj)
;
if (in_obj->carried_by != NULL
&& can_see(ch, in_obj->carried_by)
&& in_obj->carried_by->in_room != NULL)
xprintf(buf, "%3d) %s is carried by %s [Room %d]\n\r",
number, obj->short_descr,
PERS(in_obj->carried_by, ch),
in_obj->carried_by->in_room->vnum);
else if (in_obj->in_room != NULL)
xprintf(buf, "%3d) %s is in %s [Room %d]\n\r",
number, obj->short_descr,
in_obj->in_room->name, in_obj->in_room->vnum);
else
xprintf(buf, "%3d) %s is somewhere\n\r", number,
obj->short_descr);
send_to_char(buf, ch);
if (number >= max_found)
break;
}
if (!found)
send_to_char("Nothing like that in heaven or earth.\n\r", ch);
}
void do_mwhere(CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
bool found;
one_argument(argument, arg);
if (arg[0] == '\0')
{
send_to_char("Mwhere whom?\n\r", ch);
return;
}
found = FALSE;
for (victim = char_list; victim != NULL; victim = victim->next)
{
if (IS_NPC(victim)
&& victim->in_room != NULL && is_name(arg, victim->name))
{
found = TRUE;
xprintf(buf, "[%5d] %-28s [%5d] %s\n\r",
victim->pIndexData->vnum,
victim->short_descr,
victim->in_room->vnum, victim->in_room->name);
send_to_char(buf, ch);
}
}
if (!found)
act("You didn't find any $T.", ch, NULL, arg, TO_CHAR);
return;
}
void do_shutdow(CHAR_DATA * ch, char *argument)
{
send_to_char("If you want to SHUTDOWN, spell it out.\n\r", ch);
return;
}
void do_shutdown(CHAR_DATA * ch, char *argument)
{
extern bool merc_down;
CHAR_DATA *gch;
OBJ_DATA *obj;
char buf[MAX_STRING_LENGTH];
int i;
/*
* Store all mudwide data before doing anything else
*/
save_coreinfo();
/*
* Make sure all chars are ready for the shutdown
*/
do_restore(ch, "Showing the first 100 KB of 300.5 KB. Download the archive for the full file.