;add more time for humans to escape
modify:
{
	match:
	{
		"targetname" "speed_nuke_relay"
		"classname" "logic_relay"
	}
	delete:
	{
		"OnTrigger" "point_servercommand,Command,say nuke,0,-1"
		"OnTrigger" "global_hurt_hm,Enable,,180,-1"
	}
	insert:
	{
		"OnTrigger" "point_servercommand,Command,say Nuke timer was restarted,0,-1"
		"OnTrigger" "point_servercommand,Command,say 30 seconds before nuke,190,-1"
		"OnTrigger" "point_servercommand,Command,say 10 seconds before nuke,210,-1"
		"OnTrigger" "point_servercommand,Command,say 5 seconds before nuke,215,-1"
		"OnTrigger" "point_servercommand,Command,say 4 seconds before nuke,216,-1"
		"OnTrigger" "point_servercommand,Command,say 3 seconds before nuke,217,-1"
		"OnTrigger" "point_servercommand,Command,say 2 seconds before nuke,218,-1"
		"OnTrigger" "point_servercommand,Command,say 1 seconds before nuke,219,-1"

		"OnTrigger" "global_hurt_hm,Enable,,220,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "monk_trigger"
		"classname" "trigger_multiple"
	}
	insert:
	{
		"OnTrigger" "trigger_05_b,Trigger,,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "windlock_breakable02"
		"classname" "func_breakable"
	}
	replace:
	{
		"health"	"1100"
	}
}

;add shortcut
add:
{
	"StartDisabled" "0"
	"spawnflags" "0"
	"classname" "logic_relay"
	"targetname" "trigger_01_a"

	"OnTrigger" "bblock_rotating00,FireUser1,,0.1,1"
	"OnTrigger" "point_servercommand,Command,say Town main gates is open now,0.1,1"
	"OnTrigger" "trigger_01_b,CancelPending,,0,1"
}
add:
{
	"StartDisabled" "0"
	"spawnflags" "0"
	"classname" "logic_relay"
	"targetname" "trigger_01_b"

	"OnTrigger" "bblock_rotating00,FireUser1,,120,1"
	"OnTrigger" "point_servercommand,Command,say Town main gates will open in 120 seconds,0,1"
	"OnTrigger" "point_servercommand,Command,say Town main gates is open now,120,1"
	"OnTrigger" "trigger_01_a,Disable,,120.4,1"
	"OnTrigger" "global_teleport_01,Enable,,119.5,1"
	"OnTrigger" "locationinfo_case,InValue,2,120,1"
	"OnTrigger" "music_case,InValue,5,120,1"
	"OnTrigger" "drains_trigger,kill,,120.5,1"
	"OnTrigger" "trigger_01_c,Enable,,120,1"
	"OnTrigger" "trigger_02,kill,,210,1"
}

;Added auto-trigger for non Kz players
modify:
{
	match:
	{
		"origin" "6338.5 8744.5 2572.5"
		"classname" "trigger_multiple"
	}
	insert:
	{
		"OnStartTouch" "trigger_01_c,trigger,,0,-1"
	}
}

add:
{
	"StartDisabled" "1"
	"spawnflags" "0"
	"classname" "logic_relay"
	"targetname" "trigger_01_c"
	"onTrigger" "point_servercommand,Command,say Drain Shortcut will open in 90 sec,0,1"
	"onTrigger" "trigger_01_d,disable,,70,1"
	"onTrigger" "bblock_door01,Open,,90,1"
	"OnTrigger" "shortcut02,Kill,,60,1"
}
add:
{
	"StartDisabled" "0"
	"spawnflags" "0"
	"classname" "logic_relay"
	"targetname" "trigger_01_d"
	"onTrigger" "trigger_01_c,CancelPending,,0,1"
	"OnTrigger" "bblock_door01,FireUser1,,20,1"
	"OnTrigger" "point_servercommand,Command,say Drain Shortcut is open now,20,1"
	"OnTrigger" "point_servercommand,Command,say Drain Shortcut will open in 20 sec,0,1"
}
modify:
{
	match:
	{
		"targetname" "trigger_02"
		"classname" "logic_relay"
	}
	delete:
	{
		"OnTrigger" "bblock_door01,FireUser1,,20,1"
		"OnTrigger" "point_servercommand,Command,say Drain Shortcut is open now,20,1"
		"OnTrigger" "point_servercommand,Command,say Drain Shortcut will open in 20 sec,0,1"
	}
	insert:
	{
		"onTrigger" "trigger_01_d,trigger,,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "trigger_01"
		"classname" "logic_relay"
	}
	delete:
	{
		"OnTrigger" "bblock_rotating00,FireUser1,,10,1"
		"OnTrigger" "point_servercommand,Command,say Main Gates Shortcut is open now,10,1"
		"OnTrigger" "point_servercommand,Command,say Main Gates Shortcut will open in 10 sec,0,1"
	}
	insert:
	{
		"OnTrigger" "trigger_01_a,Trigger,,0,1"
		"OnTrigger" "trigger_01_b,CancelPending,,0,1"
	}
}

