;; _

;; disable bhop

;modify:
;{
;	match:
;	{
;		"classname" "logic_auto"
;		"hammerid" "179109"
;	}
;	insert:
;	{
;		"OnMapSpawn" "Server,Command,sv_enablebunnyhopping 0,0,-1"
;	}
;}

;; fix medkit

modify:
{
	match:
	{
		"targetname" "item_medkit_pistol"
		"classname" "weapon_elite"
	}
	replace:
	{
		"OnPlayerPickup" "!activator,AddOutput,targetname player_medkit,0,-1"
	}
}

;; fix afk teleport

modify:
{
	match:
	{
		"targetname" "afk_zone_1"
		"classname" "trigger_teleport"
	}
	insert:
	{
		"target" "afk_zone_dest"
	}
}

add:
{
	"targetname" "afk_zone_2_teleport"
	"target" "afk_zone_2_dest"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "132 6943.5 -3521"
	"classname" "trigger_teleport"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -1468 -623.5 -119,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 1468 623.5 119,0.1,1"
}
modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "179109"
	}
	insert:
	{
		"OnMapSpawn" "afk_zone_2_teleport,FireUser1,,0.1,1"
	}
}

;; prevent door from being blocked by ct's

add:
{
	"model" "*16"
	"StartDisabled" "1"
	"targetname" "grate_hurt"
	"spawnflags" "1"
	"origin" "896 10819 -3536.22"
	"nodmgforce" "0"
	"filtername" "filter_humans"
	"damagetype" "256"
	"damagemodel" "0"
	"damagecap" "20"
	"damage" "30"
	"classname" "trigger_hurt"
}
modify:
{
	match:
	{
		"targetname" "grate_door_door"
		"classname" "func_door_rotating"
	}
	replace:
	{
		"dmg" "1000"
	}
	insert:
	{
		"OnFullyOpen" "grate_hurt,Disable,,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "grate_door_return"
		"classname" "info_teleport_destination"
	}
	replace:
	{
		"origin" "896 10592 -3584"
	}
}

;; open door by a timer if triggerer delaying/ztele'd/suicided

modify:
{
	match:
	{
		"targetname" "grate_door_tp1"
		"origin" "896 10808 -3536.22"
		"classname" "trigger_teleport"
	}
	insert:
	{
		"OnStartTouch" "grate_hurt,Enable,,0.5,1"
		"OnStartTouch" "grate_door_door,Open,,40,1"
		"OnStartTouch" "grate_antidelay,Enable,,40,1"
	}
}
add:
{
	"model" "*45"
	"targetname" "grate_antidelay"
	"target" "grate_door_return"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "900 11398 -4116"
	"classname" "trigger_teleport"
}

;; extra holds with extra teleports

add:
{
	"targetname" "extra_hold1"
	"vrad_brush_cast_shadows" "0"
	"StartDisabled" "0"
	"spawnflags" "2"
	"Solidity" "0"
	"solidbsp" "0"
	"rendermode" "10"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "978.5 2852 -2341.5"
	"invert_exclusion" "0"
	"InputFilter" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"classname" "func_brush"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -653.5 -100 -474.5,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 653.5 100 474.5,0.1,1"
}
add:
{
	"model" "*17"
	"StartDisabled" "0"
	"spawnflags" "1"
	"origin" "778.5 2669 -2640.5"
	"classname" "trigger_once"
	"OnStartTouch" "Server,Command,say **Let's wait for other survivors**,0,1"
	"OnStartTouch" "extra_hold1,Disable,,20,1"
	"OnStartTouch" "Server,Command,say **Keep moving!**,21,1"
}

modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "179109"
	}
	insert:
	{
		"OnMapSpawn" "extra_hold1,FireUser1,,0,-1"
		"OnMapSpawn" "afk_tele*,FireUser1,,0,-1"
		"OnMapSpawn" "extra_hold1,Enable,,0,-1"
	}
}

