eod/
eod/changes/
eod/log/
eod/player/
eod/player/backup/
eod/player/store/
/* Additions to the mud by Marcus ( Marcus@z2designs.com ) AIM: Stealthbig */

#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"
#define ptc send_to_char

void do_randomitem  args((CHAR_DATA *ch));
/* Creates a random piece of armor, not in the mud yet ( And not done ) */
void do_randomitem(CHAR_DATA *ch)
   {
       char buf1[MAX_INPUT_LENGTH];
       char buf2[MAX_INPUT_LENGTH];
       char buf3[MAX_INPUT_LENGTH];
       char buf4[MAX_INPUT_LENGTH];
	char buf5[MAX_INPUT_LENGTH];
        char finallong[MAX_INPUT_LENGTH];
        char finalshort[MAX_INPUT_LENGTH];
        char finalname[MAX_INPUT_LENGTH];
        OBJ_DATA *obj = NULL;
        OBJ_INDEX_DATA *pObjIndex = NULL;
        int rnd1, mult, hitdam, ac;
        int value;
        
        if ( ( pObjIndex = get_obj_index( 4 ) ) == NULL )  
        {
	return;
        }

        if (IS_NPC(ch)) return;
        
     // Parse 1 / 3 //
        rnd1 = number_range(1,17);
        if ( rnd1 == 1 ) 	strcpy(buf1, "#RE#rvi#Rl");
        else if ( rnd1 == 2 ) 	strcpy(buf1, "#RRa#rgi#Rng");
        else if ( rnd1 == 3 ) 	strcpy(buf1, "#RD#ra#Rrk");
        else if ( rnd1 == 4 ) 	strcpy(buf1, "#RCru#rush#Ring");
        else if ( rnd1 == 5 ) 	strcpy(buf1, "#RBl#roo#Rdy");
        else if ( rnd1 == 6 ) 	strcpy(buf1, "#RR#razo#Rr");
        else if ( rnd1 == 7 ) 	strcpy(buf1, "#RShi#rmmer#Ring");
        else if ( rnd1 == 8 ) 	strcpy(buf1, "#RRad#ria#Rting");
        else if ( rnd1 == 9 ) 	strcpy(buf1, "#RS#ric#Rk");
        else if ( rnd1 == 10 ) 	strcpy(buf1, "#RPo#rwerf#Rul");
        else if ( rnd1 == 11 ) 	strcpy(buf1, "#RBl#razi#Rng");
        else if ( rnd1 == 12 ) 	strcpy(buf1, "#RR#run#Re");
        else if ( rnd1 == 13 ) 	strcpy(buf1, "#RAr#rcha#Ric");
        else if ( rnd1 == 14 ) 	strcpy(buf1, "#RMe#rnaci#Rng");
        else if ( rnd1 == 15 ) 	strcpy(buf1, "#RAn#rgel#Ric");
        else if ( rnd1 == 16 ) 	strcpy(buf1, "#RDe#rmon#Ric");
        else if ( rnd1 == 17 ) 	strcpy(buf1, "#RG#rai#Ra");
        else return;
        
    // Parse 2 / 3  //
        rnd1 = number_range(1,11);
        if ( rnd1 == 1 ) 	{ strcpy(buf2, "#GR#gin#Gg");	 value = ITEM_WEAR_FINGER;strcpy(buf3,"ring"); }
        else if ( rnd1 == 2 ) 	{ strcpy(buf2, "#GC#golla#Gr");  value = ITEM_WEAR_NECK;  strcpy(buf3,"collar"); }
        else if ( rnd1 == 3 ) 	{ strcpy(buf2, "#GH#gelme#Gt");  value = ITEM_WEAR_HEAD;  strcpy(buf3,"helmet"); }
        else if ( rnd1 == 4 ) 	{ strcpy(buf2, "#GL#gegging#Gs");value = ITEM_WEAR_LEGS;  strcpy(buf3,"leggings"); }
        else if ( rnd1 == 5 ) 	{ strcpy(buf2, "#GB#goot#Gs"); 	 value = ITEM_WEAR_FEET;  strcpy(buf3,"boots"); }
        else if ( rnd1 == 6 ) 	{ strcpy(buf2, "#GG#glove#Gs");  value = ITEM_WEAR_HANDS; strcpy(buf3,"gloves"); }
        else if ( rnd1 == 7 ) 	{ strcpy(buf2, "#GS#gleeve#Gs"); value = ITEM_WEAR_ARMS;  strcpy(buf3,"sleeves"); }
        else if ( rnd1 == 8 ) 	{ strcpy(buf2, "#GC#gap#Ge"); 	 value = ITEM_WEAR_ABOUT; strcpy(buf3,"cape"); }
        else if ( rnd1 == 9 ) 	{ strcpy(buf2, "#GB#gel#Gt"); 	 value = ITEM_WEAR_WAIST; strcpy(buf3,"belt"); }
        else if ( rnd1 == 10 ) 	{ strcpy(buf2, "#GB#grace#Gr");  value = ITEM_WEAR_WRIST; strcpy(buf3,"bracer"); }
        else if ( rnd1 == 11 ) 	{ strcpy(buf2, "#GM#gas#Gk"); 	 value = ITEM_WEAR_FACE;  strcpy(buf3,"mask"); }
        else return;
     // Parse 3 / 3 //
     
  	rnd1 = number_range(1,56);
  	if ( rnd1 > 0 && rnd1 <= 20 ) 		{ strcpy(buf4, "#7Ad#Lve#lnt#Lur#7er");    mult=1.5; strcpy(buf5,"adventurer");} 
  	else if ( rnd1 > 20 && rnd1 <= 40 )	{ strcpy(buf4, "#7F#Li#lght#Le#7r"); 	   mult=2; strcpy(buf5,"fighter");} 
  	else if ( rnd1 > 40 && rnd1 <= 50 )	{ strcpy(buf4, "#7El#Lit#le War#Lri#7or");mult=2.5;strcpy(buf5,"elite warrior");}
  	else if ( rnd1 > 50 && rnd1 <= 55 )	{ strcpy(buf4, "#7Da#Lrk O#lve#Lrlo#7rd"); mult=3; strcpy(buf5,"dark overlord");}  
  	else if ( rnd1 == 56 ) 			{ strcpy(buf4, "#7M#ye#ossi#ya#7h"); 	   mult=5; strcpy(buf5,"messiah");}
  	else if ( rnd1 == 41 && dice(1,6)==4 )	{ strcpy(buf4, "#7Da#0rkne#7ss"); 	   mult=9; strcpy(buf5,"darkness"); } 
  	else return;
	
	
        sprintf(finalshort,"%s %s #0of the %s#n", buf1, buf2, buf4 );
        sprintf(finallong,"A %s %s #0of the %s #nlies here#n", buf1, buf2, buf4 );
        sprintf(finalname,"%s of %s", buf3, buf5 );
        obj = create_object( pObjIndex, 0 );
	ac = number_range(65, 85) * mult;
	hitdam = number_range(65, 85) * mult;
        free_string( obj->name );
        obj->name = str_dup( finalname );
        value = value + 1;
        obj->wear_flags = value;
        obj->weight = 10;
        obj->cost   = 1000;
        obj->item_type = ITEM_ARMOR;
        free_string( obj->short_descr );
        free_string( obj->description );
        obj->short_descr = str_dup( finalshort );
        obj->description = str_dup( finallong );
        obj_to_char(obj, ch);
        return;
}