;add Blue Ruin Shortcut
add:
{
	"StartDisabled" "0"
	"spawnflags" "0"
	"classname" "logic_relay"
	"targetname" "trigger_08_a"

	"OnTrigger" "windlock_breakable00,FireUser1,,5,1"
	"OnTrigger" "point_servercommand,Command,say Blue Ruin Shortcut is open now,5,1"
	"OnTrigger" "point_servercommand,Command,say Blue Ruin Shortcut will open in 5 sec,0,1"
	"OnTrigger" "trigger_08_b,CancelPending,,0,1"
}
add:
{
	"StartDisabled" "0"
	"spawnflags" "0"
	"classname" "logic_relay"
	"targetname" "trigger_08_b"

	"OnTrigger" "windlock_breakable00,FireUser1,,110,1"
	"OnTrigger" "point_servercommand,Command,say Blue Ruin Shortcut will open in 110 seconds,0,1"
	"OnTrigger" "point_servercommand,Command,say Blue Ruin Shortcut is open now,110,1"
	"OnTrigger" "trigger_08_a,Disable,,109.5,1"
}
modify:
{
	match:
	{
		"targetname" "trigger_08"
		"classname" "logic_relay"
	}
	delete:
	{
		"OnTrigger" "windlock_breakable00,FireUser1,,10,1"
		"OnTrigger" "point_servercommand,Command,say Blue Ruin Shortcut is open now,10,1"
		"OnTrigger" "point_servercommand,Command,say Blue Ruin Shortcut will open in 10 sec,0,1"
	}
	insert:
	{
		"OnTrigger" "trigger_08_a,Trigger,,0,1"
		"OnTrigger" "trigger_08_a,Disable,,0.05,1"
		"OnTrigger" "trigger_08_b,CancelPending,,0,1"
		"OnTrigger"	"shortcut08,Kill,,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "blue_ruins2_trigger"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "trigger_08_b,Trigger,,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "mod_speedrun_branch"
		"classname" "logic_branch"
	}
	insert:
	{
		"OnTrue" "trigger_01_a,Kill,,0,1"
		"OnTrue" "trigger_01_b,Kill,,0,1"
		"OnTrue" "trigger_01_c,Kill,,0,1"
		"OnTrue" "trigger_01_d,Kill,,0,1"
		"OnTrue" "trigger_08_a,Kill,,0,1"
		"OnTrue" "trigger_08_b,Kill,,0,1"
	}
}

modify:
{
	match:
	{
		"message" "jk/lock11.mp3"
	}
	replace:
	{
		"message" "#jk/lock11.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock10.mp3"
	}
	replace:
	{
		"message" "#jk/lock10.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock4_1.mp3"
	}
	replace:
	{
		"message" "#jk/lock4_1.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock9_1.mp3"
	}
	replace:
	{
		"message" "#jk/lock9_1.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock7_2.mp3"
	}
	replace:
	{
		"message" "#jk/lock7_2.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock9.mp3"
	}
	replace:
	{
		"message" "#jk/lock9.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock2.mp3"
	}
	replace:
	{
		"message" "#jk/lock2.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock0_1.mp3"
	}
	replace:
	{
		"message" "#jk/lock0_1.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock1.mp3"
	}
	replace:
	{
		"message" "#jk/lock1.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock0.mp3"
	}
	replace:
	{
		"message" "#jk/lock0.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock8.mp3"
	}
	replace:
	{
		"message" "#jk/lock8.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock3_1.mp3"
	}
	replace:
	{
		"message" "#jk/lock3_1.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock7_1.mp3"
	}
	replace:
	{
		"message" "#jk/lock7_1.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock6.mp3"
	}
	replace:
	{
		"message" "#jk/lock6.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock7.mp3"
	}
	replace:
	{
		"message" "#jk/lock7.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock5.mp3"
	}
	replace:
	{
		"message" "#jk/lock5.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock4.mp3"
	}
	replace:
	{
		"message" "#jk/lock4.mp3"
	}
}
modify:
{
	match:
	{
		"message" "jk/lock3.mp3"
	}
	replace:
	{
		"message" "#jk/lock3.mp3"
	}
}