add:
{
	"origin" "6920 12350 -3635"
	"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/z-o-m-b-i-e/metro_2033/train/m_33_metro_train_02_one_part.mdl"
	"mindxlevel" "0"
	"MinAnimTime" "5"
	"maxdxlevel" "0"
	"MaxAnimTime" "10"
	"fadescale" "1"
	"fademindist" "-1"
	"fademaxdist" "0"
	"ExplodeRadius" "0"
	"ExplodeDamage" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"DisableBoneFollowers" "0"
	"angles" "0 270 0"
	"classname" "prop_dynamic"
}
add:
{
	"origin" "7334 12349 -3590"
	"StartDisabled" "0"
	"spawnflags" "0"
	"targetname" "extra_hold2"
	"solid" "6"
	"skin" "0"
	"SetBodyGroup" "0"
	"rendermode" "0"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"RandomAnimation" "0"
	"pressuredelay" "0"
	"PerformanceMode" "0"
	"model" "models/z-o-m-b-i-e/metro_ll/trash/m_ll_trash_debris_01.mdl"
	"mindxlevel" "0"
	"MinAnimTime" "5"
	"maxdxlevel" "0"
	"MaxAnimTime" "10"
	"fadescale" "1"
	"fademindist" "-1"
	"fademaxdist" "0"
	"ExplodeRadius" "0"
	"ExplodeDamage" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"DisableBoneFollowers" "0"
	"angles" "0 0 0"
	"classname" "prop_dynamic"
}
add:
{
	"model" "*35"
	"StartDisabled" "0"
	"spawnflags" "1"
	"origin" "7273 12347 -3523"
	"classname" "trigger_once"
	"OnStartTouch" "Server,Command,say **Defend until the rubble is cleared**,0,1"
	"OnStartTouch" "extra_hold2,Kill,,20,1"
	"OnStartTouch" "Server,Command,say **The way is clear!**,21,1"
	"OnStartTouch" "Server,Command,say **AFK teleport in 20 seconds**,25,1"
	"OnStartTouch" "afk_zone_dest,AddOutput,origin 7745 12344 -3584,44.9,1"
	"OnStartTouch" "afk_zone_dest,AddOutput,angles 0 0 0,44.9,1"
	"OnStartTouch" "afk_tele1,Enable,,45,1"
}
add:
{
	"targetname" "afk_tele1"
	"target" "afk_zone_dest"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "2826.5 9710.5 -3935"
	"classname" "trigger_teleport"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -4405.5 -3409.5 -1241,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 4405.5 3409.5 1241,0.1,1"
}

modify:
{
	match:
	{
		"targetname" "station_door_trigger"
		"origin" "10144 7168 -3577.69"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "Server,Command,say **AFK teleport in 20 seconds**,0,-1"
	}
}

add:
{
	"origin" "9512 5505 -3746"
	"spawnflags" "2"
	"targetname" "extra_hold3_temp"
	"Template01" "extra_hold3_button"
	"Template02" "extra_hold3_spark"
	"classname" "point_template"
}
add:
{
	"origin" "9512 5505 -3746"
	"targetname" "extra_hold3_maker"
	"spawnflags" "0"
	"PostSpawnSpeed" "0"
	"PostSpawnInheritAngles" "0"
	"PostSpawnDirectionVariance" "0.15"
	"PostSpawnDirection" "0 0 0"
	"EntityTemplate" "extra_hold3_temp"
	"angles" "0 0 0"
	"classname" "env_entity_maker"
	"OnEntitySpawned" "hold3_door1,Open,,21,1"
}

add:
{
	"model" "*2"
	"wait" "9"
	"unlocked_sound" "0"
	"unlocked_sentence" "0"
	"targetname" "extra_hold3_button"
	"speed" "10"
	"spawnflags" "0"
	"sounds" "0"
	"rendermode" "0"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "9494.5 5507 -3758.5"
	"movedir" "-90 0 0"
	"locked_sound" "0"
	"locked_sentence" "0"
	"lip" "130"
	"health" "0"
	"disablereceiveshadows" "0"
	"classname" "func_button"
	"OnIn" "!self,Kill,,0,-1"
}
add:
{
	"origin" "9512 5505 -3746"
	"targetname" "extra_hold3_spark"
	"parentname" "extra_hold3_button"
	"TrailLength" "1"
	"spawnflags" "640"
	"MaxDelay" "0"
	"Magnitude" "2"
	"angles" "0 0 0"
	"classname" "env_spark"
}