void do_pkchange (CHAR_DATA *ch, char *argument)
{
  CHAR_DATA *victim;
  char arg[MAX_INPUT_LENGTH];
  char arg1[MAX_INPUT_LENGTH];
  char arg2[MAX_INPUT_LENGTH];
    int amount; 
    argument = one_argument( argument, arg );
    argument = one_argument( argument, arg1 );
    argument = one_argument( argument, arg2 );

if ( arg[0] == '\0' )
    	{
        send_to_char( "Syntax: adjust <person>  <status/pk/pd> <amount>.\n\r", ch );
        return;
	}
if ( arg1[0] == '\0' )
        {
        send_to_char( "Syntax: adjust <person>  <status/pk/pd> <amount>.\n\r", ch );
        return;
        }
if ( arg2[0] == '\0' )
        {
        send_to_char( "Syntax: adjust <person>  <status/pk/pd> <amount>.\n\r", ch );
        return;
        }

	amount = atoi( arg2 );

if ( (victim = get_char_world( ch, arg ) ) == NULL ) 
        {
        send_to_char( "Fucking n00b, cant adjust a person that isnt in the game.\n\r", ch );
        return;
        }
if (!str_cmp(arg1,"status"))
	{
	victim->status += amount;
	}
else if (!str_cmp(arg1,"pk"))
	{
	victim->pkill = victim->pkill + amount;
	}
else if (!str_cmp(arg1,"pd"))
	{
	victim->pdeath = victim->pdeath + amount;
	}
else
	{
	do_pkchange(ch,"");
	return;
	}
        send_to_char( "Successful, you may have to force char to save for the change to come into affect, or just wait a 
bit.\n\r", ch );
return;
}

void do_tizest(CHAR_DATA *ch, char *argument)
{
do_randomitem(ch);
}

void beeserk(CHAR_DATA *ch)
{
int maxwor, reimb, total;
maxwor = ( ch->pcdata->upgrade_level * 2 );
if (ch->pcdata->upgrade_level == 0) maxwor = 1;
if (maxwor > 5) maxwor = 5;

if (( ch->pcdata->shit[DARRENS] > 1 ) && ( maxwor -  ch->pcdata->shit[DARRENS] < 0))
        {
        reimb = (maxwor -  ch->pcdata->shit[DARRENS]);
        total = ( 0 - reimb );
        ch->pcdata->quest += ( total * 150000 );
        ch->pcdata->shit[DARRENS] = maxwor; 
        ptc("You have been reimbursed for the worships taken away from you.\n\r",ch);
        return;
        }
if (( ch->pcdata->shit[ASTAROTH] > 1 ) && ( maxwor -  ch->pcdata->shit[ASTAROTH] < 0))
        {
        reimb = (maxwor -  ch->pcdata->shit[ASTAROTH]);
        total = ( 0 - reimb );
        ch->pcdata->quest += ( total * 150000 );
        ch->pcdata->shit[ASTAROTH] = maxwor;
        ptc("You have been reimbursed for the worships taken away from you.\n\r",ch);
        return;
        }  
if (( ch->pcdata->shit[SPAWN] > 1 ) && ( maxwor -  ch->pcdata->shit[SPAWN] < 0))
        {
        reimb = (maxwor -  ch->pcdata->shit[SPAWN]);
        total = ( 0 - reimb );
        ch->pcdata->quest += ( total * 150000 );
        ch->pcdata->shit[SPAWN] = maxwor; 
        ptc("You have been reimbursed for the worships taken away from you.\n\r",ch);
        return;
        }
if (( ch->pcdata->shit[MARCUS] > 1 ) && ( maxwor -  ch->pcdata->shit[MARCUS] < 0))
        {
        reimb = (maxwor -  ch->pcdata->shit[MARCUS]);
        total = ( 0 - reimb );
        ch->pcdata->quest += ( total * 150000 );
        ch->pcdata->shit[MARCUS] = maxwor; 
        ptc("You have been reimbursed for the worships taken away from you.\n\r",ch);
        return;
        }

}

void do_chaoseq( CHAR_DATA *ch, char *argument )
{
  OBJ_INDEX_DATA *pObjIndex;
  OBJ_DATA *obj;
  char arg[MAX_INPUT_LENGTH];
  int vnum = 0;
  char buf[MAX_INPUT_LENGTH];
  argument = one_argument( argument, arg );
  
  if (IS_NPC(ch)) return;
  
  if (arg[0] == '\0')
  {
send_to_char("Please specify which piece of chaos equipment you wish to make: Sword Bracer Collar Ring Chains Helmet Leggings Boots Gauntlets Sleeves Cloak Belt Visor.\n\r",ch);
  return;
  }
  if (needed(ch) < 2000)
  {

sprintf(buf,"You only have %i status. Try again later\n\r", ch->status );
send_to_char(buf,ch);
return;

  }

if (ch->pcdata->upgrade_level < 4)
{
send_to_char("You must be up5 to make this eq.\n\r",ch);
return;
}

  if (ch->pcdata->quest < 40000)
  {
    send_to_char("You need 40K qps to get a piece of chaos eq.\n\r",ch);
   return;
  }
 if (!str_cmp(arg,"sword")) vnum = 110001;
  else if (!str_cmp(arg,"bracer")) vnum = 110004;
  else if (!str_cmp(arg,"collar")) vnum = 110011;
  else if (!str_cmp(arg,"ring")) vnum = 110005;
  else if (!str_cmp(arg,"chains")) vnum = 110010;
  else if (!str_cmp(arg,"helmet")) vnum = 110009;
  else if (!str_cmp(arg,"leggings")) vnum = 110008;
  else if (!str_cmp(arg,"boots")) vnum = 110007;
  else if (!str_cmp(arg,"gauntlets")) vnum = 110002;
  else if (!str_cmp(arg,"sleeves")) vnum = 110006;
  else if (!str_cmp(arg,"cloak")) vnum = 110013;
  else if (!str_cmp(arg,"belt")) vnum = 110003;
  else if (!str_cmp(arg,"visor")) vnum = 110012;
  else
  {
    do_chaoseq(ch,"");
    return;
	}
  if ( vnum == 0 || (pObjIndex = get_obj_index( vnum )) == NULL)
  {    
    send_to_char("Invalid VNUM, Tell Marcus.\n\r",ch);
    return;
  }
  ch->pcdata->quest -= 40000;
  obj = create_object(pObjIndex, 50);
  obj->questowner = str_dup(ch->pcdata->switchname);
  obj_to_char(obj, ch);
  act("You transform the 40K qp into a $p.",ch,obj,NULL,TO_CHAR);
  act("$n forms a $p out of 40K qp.",ch,obj,NULL,TO_ROOM);
  return;
} 

void do_weapontrain( CHAR_DATA *ch, char *argument )

{
  char arg[MAX_INPUT_LENGTH];
  char buf[MAX_INPUT_LENGTH];
  int max_skl = 200;  
  int i=0;
  argument = one_argument( argument, arg);

if (arg[0] == '\0')
{
	send_to_char("weapontrain <unarmed|slice|stab|slash|whip|claw|blast|pound|crush|grep|bite|pierce|suck>.\n\r",ch);
	return;
}

if (IS_CLASS(ch, CLASS_DROW) && (IS_SET(ch->special, SPC_DROW_WAR) || ch->generation < 3)) max_skl = 300;
    else if( ch->class == CLASS_NINJA) max_skl = 300;
    else if (IS_CLASS(ch, CLASS_DEMON)) max_skl = 350;
    else if (ch->class == CLASS_WEREWOLF) max_skl = 350;
    else if (ch->class == CLASS_MONK) max_skl = 800;
    else if (IS_CLASS(ch, CLASS_ANGEL)) max_skl = 500;
    else if (IS_CLASS(ch, CLASS_LICH)) max_skl = 350;
    else if (IS_CLASS(ch, CLASS_DROID) && (ch->pcdata->powers[CYBORG_LIMBS] > 3)) max_skl = 450;
    else if (IS_CLASS(ch, CLASS_UNDEAD_KNIGHT)) max_skl = UMAX(200, ch->pcdata->powers[WEAPONSKILL] * 50);
    else if (IS_CLASS(ch, CLASS_SAMURAI)) max_skl = 1100;
    else if (IS_CLASS(ch, CLASS_WRAITH)) max_skl = 450;    
    else if (IS_CLASS(ch, CLASS_TITAN)) max_skl = 400;    
    else if( IS_CLASS(ch, CLASS_SHAPESHIFTER) || IS_CLASS(ch, CLASS_TANARRI)) max_skl = 400;

if (ch->generation == 2) max_skl += max_skl *0.1;
    else if(ch->generation == 1) max_skl += max_skl *0.2;
    if (max_skl > 1300) max_skl = 1300;

    if( ch->level < 3 && ch->class != CLASS_MONK && ch->class != CLASS_WEREWOLF) max_skl = 200;

if ( ch->practice < 1000 ) 
{
	sprintf(buf,"You only have %i primal. Try again later when you have the 1000 needed.\n\r", ch->practice );
	send_to_char(buf,ch);
	return;
}

if (!str_cmp(arg,"slice")) i=1;
else if (!str_cmp(arg,"stab")) i=2;
else if (!str_cmp(arg,"slash")) i=3;
else if (!str_cmp(arg,"whip")) i=4;
else if (!str_cmp(arg,"claw")) i=5;
else if (!str_cmp(arg,"blast")) i=6;
else if (!str_cmp(arg,"pound")) i=7;
else if (!str_cmp(arg,"crush")) i=8;
else if (!str_cmp(arg,"grep")) i=9;
else if (!str_cmp(arg,"bite")) i=10;
else if (!str_cmp(arg,"pierce")) i=11;
else if (!str_cmp(arg,"suck")) i=12;
else if (!str_cmp(arg,"unarmed")) i=0;
else
	{
	do_weapontrain(ch,"");
	return;
	}

if (ch->wpn[i] == max_skl)
{
send_to_char("You already have the max amount you can get in that weapon.\n\r",ch);
return;
}

if ((ch->wpn[i] + 100) > max_skl)
{
ch->wpn[i] = max_skl;
ch->practice -= 1000;
send_to_char("You now have the max in that weapon.\n\r",ch);
return;
}

ch->practice -= 1000;
ch->wpn[i] += 100;
send_to_char("You increase your weapon skills.\n\r",ch);
return;
}


void do_spelltrain( CHAR_DATA *ch, char *argument )
{
  char arg[MAX_INPUT_LENGTH];
  char buf[MAX_INPUT_LENGTH];
  int i=0;
  argument = one_argument( argument, arg);

if (arg[0] == '\0')
{
        send_to_char("You have to choose a spell color to train.\n\r",ch);
        return;
}
if ( ch->practice < 3000 )
{
        sprintf(buf,"You only have %i primal. Try again later when you have the 3000 needed.\n\r", ch->practice );
        send_to_char(buf,ch);
        return;
}


if (!str_cmp(arg,"red")) i=1;
else if (!str_cmp(arg,"blue")) i=2;
else if (!str_cmp(arg,"green")) i=3;
else if (!str_cmp(arg,"yellow")) i=4;
else if (!str_cmp(arg,"purple")) i=0;
else 
        {
        do_spelltrain(ch,"");
        return;
        }
if ( ch->spl[i] > 199 )  
{
send_to_char("You already have 200 or over in that color!\n\r",ch);
return;
}

ch->practice -= 3000;
ch->spl[i] = 200;
send_to_char("You have set this spell color to 200.\n\r",ch);
return;  
}

void do_qpconvert( CHAR_DATA *ch, char *argument )
{
  char arg[MAX_INPUT_LENGTH];
  char buf[MAX_INPUT_LENGTH];
  argument = one_argument( argument, arg);

if (arg[0] == '\0')
	{
        send_to_char("qpconvert <hitroll/damroll>\n\r",ch);
        return;
	}

if (ch->pcdata->quest < 5000)
	{
        sprintf(buf,"You only have %i qps. Try again later when you have the 5000 needed.\n\r", ch->pcdata->quest );
        send_to_char(buf,ch);
        return;
	}

if (!str_cmp(arg,"hitroll"))
	{
	if (ch->pcdata->powers[19] == 20)
        	{
        	send_to_char("You have already maxed out your qpconvert for hitroll.\n\r",ch);
        	return;
        	}
	ch->pcdata->powers[19] += 1;
	ch->hitroll +=50;	
	send_to_char("Hitroll increased 50.\n\r",ch);
	}

else if (!str_cmp(arg,"damroll"))
	{
		if (ch->pcdata->powers[18] == 20)
        	{
        	send_to_char("You have already maxed out your qpconvert for damroll.\n\r",ch);
        	return;
        	}
	ch->pcdata->powers[18] += 1;
	ch->damroll +=50;
	send_to_char("Damroll increased 50.\n\r",ch);
	}

else
        {
        do_qpconvert(ch,"");
        return;
        }
        
ch->pcdata->quest -= 5000;
return;
}

void do_detox (CHAR_DATA *ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
  char buf[MAX_STRING_LENGTH];    
  char class[MAX_STRING_LENGTH];
int j;
 argument = one_argument( argument, arg);
         
if (IS_NPC(ch)) return;
        
if (arg[0] == '\0')
{
send_to_char("Detox now sets hp/mana/move to 5k.\n\r",ch);
send_to_char("If you would still like to, type detox continue.\n\r",ch);     
return;
}    

 if (!str_cmp(arg,"continue"))
{        
  if (IS_NPC(ch)) return;
         
    if (ch->pcdata->quest < 30000)
  {
    sprintf(buf,"You need %d more qps.\n\r", 30000 - ch->pcdata->quest);
    send_to_char(buf,ch);
    return;
  }
                
  if ((ch->in_room == NULL || ch->in_room->vnum != 3054))
  {
    send_to_char("You can only detox at the Temple Altar of Midgaard.\n\r",ch);
    return;
  }

   if (ch->class == 0)
     {
    send_to_char("You already have no class.\n\r",ch);
    return;
     }
                
  do_clearstats(ch,"");
    if (ch->class == 1) {j=0; sprintf(class,"Demon");}
  if (ch->class == 4) {j=1; sprintf(class,"Werewolf");}
  if (ch->class == 32) {j=2; sprintf(class,"Drow");}
  if (ch->class == 128) {j=3; sprintf(class,"Ninja");}
  if (ch->class == 8) {j=4; sprintf(class,"Vampire");}
  if (ch->class == 64) {j=5; sprintf(class,"Monk");}
  if (ch->class == 2) {j=6; sprintf(class,"Mage");}
  if (ch->class == 1024) {j=7; sprintf(class,"Tanarri");}
  if (ch->class == 512) {j=8; sprintf(class,"Shapeshifter");}
  if (ch->class == 8192) {j=9; sprintf(class,"Spider Droid");}
  if (ch->class == 16) {j=10; sprintf(class,"Samurai");}
  if (ch->class == 4096) {j=11; sprintf(class,"Undead Knight");}
  if (ch->class == 2048) {j=12; sprintf(class,"Angel");}
  if (ch->class == 256) {j=13; sprintf(class,"Lich");}
  if (ch->class == 32768) {j=14; sprintf(class,"Titan");}
  if (ch->class == 16384) {j=15; sprintf(class,"Wraith");}

  if (!str_cmp(ch->pcdata->switchname,best[j].name))
{
sprintf(buf,"#C%s#0 has lost their ranking of strongest #G%s#0 due to detoxxing#n.\n\r",ch->pcdata->switchname,class);
do_info(NULL,buf);
best[j].status = 0;
free_string(best[j].name); 
best[j].name = str_dup("None");
best[j].pkscore = 0;
} 

  ch->class = 0; 
  if (IS_SET(ch->newbits, NEW_MASTERY)) REMOVE_BIT(ch->newbits, NEW_MASTERY);
  clearshit(ch);
  ch->pcdata->quest -= 30000;
  sprintf(buf,"#7%s #0has forsaken his class, and become human.\n\r", ch->name );
  do_info(ch,buf);
  set_learnable_disciplines(ch);
  do_save(ch,"");
  return;
}
return; 
 }

void do_convert ( CHAR_DATA *ch, char *argument)
{
char arg1[MAX_INPUT_LENGTH];
argument = one_argument( argument, arg1);

if (IS_NPC(ch)) return;

if (arg1[0] == '\0')
	{
	send_to_char("convert <qp|exp> <how many times>\n\r",ch);
	return;
	}
  
     if (!str_cmp(arg1,"qp"))
     { 
             if ( ch->pcdata->quest < 1000 )
             {
             send_to_char("You need at least 1000 quest points to convert.\n\r",ch);
             return;
             }
     ch->expmult += 2;
     ch->pcdata->quest -= 1000;
     }
             
     else if (!str_cmp(arg1,"exp"))
     { 
             if (ch->expmult < 2)
             {
             send_to_char("You need at least 2bil exp to convert.\n\r",ch);
             return;
             }    
     ch->expmult -= 2;
     ch->pcdata->quest += 1000;
     }
   
   else
{
return;
}
}

void do_spread( 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 amount,i;
           
    argument = one_argument( argument, arg1 );
    argument = one_argument( argument, arg2 );
         
    if ( arg1[0] == '\0' || !is_number( arg1 ) )
    {
        send_to_char( "Syntax: spread <vnum> <amount>.\n\r", ch );
        return;
    }   
    
    if ( arg2[0] == '\0' )
    {
amount=1;
    }    
 
    if ( ( pObjIndex = get_obj_index( atoi( arg1 ) ) ) == NULL )
    {
        send_to_char( "No object has that vnum.\n\r", ch );
        return;
    }   

  if (!is_number(arg2))
  {
    send_to_char("Please enter a numeric value.\n\r",ch);
    return;
  }
  if (is_number(arg2))
    {
      amount = atoi( arg2 );
    }   

    for (i=0; i < amount; i++)
  {
    obj = create_object( pObjIndex, 12 );
    obj_to_room(obj, get_random_room(ch));
    if (obj->questmaker != NULL) free_string(obj->questmaker);
    obj->questmaker = str_dup(ch->name);
  }
return;
}
    

void do_worship( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];
int maxwor;

    argument = one_argument( argument, arg);

maxwor = ( ch->pcdata->upgrade_level * 2 );
if (ch->pcdata->upgrade_level == 0) maxwor = 1;   
if (maxwor > 5) maxwor = 5;

if ( (ch->pcdata->shit[ASTAROTH] >= maxwor ) || (ch->pcdata->shit[SPAWN] >= maxwor ) || (ch->pcdata->shit[DARRENS] >= maxwor) 
|| (ch->pcdata->shit[MARCUS] >= maxwor) )
        {
        send_to_char("You can not worship anymore at your current strength.\n\r",ch);
        return;
        }

if (arg[0] == '\0')
	{  
	send_to_char("Which God do you wish to worship?\n\r",ch);
	return;
	}
if (ch->pcdata->quest < 150000)
	{
	send_to_char("You need 150k qp to worship the Lords of Destruction.\n\r",ch);
	return;
	} 
if ((ch->pcdata->shit[DARRENS]  == 5) || (ch->pcdata->shit[MARCUS] == 5) || (ch->pcdata->shit[SPAWN] == 5) || 
(ch->pcdata->shit[ASTAROTH] == 5))
	{
	send_to_char("You cannot worship anymore.\n\r",ch);
	return;
	}

if (!str_cmp(arg,"Astaroth"))
        {
        if (ch->pcdata->shit[DARRENS] != 0) return;
        if (ch->pcdata->shit[SPAWN] != 0) return;
        if (ch->pcdata->shit[MARCUS] != 0) return;
        sprintf(buf,"#R%s #0rises his sword to the skies as #CA#cstarot#Ch #0bestows #7H#nol#7y #nP#7owe#nr #0upon him#n\n\r", ch->name);
	do_info(NULL,buf);
        ch->pcdata->shit[ASTAROTH] ++;
        } 
else if (!str_cmp(arg,"Marcus"))
	{
	if (ch->pcdata->shit[DARRENS] != 0) return;
	if (ch->pcdata->shit[SPAWN] != 0) return;
	if (ch->pcdata->shit[ASTAROTH] != 0) return;
	sprintf(buf,"#R%s #0Roars in Triumph as #RL#ror#Rd #yMa#orc#yus#0 Empowers Him With Extreme Fighting Abilities.\n\r", ch->name);
	do_info(NULL,buf);
	ch->pcdata->shit[MARCUS] ++;
	}
else if (!str_cmp(arg,"Darrens"))
	{
	if (ch->pcdata->shit[MARCUS] != 0) return;
	if (ch->pcdata->shit[SPAWN] != 0) return;
	if (ch->pcdata->shit[ASTAROTH] != 0) return;
	sprintf(buf,"#7%s #LGrins #0as #CD#ca#Cr#cr#Ce#cn#Cs#0, the God of #yRi#och#yes, #0provides him with secrets of #ywe#oal#yth.#n\n\r", ch->name );    
        do_info(ch,buf);
	ch->pcdata->shit[DARRENS] ++;
	}
else if (!str_cmp(arg,"Spawn"))
        {
        if (ch->pcdata->shit[MARCUS] != 0) return;
        if (ch->pcdata->shit[DARRENS] != 0) return;
	if (ch->pcdata->shit[ASTAROTH] != 0) return;
        sprintf(buf,"#7%s #cyells #y'#RS#rpaw#Rn #yL#oor#yd #0Of Darkness #RGrant Me Y#rour #RP#rower#Rs#y'#n\n\r", ch->name); 
        do_info(ch,buf);
        ch->pcdata->shit[SPAWN] ++;
	}
else
	{
	send_to_char("Which God do you wish to worship?\n\r",ch);
	return; 
	}
ch->pcdata->quest -= 150000;
return;
}

