//@unloadnpc DeathMatch
//@unloadnpc Exit1
//@unloadnpc Exit2
//@unloadnpc Exit3
//@unloadnpc Exit4
//@unloadnpc Healer#deathmatch
//@loadnpc npc/thor/deathmatch.txt


-	script	DeathMatch	FAKE_NPC,{

OnClock2200:
	if (!$deathmatch) {
			set $deathmatch,1;
			pvpon "guild_vs1";
			announce "Death Match Arena is now open.  Visit and talk to PvP Gatekeeper at the Office to join.",bc_all,0x66FFFF;
	}
	end;

OnClock1300:
	if ($deathmatch) {
		set $deathmatch,0;
		pvpoff "guild_vs1";
		announce "Death Match Arena is now over.  We hope you had fun.",bc_all,0x66FFFF;
	}
	end;

OnPCDieEvent:
	if ( strcharinfo(3) == "guild_vs1" ) {
		message strcharinfo(0), "You will respawn in 3 seconds";
		sleep2 3000;
		warp "guild_vs1", 0,0;
		percentheal 100,100;
	
		skilleffect AL_BLESSING,0;
		sc_start SC_BLESSING,240000,10;

		skilleffect AL_INCAGI,0;
		sc_start SC_INC_AGI,240000,10;
		heal -15,0;
		sleep2 1000;
	}
	end;

OnPCLoginEvent:

	if (deathmatch == 1) {
		set deathmatch, 0;
		sc_end SC_BLESSING;
		sc_end SC_INC_AGI;
		set Hp,dhp;
		set Sp,dsp;
		warp dlastmap$, dlastx, dlasty;
	}

}

guild_vs1,7,49,2	script	Exit1	WARPNPC,1,1,{
	set deathmatch,0;
	sc_end SC_BLESSING;
	sc_end SC_INC_AGI;
	set Hp,dhp;
	set Sp,dsp;
	warp dlastmap$, dlastx, dlasty;
end;
}

guild_vs1,49,92,2	script	Exit2	WARPNPC,1,1,{
	set deathmatch,0;
	sc_end SC_BLESSING;
	sc_end SC_INC_AGI;
	set Hp,dhp;
	set Sp,dsp;
	warp dlastmap$, dlastx, dlasty;
end;
}


guild_vs1,92,50,2	script	Exit3	WARPNPC,1,1,{
	set deathmatch,0;
	sc_end SC_BLESSING;
	sc_end SC_INC_AGI;
	set Hp,dhp;
	set Sp,dsp;
	warp dlastmap$, dlastx, dlasty;
end;
}


guild_vs1,50,7,2	script	Exit4	WARPNPC,1,1,{
	set deathmatch,0;
	sc_end SC_BLESSING;
	sc_end SC_INC_AGI;
	set Hp,dhp;
	set Sp,dsp;
	warp dlastmap$, dlastx, dlasty;
end;
}


/* Healer */

guild_vs1,50,50,2	script	Healer#deathmatch	4_F_NURSE,{
	if (!$deathmatch) end;	
	.@Delay = 10;	// Heal delay, in seconds
	if (@HD > gettimetick(2)) end;
	percentheal 100,100;
	skilleffect AL_BLESSING,0;
	sc_start SC_BLESSING,240000,10;
	skilleffect AL_INCAGI,0;
	sc_start SC_INC_AGI,240000,10;
	heal -15,0;
	if (.@Delay) @HD = gettimetick(2)+.@Delay;
	end;
}

guild_vs1	mapflag	nocommand	2
guild_vs1	mapflag	zone	DeathMatch
guild_vs1	mapflag	nobranch
guild_vs1	mapflag	nomemo
guild_vs1	mapflag	noteleport
guild_vs1	mapflag	nosave
guild_vs1	mapflag	novending
guild_vs1	mapflag	nowarp
guild_vs1	mapflag	nobranch
guild_vs1	mapflag	partylock

