xset.txt
snippets · 38.3 KB · 2010-03-30
Xset by Kline: a large set command (credit requested).
Download « Back to the snippets list
/**********************************************
* Xset by Kline...Use as you will, just *
* please give credit *
* *
* Might need a define for stc (send_to_char) *
* Originally designed for a WOTK/RoDaM MUD *
* So you may need to remove a few fields *
* And probably remove the element.h include *
* *
* File Contains: *
* void do_xset (pset + mset) *
*********************************************/
#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 <unistd.h>
#include "merc.h"
#include "element.h"
void do_xset( CHAR_DATA *ch, char *argument )
{ /* Basic Stuff */
char arg1 [MAX_INPUT_LENGTH];
char arg2 [MAX_INPUT_LENGTH];
char arg3 [MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
unsigned long int value = 0;
sprintf(buf,"%s: Xset %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 );
/* Menu System */
if ( arg1[0] == '\0' )
{
stc( "#4............................................#n\n\r", ch );
stc( "Syntax: xset <pset/mset/all>\n\r", ch );
stc( "#4............................................#n\n\r", ch );
return;
}
/* Old Pset Menu */
else if ( !str_cmp( arg1, "pset" ) )
{
stc( "#4............................................#n\n\r", ch );
stc( "Syntax: xset <target> <field> <value>\n\r", ch );
stc( "#4............................................#n\n\r", ch );
stc( "\n\r", ch );
stc( "Integration: pset\n\r", ch );
stc( "\n\r", ch );
stc( "Field Values:\n\r", ch );
stc( " Points:\n\r", ch );
stc( " aura quest palpts dempts\n\r", ch );
stc( " souls elepts beast status\n\r", ch );
stc( " Magic:\n\r", ch );
stc( " purple red blue green yellow black white allm\n\r", ch );
stc( " Stance:\n\r", ch );
stc( " viper crane crab mongoose bull\n\r", ch );
stc( " mantis dragon tiger monkey swallow alls\n\r", ch );
stc( " Weapon:\n\r", ch );
stc( " unarm slice stab slash whip claw blast\n\r", ch );
stc( " pound crush grep bite pierce suck allw\n\r", ch );
stc( " Immune:\n\r", ch );
stc( " slashi stabi smash animal misc charm\n\r", ch );
stc( " hurl backstab shielded kick disarm\n\r", ch );
stc( " steal sleep drain heat cold acid summon\n\r", ch );
stc( " lightning sunlight allis allir\n\r", ch );
return;
}
/* Old Mset Menu */
else if ( !str_cmp( arg1, "mset" ) )
{
stc( "#4............................................#n\n\r", ch );
stc( "Syntax: xset <target> <field> <value>\n\r", ch );
stc( "#4............................................#n\n\r", ch );
stc( "\n\r", ch );
stc( "Integration: mset\n\r", ch );
stc( "\n\r", ch );
stc( "Field Values:\n\r", ch );
stc( " str int wis dex con sex level exp\n\r", ch );
stc( " gold hp mp mv primal align alla\n\r", ch );
stc( " thirst drunk full hit dam ac\n\r", ch );
stc( " name short long desc title spec\n\r", ch );
return;
}
/* Combined Menu */
else if ( !str_cmp( arg1, "all" ) )
{
stc( "#4............................................#n\n\r", ch );
stc( "Syntax: xset <target> <field> <value>\n\r", ch );
stc( "#4............................................#n\n\r", ch );
stc( "\n\r", ch );
stc( "Integration: pset\n\r", ch );
stc( "\n\r", ch );
stc( "Field Values:\n\r", ch );
stc( " Points:\n\r", ch );
stc( " aura quest palpts dempts\n\r", ch );
stc( " souls elepts beast status\n\r", ch );
stc( " Magic:\n\r", ch );
stc( " purple red blue green yellow black white allm\n\r", ch );
stc( " Stance:\n\r", ch );
stc( " viper crane crab mongoose bull\n\r", ch );
stc( " mantis dragon tiger monkey swallow alls\n\r", ch );
stc( " Weapon:\n\r", ch );
stc( " unarm slice stab slash whip claw blast\n\r", ch );
stc( " pound crush grep bite pierce suck allw\n\r", ch );
stc( " Immune:\n\r", ch );
stc( " slashi stabi smash animal misc charm\n\r", ch );
stc( " hurl backstab shielded kick disarm\n\r", ch );
stc( " steal sleep drain heat cold acid summon\n\r", ch );
stc( " lightning sunlight allis allir\n\r", ch );
stc( "\n\r", ch );
stc( "Integration: mset\n\r", ch );
stc( "#4............................................#n\n\r", ch );
stc( "Syntax: xset <target> <field> <value>\n\r", ch );
stc( "#4............................................#n\n\r", ch );
stc( "\n\r", ch );
stc( "Field Values:\n\r", ch );
stc( " str int wis dex con sex level exp\n\r", ch );
stc( " gold hp mp mv primal align alla\n\r", ch );
stc( " thirst drunk full hit dam ac\n\r", ch );
stc( " name short long desc title spec\n\r", ch );
return;
}
/* Idiot Check */
else if ( arg1[0] == '\0' || arg2[0] == '\0' )
{
stc( "#4............................................#n\n\r", ch );
stc( "Syntax: xset <target> <field> <value>\n\r", ch );
stc( "#4............................................#n\n\r", ch );
return;
}
else if ( ( victim = get_char_world( ch, arg1 ) ) == NULL )
{
stc( "They aren't here.\n\r", ch );
return;
}
value = is_number( arg3 ) ? atoi( arg3 ) : -1;
/* Begin: Pset Integration */
if ( !str_cmp( arg2, "aura" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200000 )
{
stc( "Aura points range is 0 to 200000.\n\r", ch );
return;
}
victim->pcdata->stats[PALADIN_AURA] = value;
stc( "Ok.\n\r", ch );
return;
}
if ( !str_cmp( arg2, "quest" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 200000 )
{
stc( "Quest points range is 0 to 200000.\n\r", ch );
return;
}
victim->pcdata->quest = value;
stc( "Ok.\n\r", ch );
return;
}
if ( !str_cmp( arg2, "palpts" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 10 )
{
stc( "Paladin power points range is 0 to 10.\n\r", ch );
return;
}
victim->pcdata->stats[PALADIN_PTS] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "dempts" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 800000 )
{
stc( "Demon points range is 0 to 800000.\n\r", ch );
return;
}
victim->pcdata->stats[DEMON_CURRENT] = value;
victim->pcdata->stats[DEMON_TOTAL] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "souls" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 500 )
{
stc( "Soul range is 0 to 500.\n\r", ch );
return;
}
victim->pcdata->classbit = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "elepts" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 800000 )
{
stc( "Elemental points range is 0 to 800000.\n\r", ch );
return;
}
victim->elem[6] = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "beast" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Beast range is 0 to 100.\n\r", ch );
return;
}
victim->beast = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "status" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Status range is 0 to 100.\n\r", ch );
return;
}
victim->status = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "purple" ) )
{
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;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "red" ) )
{
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[RED_MAGIC] = value;
send_to_char("Ok.\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 ( value < 0 || value > 300 )
{
stc( "Spell range is 0 to 300.\n\r", ch );
return;
}
victim->spl[BLUE_MAGIC] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "green" ) )
{
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[GREEN_MAGIC] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "yellow" ) )
{
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[YELLOW_MAGIC] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "black" ) )
{
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[BLACK_MAGIC] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "white" ) )
{
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[WHITE_MAGIC] = 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, "viper" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Stance range is 0 to 300.\n\r", ch );
return;
}
victim->stance[STANCE_VIPER] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "crane" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Stance range is 0 to 300.\n\r", ch );
return;
}
victim->stance[STANCE_CRANE] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "crab" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Stance range is 0 to 300.\n\r", ch );
return;
}
victim->stance[STANCE_CRAB] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "mongoose" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Stance range is 0 to 300.\n\r", ch );
return;
}
victim->stance[STANCE_MONGOOSE] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "bull" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Stance range is 0 to 300.\n\r", ch );
return;
}
victim->stance[STANCE_BULL] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "mantis" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Stance range is 0 to 300.\n\r", ch );
return;
}
victim->stance[STANCE_MANTIS] = value;
victim->stance[STANCE_CRANE] = value;
victim->stance[STANCE_VIPER] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "dragon" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Stance range is 0 to 300.\n\r", ch );
return;
}
victim->stance[STANCE_DRAGON] = value;
victim->stance[STANCE_CRAB] = value;
victim->stance[STANCE_BULL] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "tiger" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Stance range is 0 to 300.\n\r", ch );
return;
}
victim->stance[STANCE_TIGER] = value;
victim->stance[STANCE_BULL] = value;
victim->stance[STANCE_VIPER] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "monkey" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Stance range is 0 to 300.\n\r", ch );
return;
}
victim->stance[STANCE_MONKEY] = value;
victim->stance[STANCE_MONGOOSE] = value;
victim->stance[STANCE_CRANE] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "swallow" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 300 )
{
stc( "Stance range is 0 to 300.\n\r", ch );
return;
}
victim->stance[STANCE_SWALLOW] = value;
victim->stance[STANCE_CRAB] = value;
victim->stance[STANCE_MONGOOSE] = 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 > 300 )
{
stc( "Stance range is 0 to 300.\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_BULL] = value;
victim->stance[STANCE_MANTIS] = value;
victim->stance[STANCE_DRAGON] = value;
victim->stance[STANCE_TIGER] = value;
victim->stance[STANCE_MONKEY] = value;
victim->stance[STANCE_SWALLOW] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "unarmed" ) )
{
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;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "slice" ) )
{
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[1] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "stab" ) )
{
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[2] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "slash" ) )
{
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[3] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "whip" ) )
{
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[4] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "claw" ) )
{
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[5] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "blast" ) )
{
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[6] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "pound" ) )
{
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[7] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "crush" ) )
{
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[8] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "grep" ) )
{
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[9] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "bite" ) )
{
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[10] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "pierce" ) )
{
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[11] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp ( arg2, "suck" ) )
{
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[12] = value;
stc("Ok.\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, "slashi" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_SLASH ) )
{
REMOVE_BIT( victim->immune, IMM_SLASH );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_SLASH );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "stabi" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_STAB ) )
{
REMOVE_BIT( victim->immune, IMM_STAB );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_STAB );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "smash" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_SMASH ) )
{
REMOVE_BIT( victim->immune, IMM_SMASH );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_SMASH );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "animal" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_ANIMAL ) )
{
REMOVE_BIT( victim->immune, IMM_ANIMAL );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_ANIMAL );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "misc" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_MISC ) )
{
REMOVE_BIT( victim->immune, IMM_MISC );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_MISC );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "charm" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_CHARM ) )
{
REMOVE_BIT( victim->immune, IMM_CHARM );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_CHARM );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "hurl" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_HURL ) )
{
REMOVE_BIT( victim->immune, IMM_HURL );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_HURL );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "backstab" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_BACKSTAB ) )
{
REMOVE_BIT( victim->immune, IMM_BACKSTAB );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_BACKSTAB );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "shielded" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_SHIELDED ) )
{
REMOVE_BIT( victim->immune, IMM_SHIELDED );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_SHIELDED );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "kick" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_KICK ) )
{
REMOVE_BIT( victim->immune, IMM_KICK );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_KICK );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "disarm" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_DISARM ) )
{
REMOVE_BIT( victim->immune, IMM_DISARM );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_DISARM );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "steal" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_STEAL ) )
{
REMOVE_BIT( victim->immune, IMM_STEAL );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_STEAL );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "sleep" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_SLEEP ) )
{
REMOVE_BIT( victim->immune, IMM_SLEEP );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_SLEEP );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "drain" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_DRAIN ) )
{
REMOVE_BIT( victim->immune, IMM_DRAIN );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_DRAIN );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "heat" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_HEAT ) )
{
REMOVE_BIT( victim->immune, IMM_HEAT );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_HEAT );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "cold" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_COLD ) )
{
REMOVE_BIT( victim->immune, IMM_COLD );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_COLD );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "acid" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_ACID ) )
{
REMOVE_BIT( victim->immune, IMM_ACID );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_ACID );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "summon" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_SUMMON ) )
{
REMOVE_BIT( victim->immune, IMM_SUMMON );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_SUMMON );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "lightning" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_LIGHTNING ) )
{
REMOVE_BIT( victim->immune, IMM_LIGHTNING );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_LIGHTNING );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "sunlight" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( IS_SET ( victim->immune, IMM_SUNLIGHT ) )
{
REMOVE_BIT( victim->immune, IMM_SUNLIGHT );
stc( "Immunity removed.\n\r",ch );
return;
}
else
{
SET_BIT( victim->immune, IMM_SUNLIGHT );
stc( "Immunity added.\n\r",ch );
return;
}
}
if ( !str_cmp ( arg2, "allis" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
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_HURL );
SET_BIT( victim->immune, IMM_BACKSTAB );
SET_BIT( victim->immune, IMM_SHIELDED );
SET_BIT( victim->immune, IMM_KICK );
SET_BIT( victim->immune, IMM_DISARM );
SET_BIT( victim->immune, IMM_STEAL );
SET_BIT( victim->immune, IMM_SLEEP );
SET_BIT( victim->immune, IMM_DRAIN );
SET_BIT( victim->immune, IMM_HEAT );
SET_BIT( victim->immune, IMM_COLD );
SET_BIT( victim->immune, IMM_ACID );
SET_BIT( victim->immune, IMM_SUMMON );
SET_BIT( victim->immune, IMM_LIGHTNING );
SET_BIT( victim->immune, IMM_SUNLIGHT );
stc( "All immunities added.\n\r",ch );
return;
}
if ( !str_cmp ( arg2, "allir" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
REMOVE_BIT( victim->immune, IMM_SLASH );
REMOVE_BIT( victim->immune, IMM_STAB );
REMOVE_BIT( victim->immune, IMM_SMASH );
REMOVE_BIT( victim->immune, IMM_ANIMAL );
REMOVE_BIT( victim->immune, IMM_MISC );
REMOVE_BIT( victim->immune, IMM_CHARM );
REMOVE_BIT( victim->immune, IMM_HURL );
REMOVE_BIT( victim->immune, IMM_BACKSTAB );
REMOVE_BIT( victim->immune, IMM_SHIELDED );
REMOVE_BIT( victim->immune, IMM_KICK );
REMOVE_BIT( victim->immune, IMM_DISARM );
REMOVE_BIT( victim->immune, IMM_STEAL );
REMOVE_BIT( victim->immune, IMM_SLEEP );
REMOVE_BIT( victim->immune, IMM_DRAIN );
REMOVE_BIT( victim->immune, IMM_HEAT );
REMOVE_BIT( victim->immune, IMM_COLD );
REMOVE_BIT( victim->immune, IMM_ACID );
REMOVE_BIT( victim->immune, IMM_SUMMON );
REMOVE_BIT( victim->immune, IMM_LIGHTNING );
REMOVE_BIT( victim->immune, IMM_SUNLIGHT );
stc( "All immunities removed.\n\r",ch );
return;
}
/* End: Pset Integration
Begin: Mset Integration */
if ( !str_cmp( arg2, "str" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Attribute range is 0 to 100.\n\r", ch );
return;
}
victim->pcdata->perm_str = value;
send_to_char("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "int" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Attribute range is 0 to 100.\n\r", ch );
return;
}
victim->pcdata->perm_int = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "wis" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Attribute range is 0 to 100.\n\r", ch );
return;
}
victim->pcdata->perm_wis = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "dex" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Attribute range is 0 to 100.\n\r", ch );
return;
}
victim->pcdata->perm_dex = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "con" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Attribute range is 0 to 100.\n\r", ch );
return;
}
victim->pcdata->perm_con = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "sex" ) )
{
if ( value < 0 || value > 2 )
{
stc( "Sex range is 0 to 2.\n\r", ch );
return;
}
victim->sex = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "level" ) )
{
if ( IS_NPC(victim) && ( value < 1 || value > 32767 ) )
{
stc( "Level range is 1 to 32767 for mobs.\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, "archmage" ) ) value = 6;
else if ( !str_cmp( arg3, "immortal" ) ) value = 7;
else if ( !str_cmp( arg3, "builder" ) ) value = 8;
else if ( !str_cmp( arg3, "enforcer" ) ) value = 9;
else if ( !str_cmp( arg3, "judge" ) ) value = 10;
else if ( !str_cmp( arg3, "deity" ) ) value = 11;
else if ( !IS_NPC(victim) )
{
stc( "Level should be one of the following:\n\r", ch );
stc( "Mortal, Avatar, Apprentice, Mage, Archmage\n\r", ch );
stc( "Immortal, Builder, Enforcer, Judge, or Deity.\n\r", ch );
return;
}
if (value >= victim->level && !IS_NPC(victim) )
stc( "Sorry, no can do...\n\r", ch );
else
{
victim->level = value; victim->trust = value;
stc("Ok.\n\r",ch);
return;
}
}
if ( !str_cmp( arg2, "exp" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 )
{
stc( "Exp must be at least 0.\n\r", ch );
return;
}
if ( value > 500000000 )
{
stc( "No more than 500,000,000 possible.\n\r", ch );
return;
}
victim->exp = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "gold" ) )
{
if ( value < 0 || value > 100000 );
{
stc( "Gold range is 0 to 100,000", ch );
return;
}
victim->gold = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "hp" ) )
{
if ( value < 0 || value > 50000 )
{
stc( "Hp range is 0 to 50,000.\n\r", ch );
return;
}
victim->max_hit = value;
victim->hit = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "mana" ) )
{
if ( value < 0 || value > 50000 )
{
stc( "Mana range is 0 to 50,000.\n\r", ch );
return;
}
victim->max_mana = value;
victim->mana = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "move" ) )
{
if ( value < 0 || value > 50000 )
{
stc( "Move range is 0 to 50,000.\n\r", ch );
return;
}
victim->max_move = value;
victim->move = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "primal" ) )
{
if ( value < 0 || value > 10000 )
{
stc( "Primal range is 0 to 10000.\n\r", ch );
return;
}
victim->primal = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "align" ) )
{
if ( !str_cmp( argument, "evil" ) )
value = -1000;
if ( !str_cmp( argument, "neutral" ) )
value = 0;
if ( !str_cmp( argument, "good" ) )
value = 1000;
if ( ( value < -1000) || ( value > 1000 ) )
{
stc( "Alignment range is -1000 to 1000.\n\r", ch );
return;
}
victim->alignment = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "alla" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Attribute range is 0 to 100\n\r", ch );
return;
}
victim->pcdata->perm_str = value;
victim->pcdata->perm_int = value;
victim->pcdata->perm_wis = value;
victim->pcdata->perm_dex = value;
victim->pcdata->perm_con = value;
return;
}
if ( !str_cmp( arg2, "thirst" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Thirst range is 0 to 100.\n\r", ch );
return;
}
victim->pcdata->condition[COND_THIRST] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "drunk" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Drunk range is 0 to 100.\n\r", ch );
return;
}
victim->pcdata->condition[COND_DRUNK] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "full" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
if ( value < 0 || value > 100 )
{
stc( "Full range is 0 to 100.\n\r", ch );
return;
}
victim->pcdata->condition[COND_FULL] = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "hit" ) )
{
if ( ( value < 0 || value > 500 ) )
{
stc( "Hitroll range is 0 to 500.\n\r", ch );
return;
}
victim->hitroll = value;
stc("Ok.\n\r",ch);
return;
}
if (!str_cmp( arg2, "dam" ) )
{
if ( ( value < 0 || value > 500 ) )
{
stc( "Damroll range is 0 to 500.\n\r", ch );
return;
}
victim->damroll = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "ac" ) )
{
if ( ( value < -1000 || value > 1000 ) )
{
stc( "Armor class range is -1000 to 1000.\n\r", ch );
return;
}
victim->armor = value;
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "name" ) )
{
if ( !IS_NPC(victim) )
{
stc( "Not on PC's.\n\r", ch );
return;
}
free_string( victim->name );
victim->name = str_dup( arg3 );
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "short" ) )
{
free_string( victim->short_descr );
victim->short_descr = str_dup( arg3 );
if ( !IS_NPC(victim) && ( !str_cmp( arg3,"#n" ) ) )
free_string( victim->short_descr );
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "long" ) )
{
free_string( victim->long_descr );
victim->long_descr = str_dup( arg3 );
if ( !IS_NPC(victim) && ( !str_cmp( arg3,"#n" ) ) )
free_string( victim->long_descr );
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "desc" ) )
{
free_string( victim->description );
victim->description = str_dup( arg3 );
if ( !IS_NPC(victim) && ( !str_cmp( arg3,"#n" ) ) )
free_string( victim->description );
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "title" ) )
{
if ( IS_NPC(victim) )
{
stc( "Not on NPC's.\n\r", ch );
return;
}
set_title( victim, arg3 );
stc("Ok.\n\r",ch);
return;
}
if ( !str_cmp( arg2, "spec" ) )
{
if ( !IS_NPC(victim) && victim->trust < 12)
{
stc( "Not on PC's.\n\r", ch );
return;
}
if ( ( victim->spec_fun = spec_lookup( arg3 ) ) == 0 )
{
stc( "No such spec fun.\n\r", ch );
return;
}
stc("Ok.\n\r",ch);
return;
}
/*End: Mset Integration*/
}