;remove my name from chat & enabling practice button
modify:
{
	match:
	{
		"classname" "logic_auto"
	}
	delete:
	{
		"OnMapSpawn" "command,Command,say << Map ported by koen >>,10,-1"
	}
	insert:
	{
		"OnMapSpawn" "practice_start_button,Unlock,,12,-1"
		"OnMapSpawn" "command,Command,say *** Practice button unlocked ***,11.50,-1"
	}
}

;fix health not being set properly by moving the set health trigger due to people spawning in late
modify:
{
	match:
	{
		"classname" "trigger_multiple"
		"targetname" "health1"
	}
	replace:
	{
		"origin" "9250 -12802 1200"
	}
}

;nerf zombie slow so players will have to defend a bit
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "laser_hurt_zm"
	}
	delete:
	{
		"OnStartTouch" "speed,ModifySpeed,0.2,0,-1"
	}
	insert:
	{
		"OnStartTouch" "speed,ModifySpeed,0.5,0,-1"
	}
}

;------------------------------------------------
; Fixes health issue for late joining people
;------------------------------------------------
modify:
{
	match:
	{
		"classname" "logic_auto"
	}
	delete:
	{
		"OnMapSpawn" "health1,Enable,,1,1"
	}
	insert:
	{
		"OnMapSpawn" "late_hp_timer,Enable,,1,1"
		"OnMapSpawn" "late_hp_timer,Disable,,25,1"
		"OnMapSpawn" "late_hp_timer,Kill,,26,1"
	}
}

;------------------------------------------------
; Fixes health issue for late joining people
;------------------------------------------------
add:
{
	"origin" "7632 312 2408"
	"UseRandomTime" "0"
	"targetname" "late_hp_timer"
	"StartDisabled" "1"
	"spawnflags" "0"
	"RefireTime" "0.5"
	"classname" "logic_timer"
	"OnTimer" "health1,Enable,,0,-1"
	"OnTimer" "health1,Disable,,0.4,-1"
}

;=================================================
;=================================================
; Add practice mode
;=================================================
;=================================================

;-----------------------------
; Adds teleporter for humans
;-----------------------------
add:
{
	"model" "*100"
	"targetname" "practice_mode_human_tele"
	"target" "tele_last_tp2"
	"StartDisabled" "1"
	"spawnflags" "4097"
	"filtername" "human"
	"origin" "209.5 -595 394"
	"classname" "trigger_teleport"
}
add:
{
	"model" "*82"
	"targetname" "practice_mode_human_tele2"
	"target" "tele_last_tp2"
	"StartDisabled" "1"
	"spawnflags" "4097"
	"filtername" "human"
	"origin" "8646.73 -9388.15 967.5"
	"classname" "trigger_teleport"
}

;-----------------------------
; Adds teleporter for zombies
;-----------------------------
add:
{
	"model" "*100"
	"targetname" "practice_mode_zombie_tele"
	"target" "zm_tp3"
	"StartDisabled" "1"
	"spawnflags" "4097"
	"filtername" "zombie"
	"origin" "209.5 -595 394"
	"classname" "trigger_teleport"
}
add:
{
	"model" "*82"
	"targetname" "practice_mode_zombie_tele2"
	"target" "zm_tp3"
	"StartDisabled" "1"
	"spawnflags" "4097"
	"filtername" "zombie"
	"origin" "8646.73 -9388.15 967.5"
	"classname" "trigger_teleport"
}

;-------------------------------------
; Adds button for practice in spawn
;-------------------------------------
add:
{
	"model" "*39"
	"wait" "-1"
	"unlocked_sound" "0"
	"unlocked_sentence" "0"
	"targetname" "practice_start_button"
	"speed" "5"
	"spawnflags" "3073"
	"rendermode" "0"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "155.92 -529.23 884.53"
	"movedir" "0 0 0"
	"locked_sound" "0"
	"locked_sentence" "0"
	"lip" "0"
	"health" "0"
	"disablereceiveshadows" "0"
	"classname" "func_button"
	"OnPressed" "command,Command,say *** PRACTICE MODE ENABLED ***,0,1"
	"OnPressed" "command,Command,say *** PRACTICE STARTING in 2 ***,1,1"
	"OnPressed" "command,Command,say *** PRACTICE STARTING in 1 ***,2,1"
	"OnPressed" "command,Command,say *** PRACTICE MODE STARTING NOW - GL ***,3,1"
	"OnPressed" "practice_mode_zombie_tele,Enable,,3,1"
	"OnPressed" "practice_mode_zombie_tele2,Enable,,3,1"
	"OnPressed" "practice_mode_human_tele,Enable,,3,1"
	"OnPressed" "practice_mode_human_tele2,Enable,,3,1"
	"OnPressed" "music_my,volume,0,3,1"
	"OnPressed" "trr_tp1,Kill,,0,1"
	"OnPressed" "lv1_tp,Kill,,0,1"
}

;-------------------------------------------------
; Fix possible ZM exploit at the dodge balls area
;-------------------------------------------------
filter:
{
	"classname" "trigger_teleport"
	"targetname" "zm_go_tp2"
}
add:
{
	"model" "*82"
	"hammerid" "165397"
	"UseLandmarkAngles" "1"
	"targetname" "zm_go_tp2"
	"target" "zm_tp3"
	"StartDisabled" "1"
	"spawnflags" "4097"
	"origin" "-7156.27 -5404.01 -2917.67"
	"CheckDestIfClearForPlayer" "0"
	"classname" "trigger_teleport"
}

;-----------------------------------------------
; Fix possible Humans exploit at the end of map
;-----------------------------------------------
add:
{
	"model" "*96"
	"id" "999987"
	"vrad_brush_cast_shadows" "0"
	"targetname" "end_exploit"
	"StartDisabled" "0"
	"spawnflags" "2"
	"Solidity" "0"
	"solidbsp" "0"
	"rendermode" "0"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "-13892.5 -4069 912"
	"invert_exclusion" "0"
	"InputFilter" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"classname" "func_brush"
}
add:
{
	"model" "*96"
	"id" "999987"
	"vrad_brush_cast_shadows" "0"
	"targetname" "end_exploit"
	"StartDisabled" "0"
	"spawnflags" "2"
	"Solidity" "0"
	"solidbsp" "0"
	"rendermode" "0"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "-13892.5 -3710 912"
	"invert_exclusion" "0"
	"InputFilter" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"classname" "func_brush"
}
modify:
{
	match:
	{
		"classname" "logic_auto"
	}
	insert:
	{
		"OnMapSpawn" "end_exploit,addoutput,angles 90 0 0,1,-1"
	}
}