;-----------------;
; CSGO Fixes 2024 ;
;-----------------;

;-------------------------------------------;
; Final TP delay just like in cs:go version ;
;-------------------------------------------;

modify:
{
	match:
		{
		"targetname" "trigger_10"
		"classname" "logic_relay"
		}
	delete:
		{
		"OnTrigger" "point_servercommand,Command,say Final ZM teleport will be activated in 15 sec,2,1"
		"OnTrigger" "teleport_case,InValue,6,15,1"
		"OnTrigger" "speedrun_final_hurt_ct,Enable,,15,1"
		"OnTrigger" "speedrun_final_hurt_ct,Disable,,17,1"
		}
	insert:
		{
		"OnTrigger" "point_servercommand,Command,say Final ZM teleport will be activated in 20 sec,2,1"
		"OnTrigger" "teleport_case,InValue,6,20,1"
		"OnTrigger" "speedrun_final_hurt_ct,Enable,,20,1"
		"OnTrigger" "speedrun_final_hurt_ct,Disable,,22,1"
		}
}

modify:
{
	match:
		{
		"classname" "logic_relay"
		"targetname" "trigger_01_d"
		}
	delete:
		{
		"OnTrigger" "bblock_door01,FireUser1,,20,1"
		"OnTrigger" "point_servercommand,Command,say Drain Shortcut is open now,20,1"
		"OnTrigger" "point_servercommand,Command,say Drain Shortcut will open in 20 sec,0,1"
		}
	insert:
		{
		"OnTrigger" "bblock_door01,FireUser1,,5,1"
		"OnTrigger" "point_servercommand,Command,say Drain Shortcut is open now,5,1"
		"OnTrigger" "point_servercommand,Command,say Drain Shortcut will open in 5 sec,0,1"
		}
}

;-----------------------------------;
; Replace Timer for Final Shortcuts ;
;-----------------------------------;

modify:
{
	match:
		{
		"targetname" "trigger_09"
		"classname" "logic_relay"
		}
	delete:
		{
		"OnTrigger" "windlock_door05,Open,,5,1"
		"OnTrigger" "windlock_door06,Open,,6,1"
		"OnTrigger" "point_servercommand,Command,say Final Tower Shortcuts will open in 5 sec,0,1"
		"OnTrigger" "point_servercommand,Command,say Final Tower Shortcuts is open now,5,1"
		}
	insert:
		{
		"OnTrigger" "windlock_door05,Open,,0,1"
		"OnTrigger" "windlock_door06,Open,,0,1"
		"OnTrigger" "point_servercommand,Command,say Final Tower Shortcuts is open now,0,1"
		}
}

;----------------------------------;
; Adding zombie protection on Tree ;
;----------------------------------;

add:
{
	"model" "*177"
	"classname" "trigger_push"
	"alternateticksfix" "0"
	"FallingSpeedThreshold" "-150"
	"filtername" "filter_zm"
	"origin" "1924 10097 1436.5"
	"pushdir" "0 270 0"
	"spawnflags" "1"
	"speed" "800"
	"StartDisabled" "1"
	"targetname" "protect_push_01"
}

add:
{
	"model" "*178"
	"classname" "trigger_once"
	"filtername" "filter_zm"
	"origin" "1922 10054 1452.51"
	"spawnflags" "1"
	"StartDisabled" "0"
	"targetname" "protect_trigger_01"
	"OnStartTouch" "protect_push_01,Enable,,0,1"
	"OnStartTouch" "protect_push_01,Kill,,8,1"
	"OnStartTouch" "point_servercommand,Command,say Zombie Protection Shield activated on 8 sec,0,1"
	"OnStartTouch" "protect_particle_01,Start,,0,1"
	"OnStartTouch" "protect_particle_01,Kill,,8,1"
}