modify:
{
	match:
	{
		"origin" "9508 5568 -3796"
		"classname" "func_door_rotating"
		"hammerid" "191029"
	}
	replace:
	{
		"spawnflags" "2304"
	}
	insert:
	{
		"targetname" "hold3_door1"
		"OnLockedUse" "Server,Command,say **Looks like the door is sealed...**,2,1"
		"OnLockedUse" "Server,Command,say **Hold until we cut it open**,7,1"
		"OnLockedUse" "extra_hold3_maker,ForceSpawn,,9,1"
		"OnLockedUse" "extra_hold3_button,Press,,10,1"
		"OnLockedUse" "extra_hold3_spark,StartSpark,,10,1"
		"OnLockedUse" "hold3_door1,Unlock,,20,1"
		"OnLockedUse" "hold3_door1,Open,,21,1"
	}
}
modify:
{
	match:
	{
		"origin" "6784 2844 -3796"
		"classname" "func_door_rotating"
		"hammerid" "191040"
	}
	replace:
	{
		"spawnflags" "2304"
	}
	insert:
	{
		"targetname" "hold3_door2"
		"OnLockedUse" "extra_hold3_maker,AddOutput,origin 6848 2848 -3747,2,1"
		"OnLockedUse" "extra_hold3_maker,AddOutput,angles 0 90 0,2.1,1"		
		"OnLockedUse" "extra_hold3_maker,ForceSpawn,,2.5,1"
		"OnLockedUse" "extra_hold3_spark,SetParent,extra_hold3_button,2.9,1"
		"OnLockedUse" "extra_hold3_button,Press,,3,1"
		"OnLockedUse" "extra_hold3_spark,StartSpark,,3,1"
		"OnLockedUse" "hold3_door2,Unlock,,13,1"
		"OnLockedUse" "hold3_door2,Open,,14,1"
	}
}
modify:
{
	match:
	{
		"origin" "8796 2736 -3796"
		"classname" "func_door_rotating"
		"hammerid" "191052"
	}
	replace:
	{
		"spawnflags" "2304"
	}
	insert:
	{
		"targetname" "hold3_door3"
		"OnLockedUse" "extra_hold3_maker,AddOutput,origin 8793 2799 -3747,2,1"
		"OnLockedUse" "extra_hold3_maker,AddOutput,angles 0 180 0,2.1,1"
		"OnLockedUse" "extra_hold3_maker,ForceSpawn,,2.5,1"
		"OnLockedUse" "extra_hold3_spark,SetParent,extra_hold3_button,2.9,1"
		"OnLockedUse" "extra_hold3_button,Press,,3,1"
		"OnLockedUse" "extra_hold3_spark,StartSpark,,3,1"
		"OnLockedUse" "hold3_door3,Unlock,,13,1"
		"OnLockedUse" "hold3_door3,Open,,14,1"
	}
}
modify:
{
	match:
	{
		"origin" "8804 16 -3756"
		"classname" "func_door_rotating"
		"hammerid" "229381"
	}
	replace:
	{
		"spawnflags" "2304"
	}
	insert:
	{
		"targetname" "hold3_door4"
		"OnLockedUse" "extra_hold3_maker,AddOutput,origin 8806 -48 -3704,2,1"
		"OnLockedUse" "extra_hold3_maker,AddOutput,angles 0 0 0,2.1,1"
		"OnLockedUse" "extra_hold3_maker,ForceSpawn,,2.5,1"
		"OnLockedUse" "extra_hold3_spark,SetParent,extra_hold3_button,2.9,1"
		"OnLockedUse" "extra_hold3_button,Press,,3,1"
		"OnLockedUse" "extra_hold3_spark,StartSpark,,3,1"
		"OnLockedUse" "hold3_door4,Unlock,,13,1"
		"OnLockedUse" "hold3_door4,Open,,14,1"
	}
}
modify:
{
	match:
	{
		"origin" "8784 -196 -4092"
		"classname" "func_door_rotating"
		"hammerid" "229392"
	}
	replace:
	{
		"spawnflags" "2304"
	}
	insert:
	{
		"targetname" "hold3_door5"
		"OnLockedUse" "extra_hold3_maker,AddOutput,origin 8721 -194 -4041,2,1"
		"OnLockedUse" "extra_hold3_maker,AddOutput,angles 0 90 0,2.1,1"
		"OnLockedUse" "extra_hold3_maker,ForceSpawn,,2.5,1"
		"OnLockedUse" "extra_hold3_spark,SetParent,extra_hold3_button,2.9,1"
		"OnLockedUse" "extra_hold3_button,Press,,3,1"
		"OnLockedUse" "extra_hold3_spark,StartSpark,,3,1"
		"OnLockedUse" "hold3_door5,Unlock,,13,1"
		"OnLockedUse" "hold3_door5,Open,,14,1"
	}
}
modify:
{
	match:
	{
		"origin" "8720 -1280 -4146"
		"classname" "func_door_rotating"
		"hammerid" "229407"
	}
	replace:
	{
		"spawnflags" "2304"
	}
	insert:
	{
		"targetname" "hold3_door6"
		"OnLockedUse" "extra_hold3_maker,AddOutput,origin 8782 -1277 -4098,2,1"
		"OnLockedUse" "extra_hold3_maker,AddOutput,angles 0 90 0,2.1,1"
		"OnLockedUse" "extra_hold3_maker,ForceSpawn,,2.5,1"
		"OnLockedUse" "extra_hold3_spark,SetParent,extra_hold3_button,2.9,1"
		"OnLockedUse" "extra_hold3_button,Press,,3,1"
		"OnLockedUse" "extra_hold3_spark,StartSpark,,3,1"
		"OnLockedUse" "hold3_door6,Unlock,,13,1"
		"OnLockedUse" "hold3_door6,Open,,14,1"
	}
}
modify:
{
	match:
	{
		"origin" "8720 -4736 -4146"
		"classname" "func_door_rotating"
		"hammerid" "229419"
	}
	replace:
	{
		"spawnflags" "2304"
	}
	insert:
	{
		"targetname" "hold3_door7"
		"OnLockedUse" "Server,Command,say **This should be the last door**,2,1"
		"OnLockedUse" "Server,Command,say **Keep defending!**,7,1"
		"OnLockedUse" "extra_hold3_maker,AddOutput,origin 8782 -4733 -4098,10,1"
		"OnLockedUse" "extra_hold3_maker,AddOutput,angles 0 90 0,10.1,1"
		"OnLockedUse" "extra_hold3_maker,ForceSpawn,,10.5,1"
		"OnLockedUse" "extra_hold3_button,Press,,11,1"
		"OnLockedUse" "extra_hold3_spark,StartSpark,,11,1"
		"OnLockedUse" "hold3_door7,Unlock,,21,1"
		"OnLockedUse" "hold3_door7,Open,,22,1"
	}
}

