;Fix stage 4 nuke
modify:
{
	match:
	{
		"classname"		"trigger_multiple"
		"targetname"	"stage_4_escape_elevator_trigger_win"
	}
	insert:
	{
		"parentname"	"stage_4_escape_elevator"
	}
}


;; _

;; stage 3 - players can't block elevator

modify:
{
	match:
	{
		"targetname" "stage_3_facility_mine_elevator"
		"classname" "func_movelinear"
	}
	replace:
	{
		"blockdamage" "1000"
	}
}

;; stage 3 - fix afk teleport origin

modify:
{
	match:
	{
		"targetname" "stage_3_afk_teleport_3"
		"classname" "trigger_teleport"
	}
	replace:
	{
		"origin" "-9888 7552 6815"
	}
}

;; stage 3 - block cave skip, playerclips for last elevator

add:
{
	"targetname" "stage3_clip"
	"vrad_brush_cast_shadows" "0"
	"StartDisabled" "0"
	"spawnflags" "2"
	"Solidity" "0"
	"solidbsp" "0"
	"rendermode" "10"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "-9460.5 8500.5 7356"
	"invert_exclusion" "0"
	"InputFilter" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"classname" "func_brush"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -537 -5.5 -60,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 537 5.5 60,0.1,1"
}
add:
{
	"targetname" "stage3_clip"
	"vrad_brush_cast_shadows" "0"
	"StartDisabled" "0"
	"spawnflags" "2"
	"Solidity" "0"
	"solidbsp" "0"
	"rendermode" "10"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "240 8648 7679"
	"invert_exclusion" "0"
	"InputFilter" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"classname" "func_brush"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -16 -24 -128,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 16 24 128,0.1,1"
}
add:
{
	"targetname" "stage3_clip"
	"vrad_brush_cast_shadows" "0"
	"StartDisabled" "0"
	"spawnflags" "2"
	"Solidity" "0"
	"solidbsp" "0"
	"rendermode" "10"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "-240 8648 7679"
	"invert_exclusion" "0"
	"InputFilter" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"classname" "func_brush"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -16 -24 -128,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 16 24 128,0.1,1"
}

modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "4783"
	}
	insert:
	{
		"OnMapSpawn" "stage3_clip,FireUser1,,0,-1"
	}
}

;; stage 4 - fix crane collision model

modify:
{
	match:
	{
		"model" "models/cranes/crane_docks.mdl"
		"classname" "prop_dynamic_override"
		"hammerid" "18302"
	}
	replace:
	{
		"solid" "0"
	}
}

;; stage 5 - fix nuke

modify:
{
	match:
	{
		"targetname" "stage_5_zombie_detector"
		"classname" "trigger_multiple"
	}
	insert:
	{
		"parentname" "Helicopter"
	}
}

;; stage 5 - players can't block elevators

modify:
{
	match:
	{
		"targetname" "/illya_parking_lift_[A-B]/"
		"classname" "func_movelinear"
	}
	replace:
	{
		"blockdamage" "10000"
	}
}
modify:
{
	match:
	{
		"targetname" "/illya_parking_lift_[A-B]_door/"
		"classname" "func_door"
	}
	replace:
	{
		"ignoredebris" "0"
	}
}
modify:
{
	match:
	{
		"targetname" "/illya_parking_lift_[A-B]_door_bottom/"
		"classname" "func_door"
	}
	replace:
	{
		"ignoredebris" "0"
	}
}

;; stage 4 - split players on spawn

add:
{
	"origin" "-11840 13824 13321"
	"targetname" "s4_spawn_ct1"
	"angles" "0 0 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "-12736 13824 13321"
	"targetname" "s4_spawn_ct2"
	"angles" "0 180 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"model" "*47"
	"wait" "1"
	"targetname" "stage4_spawn_tele_ct"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "11768 14848 14448"
	"filtername" "filter_humans"
	"classname" "trigger_multiple"
	"OnStartTouch" "stage4_spawn_case_ct,PickRandomShuffle,,0,-1"
}
add:
{
	"origin" "11768 14868 14468"
	"targetname" "stage4_spawn_case_ct"
	"classname" "logic_case"
	"OnCase01" "s4_spawn_ct1,Teleport,,0,-1"
	"OnCase02" "s4_spawn_ct2,Teleport,,0,-1"
}