void do_spawnhide( CHAR_DATA *ch, char *argument )
{
if (ch->pcdata->shit[SPAWN] == 0)
	{
	send_to_char("You are not worshipping Lord Spawn\n\r",ch);
	return;
	}
if IS_SET(ch->pcdata->shit[3],HIDE)
        {
        send_to_char("You become visible to the world.\n\r",ch);
	act("$n removes his cloak of darkness.\n\r",ch,NULL,NULL,TO_ROOM);
//	ch->pcdata->shit[HIDE] = 0;
REMOVE_BIT(ch->pcdata->shit[3],HIDE);        
return;
        }
if  (!IS_SET(ch->pcdata->shit[3],HIDE))               
        {
	act("Lord Spawn bestows a cloak of darkness upon $n.\n\r",ch,NULL,NULL,TO_ROOM);
        send_to_char("Lord Spawn shields you from all eyes..\n\r",ch);  
//        ch->pcdata->shit[HIDE] = 1;
SET_BIT(ch->pcdata->shit[3],HIDE);
        return;
        }
}

void do_pvision( CHAR_DATA *ch, char *argument )
{
if (ch->pcdata->shit[ASTAROTH] == 0)
        {
        send_to_char("You are not worshipping Lord Astaroth\n\r",ch);
        return;
        }
if IS_SET(ch->pcdata->shit[3],PVISION)
        {
        send_to_char("Your eyes return to their normal state..\n\r",ch);
        act("$n's eyes stop glowing.\n\r",ch,NULL,NULL,TO_ROOM);
REMOVE_BIT(ch->pcdata->shit[3],PVISION);
return; 
        }
if  (!IS_SET(ch->pcdata->shit[3],PVISION))
        {
        act("#0$n's eyes explode into a blinding #7white#0, piercing all shadows.\n\r",ch,NULL,NULL,TO_ROOM);
        send_to_char("#0Your eyes explode into a blinding #7white#0, piercing all shadows.\n\r",ch);
SET_BIT(ch->pcdata->shit[3],PVISION);
        return;
        }
}

