act_wiz.c
dystopia/src/act_wiz.c · 179.4 KB
From the archive dystopia-1.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. *
* *
* 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. *
***************************************************************************/
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"
#include <unistd.h>
/*
* Local functions.
*/
ROOM_INDEX_DATA * find_location args( ( CHAR_DATA *ch, char *arg ) );
void call_all args( ( CHAR_DATA *ch ) );
char buf [MAX_STRING_LENGTH];
char arg [MAX_INPUT_LENGTH];
bool write_to_descriptor args( ( DESCRIPTOR_DATA *d, char *txt, int length ) );
bool write_to_descriptor_2 args( ( int desc, char *txt, int length ) );
void init_descriptor args ((DESCRIPTOR_DATA *dnew, int desc));
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);
weather_update();
char_update();
obj_update();
area_update();
room_update();
update_pos(ch);
}
/* show linkdeads - code by Marlow */
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;
sprintf(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 buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
int value;
sprintf(buf,"%s: Pset %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
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( "#7Syntax: pset <victim> <area> <field> <value>\n\r",ch );
send_to_char( "\n\r", ch );
send_to_char( "#7Area being one of:\n\r",
ch );
send_to_char( " #3quest quest+ quest- weapon immune beast\n\r",
ch );
send_to_char( " #3blue red yellow green purple \n\r", ch
);
send_to_char( " #3mongoose crane crab viper bull mantis\n\r", ch
);
send_to_char( " #3dragon tiger monkey swallow \n\r", ch
);
send_to_char( "\n\r", ch );
send_to_char( "#7Field being one of:\n\r", ch
);
send_to_char( "#3Weapon: slice stab slash whip claw blast\n\r", ch );
send_to_char( "#3Weapon: pound crush grep bite pierce suck \n\r",
ch );
send_to_char( "#3Immune: slash stab smash animal misc charm\n\r",
ch );
send_to_char( "#3Immune: heat cold acid summon voodoo \n\r",
ch );
send_to_char( "#3Immune: hurl backstab shielded kick disarm\n\r",
ch );
send_to_char( "#3Immune: steal sleep drain sunlight\n\r",
ch );
send_to_char( "#3 all#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, "bitch"))
{
if(victim->flag4==1)
{
victim->flag4=0;
send_to_char( "Whore removed.\n\r", ch);
}
else
{
victim->flag4=1;
send_to_char( "Whore set!\n\r", ch);
send_to_char( "You bitch!\n\r", victim);
}
return;
}
if ( !str_cmp( arg2, "beast" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
send_to_char( "Beast range is 0 to 100.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->beast = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "quest" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 1 || value > 99999 )
{
send_to_char( "Quest range is 1 to 99999.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->pcdata->quest = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "quest+" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 1 || value + victim->pcdata->quest > 99999 )
{
send_to_char( "Quest range is 1 to 99999.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->pcdata->quest += value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "quest-" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( victim->pcdata->quest - value < 1 || value > 99999 )
{
send_to_char( "Quest range is 1 to 99999.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->pcdata->quest -= 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, "bull" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance Bull range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_BULL] = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "mantis" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance Mantis range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_MANTIS] = 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, "dragon" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance Dragon range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_DRAGON] = value;
victim->stance[STANCE_CRAB] = 200;
victim->stance[STANCE_BULL] = 200;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "tiger" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance Tiger range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_TIGER] = value;
victim->stance[STANCE_BULL] = 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, "monkey" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance Monkey range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_MONKEY] = 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, "swallow" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance Swallow range is 0 to 200.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->stance[STANCE_SWALLOW] = 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, "ss4" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance ss4 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, "ss5" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200 )
{
send_to_char( "Stance ss5 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 (!IS_CREATOR(ch))
{
if ( value < 0 || value > 1000 )
{
send_to_char( "Weapon skill range is 0 to 1000.\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 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) sprintf(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 sprintf(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_hit = (ch->max_hit * 90) /100;
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;
col = 0;
for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ )
{
if ( cmd_table[cmd].level > LEVEL_HERO
&& cmd_table[cmd].level <= get_trust( ch ) )
{
sprintf( 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_watcher( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
one_argument( argument, arg );
/* if (IS_NPC(ch) || !IS_SET(ch->act, PLR_WATCHER)
|| (ch->level > 6)
|| (ch->level < 2)
|| (ch->trust > 0) )
{
send_to_char( "Huh?\n\r", ch );
return;
}
*/
if ( arg[0] == '\0' )
{
do_users(ch,"");
return;
}
if ( ( victim = get_char_world( ch, arg ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
/*
if (ch == victim)
{
send_to_char( "Not on yourself.\n\r", ch );
return;
}
*/
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( victim->desc->snoop_by != NULL )
{
send_to_char( "You better not, they are being snooped.\n\r", ch );
return;
}
if( IS_SET(victim->act, PLR_WATCHER))
{
REMOVE_BIT(victim->act, PLR_WATCHER);
act( "You remove $N's watcher status.",ch,NULL,victim,TO_CHAR);
}
else
{
SET_BIT(victim->act, PLR_WATCHER);
act( "$n has made you a watcher.", ch, NULL, victim, TO_VICT );
act( "You make $N a watcher.", ch, NULL, victim, TO_CHAR );
}
return;
}
void do_deny( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
char buf[MAX_STRING_LENGTH];
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Deny 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;
}
sprintf(buf,"%s: Deny %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
if ( get_trust( victim ) >= get_trust( ch ) )
{
send_to_char( "You failed.\n\r", ch );
return;
}
SET_BIT(victim->act, PLR_DENY);
send_to_char( "You are denied access!\n\r", victim );
send_to_char( "OK.\n\r", ch );
victim->fight_timer = 0;
victim->position = POS_STANDING;
do_quit( victim, "" );
return;
}
void do_disconnect( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
DESCRIPTOR_DATA *d;
CHAR_DATA *victim;
sprintf(buf,"%s: Disconnect %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
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;
if ( argument[0] == '\0' )
{
return;
}
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( "#C<- #RInfo #C->#n ",d->character );
send_to_char( argument, d->character );
send_to_char( "\n\r", d->character );
}
}
return;
}
void do_watching( CHAR_DATA *ch, char *argument )
{
DESCRIPTOR_DATA *d;
if ( argument[0] == '\0' )
{
return;
}
for ( d = descriptor_list; d != NULL; d = d->next )
{
if ( d->connected == CON_PLAYING &&
IS_SET(d->character->act, PLR_WATCHER) &&
!IS_SET(d->character->deaf, CHANNEL_INFO) )
{
send_to_char( "Monitor -> ",d->character );
send_to_char( argument, d->character );
send_to_char( "\n\r", d->character );
}
}
return;
}
void logchan( char *argument )
{
CHAR_DATA *ch;
DESCRIPTOR_DATA *d;
if ( argument[0] == '\0' )
{
return;
}
for ( d = descriptor_list; d != NULL; d = d->next )
{
if ( ( ch = d->character ) == NULL ) continue;
if ( (d->connected == CON_PLAYING) && IS_JUDGE(ch) &&
!IS_SET(ch->deaf,CHANNEL_LOG) )
{
send_to_char( "[", ch );
send_to_char( argument, ch );
send_to_char( "]\n\r", ch );
}
}
return;
}
void do_echo( CHAR_DATA *ch, char *argument )
{
DESCRIPTOR_DATA *d;
char buf[MAX_STRING_LENGTH];
sprintf(buf,"%s: Echo %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
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;
char buf[MAX_STRING_LENGTH];
sprintf(buf,"%s: Recho %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
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];
char buf[MAX_STRING_LENGTH];
ROOM_INDEX_DATA *location;
DESCRIPTOR_DATA *d;
CHAR_DATA *victim;
CHAR_DATA *mount;
sprintf(buf,"%s: Transfer %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
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];
sprintf( 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];
char buf[MAX_STRING_LENGTH];
ROOM_INDEX_DATA *location;
ROOM_INDEX_DATA *original;
CHAR_DATA *wch;
sprintf(buf,"%s: At %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
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_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;
}
sprintf( buf, "Name: '%s.'\n\rArea: '%s'.\n\r",
location->name,
location->area->name );
send_to_char( buf, ch );
sprintf( buf,
"Vnum: %d. Sector: %d. Light: %d.\n\r",
location->vnum,
location->sector_type,
location->light );
send_to_char( buf, ch );
sprintf( 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 )
{
sprintf( 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)
sprintf(nm1,obj->questmaker); else sprintf(nm1,"None");
if (obj->questowner != NULL && strlen(obj->questowner) > 1)
sprintf(nm2,obj->questowner); else sprintf(nm2,"None");
sprintf( buf, "Name: %s.\n\r",
obj->name );
send_to_char( buf, ch );
sprintf( buf, "Vnum: %d. Type: %s.\n\r",
obj->pIndexData->vnum, item_type_name( obj ) );
send_to_char( buf, ch );
sprintf( buf, "Short description: %s.\n\rLong description: %s\n\r",
obj->short_descr, obj->description );
send_to_char( buf, ch );
sprintf( 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 );
}
sprintf( buf, "Wear bits: %d. Extra bits: %s.\n\r",
obj->wear_flags, extra_bit_name( obj->extra_flags ) );
send_to_char( buf, ch );
sprintf( buf, "Weight: %d/%d.\n\r",
obj->weight, get_obj_weight( obj ) );
send_to_char( buf, ch );
sprintf( buf, "Cost: %d. Timer: %d. Level: %d.\n\r",
obj->cost, obj->timer, obj->level );
send_to_char( buf, ch );
sprintf( 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 );
sprintf( buf, "Values: %d %d %d %d.\n\r",
obj->value[0], obj->value[1], obj->value[2], obj->value[3] );
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 )
{
sprintf( 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 )
{
sprintf( 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;
}
sprintf( buf, "Name: %s.\n\r",
victim->name );
send_to_char( buf, ch );
sprintf( 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 );
sprintf( 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 );
sprintf( 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 );
sprintf( buf,
"Lv: %d. Align: %d. AC: %d. Gold: %d. Exp: %d.\n\r",
victim->level, victim->alignment,
char_ac(victim), victim->gold, victim->exp );
send_to_char( buf, ch );
sprintf( 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 );
sprintf( buf, "Fighting: %s.\n\r",
victim->fighting ? victim->fighting->name : "(none)" );
send_to_char( buf, ch );
if ( !IS_NPC(victim) )
{
sprintf( 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))
{
sprintf( buf, "Rage: %d. ", victim->rage);
send_to_char( buf, ch );
if (IS_CLASS(victim, CLASS_VAMPIRE))
{
sprintf( buf, "Beast: %d. ", victim->beast);
send_to_char( buf, ch );
sprintf( 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))
{
sprintf( buf, "Demonic armor: %d pieces. ", victim->pcdata->stats[DEMON_POWER]);
send_to_char( buf, ch );
sprintf( 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 );
}
}
sprintf( buf, "Carry number: %d. Carry weight: %d.\n\r",
victim->carry_number, victim->carry_weight );
send_to_char( buf, ch );
sprintf( 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 );
sprintf( 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 */
{
sprintf( buf, "Security: %d.\n\r", victim->pcdata->security );
send_to_char( buf, ch );
}
sprintf( 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 )
{
sprintf( 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 )
{
extern int top_mob_index;
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;
sprintf( 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 )
{
extern int top_obj_index;
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;
sprintf( 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_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;
sprintf( 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 )
{
char buf[MAX_STRING_LENGTH];
extern bool merc_down;
sprintf( buf, "Shutdown by %s.", ch->name );
append_file( ch, SHUTDOWN_FILE, buf );
strcat( buf, "\n\r" );
do_echo( ch, buf );
do_asave(ch,"changed");
do_forceauto(ch,"save");
do_autosave(ch,"");
merc_down = TRUE;
return;
}
void do_snoop( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
DESCRIPTOR_DATA *d;
CHAR_DATA *victim;
sprintf(buf,"%s: Snoop %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Snoop 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 )
{
send_to_char( "No descriptor to snoop.\n\r", ch );
return;
}
if ( victim == ch )
{
send_to_char( "Cancelling all snoops.\n\r", ch );
for ( d = descriptor_list; d != NULL; d = d->next )
{
if ( d->snoop_by == ch->desc )
d->snoop_by = NULL;
}
return;
}
if ( victim->desc->snoop_by != NULL )
{
send_to_char( "Busy already.\n\r", ch );
return;
}
if (IS_SET(victim->act, PLR_WATCHER))
{
send_to_char( "Busy already.\n\r", ch );
return;
}
if ( get_trust( victim ) >= get_trust( ch ) )
{
send_to_char( "You failed.\n\r", ch );
return;
}
if ( ch->desc != NULL )
{
for ( d = ch->desc->snoop_by; d != NULL; d = d->snoop_by )
{
if ( d->character == victim || d->original == victim )
{
send_to_char( "No snoop loops.\n\r", ch );
return;
}
}
}
victim->desc->snoop_by = ch->desc;
send_to_char( "Ok.\n\r", ch );
return;
}
void do_oswitch( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
OBJ_DATA *obj;
CHAR_DATA *mount;
sprintf(buf,"%s: Oswitch %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
one_argument( argument, arg );
if ( IS_NPC(ch) )
return;
if ( arg[0] == '\0' )
{
send_to_char( "Switch into what?\n\r", ch );
return;
}
if ( IS_EXTRA(ch, EXTRA_OSWITCH) || IS_HEAD(ch,LOST_HEAD) )
{
send_to_char( "You are already oswitched.\n\r", ch );
return;
}
if ( IS_AFFECTED(ch, AFF_POLYMORPH) )
{
send_to_char( "Not while polymorphed.\n\r", ch );
return;
}
if ( IS_NPC(ch) || IS_EXTRA(ch,EXTRA_SWITCH) )
{
send_to_char( "Not while switched.\n\r", ch );
return;
}
if ( ( obj = get_obj_world( ch, arg ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if ( obj->chobj != NULL )
{
send_to_char( "Object in use.\n\r", ch );
return;
}
if ( (mount = ch->mount) != NULL) do_dismount(ch,"");
obj->chobj = ch;
ch->pcdata->chobj = obj;
SET_BIT(ch->affected_by, AFF_POLYMORPH);
SET_BIT(ch->extra, EXTRA_OSWITCH);
free_string(ch->morph);
ch->morph = str_dup(obj->short_descr);
send_to_char( "Ok.\n\r", ch );
return;
}
void do_oreturn( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
OBJ_DATA *obj;
sprintf(buf,"%s: Oreturn",ch->name);
if (ch->level < NO_WATCH) do_watching(ch,buf);
one_argument( argument, arg );
if ( IS_NPC(ch) )
return;
if ( !IS_EXTRA(ch, EXTRA_OSWITCH) && !IS_HEAD(ch,LOST_HEAD) )
{
send_to_char( "You are not oswitched.\n\r", ch );
return;
}
if ( ( obj = ch->pcdata->chobj ) != NULL ) obj->chobj = NULL;
ch->pcdata->chobj = NULL;
REMOVE_BIT(ch->affected_by, AFF_POLYMORPH);
REMOVE_BIT(ch->extra, EXTRA_OSWITCH);
if (IS_HEAD(ch,LOST_HEAD)) REMOVE_BIT(ch->loc_hp[0], LOST_HEAD);
free_string(ch->morph);
ch->morph = str_dup("");
char_from_room(ch);
char_to_room(ch,get_room_index(ROOM_VNUM_ALTAR));
send_to_char( "Ok.\n\r", ch );
return;
}
void do_switch( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
sprintf(buf,"%s: Switch %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Switch into whom?\n\r", ch );
return;
}
if ( ch->desc == NULL )
return;
if ( ch->desc->original != NULL )
{
send_to_char( "You are already switched.\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 == ch )
{
send_to_char( "Ok.\n\r", ch );
return;
}
if ( victim->desc != NULL )
{
send_to_char( "Character in use.\n\r", ch );
return;
}
/*
if ( !IS_NPC(victim))
{
send_to_char( "Only on NPC's.\n\r", ch );
return;
}
*/
SET_BIT(ch->extra, EXTRA_SWITCH);
ch->desc->character = victim;
ch->desc->original = ch;
victim->desc = ch->desc;
ch->desc = NULL;
send_to_char( "Ok.\n\r", victim );
return;
}
void do_return( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
sprintf(buf,"%s: Return %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
if ( ch->desc == NULL )
return;
if ( ch->desc->original == NULL )
{
send_to_char( "You aren't switched.\n\r", ch );
return;
}
send_to_char( "You return to your original body.\n\r", ch );
REMOVE_BIT(ch->desc->original->extra, EXTRA_SWITCH);
ch->desc->character = ch->desc->original;
ch->desc->original = NULL;
ch->desc->character->desc = ch->desc;
ch->desc = NULL;
return;
}
void do_mload( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
MOB_INDEX_DATA *pMobIndex;
CHAR_DATA *victim;
sprintf(buf,"%s: Mload %s",ch->name,argument);
if (ch->level < NO_WATCH && ch->trust > 3) do_watching(ch,buf);
one_argument( argument, arg );
if ( arg[0] == '\0' || !is_number(arg) )
{
send_to_char( "Syntax: mload <vnum>.\n\r", ch );
return;
}
if ( ( pMobIndex = get_mob_index( atoi( arg ) ) ) == NULL )
{
send_to_char( "No mob has that vnum.\n\r", ch );
return;
}
victim = create_mobile( pMobIndex );
char_to_room( victim, ch->in_room );
act( "$n has created $N!", ch, NULL, victim, TO_ROOM );
act( "You have created $N!", ch, NULL, victim, TO_CHAR );
return;
}
void do_pload( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
DESCRIPTOR_DATA *d;
ROOM_INDEX_DATA *in_room;
bool fOld;
if ( IS_NPC(ch) || ch->desc == NULL || ch->in_room == NULL ) return;
if ( argument[0] == '\0' )
{
send_to_char( "Syntax: pload <name>.\n\r", ch );
return;
}
if (!check_parse_name( argument ))
{
send_to_char( "Thats an illegal name.\n\r", ch );
return;
}
if ( !char_exists(FALSE,argument) )
{
send_to_char( "That player doesn't exist.\n\r", ch );
return;
}
sprintf(buf,"%s: Pload %s",ch->name,argument);
if (ch->level < NO_WATCH && ch->trust > 3) do_watching(ch,buf);
argument[0] = UPPER(argument[0]);
sprintf(buf,"You transform into %s.\n\r",argument);
send_to_char(buf,ch);
sprintf(buf,"$n transforms into %s.",argument);
act(buf,ch,NULL,NULL,TO_ROOM);
d = ch->desc;
do_autosave(ch,"");
in_room = ch->in_room;
extract_char(ch, TRUE);
d->character = NULL;
fOld = load_char_obj( d, argument );
ch = d->character;
ch->next = char_list;
char_list = ch;
char_to_room(ch,in_room);
return;
}
void do_preturn( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
DESCRIPTOR_DATA *d;
bool fOld;
if (IS_NPC(ch)) {send_to_char("Huh?\n\r",ch);return;}
if (ch->pload == NULL) {send_to_char("Huh?\n\r",ch);return;}
sprintf(arg,ch->pload);
if (strlen(arg) < 3 || strlen(arg) > 8)
{send_to_char("Huh?\n\r",ch);return;}
if (!str_cmp(ch->name,arg)) {send_to_char("Huh?\n\r",ch);return;}
d = ch->desc;
sprintf(buf,"You transform back into %s.\n\r",capitalize(ch->pload));
send_to_char(buf,ch);
sprintf(buf,"$n transforms back into %s.",capitalize(ch->pload));
act(buf,ch,NULL,NULL,TO_ROOM);
do_autosave(ch,"");
if (ch != NULL && ch->desc != NULL)
extract_char(ch,TRUE);
else if (ch != NULL)
extract_char(ch,TRUE);
if (ch->desc) ch->desc->character = NULL;
/*
ch->next = char_list;
char_list = ch;
*/
fOld = load_char_obj(d, capitalize(arg));
if (ch->in_room != NULL)
char_to_room(ch,ch->in_room);
else
char_to_room(ch,get_room_index(3001));
free_string(ch->pload);
ch->pload = str_dup("");
return;
}
void do_oload( CHAR_DATA *ch, char *argument )
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
OBJ_INDEX_DATA *pObjIndex;
OBJ_DATA *obj;
int level;
if (IS_NPC(ch)) {send_to_char("Not while switched.\n\r",ch); return;}
sprintf(buf,"%s: Oload %s",ch->name,argument);
if (ch->level < NO_WATCH && ch->trust > 3) do_watching(ch,buf);
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
if ( arg1[0] == '\0' || !is_number( arg1 ) )
{
send_to_char( "Syntax: oload <vnum> <level>.\n\r", ch );
return;
}
if ( arg2[0] == '\0' )
{
level = get_trust( ch );
}
else
{
/*
* New feature from Alander.
*/
if ( !is_number( arg2 ) )
{
send_to_char( "Syntax: oload <vnum> <level>.\n\r", ch );
return;
}
level = atoi( arg2 );
if ( level < 0 || level > get_trust( ch ) )
{
send_to_char( "Limited to your trust level.\n\r", ch );
return;
}
}
if ( ( pObjIndex = get_obj_index( atoi( arg1 ) ) ) == NULL )
{
send_to_char( "No object has that vnum.\n\r", ch );
return;
}
obj = create_object( pObjIndex, level );
if ( CAN_WEAR(obj, ITEM_TAKE) )
{
obj_to_char( obj, ch );
act( "$p appears in $n's hands!", ch, obj, NULL, TO_ROOM );
}
else
{
obj_to_room( obj, ch->in_room );
act( "$n has created $p!", ch, obj, NULL, TO_ROOM );
}
act( "You create $p.", ch, obj, NULL, TO_CHAR );
if (obj->questmaker != NULL) free_string(obj->questmaker);
obj->questmaker = str_dup(ch->name);
return;
}
void do_purge( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
CHAR_DATA *mount;
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
/* 'purge' */
CHAR_DATA *vnext;
for ( victim = ch->in_room->people; victim != NULL; victim = vnext )
{
vnext = victim->next_in_room;
if (IS_NPC(victim) && victim->desc == NULL && (mount = victim->mount) == NULL)
extract_char( victim, TRUE );
}
act( "$n purges the room!", ch, NULL, NULL, TO_ROOM);
send_to_char( "Ok.\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 PC's.\n\r", ch );
return;
}
if ( victim->desc != NULL )
{
send_to_char( "Not on switched players.\n\r", ch );
return;
}
act( "$n purges $N.", ch, NULL, victim, TO_NOTVICT );
extract_char( victim, TRUE );
return;
}
void do_trust( CHAR_DATA *ch, char *argument )
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
int level;
sprintf(buf,"%s: Trust %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
if ( arg1[0] == '\0' || arg2[0] == '\0' )
{
send_to_char( "Syntax: trust <char> <trust>.\n\r", ch );
send_to_char( "Trust being one of: None, Builder, Questmaker, Enforcer, Judge, or Highjudge.\n\r", ch );
return;
}
if ( ( victim = get_char_world( ch, arg1 ) ) == NULL )
{
send_to_char( "That player is not here.\n\r", ch);
return;
}
if ( !str_cmp( arg2, "none" ) ) level = 0;
else if ( !str_cmp( arg2, "builder" ) ) level = 7;
else if ( !str_cmp( arg2, "questmaker" ) ) level = 8;
else if ( !str_cmp( arg2, "enforcer" ) ) level = 9;
else if ( !str_cmp( arg2, "judge" ) ) level = 10;
else if ( !str_cmp( arg2, "highjudge" ) ) level = 11;
else
{
send_to_char( "Please enter: None, Builder, Questmaker, Enforcer, Judge, or Highjudge.\n\r", ch );
return;
}
if ( level >= get_trust( ch ) )
{
send_to_char( "Limited to below your trust.\n\r", ch );
return;
}
send_to_char("Ok.\n\r",ch);
victim->trust = level;
return;
}
void do_restore( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
DESCRIPTOR_DATA *d;
sprintf(buf,"%s: Restore %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
one_argument( argument, arg );
if ( get_trust(ch) >= MAX_LEVEL - 2 && !str_cmp(arg,"all"))
{
/* cure all */
for (d = descriptor_list; d != NULL; d = d->next)
{
victim = d->character;
if (victim == NULL || IS_NPC(victim))
continue;
{
if (IS_SET(victim->extra,TIED_UP)) REMOVE_BIT(victim->extra,TIED_UP);
affect_strip(victim,gsn_drowfire);
affect_strip(victim,gsn_poison);
affect_strip(victim,gsn_blindness);
affect_strip(victim,gsn_sleep);
affect_strip(victim,gsn_curse);
victim->loc_hp[0] = 0;
victim->loc_hp[1] = 0;
victim->loc_hp[2] = 0;
victim->loc_hp[3] = 0;
victim->loc_hp[4] = 0;
victim->loc_hp[5] = 0;
victim->loc_hp[6] = 0;
update_pos( victim );
victim->hit = victim->max_hit;
victim->mana = victim->max_mana;
victim->move = victim->max_move;
update_pos( victim);
if (victim->in_room != NULL)
act("$n has restored you.",ch,NULL,victim,TO_VICT);
}
}
send_to_char("All active players restored.\n\r",ch);
return;
}
if ( ( victim = get_char_world( ch, arg ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
victim->hit = victim->max_hit;
victim->mana = victim->max_mana;
victim->move = victim->max_move;
victim->loc_hp[0] = 0;
victim->loc_hp[1] = 0;
victim->loc_hp[2] = 0;
victim->loc_hp[3] = 0;
victim->loc_hp[4] = 0;
victim->loc_hp[5] = 0;
victim->loc_hp[6] = 0;
update_pos( victim );
act( "$n has restored you.", ch, NULL, victim, TO_VICT );
if (!IS_CLASS(ch, CLASS_ANGEL)) send_to_char( "Ok.\n\r", ch );
return;
}
void do_freeze( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
sprintf(buf,"%s: Freeze %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Bitchslap 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;
}
if ( IS_SET(victim->act, PLR_FREEZE) )
{
REMOVE_BIT(victim->act, PLR_FREEZE);
send_to_char( "You stop crying.\n\r", victim );
send_to_char( "Crybaby removed.\n\r", ch );
}
else
{
SET_BIT(victim->act, PLR_FREEZE);
send_to_char( "You recieve a BITCHSLAP, and start crying like the bitch you are!\n\r", victim );
send_to_char( "Crybaby set.\n\r", ch );
}
save_char_obj( victim );
return;
}
void do_log( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
sprintf(buf,"%s: Log %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Log whom?\n\r", ch );
return;
}
if ( !str_cmp( arg, "all" ) )
{
if ( fLogAll )
{
fLogAll = FALSE;
send_to_char( "Log ALL off.\n\r", ch );
}
else
{
fLogAll = TRUE;
send_to_char( "Log ALL on.\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;
}
/*
* No level check, gods can log anyone.
*/
if ( IS_SET(victim->act, PLR_LOG) )
{
REMOVE_BIT(victim->act, PLR_LOG);
send_to_char( "LOG removed.\n\r", ch );
}
else
{
SET_BIT(victim->act, PLR_LOG);
send_to_char( "LOG set.\n\r", ch );
}
return;
}
void do_undeny( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
char *oldname;
CHAR_DATA *victim;
DESCRIPTOR_DATA *d;
ROOM_INDEX_DATA *in_room;
sprintf(buf,"%s: Undeny %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Undeny whom?", ch );
return;
}
if ((victim = get_char_world(ch, arg)) != NULL) {
send_to_char("They are already online.\n\r", ch );
return;}
if (!char_exists(FALSE,arg))
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
oldname = str_dup(ch->pcdata->switchname);
d = ch->desc;
do_autosave(ch,"");
in_room = ch->in_room;
extract_char(ch, TRUE);
d->character = NULL;
load_char_obj(d, arg);
ch = d->character;
ch->next = char_list;
char_list = ch;
char_to_room(ch,in_room);
if ( IS_SET(ch->act, PLR_DENY) )
{
REMOVE_BIT(ch->act, PLR_DENY);
send_to_char( "DENY removed.\n\r", ch );
} else {
send_to_char("They are not DENIED.\n\r", ch ); }
d = ch->desc;
do_autosave(ch,"");
in_room = ch->in_room;
extract_char(ch, TRUE);
d->character = NULL;
load_char_obj(d, oldname);
ch = d->character;
ch->next = char_list;
char_list = ch;
char_to_room(ch,in_room);
return;
}
void do_silence( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
sprintf(buf,"%s: Silence %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Silence 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;
}
if ( IS_SET(victim->act, PLR_SILENCE) )
{
REMOVE_BIT(victim->act, PLR_SILENCE);
// send_to_char( "You can use channels again.\n\r", victim );
send_to_char( "SILENCE removed.\n\r", ch );
}
else
{
SET_BIT(victim->act, PLR_SILENCE);
// send_to_char( "You can't use channels!\n\r", victim );
send_to_char( "SILENCE set.\n\r", ch );
}
return;
}
void do_peace( CHAR_DATA *ch, char *argument )
{
CHAR_DATA *rch;
char buf[MAX_STRING_LENGTH];
sprintf(buf,"%s: Peace %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
for ( rch = ch->in_room->people; rch != NULL; rch = rch->next_in_room )
{
if ( rch->fighting != NULL )
stop_fighting( rch, TRUE );
}
if (!IS_CLASS(ch, CLASS_ANGEL)) send_to_char( "Ok.\n\r", ch );
return;
}
void do_ban( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
char buf2[MAX_STRING_LENGTH];
BAN_DATA *pban;
sprintf(buf2,"%s: Ban %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
if ( IS_NPC(ch) )
return;
argument = one_argument( argument, arg );
if ( arg[0] == '\0' )
{
strcpy( buf, "Banned sites:\n\r" );
for ( pban = ban_list; pban != NULL; pban = pban->next )
{
strcat( buf, pban->name );
strcat( buf, " (");
strcat( buf, pban->reason );
strcat( buf, ")\n\r" );
}
send_to_char( buf, ch );
return;
}
for ( pban = ban_list; pban != NULL; pban = pban->next )
{
if ( !str_cmp( arg, pban->name ) )
{
send_to_char( "That site is already banned!\n\r", ch );
return;
}
}
if ( ban_free == NULL )
{
pban = alloc_perm( sizeof(*pban) );
}
else
{
pban = ban_free;
ban_free = ban_free->next;
}
pban->name = str_dup( arg );
if (argument[0] == '\0') pban->reason = str_dup("no reason given");
else pban->reason = str_dup(argument);
pban->next = ban_list;
ban_list = pban;
send_to_char( "Ok.\n\r", ch );
save_bans();
return;
}
void do_allow( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
BAN_DATA *prev;
BAN_DATA *curr;
sprintf(buf,"%s: Allow %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Remove which site from the ban list?\n\r", ch );
return;
}
prev = NULL;
for ( curr = ban_list; curr != NULL; prev = curr, curr = curr->next )
{
if ( !str_cmp( arg, curr->name ) )
{
if ( prev == NULL )
ban_list = ban_list->next;
else
prev->next = curr->next;
free_string( curr->name );
free_string( curr->reason );
curr->next = ban_free;
ban_free = curr;
send_to_char( "Ok.\n\r", ch );
save_bans();
return;
}
}
send_to_char( "Site is not banned.\n\r", ch );
return;
}
void do_wizlock( CHAR_DATA *ch, char *argument )
{
extern bool wizlock;
char buf[MAX_STRING_LENGTH];
sprintf(buf,"%s: Wizlock %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
wizlock = !wizlock;
if ( wizlock )
send_to_char( "Game wizlocked.\n\r", ch );
else
send_to_char( "Game un-wizlocked.\n\r", ch );
return;
}
void do_closemud( CHAR_DATA *ch, char *argument )
{
extern bool wizlock;
char buf[MAX_STRING_LENGTH];
sprintf(buf,"%s: Wizlock %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
wizlock = !wizlock;
if ( wizlock )
send_to_char( "Game wizlocked.\n\r", ch );
else
send_to_char( "Game un-wizlocked.\n\r", ch );
return;
}
void do_slookup( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
char arg[MAX_INPUT_LENGTH];
int sn;
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Slookup what?\n\r", ch );
return;
}
if ( !str_cmp( arg, "all" ) )
{
for ( sn = 0; sn < MAX_SKILL; sn++ )
{
if ( skill_table[sn].name == NULL )
break;
sprintf( buf, "Sn: %4d Slot: %4d Skill/spell: '%s'\n\r",
sn, skill_table[sn].slot, skill_table[sn].name );
send_to_char( buf, ch );
}
}
else
{
if ( ( sn = skill_lookup( arg ) ) < 0 )
{
send_to_char( "No such skill or spell.\n\r", ch );
return;
}
sprintf( buf, "Sn: %4d Slot: %4d Skill/spell: '%s'\n\r",
sn, skill_table[sn].slot, skill_table[sn].name );
send_to_char( buf, ch );
}
return;
}
void do_sset( CHAR_DATA *ch, char *argument )
{
char arg1 [MAX_INPUT_LENGTH];
char arg2 [MAX_INPUT_LENGTH];
char arg3 [MAX_INPUT_LENGTH];
CHAR_DATA *victim;
int value;
int sn;
bool fAll;
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
argument = one_argument( argument, arg3 );
if ( arg1[0] == '\0' || arg2[0] == '\0' || arg3[0] == '\0' )
{
send_to_char( "#7Syntax: sset <victim> <skill> <value>\n\r", ch);
send_to_char( "#7or: sset <victim> all <value>\n\r", ch);
send_to_char( "#3Skill being any skill or spell.\n\r", ch);
return;
}
if ( ( victim = get_char_world( ch, arg1 ) ) == 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;
}
fAll = !str_cmp( arg2, "all" );
sn = 0;
if ( !fAll && ( sn = skill_lookup( arg2 ) ) < 0 )
{
send_to_char( "No such skill or spell.\n\r", ch );
return;
}
/*
* Snarf the value.
*/
if ( !is_number( arg3 ) )
{
send_to_char( "Value must be numeric.\n\r", ch );
return;
}
value = atoi( arg3 );
if ( value < 0 || value > 100 )
{
send_to_char( "Value range is 0 to 100.\n\r", ch );
return;
}
if ( fAll )
{
for ( sn = 0; sn < MAX_SKILL; sn++ )
{
if ( skill_table[sn].name != NULL )
victim->pcdata->learned[sn] = value;
}
}
else
{
victim->pcdata->learned[sn] = value;
}
send_to_char("Ok.\n\r",ch);
return;
}
void do_mset( CHAR_DATA *ch, char *argument )
{
char arg1 [MAX_INPUT_LENGTH];
char arg2 [MAX_INPUT_LENGTH];
char arg3 [MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
int value;
sprintf(buf,"%s: Mset %s",ch->name,argument);
if (ch->level < NO_WATCH) do_watching(ch,buf);
smash_tilde( argument );
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
strcpy( arg3, argument );
if ( arg1[0] == '\0' || arg2[0] == '\0' || arg3[0] == '\0' )
{
send_to_char( "#7Syntax: mset <victim> <field> <value>\n\r", ch );
send_to_char( "#7or: mset <victim> <string> <value>\n\r", ch );
send_to_char( "\n\r", ch );
send_to_char( "#7Field being one of:\n\r", ch );
send_to_char( "#3 str int wis dex con sex level exp\n\r", ch );
send_to_char( "#3 gold hp mana move primal align\n\r", ch );
send_to_char( "#3 thirst drunk full hit dam ac dp cp\n\r", ch );
send_to_char( "#3 security rune extra bounty hours\n\r", ch );
send_to_char( "#3 hpower origclass dage\n\r\n\r", ch );
send_to_char( "#7String being one of:\n\r", ch );
send_to_char( "#3 name short long description title spec clan#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, "extra"))
{
if( IS_NPC(victim))
{
stc( "Not on mobs.\n\r",ch);
return;
}
if( !str_cmp(arg3,"pregnant"))
{
if( IS_EXTRA(victim,EXTRA_PREGNANT))
REMOVE_BIT(victim->extra, EXTRA_PREGNANT);
else
SET_BIT(victim->extra,EXTRA_PREGNANT);
stc( "Ok.\n\r",ch);
return;
}
else if( !str_cmp(arg3,"poly"))
{
if( IS_SET(victim->affected_by, AFF_POLYMORPH) )
REMOVE_BIT(victim->affected_by, AFF_POLYMORPH);
else
SET_BIT(victim->affected_by, AFF_POLYMORPH);
stc( "Ok.\n\r",ch);
return;
}
else if( !str_cmp(arg3,"zuloform"))
{
if( IS_SET(victim->polyaff, POLY_ZULOFORM))
REMOVE_BIT(victim->polyaff, POLY_ZULOFORM);
else
SET_BIT(victim->polyaff, POLY_ZULOFORM);
stc("Ok.\n\r",ch);
return;
}
else if( !str_cmp(arg3,"pdragon"))
{
if( IS_SET(victim->polyaff, POLY_DRAGON))
REMOVE_BIT(victim->polyaff, POLY_DRAGON);
else
SET_BIT(victim->polyaff, POLY_DRAGON);
stc("Ok.\n\r",ch);
return;
}
else if( !str_cmp(arg3,"dragon"))
{
if( IS_EXTRA(victim, EXTRA_DRAGON))
REMOVE_BIT(victim->extra, EXTRA_DRAGON);
else
SET_BIT(victim->extra,EXTRA_DRAGON);
stc("Ok.\n\r",ch);
return;
}
else
{
stc( "Pregnant, dragon, pdragon, zuloform, poly.\n\r",ch);
return;
}
}
if(!str_cmp(arg2,"bounty"))
{
if( IS_NPC(victim))
{
stc( "Not on mobs.\n\r",ch);
return;
}
if( value < 0) value = 0;
victim->pcdata->bounty = value;
sprintf(buf, "%s bounty is now at %d.\n\r",victim->name,victim->pcdata->bounty);
stc(buf, ch);
return;
}
else if (!str_cmp(arg2, "hours"))
{
if ( IS_NPC( victim ) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( !is_number( arg3 ) )
{
send_to_char( "Value must be numeric.\n\r", ch );
return;
}
value = atoi( arg3 );
if ( value < 0 || value > 999 )
{
send_to_char( "Value must be betwen 0 and 999.\n\r", ch );
return;
}
value *= 3600;
victim->played = value;
return;
}
if ( !str_cmp( arg2, "str" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 3 || value > 35 )
{
send_to_char( "Strength range is 3 to 25.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->pcdata->perm_str = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "dp" ))
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r",ch);
return;
}
/* if (!IS_CLASS(victim, CLASS_DEMON))
{
send_to_char("Only on Demons.\n\r",ch);
return;
}
*/
if ( value < 1 || value > 10000000 )
{
send_to_char("Valid range is 1 to 10000000.\n\r",ch);
return;
}
victim->pcdata->stats[DEMON_CURRENT] = value;
victim->pcdata->stats[DEMON_TOTAL] = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "cp" ))
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r",ch);
return;
}
/* if (!IS_CLASS(victim, CLASS_DEMON))
{
send_to_char("Only on Demons.\n\r",ch);
return;
}
*/
if ( value < 1 || value > 10000000 )
{
send_to_char("Valid range is 1 to 10000000.\n\r",ch);
return;
}
victim->pcdata->stats[DROID_POWER] = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "int" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 3 || value > 35 )
{
send_to_char( "Intelligence range is 3 to 25.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->pcdata->perm_int = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "wis" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 3 || value > 35 )
{
send_to_char( "Wisdom range is 3 to 25.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->pcdata->perm_wis = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "dex" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 3 || value > 35 )
{
send_to_char( "Dexterity range is 3 to 25.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->pcdata->perm_dex = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "con" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 3 || value > 35 )
{
send_to_char( "Constitution range is 3 to 25.\n\r", ch );
return;
}
if (IS_JUDGE(ch)) {
victim->pcdata->perm_con = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "sex" ) )
{
if ( value < 0 || value > 2 )
{
send_to_char( "Sex range is 0 to 2.\n\r", ch );
return;
}
victim->sex = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "level" ) )
{
if ( IS_NPC(victim) && ( value < 1 || value > 250 ) )
{
send_to_char( "Level range is 1 to 250 for mobs.\n\r", ch );
return;
}
else if (!IS_JUDGE(ch))
{
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg3, "mortal" ) ) value = 2;
else if ( !str_cmp( arg3, "avatar" ) ) value = 3;
else if ( !str_cmp( arg3, "apprentice" ) ) value = 4;
else if ( !str_cmp( arg3, "mage" ) ) value = 5;
else if ( !str_cmp( arg3, "monk" ) ) value = 6;
else if ( !str_cmp( arg3, "archmage" ) ) value = 6;
else if ( !str_cmp( arg3, "builder" ) ) value = 7;
else if ( !str_cmp( arg3, "questmaker" ) ) value = 8;
else if ( !str_cmp( arg3, "enforcer" ) ) value = 9;
else if ( !str_cmp( arg3, "judge" ) ) value = 10;
else if ( !str_cmp( arg3, "highjudge" ) ) value = 11;
else if (!IS_NPC(victim))
{
send_to_char( "Level should be one of the following:\n\rMortal, Avatar, Apprentice, Mage, Archmage, Builder, Questmaker, Enforcer,\n\rJudge, or Highjudge.\n\r", ch );
return;
}
if (value >= ch->level && !IS_NPC(victim))
send_to_char( "Sorry, no can do...\n\r", ch );
else {victim->level = value; victim->trust = value;
send_to_char("Ok.\n\r",ch);}
return;
}
if ( !str_cmp( arg2, "hitroll" ) || !str_cmp(arg2, "hit" ) )
{
if ( !IS_NPC(victim) && ( value < 0 || value > 50 ) )
{
send_to_char( "Hitroll range is 0 to 50.\n\r", ch );
return;
}
else if ( IS_NPC(victim) && ( value < 0 || value > 250 ) )
{
send_to_char( "Hitroll range is 0 to 250.\n\r", ch );
return;
}
if (!IS_NPC(victim) && !IS_JUDGE(ch) && ch != victim)
{
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
victim->hitroll = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "damroll" ) || !str_cmp( arg2, "dam" ) )
{
if ( !IS_NPC(victim) && ( value < 0 || value > 50 ) )
{
send_to_char( "Damroll range is 0 to 50.\n\r", ch );
return;
}
else if ( IS_NPC(victim) && ( value < 0 || value > 250 ) )
{
send_to_char( "Damroll range is 0 to 250.\n\r", ch );
return;
}
if (!IS_NPC(victim) && !IS_JUDGE(ch) && ch != victim)
{
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
victim->damroll = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "Xhitroll" ) || !str_cmp( arg2, "hit" ) )
{
if ( !IS_NPC(victim) && ( value < 0 || value > 50 ) )
{
send_to_char( "Xhitroll range is 0 to 50.\n\r", ch );
return;
}
else if ( IS_NPC(victim) && ( value < 0 || value > 250 ) )
{
send_to_char( "Xhitroll range is 0 to 250.\n\r", ch );
return;
}
if (!IS_NPC(victim) && !IS_JUDGE(ch) && ch != victim)
{
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
victim->xhitroll = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "Xdamroll" ) || !str_cmp( arg2, "dam" ) )
{
if ( !IS_NPC(victim) && ( value < 0 || value > 50 ) )
{
send_to_char( "Xdamroll range is 0 to 50.\n\r", ch );
return;
}
else if ( IS_NPC(victim) && ( value < 0 || value > 250 ) )
{
send_to_char( "Xdamroll range is 0 to 250.\n\r", ch );
return;
}
if (!IS_NPC(victim) && !IS_JUDGE(ch) && ch != victim)
{
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
victim->xdamroll = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "armor" ) || !str_cmp( arg2, "ac" ) )
{
if ( !IS_NPC(victim) && ( value < -200 || value > 200 ) )
{
send_to_char( "Armor class range is -200 to 200.\n\r", ch );
return;
}
if (!IS_NPC(victim) && !IS_JUDGE(ch) && ch != victim)
{
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
victim->armor = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "exp" ) )
{
if ( IS_NPC(victim) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 )
{
send_to_char( "Exp must be at least 0.\n\r", ch );
return;
}
/* if ( value > 99000000 )
{
send_to_char( "No more than 99000000 possible.\n\r", ch );
return;
}
*/
if (IS_JUDGE(ch) || (ch == victim)) {
victim->exp = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "gold" ) )
{
if (value > 100000 && !IS_JUDGE(ch))
send_to_char("Don't be so damn greedy!\n\r",ch);
else
{victim->gold = value; send_to_char("Ok.\n\r",ch);}
return;
}
if ( !str_cmp( arg2, "hp" ) )
{
if ( value < 1 || value > 150000 )
{
send_to_char( "Hp range is 1 to 150,000 hit points.\n\r", ch );
return;
}
if (IS_JUDGE(ch) || (ch == victim) || (IS_NPC(victim)) ) {
victim->max_hit = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no can do...\n\r", ch );
return;
}
if ( !str_cmp( arg2, "mana" ) )
{
if ( value < 0 || value > 150000 )
{
send_to_char( "Mana range is 0 to 150,000 mana points.\n\r", ch );
return;
}
if (IS_JUDGE(ch) || (ch == victim) || (IS_NPC(victim)) ) {
victim->max_mana = value;
send_to_char("Ok.\n\r",ch);}
else
send_to_char( "Sorry, no canShowing the first 100 KB of 179.4 KB. Download the archive for the full file.