add:
{
	"origin" "-10944 13824 13257"
	"targetname" "s4_spawn_t1"
	"angles" "0 180 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "-13632 13824 13257"
	"targetname" "s4_spawn_t2"
	"angles" "0 0 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"model" "*47"
	"wait" "1"
	"targetname" "stage4_spawn_tele_t"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "11768 14848 14448"
	"filtername" "filter_zombies"
	"classname" "trigger_multiple"
	"OnStartTouch" "stage4_spawn_case_t,PickRandomShuffle,,0,-1"
}
add:
{
	"origin" "11768 14868 14478"
	"targetname" "stage4_spawn_case_t"
	"classname" "logic_case"
	"OnCase01" "s4_spawn_t1,Teleport,,0,-1"
	"OnCase02" "s4_spawn_t2,Teleport,,0,-1"
}

modify:
{
	match:
	{
		"targetname" "stage_case"
		"classname" "logic_case"
	}
	delete:
	{
		"OnCase05" "teleport_destination_afk,AddOutput,origin -11024 13824 13264,0,1"
		"OnCase05" "teleport_destination_afk,AddOutput,angles 0 180 0,0,1"
	}
	insert:
	{
		"OnCase05" "spawn_teleport,Kill,,0,1"
		"OnCase05" "stage4_spawn_tele_ct,Enable,,2,1"
		"OnCase05" "stage4_spawn_tele_t,Enable,,3,1"
	}
}

;; stage 5 - boss arena rework

add:
{
	"origin" "-5032 3952 7744"
	"spawnflags" "0"
	"solid" "6"
	"skin" "0"
	"SetBodyGroup" "0"
	"rendermode" "0"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"RandomAnimation" "0"
	"pressuredelay" "0"
	"PerformanceMode" "0"
	"modelscale" "1.0"
	"model" "models/props_wasteland/interior_fence001g.mdl"
	"MinAnimTime" "5"
	"MaxAnimTime" "10"
	"health" "0"
	"fadescale" "1"
	"fademindist" "-1"
	"ExplodeRadius" "0"
	"ExplodeDamage" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"DisableBoneFollowers" "0"
	"angles" "0 0 0"
	"classname" "prop_dynamic_override"
}
add:
{
	"origin" "-5032 4080 7728"
	"StartDisabled" "0"
	"spawnflags" "0"
	"solid" "6"
	"skin" "0"
	"SetBodyGroup" "0"
	"rendermode" "0"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"RandomAnimation" "0"
	"pressuredelay" "0"
	"PerformanceMode" "0"
	"model" "models/props/de_nuke/crate_extrasmall.mdl"
	"mindxlevel" "0"
	"MinAnimTime" "5"
	"maxdxlevel" "0"
	"MaxAnimTime" "10"
	"fadescale" "1"
	"fademindist" "-1"
	"fademaxdist" "0"
	"ExplodeRadius" "0"
	"ExplodeDamage" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"DisableBoneFollowers" "1"
	"angles" "0 0 0"
	"classname" "prop_dynamic"
}
add:
{
	"classname" "prop_dynamic"
	"origin" "-4980 4124 7680"
	"angles" "0 90 0"
	"model" "models/props_lab/blastdoor001c.mdl"
	"disablereceiveshadows" "1"
	"disableshadows" "1"
	"solid" "6"
	"rendermode" "10"
}
add:
{
	"model" "*179"
	"targetname" "stage_5_finale_zombie_blocker_tp"
	"target" "teleport_destination_afk"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-4608 3584 8000"
	"filtername" "filter_zombies"
	"classname" "trigger_teleport"
}

modify:
{
	match:
	{
		"targetname" "depth_titan_End"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "stage_5_finale_zombie_blocker_tp,Enable,,0,1"
		"OnTrigger" "stage_5_finale_zombie_blocker_tp,Disable,,1,1"
	}
}

;; stage 1,2,3,5 - fix zombie checker

modify:
{
	match:
	{
		"targetname" "/stage_[1-5]_zombie_detector/"
		"classname" "trigger_multiple"
	}
	replace:
	{
		"wait" "1"
	}
}

;; stage 2 - tram antistuck

add:
{
	"model" "*120"
	"targetname" "tram_hurt"
	"StartDisabled" "0"
	"spawnflags" "1"
	"origin" "38.39 -1457.25 4671.91"
	"damage" "100000"
	"classname" "trigger_hurt"
}
add:
{
	"model" "*120"
	"targetname" "tram_hurt"
	"StartDisabled" "0"
	"spawnflags" "1"
	"origin" "-74.76 -1272.08 4676.86"
	"damage" "100000"
	"classname" "trigger_hurt"
	"OnUser3" "!self,AddOutput,angles 0 90 0,0,1"
}
modify:
{
	match:
	{
		"origin" "-1408 -2000 4720"
		"classname" "trigger_multiple"
		"hammerid" "766891"
	}
	insert:
	{
		"OnUser3" "tram_hurt,FireUser3,,0,1"
		"OnUser3" "tram_hurt,SetParent,env_illya_tram_moving,0,1"
	}
}