modify:
{
	match:
	{
		"origin" "9248 -5616 -4044"
		"classname" "trigger_once"
		"hammerid" "203900"
	}
	insert:
	{
		"OnStartTouch" "Server,Command,say **Zombies will be teleported to last room in 10 seconds**,62,1"
		"OnStartTouch" "afk_zone_dest,AddOutput,origin 9227 -5937 -4087,71.5,1"
		"OnStartTouch" "afk_zone_dest,AddOutput,angles 0 180 0,71.5,1"
		"OnStartTouch" "afk_tele2,Enable,,72,1"
	}
}
add:
{
	"targetname" "afk_tele2"
	"target" "afk_zone_dest"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "8704 644 -3107.5"
	"classname" "trigger_teleport"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -2128 -6460 -1100.5,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 2128 6460 1100.5,0.1,1"
}

;; apply human skin

modify:
{
	match:
	{
		"targetname" "spawn_tp_ct"
		"filtername" "filter_humans"
		"classname" "trigger_teleport"
	}
	insert:
	{
		"OnStartTouch" "!activator,AddOutput,modelindex 189,0,-1"
	}
}

;; music volume 

modify:
{
	match:
	{
		"message" "metro2033/music/ambience_1.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#metro2033/music/ambience_1.mp3"
	}
}
modify:
{
	match:
	{
		"message" "metro2033/music/ambience_2.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#metro2033/music/ambience_2.mp3"
	}
}
modify:
{
	match:
	{
		"message" "metro2033/music/intro_diff_1.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#metro2033/music/intro_diff_1.mp3"
	}
}
modify:
{
	match:
	{
		"message" "metro2033/music/intro_diff_2.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#metro2033/music/intro_diff_2.mp3"
	}
}
modify:
{
	match:
	{
		"message" "metro2033/music/intro_diff_3.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#metro2033/music/intro_diff_3.mp3"
	}
}
modify:
{
	match:
	{
		"message" "metro2033/music/ending_diff_1.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#metro2033/music/ending_diff_1.mp3"
	}
}
modify:
{
	match:
	{
		"message" "metro2033/music/ending_diff_2.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#metro2033/music/ending_diff_2.mp3"
	}
}
modify:
{
	match:
	{
		"message" "metro2033/music/ending_diff_3.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#metro2033/music/ending_diff_3.mp3"
	}
}
modify:
{
	match:
	{
		"message" "metro2033/music/ending_diff_4.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#metro2033/music/ending_diff_4.mp3"
	}
}
modify:
{
	match:
	{
		"message" "metro2033/music/warmup.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#metro2033/music/warmup.mp3"
	}
}

