#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"
void do_cready(CHAR_DATA *ch, char *argument)
{
if(IS_NPC(ch)) return;
do_force(ch, "all wake");
do_force(ch, "all call all");
do_force(ch, "all save");
do_asave(ch, "changed");
do_asave(ch, "list");
do_save(ch,"auto");
do_restore(ch, "all");
stc("#y[#RPrepare for a copyover.#y]#n\n\r",ch);
do_info(ch, "We need a copyover!");
return;
}
void do_discset(CHAR_DATA *ch, char *argument)
{
CHAR_DATA *victim;
char arg[MIL];
int disc_num= 0;
argument = one_argument(argument, arg);
if((victim = get_char_world(ch, arg)) == NULL)
{
stc("They aren't here.\n\r", ch);
return;
}
for(;disc_num < MAX_DISCIPLINES; disc_num++)
{
if(victim->power[disc_num] >= 0)
victim->power[disc_num] = 10;
}
stc("Set all disciplines to 10\n\r", ch);
return;
}
void do_powerreset(CHAR_DATA *ch, char *argument)
{
CHAR_DATA *victim;
char arg[MAX_INPUT_LENGTH];
int power = 0;
int cmbt = 0;
argument = one_argument(argument, arg);
if (arg[0] == '\0')
{
send_to_char("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 (!str_cmp(arg, "self"))
{
for (power = 0; power < 44; power++)
{
ch->pcdata->powers[power] = 0;
}
for (cmbt = 0; cmbt < 8; cmbt++)
{
ch->cmbt[cmbt] = 0;
}
return;
}
for (cmbt = 0; cmbt < 8; cmbt++)
{
victim->cmbt[cmbt] = 0;
}
for (power = 0; power < 44; power++)
{
victim->pcdata->powers[power] = 0;
}
send_to_char("#RPowers reset.\n\r", ch);
send_to_char("#RYour powers have been reset.\n\r", victim);
return;
}
void do_scatter( CHAR_DATA *ch, char *argument )
{
char arg [ MIL ];
OBJ_DATA *obj;
CHAR_DATA *victim;
bool found;
argument = one_argument( argument, arg );
if( arg[0] == '\0' )
{
send_to_char("Syntax: scatter <item>\n\r", ch );
send_to_char(" Will loop until you have no more in inventory.\n\r", ch );
stc("Remember: artifacts will be scattered but it will be scattered into rooms because mobs cannot carry artifacts..\n\r",ch);
return;
}
found = FALSE;
for( obj = get_obj_carry(ch,arg); obj; obj = get_obj_carry(ch,arg) )
{
if( !obj )
{
send_to_char("There are no more objects in your inventory.\n\r",ch);
return;
}
if (IS_SET(obj->quest, QUEST_ARTIFACT))
{
stc("No artifact scattering please.\n\r",ch);
return;
}
for ( victim = char_list; victim; victim = victim->next )
{
if( number_range(1,1000) == 1 )
{
found = TRUE;
obj_from_char(obj);
obj_to_char( obj, victim);
}
}
}
if( found )
send_to_char( "Done\n\r",ch);
return;
}
void do_claimall(CHAR_DATA *ch, char *argument)
{
OBJ_DATA *obj;
OBJ_DATA *next_obj;
int i=0;
if (IS_NPC(ch)) return;
for (obj = ch->carrying; obj != NULL; obj = next_obj)
{
if (ch->exp < 500)
{
stc("You are out of experience.\n\r",ch);
return;
}
next_obj = obj->next_content;
if (obj->item_type == ITEM_QUEST || obj->item_type == ITEM_AMMO ||
obj->item_type == ITEM_EGG || obj->item_type == ITEM_VOODOO ||
obj->item_type == ITEM_MONEY || obj->item_type == ITEM_TREASURE ||
obj->item_type == ITEM_PAGE || IS_SET(obj->quest, QUEST_ARTIFACT))
continue;
if (obj->chobj != NULL && !IS_NPC(obj->chobj)
&& obj->chobj->pcdata->obj_vnum != 0) continue;
if ( obj->questowner != NULL && strlen(obj->questowner) > 1 ) continue;
if (++i > 40) break;
ch->exp -= 500;
if (obj->questowner != NULL) free_string(obj->questowner);
obj->questowner = str_dup(ch->pcdata->switchname);
act("You are now the owner of $p.",ch,obj,NULL,TO_CHAR);
act("$n is now the owner of $p.",ch,obj,NULL,TO_ROOM);
}
if (i==0) stc("You had nothing to claim.\n\r",ch);
else act("$n claims everything in their inventory.\n\r",ch, NULL, NULL, TO_ROOM);
return;
}
void do_dismember(CHAR_DATA *ch, char *argument)
{
char buf[MSL];
char arg[MIL];
CHAR_DATA *victim;
argument=one_argument(argument,arg);
if(arg[0]== '\0')
{
stc("Dismember whom?\n\r",ch);
return;
}
if ((victim = get_char_world(ch, arg)) == NULL) {
stc("They are not here.\r\n", ch);
return;
}
if (IS_NPC(victim))
{
stc("No mobs.\n\r",ch);
return;
}
if(victim == ch)
{
stc("Stupid.\n\r",ch);
return;
}
if (victim->trust > ch->trust)
{
stc("I don't think so!\n\r",ch);
return;
}
SET_BIT(victim->loc_hp[2],LOST_ARM);
SET_BIT(victim->loc_hp[6],BLEEDING_ARM_L);
SET_BIT(victim->loc_hp[0],LOST_EYE_L);
SET_BIT(victim->loc_hp[0],LOST_EYE_R);
SET_BIT(victim->loc_hp[0],LOST_EYE_L);
SET_BIT(victim->loc_hp[0],LOST_EAR_L);
SET_BIT(victim->loc_hp[0],LOST_EAR_R);
SET_BIT(victim->loc_hp[0],LOST_EAR_L);
SET_BIT(victim->loc_hp[0],LOST_NOSE);
SET_BIT(victim->loc_hp[0],BROKEN_NOSE);
SET_BIT(victim->loc_hp[0],BROKEN_JAW);
SET_BIT(victim->loc_hp[2],LOST_ARM);
SET_BIT(victim->loc_hp[6],BLEEDING_ARM_L);
SET_BIT(victim->loc_hp[3],LOST_ARM);
SET_BIT(victim->loc_hp[6],BLEEDING_ARM_R);
SET_BIT(victim->loc_hp[2],BROKEN_ARM);
SET_BIT(victim->loc_hp[3],BROKEN_ARM);
SET_BIT(victim->loc_hp[2],LOST_HAND);
SET_BIT(victim->loc_hp[6],BLEEDING_HAND_L);
SET_BIT(victim->loc_hp[3],LOST_HAND);
SET_BIT(victim->loc_hp[6],BLEEDING_HAND_R);
SET_BIT(victim->loc_hp[2],LOST_THUMB);
SET_BIT(victim->loc_hp[2],LOST_FINGER_I);
SET_BIT(victim->loc_hp[2],LOST_FINGER_M);
SET_BIT(victim->loc_hp[2],LOST_FINGER_R);
SET_BIT(victim->loc_hp[2],LOST_FINGER_L);
SET_BIT(victim->loc_hp[2],BROKEN_THUMB);
SET_BIT(victim->loc_hp[2],BROKEN_FINGER_I);
SET_BIT(victim->loc_hp[2],BROKEN_FINGER_M);
SET_BIT(victim->loc_hp[2],BROKEN_FINGER_R);
SET_BIT(victim->loc_hp[2],BROKEN_FINGER_L);
SET_BIT(victim->loc_hp[3],LOST_THUMB);
SET_BIT(victim->loc_hp[3],LOST_FINGER_I);
SET_BIT(victim->loc_hp[3],LOST_FINGER_M);
SET_BIT(victim->loc_hp[3],LOST_FINGER_R);
SET_BIT(victim->loc_hp[3],LOST_FINGER_L);
SET_BIT(victim->loc_hp[3],BROKEN_THUMB);
SET_BIT(victim->loc_hp[3],BROKEN_FINGER_I);
SET_BIT(victim->loc_hp[3],BROKEN_FINGER_M);
SET_BIT(victim->loc_hp[3],BROKEN_FINGER_R);
SET_BIT(victim->loc_hp[3],BROKEN_FINGER_L);
SET_BIT(victim->loc_hp[4],LOST_LEG);
SET_BIT(victim->loc_hp[6],BLEEDING_LEG_L);
SET_BIT(victim->loc_hp[5],LOST_LEG);
SET_BIT(victim->loc_hp[6],BLEEDING_LEG_R);
SET_BIT(victim->loc_hp[4],BROKEN_LEG);
SET_BIT(victim->loc_hp[5],BROKEN_LEG);
SET_BIT(victim->loc_hp[4],LOST_FOOT);
SET_BIT(victim->loc_hp[6],BLEEDING_FOOT_L);
SET_BIT(victim->loc_hp[5],LOST_FOOT);
SET_BIT(victim->loc_hp[6],BLEEDING_FOOT_R);
SET_BIT(victim->loc_hp[1],BROKEN_RIBS_16);
SET_BIT(victim->loc_hp[1],BROKEN_RIBS_8);
SET_BIT(victim->loc_hp[1],BROKEN_RIBS_4);
SET_BIT(victim->loc_hp[1],BROKEN_RIBS_2);
SET_BIT(victim->loc_hp[1],BROKEN_RIBS_1);
SET_BIT(victim->loc_hp[LOC_HEAD],LOST_TOOTH_16);
SET_BIT(victim->loc_hp[LOC_HEAD],LOST_TOOTH_8);
SET_BIT(victim->loc_hp[LOC_HEAD],LOST_TOOTH_4);
SET_BIT(victim->loc_hp[LOC_HEAD],LOST_TOOTH_2);
SET_BIT(victim->loc_hp[LOC_HEAD],LOST_TOOTH_1);
SET_BIT(victim->loc_hp[LOC_LEG_L],BROKEN_LEG);
SET_BIT(victim->loc_hp[LOC_LEG_R],BROKEN_LEG);
SET_BIT(victim->loc_hp[LOC_BODY],BROKEN_SPINE);
SET_BIT(victim->loc_hp[LOC_HEAD],BROKEN_NOSE);
SET_BIT(victim->loc_hp[LOC_HEAD],BROKEN_JAW);
SET_BIT(victim->loc_hp[LOC_BODY],BROKEN_NECK);
SET_BIT(victim->loc_hp[LOC_HEAD],BROKEN_NOSE);
SET_BIT(victim->loc_hp[LOC_HEAD],BROKEN_JAW);
SET_BIT(victim->loc_hp[LOC_BODY],BROKEN_NECK);
SET_BIT(victim->loc_hp[LOC_HEAD],BROKEN_NOSE);
SET_BIT(victim->loc_hp[LOC_HEAD],BROKEN_JAW);
SET_BIT(victim->loc_hp[LOC_BODY],BROKEN_NECK);
SET_BIT(victim->loc_hp[LOC_HEAD],BROKEN_NOSE);
SET_BIT(victim->loc_hp[LOC_HEAD],BROKEN_JAW);
SET_BIT(victim->loc_hp[LOC_BODY],BROKEN_NECK);
make_part(victim,"arm");
make_part(victim,"arm");
make_part(victim,"leg");
make_part(victim,"leg");
make_part(victim,"blood");
make_part(victim,"blood");
make_part(victim,"tooth");
make_part(victim,"tooth");
make_part(victim,"tooth");
make_part(victim,"tooth");
make_part(victim,"tooth");
make_part(victim,"foot");
make_part(victim,"foot");
make_part(victim,"thumb");
make_part(victim,"thumb");
make_part(victim,"index");
make_part(victim,"hand");
make_part(victim,"hand");
make_part(victim,"ring");
make_part(victim,"little");
make_part(victim,"middle");
make_part(victim,"little");
make_part(victim,"middle");
victim->hit = -10;
victim->mana = -10;
victim->move = -10;
act("You dismembered $N!",ch,NULL,victim,TO_CHAR);
send_to_char("You have been #RDISMEMBERED#n\n\r", victim );
sprintf(buf,"%s got #sDISMEMBERED #nby %s!!",victim->name,ch->name);
do_info(ch,buf);
victim->in_room->blood += 200;
return;
}