; Use a bigger teleport trigger on 2nd surf stage to patch gaps
modify:
{
	match:
	{
		 "classname" "trigger_teleport"
		 "origin" "-4009 10243.5 8623.5"
	}
	replace:
	{
		"model" "*92"
	}
}


; Rename "boss cage tele" to "boss_cage" for AddOutput to work
modify:
{
	match:
	{
		"classname" "info_teleport_destination"
		"targetname" "boss cage tele"
	}
	replace:
	{
		"targetname" "boss_cage"
	}
}

modify:
{
	match:
	{
		"classname" "trigger_teleport"
		"targetname" "Ztele 10"
		"origin" "2829.5 -10467.5 -13104"
	}
	replace:
	{
		"target" "boss_cage"
	}
}

modify:
{
	match:
	{
		"classname" "trigger_teleport"
		"targetname" "the failure"
		"origin" "13377 3621 -11830.5"
	}
	replace:
	{
		"target" "boss_cage"
	}
}

modify:
{
	match:
	{
		"origin" "13356 14799.5 -9586.5"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "boss cage tele,SetParent,Boss tracktrain,0,1"
	}
	insert:
	{
		"OnStartTouch" "boss_cage,SetParent,Boss tracktrain,0,1"
	}
}

; Fix a ztele exploit
modify:
{
	match:
	{
		"classname" "trigger_once"
		"targetname" "boss end"
		"origin" "13336 -6248 -11112"
		"model" "*90"
		"hammerid" "521728"
	}
	delete:
	{
		"OnStartTouch" "Ztele 1,Disable,,0,-1"
	}
	insert:
	{
		"OnStartTouch" "Ztele 1,AddOutput,target boss_cage,0,-1"
		"OnStartTouch" "Ztele 11,Enable,,25,-1"
	}
}

modify:
{
	match:
	{
		"classname" "trigger_once"
		"targetname" "escape ruin"
		"origin" "4899.5 -7069.5 -11770.5"
	}
	delete:
	{
		"OnStartTouch" "Ztele change,Enable,,10,1"
	}
}

filter:
{
	"classname" "trigger_teleport"
	"targetname" "Ztele change"
}