;; fix item visibility?

modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "179109"
	}
	insert:
	{
		"OnMapSpawn" "item_flame_model,AddOutput,rendermode 10,8,-1"
		"OnMapSpawn" "item_flame_model,AddOutput,rendermode 1,10,-1"
		"OnMapSpawn" "item_medkit_model,AddOutput,rendermode 10,8,-1"
		"OnMapSpawn" "item_medkit_model,AddOutput,rendermode 1,10,-1"
		"OnMapSpawn" "item_railgun_model,AddOutput,rendermode 10,8,-1"
		"OnMapSpawn" "item_railgun_model,AddOutput,rendermode 1,10,-1"
		"OnMapSpawn" "item_shotgun_model,AddOutput,rendermode 10,8,-1"
		"OnMapSpawn" "item_shotgun_model,AddOutput,rendermode 1,10,-1"
		"OnMapSpawn" "item_flame_model,AddOutput,rendermode 10,18,-1"
		"OnMapSpawn" "item_flame_model,AddOutput,rendermode 1,20,-1"
		"OnMapSpawn" "item_medkit_model,AddOutput,rendermode 10,18,-1"
		"OnMapSpawn" "item_medkit_model,AddOutput,rendermode 1,20,-1"
		"OnMapSpawn" "item_railgun_model,AddOutput,rendermode 10,18,-1"
		"OnMapSpawn" "item_railgun_model,AddOutput,rendermode 1,20,-1"
		"OnMapSpawn" "item_shotgun_model,AddOutput,rendermode 10,18,-1"
		"OnMapSpawn" "item_shotgun_model,AddOutput,rendermode 1,20,-1"
	}
}

;; start with snow particle disabled

modify:
{
	match:
	{
		"effect_name" "snow_storm"
		"classname" "info_particle_system"
	}
	replace:
	{
		"start_active" "0"
		"flag_as_weather" "0"
	}
	insert:
	{
		"targetname" "snow"
	}
}

;; longer warmup

modify:
{
	match:
	{
		"targetname" "Relay_Level1"
		"classname" "logic_relay"
	}
	delete:
	{
		"OnTrigger" "Level_Counter,Add,1,0,-1"
		"OnTrigger" "music_warmup,PlaySound,,30,-1"
	}
	insert:
	{
		"OnTrigger" "bunker_m_door_button,Kill,,0,1"
		"OnTrigger" "spawn_tp_zm,Kill,,0,1"
		"OnTrigger" "music_warmup,PlaySound,,5,1"
		"OnTrigger" "Level_Counter,Add,1,74,1"
		"OnTrigger" "Server,Command,mp_restartgame 1,75,1"
	}
}
