;--------------------------------
; fix basic out of bounds issues
;--------------------------------

add:
{
	"model" "*31"
	"angles" "0 300 0"
	"pushdir" "0 90 0"
	"StartDisabled" "0"
	"spawnflags" "1"
	"speed" "250"
	"origin" "-1447.5 -187 196.59"
	"classname" "trigger_push"
}

modify:
{
	match:
	{
		"targetname" "raptor1mover"
		"classname" "func_tracktrain"
	}
	replace:
	{
		"spawnflags" "522"
	}
}
modify:
{
	match:
	{
		"targetname" "raptor2mover"
		"classname" "func_tracktrain"
	}
	replace:
	{
		"spawnflags" "522"
	}
}

;----------------------
; init triggers
;----------------------

modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "684"
	}
	insert:
	{
		"OnMapSpawn" "ATeleportAtTheBottom,FireUser1,,1,1"
		"OnMapSpawn" "ATeleportAtTheEnd,FireUser1,,1,1"
		"OnMapSpawn" "APushOnHouse,FireUser1,,1,1"
	}
}


;----------------------
; fix camping on house
;----------------------

add:
{
	"targetname" "APushOnHouse"
	"pushdir" "0 0 0"
	"StartDisabled" "0"
	"spawnflags" "1"
	"speed" "350"
	"origin" "-2456 -72 324.85"
	"classname" "trigger_push"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -224 -224 -100,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 224 224 100,0.1,1"
}

modify:
{
	match:
	{
		"targetname" "smokegran"
		"classname" "weapon_smokegrenade"
	}
	replace:
	{
		"classname" "weapon_hegrenade"
	}
}



;----------------------------------------
; safe teleport at the bottom of the map
;----------------------------------------


add:
{
	"classname" "info_teleport_destination"
	"targetname" "ADestAtSpawn"
	"angles" "0 90 0"
	"origin" "-136 64 192"
}

add:
{
	"targetname" "ATeleportAtTheBottom"
	"target" "ADestAtSpawn"
	"StartDisabled" "0"
	"spawnflags" "1"
	"origin" "2288 6112 -2016"
	"classname" "trigger_teleport"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -5552 -7552 -96,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 5552 7552 96,0.1,1"
}


;--------------
; FINAL AFK TP 
;--------------

add:
{
	"targetname" "ATeleportAtTheEnd"
	"target" "td_gate"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "2048 3552 -478.5"
	"classname" "trigger_teleport"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -5632 -5088 -1700,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 5632 5088 1700,0.1,1"
}

;-------------
; other fixes
;-------------

modify:
{
	match:
	{
		"targetname" "helicopter"
	}
	replace:
	{
		"spawnflags" "515"
	}
}

modify:
{
	match:
	{
		"targetname" "dinotransportercar"
	}
	replace:
	{
		"spawnflags" "515"
	}
}

modify:
{
	match:
	{
		"targetname" "dinocarpath1"
	}
	replace:
	{
		"speed" "0"
	}
}

modify:
{
	match:
	{
		"targetname" "helipath1"
	}
	replace:
	{
		"speed" "0"
	}
}

modify:
{
	match:
	{
		"targetname" "helipath3"
	}
	replace:
	{
		"speed" "0"
	}
	insert:
	{
		"OnPass" "helicopter,SetSpeed,0,0,1"
		"OnPass" "helicopter,SetSpeed,150,5,1"
	}
}

modify:
{
	match:
	{
		"targetname" "phonebutton"
	}
	delete:
	{
		"OnPressed" "helicopter,SetSpeed,0,140,1"
		"OnPressed" "helicopter,SetSpeed,150,145,1"
	}
	insert:
	{
		"OnPressed" "tp_spawn,Enable,,65,1"
		"OnPressed" "ATeleportAtTheEnd,Enable,,65,1"
		"OnPressed" "callmainland,Command,say ***SPAWN TELEPORT ENABLED***,66,1"
	}
}

add:
{
	"model" "*3"
	"classname" "trigger_teleport"
	"spawnflags" "1"
	"startdisabled" "1"
	"target" "td_gate"
	"targetname" "tp_spawn"
}

add:
{
	"classname" "info_teleport_destination"
	"targetname" "td_gate"
	"angles" "0 180 0"
	"origin" "3632 8896 -912"
}

modify:
{
	match:
	{
		"targetname" "endgamekiller"
	}
	replace:
	{
		"damage" "50000"
	}
}