void do_forsake( CHAR_DATA *ch, char *argument )
{
    char buf[MAX_INPUT_LENGTH];

if ((ch->pcdata->shit[ASTAROTH]  == 0) && (ch->pcdata->shit[DARRENS]  == 0) && (ch->pcdata->shit[MARCUS] == 0) && 
(ch->pcdata->shit[SPAWN] == 0))
        {
        send_to_char("You have no god to forsake.\n\r",ch);
        return;
        }
	ch->pcdata->shit[MARCUS] = 0;
	ch->pcdata->shit[ASTAROTH] = 0;
        ch->pcdata->shit[SPAWN] = 0; 
        ch->pcdata->shit[DARRENS] = 0;

sprintf(buf,"#7%s#0 Forsakes His Chosen Deity, and Worships No One.#n\n\r" , ch->name);
do_info(ch,buf); 
}

void do_goldkill (CHAR_DATA *ch, char *argument)
{
  CHAR_DATA *victim;
  char arg1[MAX_INPUT_LENGTH];
  char arg2[MAX_INPUT_LENGTH];
  char buf1[MAX_INPUT_LENGTH];
  int initial, dam;
  argument = one_argument( argument, arg1 );
  argument = one_argument( argument, arg2 );


if ( ch->pcdata->shit[DARRENS] < 1 )
        {
        send_to_char( "Huh?", ch );
        return;
        }
if ( IS_SET(ch->in_room->room_flags,ROOM_SAFE) && !ragnarok)
	{   
	send_to_char( "You cannot fight in a safe room.\n\r", ch );
	return;   
	}
if ( arg1[0] == '\0' || !is_number( arg2 ) || arg2[0] == '\0' )
	{
        send_to_char( "Syntax: qpdestroy <victim> <amount of qp >.\n\r", ch );
        return;
	}
if ((victim = get_char_room(ch, arg1)) == NULL)
	{
        send_to_char("They are not here.\n\r", ch );
        return;    
	}
if (is_number(arg2))
	{
	initial = atoi( arg2 );
	}    
if ( initial > 15000 )
	{
	send_to_char("You cannot put more than 15000 qp in this attack.\n\r", ch );	
	return;
	}
if (ch->pcdata->quest < initial)
        {
        send_to_char("You dont have enough QP.\n\r", ch );
        return;
        }

if (is_safe(ch,victim)) return;

if (is_safe(victim,ch)) return;

if (!IS_NPC(victim)) 
{     
        if ((str_cmp(victim->pcdata->lasthit,"") && str_cmp(victim->pcdata->lasthit,ch->pcdata->switchname)))     
{       
send_to_char("They are currently in battle with somebody else.\n\r",ch);
return; 
}       
        
        if ((str_cmp(ch->pcdata->lasthit,"") && str_cmp(ch->pcdata->lasthit,victim->pcdata->switchname)))          
{     
send_to_char("You are currently in battle with somebody else.\n\r",ch);
return;
}     
}     

if (!IS_NPC(victim))
        {
    dam = ch->pcdata->shit[DARRENS] * initial * 1.1;
    if (ch->pcdata->upgrade_level != 0)
    dam = ch->pcdata->shit[DARRENS] * initial * ((ch->pcdata->upgrade_level + 1)/1.5);
    hurt_person(ch, victim, dam);

    do_say(ch,"#CD#ca#Cr#cr#Ce#cn#Cs, #7Lord of #yRi#och#yes #0and #PJe#pwe#Pls, #0I bid thee quest points.");
    do_say(ch,"#0In return, smite down my enemies, and put fear info all!");

    sprintf(buf1,"#7The Mighty Hand #0Of #CL#cor#Cd #CD#ca#Cr#cr#Ce#cn#Cs #RSt#rri#Rkes #7$N #R[#C%d#n#R]#n" , dam);
    act(buf1,ch,NULL,victim, TO_NOTVICT);
    sprintf(buf1,"#7The Mighty Hand #0Of #CL#cor#Cd #CD#ca#Cr#cr#Ce#cn#Cs #RSt#rri#Rkes #7$N #R[#C%d#n#R]#n" , dam);
    act(buf1,ch,NULL,victim, TO_CHAR);
    sprintf(buf1,"#7The Mighty Hand #0Of #CL#cor#Cd #CD#ca#Cr#cr#Ce#cn#Cs #RSt#rri#Rkes #7You #R[#C%d#n#R]#n" , dam);
    act(buf1,ch,NULL,victim, TO_VICT);
    ch->pcdata->quest -= initial;
    ch->fight_timer +=5;
    victim->fight_timer +=5;
    ch->pcdata->lasthit = str_dup(victim->pcdata->switchname);
    victim->pcdata->lasthit = str_dup(ch->pcdata->switchname);
    ch->pcdata->lasthittimer += 10;
    victim->pcdata->lasthittimer += 10;	
    WAIT_STATE(ch, 35);

    return;
   }
}

  
void do_darkspawn (CHAR_DATA *ch, char *argument)
{

  CHAR_DATA *victim;
  AFFECT_DATA af;
  char arg[MAX_INPUT_LENGTH];
  char buf1[MAX_INPUT_LENGTH];  
int dam;

argument = one_argument( argument, arg );

   if (ch->pcdata->shit[SPAWN] == 0)
   {
   send_to_char("Huh?\n\r",ch);
   return;
   }
if ( ch->mana < 20000 )
{
send_to_char("Not enough mana\n\r",ch);
return;
}   
else if (arg[0] == '\0')
   {
   send_to_char("Please choose your victim.\n\r", ch );
   return;
   }

   else if ((victim = get_char_room(ch, arg)) == NULL)
   {
        send_to_char("They are not here.\n\r", ch );
        return;
   }

      if (is_safe(ch, victim)) return;
      if (is_safe(victim,ch)) return;

if (!IS_NPC(victim))
{
        if ((str_cmp(victim->pcdata->lasthit,"") && str_cmp(victim->pcdata->lasthit,ch->pcdata->switchname)))
{
send_to_char("They are currently in battle with somebody else.\n\r",ch);
return;
}

        if ((str_cmp(ch->pcdata->lasthit,"") && str_cmp(ch->pcdata->lasthit,victim->pcdata->switchname)))
{

send_to_char("You are currently in battle with somebody else.\n\r",ch);
return;
}
}


      do_say(ch,"#7Spawn Lord Of #0Darkness#n#7 send this fool to #0shadows#n...#R ShadowFlare!#n");
      act("#RBalls of #0pitch-black #Renergy is drawn inside of #0$N's #Rbody.",ch,NULL,victim,TO_ALL);
      act("#0$N #Rsuddenly turns into a shadowly outline as a demonic cackle fills the room.",ch,NULL,victim,TO_ALL);
      act("#RThe Demonic Cackles deafens your ears as the balls of Pitch-Black energy rips apart #0$N's #Rbody.",ch,NULL,victim,TO_ROOM);
      act("#0$N #Rsuddenly turns into a shadowly outline as a demonic cackle fills the room.",ch,NULL,victim,TO_ROOM);
      act("#RThe room is filled with blinding energy as the pitch-black substance #0ROARS#n #Rfrom within #0$N!!!",ch,NULL,victim,TO_ROOM);     

    dam = ch->pcdata->shit[SPAWN] * 14000 + ( (ch->pcdata->upgrade_level + 1) * 10000 ) ;
    sprintf(buf1,"#7The Sweeping #0Darkness #0Of #CL#cor#Cd #RS#rpaw#Rn #RSt#rri#Rkes #7$N #R[#C%d#n#R]#n" , dam);
    act(buf1,ch,NULL,victim, TO_NOTVICT);
    act(buf1,ch,NULL,victim, TO_CHAR);
    sprintf(buf1,"#7The Sweeping #0Darkness #0Of #CL#cor#Cd #RS#rpaw#Rn #RSt#rri#Rkes #7You #R[#C%d#n#R]#n" , dam);
    act(buf1,ch,NULL,victim, TO_VICT);
    hurt_person(ch, victim, dam);
    do_kill(ch,victim->name);

    //Blind Enemy  
      if (IS_SET(victim->act,PLR_HOLYLIGHT)) REMOVE_BIT(victim->act,PLR_HOLYLIGHT);
      if (IS_SET(victim->affected_by, AFF_DETECT_HIDDEN))
        REMOVE_BIT(victim->affected_by, AFF_DETECT_HIDDEN);
      if (IS_SET(victim->affected_by, AFF_DETECT_INVIS))
        REMOVE_BIT(victim->affected_by, AFF_DETECT_INVIS);
      af.type      = skill_lookup("blindness");
      af.location  = APPLY_HITROLL;
      af.modifier  = -4;
      af.duration  = 60;
      af.bitvector = AFF_BLIND;
      affect_to_char( victim, &af );
      WAIT_STATE(ch,20);

ch->mana  -= ((ch->max_mana) * .2 );
return;
}