add:
{
	"classname" "info_particle_system"
	"angles" "0 0 0"
	"effect_name" "custom_particle_028"
	"targetname" "protect_particle_01"
	"origin" "1925 10074 1432"
}

add:
{
	"model" "*177"
	"classname" "trigger_push"
	"alternateticksfix" "0"
	"FallingSpeedThreshold" "-150"
	"filtername" "filter_zm"
	"origin" "1846 10058.5 2031.5"
	"pushdir" "0 90 0"
	"spawnflags" "1"
	"speed" "800"
	"StartDisabled" "1"
	"targetname" "protect_push_02"
}

add:
{
	"model" "*178"
	"classname" "trigger_once"
	"filtername" "filter_zm"
	"origin" "1846 10099 2031.52"
	"spawnflags" "1"
	"StartDisabled" "0"
	"targetname" "protect_trigger_02"
	"OnStartTouch" "protect_push_02,Enable,,0,1"
	"OnStartTouch" "protect_push_02,Kill,,7,1"
	"OnStartTouch" "point_servercommand,Command,say Zombie Protection Shield activated on 7 sec,0,1"
	"OnStartTouch" "protect_particle_02,Start,,0,1"
	"OnStartTouch" "protect_particle_02,Kill,,7,1"
}

add:
{
	"classname" "info_particle_system"
	"angles" "0 0 0"
	"effect_name" "custom_particle_028"
	"targetname" "protect_particle_02"
	"origin" "1840 10076 2025"
}

;--------------------------------------;
; Adding zombie protection on Chappell ;
;--------------------------------------;

add:
{
	"classname" "trigger_push"
	"alternateticksfix" "0"
	"FallingSpeedThreshold" "-150"
	"filtername" "filter_zm"
	"origin" "7081 4935.5 6297.49"
	"pushdir" "0 90 0"
	"spawnflags" "1"
	"speed" "800"
	"StartDisabled" "1"
	"targetname" "protect_push_03"
}
add:
{
	"model" "*178"
	"classname" "trigger_once"
	"filtername" "filter_zm"
	"origin" "7076 4941 6315.51"
	"spawnflags" "1"
	"StartDisabled" "0"
	"targetname" "protect_trigger_03"
	"OnStartTouch" "protect_push_03,Enable,,0,1"
	"OnStartTouch" "protect_push_03,Kill,,7,1"
	"OnStartTouch" "point_servercommand,Command,say Zombie Protection Shield activated on 7 sec,0,1"
	"OnStartTouch" "protect_particle_03,Start,,0,1"
	"OnStartTouch" "protect_particle_03,Kill,,7,1"
}
add:
{
	"classname" "info_particle_system"
	"angles" "0 0 0"
	"effect_name" "custom_particle_028"
	"targetname" "protect_particle_03"
	"origin" "7072 4927 6308.99"
}

;-----------------------------------;
; Remove Old Town Chain and add new ;
;-----------------------------------;

filter:
{
	"targetname" "town_chain_trigger"
	"classname" "trigger_once"
}

add:
{
	"id" "122111"
	"targetname" "town_chain_trigger"
	"StartDisabled" "0"
	"spawnflags" "1"
	"origin" "6757 9676.5 3030"
	"classname" "trigger_once"
	"OnStartTouch" "trigger_00,Trigger,,0,1"
	"OnStartTouch" "trigger_01_b,Trigger,,0,1"
}

modify:
{
	match:
		{
		"hammerid" "122284"
		"classname" "logic_auto"
		}
	insert:
		{
		"OnMapSpawn" "town_chain_trigger,AddOutput,solid 2,0.5,-1"
		"OnMapSpawn" "town_chain_trigger,AddOutput,mins -5 -563.5 -196,1,-1"
		"OnMapSpawn" "town_chain_trigger,AddOutput,maxs 5 563.5 196,1,-1"
		
		"OnMapSpawn" "protect_push_03,AddOutput,solid 2,0.5,-1"
		"OnMapSpawn" "protect_push_03,AddOutput,mins -79 -50.5 -85.5,1,-1"
		"OnMapSpawn" "protect_push_03,AddOutput,maxs 79 50.5 85.5,1,-1"
		}
}

;-------------------;
; Remove Final Door ;
;-------------------;

filter:
{		
	"origin" "6144 1865 10971"
	"targetname" "windlock_breakable02"
}