;; stage 1-3,5 - fix nuke

modify:
{
	match:
	{
		"damage" "10000"
		"classname" "trigger_hurt"
	}
	replace:
	{
		"damage" "100000"
	}
}

;------------------
; Event 13/03/2021
; Random Weapon
;------------------

;;add:
;;{
;;	"origin" "0 0 0"
;;	"targetname" "Stripper_EventCasper_Case"
;;	"classname" "logic_case"
;;	"OnCase01" "point_servercommand,Command,zr_unrestrict m3,0,1"
;;	"OnCase02" "point_servercommand,Command,zr_unrestrict xm1014,0,1"
;;	"OnCase03" "point_servercommand,Command,zr_unrestrict mac10,0,1"
;;	"OnCase04" "point_servercommand,Command,zr_unrestrict tmp,0,1"
;;	"OnCase05" "point_servercommand,Command,zr_unrestrict mp5navy,0,1"
;;	"OnCase06" "point_servercommand,Command,zr_unrestrict ump45,0,1"
;;	"OnCase07" "point_servercommand,Command,zr_unrestrict p90,0,1"
;;	"OnCase08" "point_servercommand,Command,zr_unrestrict galil,0,1"
;;	"OnCase09" "point_servercommand,Command,zr_unrestrict famas,0,1"
;;	"OnCase10" "point_servercommand,Command,zr_unrestrict ak47,0,1"
;;	"OnCase11" "point_servercommand,Command,zr_unrestrict m4a1,0,1"
;;	"OnCase12" "point_servercommand,Command,zr_unrestrict sg552,0,1"
;;	"OnCase13" "point_servercommand,Command,zr_unrestrict aug,0,1"
;;	"OnCase14" "point_servercommand,Command,zr_unrestrict m249,0,1"
;;	"OnCase01" "point_servercommand,Command,sm_give @ct m3,0.1,1"
;;	"OnCase02" "point_servercommand,Command,sm_give @ct xm1014,0.1,1"
;;	"OnCase03" "point_servercommand,Command,sm_give @ct mac10,0.1,1"
;;	"OnCase04" "point_servercommand,Command,sm_give @ct tmp,0.1,1"
;;	"OnCase05" "point_servercommand,Command,sm_give @ct mp5navy,0.1,1"
;;	"OnCase06" "point_servercommand,Command,sm_give @ct ump45,0.1,1"
;;	"OnCase07" "point_servercommand,Command,sm_give @ct p90,0.1,1"
;;	"OnCase08" "point_servercommand,Command,sm_give @ct galil,0.1,1"
;;	"OnCase09" "point_servercommand,Command,sm_give @ct famas,0.1,1"
;;	"OnCase10" "point_servercommand,Command,sm_give @ct ak47,0.1,1"
;;	"OnCase11" "point_servercommand,Command,sm_give @ct m4a1,0.1,1"
;;	"OnCase12" "point_servercommand,Command,sm_give @ct sg552,0.1,1"
;;	"OnCase13" "point_servercommand,Command,sm_give @ct aug,0.1,1"
;;	"OnCase14" "point_servercommand,Command,sm_give @ct m249,0.1,1"
;;	"OnCase01" "point_servercommand,Command,say ** The weapon this round is M3 **,0.05,1"
;;	"OnCase01" "point_servercommand,Command,say ** The weapon this round is M3 **,1.05,1"
;;	"OnCase01" "point_servercommand,Command,say ** The weapon this round is M3 **,2.05,1"
;;	"OnCase02" "point_servercommand,Command,say ** The weapon this round is XM1014 **,0.05,1"
;;	"OnCase02" "point_servercommand,Command,say ** The weapon this round is XM1014 **,1.05,1"
;;	"OnCase02" "point_servercommand,Command,say ** The weapon this round is XM1014 **,2.05,1"
;;	"OnCase03" "point_servercommand,Command,say ** The weapon this round is Mac10 **,0.05,1"
;;	"OnCase03" "point_servercommand,Command,say ** The weapon this round is Mac10 **,0.05,1"
;;	"OnCase03" "point_servercommand,Command,say ** The weapon this round is Mac10 **,0.05,1"
;;	"OnCase04" "point_servercommand,Command,say ** The weapon this round is TMP **,0.05,1"
;;	"OnCase04" "point_servercommand,Command,say ** The weapon this round is TMP **,0.05,1"
;;	"OnCase04" "point_servercommand,Command,say ** The weapon this round is TMP **,0.05,1"
;;	"OnCase05" "point_servercommand,Command,say ** The weapon this round is MP5Navy **,0.05,1"
;;	"OnCase05" "point_servercommand,Command,say ** The weapon this round is MP5Navy **,0.05,1"
;;	"OnCase05" "point_servercommand,Command,say ** The weapon this round is MP5Navy **,0.05,1"
;;	"OnCase06" "point_servercommand,Command,say ** The weapon this round is UMP45 **,0.05,1"
;;	"OnCase06" "point_servercommand,Command,say ** The weapon this round is UMP45 **,0.05,1"
;;	"OnCase06" "point_servercommand,Command,say ** The weapon this round is UMP45 **,0.05,1"
;;	"OnCase07" "point_servercommand,Command,say ** The weapon this round is P90 **,0.05,1"
;;	"OnCase07" "point_servercommand,Command,say ** The weapon this round is P90 **,0.05,1"
;;	"OnCase07" "point_servercommand,Command,say ** The weapon this round is P90 **,0.05,1"
;;	"OnCase08" "point_servercommand,Command,say ** The weapon this round is Galil **,0.05,1"
;;	"OnCase08" "point_servercommand,Command,say ** The weapon this round is Galil **,0.05,1"
;;	"OnCase08" "point_servercommand,Command,say ** The weapon this round is Galil **,0.05,1"
;;	"OnCase09" "point_servercommand,Command,say ** The weapon this round is Famas **,0.05,1"
;;	"OnCase09" "point_servercommand,Command,say ** The weapon this round is Famas **,0.05,1"
;;	"OnCase09" "point_servercommand,Command,say ** The weapon this round is Famas **,0.05,1"
;;	"OnCase10" "point_servercommand,Command,say ** The weapon this round is AK47 **,0.05,1"
;;	"OnCase10" "point_servercommand,Command,say ** The weapon this round is AK47 **,0.05,1"
;;	"OnCase10" "point_servercommand,Command,say ** The weapon this round is AK47 **,0.05,1"
;;	"OnCase11" "point_servercommand,Command,say ** The weapon this round is M4A1 **,0.05,1"
;;	"OnCase11" "point_servercommand,Command,say ** The weapon this round is M4A1 **,0.05,1"
;;	"OnCase11" "point_servercommand,Command,say ** The weapon this round is M4A1 **,0.05,1"
;;	"OnCase12" "point_servercommand,Command,say ** The weapon this round is SG552 **,0.05,1"
;;	"OnCase12" "point_servercommand,Command,say ** The weapon this round is SG552 **,0.05,1"
;;	"OnCase12" "point_servercommand,Command,say ** The weapon this round is SG552 **,0.05,1"
;;	"OnCase13" "point_servercommand,Command,say ** The weapon this round is AUG **,0.05,1"
;;	"OnCase13" "point_servercommand,Command,say ** The weapon this round is AUG **,0.05,1"
;;	"OnCase13" "point_servercommand,Command,say ** The weapon this round is AUG **,0.05,1"
;;	"OnCase14" "point_servercommand,Command,say ** The weapon this round is M249 **,0.05,1"
;;	"OnCase14" "point_servercommand,Command,say ** The weapon this round is M249 **,0.05,1"
;;	"OnCase14" "point_servercommand,Command,say ** The weapon this round is M249 **,0.05,1"
;;}

;;add:
;;{
;;	"origin" "0 0 0"
;;	"targetname" "Stripper_EventCasper_Relay"
;;	"spawnflags" "0"
;;	"classname" "logic_relay"
;;	"OnSpawn" "point_servercommand,Command,zr_restrict shotgun,0,1"
;;	"OnSpawn" "point_servercommand,Command,zr_restrict smg,0,1"
;;	"OnSpawn" "point_servercommand,Command,zr_restrict rifle,0,1"
;;	"OnSpawn" "point_servercommand,Command,zr_restrict m249,0,1"
;;	"OnSpawn" "point_servercommand,Command,zr_restrict sniper,0,1"
;;	"OnSpawn" "point_servercommand,Command,say ** Selecting a random weapon this round... ***,0.5,1"
;;	"OnSpawn" "Stripper_EventCasper_Case,PickRandom,,1.5,1"
;;}
