;; fix by encap
 
;; replaced crystal skull push particle
 
modify:
{
	match:
	{
		"targetname" "particle_crane"
		"classname" "info_particle_system"
	}
	replace:
	{
		"angles" "-90 0 0"
		"effect_name" "energie"
	}
}
 
;; fix crystal skull push sound
 
modify:
{
	match:
	{
		"targetname" "wind"
		"classname" "ambient_generic"
	}
	insert:
	{
		"SourceEntityName" "cut_crane"
	}
}

;; stage 3 - fix boss afk teleport
 
modify:
{
	match:
	{
		"targetname" "door_temple"
		"classname" "func_door"
	}
	insert:
	{
		"OnFullyClosed" "teleport_fin1,Enable,,0,1"
		"OnFullyClosed" "teleport_fin2,Enable,,0,1"
	}
}
 
;; stage 3 - increase nuke damage
 
modify:
{
	match:
	{
		"targetname" "hurt_level_3"
		"classname" "trigger_hurt"
	}
	replace:
	{
		"damage" "100000"
	}
}
 
;; fix indiana's xtrem physbox, death sound
 
modify:
{
	match:
	{
		"targetname" "bloc_indiana"
		"classname" "func_physbox_multiplayer"
	}
	replace:
	{
		"spawnflags" "9237504"
	}
}
modify:
{
	match:
	{
		"targetname" "vie_indiana_jones"
		"classname" "logic_relay"
	}
	delete:
	{
		"OnTrigger" "cpt_porteur,Add,1,0,-1"
	}
	insert:
	{
		"OnTrigger" "cpt_porteur,Add,1,2,-1"
	}
}

modify:
{
	match:
	{
		"targetname" "jones_dead"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "vo\npc\male01\pain07.wav"
	}
}
modify:
{
	match:
	{
		"targetname" "cpt_porteur"
		"classname" "math_counter"
	}
	insert:
	{
		"OnHitMax" "indiana_help,Volume,0,0,-1"
	}
}

;; stage 3 - unlock boss button only after door is closed

modify:
{
	match:
	{
		"targetname" "button_crane"
		"classname" "func_button"
	}
	replace:
	{
		"spawnflags" "3073"
	}
}
modify:
{
	match:
	{
		"targetname" "door_temple"
		"classname" "func_door"
	}
	insert:
	{
		"OnFullyClosed" "button_crane,Unlock,,5,-1"
	}
}


;; make indiana invulnerable on extreme stages
 
add:
{
	"origin" "-9538 4537 634"
	"targetname" "indy"
	"Negated" "1"
	"filterteam" "2"
	"classname" "filter_activator_team"
}
add:
{
	"model" "*140"
	"targetname" "indy_xtrem"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-9522 4514.5 559"
	"classname" "trigger_once"
	"OnStartTouch" "!activator,SetDamageFilter,indy,0,1"
}
 
modify:
{
	match:
	{
		"targetname" "engage_XTREM"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "indy_xtrem,Enable,,0,-1"
	}
}
 
;; prevent zombies from taking crystal skull item
 
modify:
{
	match:
	{
		"targetname" "tele_porteur_crane_3"
		"classname" "trigger_teleport"
	}
	insert:
	{
		"filtername" "filtre_humain"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_teleport"
		"hammerid" "3259"
	}
	insert:
	{
		"filtername" "filtre_humain"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_teleport"
		"hammerid" "3262"
	}
	insert:
	{
		"filtername" "filtre_humain"
	}
}

;; stage 2 - afk teleport

add:
{
	"targetname" "stage2_trucks_afk"
	"target" "retour_camion_t"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-13727.5 8804 2386"
	"classname" "trigger_teleport"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -921.5 -1148 -235,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 921.5 1148 235,0.1,1"
}
modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "1820"
	}
	insert:
	{
		"OnMapSpawn" "stage2_trucks_afk,FireUser1,,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-14201.5 8844 2253.81"
		"classname" "trigger_once"
		"hammerid" "2212"
	}
	insert:
	{
		"OnStartTouch" "stage2_trucks_afk,Enable,,30,1"
	}
}
modify:
{
	match:
	{
		"targetname" "way_ct_41"
		"classname" "path_track"
	}
	insert:
	{
		"OnPass" "stage2_trucks_afk,AddOutput,target cage,0,1"
	}
}

;; stage 3 - increase door blocking damage

modify:
{
	match:
	{
		"targetname" "door_temple"
		"classname" "func_door"
	}
	replace:
	{
		"dmg" "10000"
	}
}

;; stage 3 - fix xtrem detection of zombies inside boss area, only kill humans on detection

modify:
{
	match:
	{
		"targetname" "trigger_detec"
		"classname" "trigger_once"
	}
	replace:
	{
		"origin" "-11954.5 -804 4180"
	}
	delete:
	{
		"OnTrigger" "hurt_level_3,Enable,,7,-1"
	}
	insert:
	{
		"OnTrigger" "trigger_kill_ct,Enable,,5,1"
	}
}

;; stage 3 - fix second afk teleport

modify:
{
	match:
	{
		"targetname" "teleport_fin"
		"classname" "trigger_teleport"
		"hammerid" "2999"
	}
	replace:
	{
		"origin" "-7451 -3642.5 5193"
	}
}

;; stage 3 - scale boss hp properly

modify:
{
	match:
	{
		"targetname" "boss_math"
		"classname" "math_counter"
	}
	replace:
	{
		"max" "10000"
	}
}

modify:
{
	match:
	{
		"classname" "trigger_multiple"
		"hammerid" "94625"
	}
	delete:
	{
		"OnStartTouch" "boss_math,Add,125,0,-1"
	}
	insert:
	{
		"OnStartTouch" "boss_math,Add,200,0,-1"
	}
}

;; stage 3 - trigger door relay only once

modify:
{
	match:
	{
		"targetname" "relay_close_porte"
		"classname" "logic_relay"
	}
	replace:
	{
		"spawnflags" "1"
	}
}

;; alternative nuke

add:
{
	"origin" "-4064 3904 -2550"
	"targetname" "alt_nuke_dest"
	"angles" "0 0 0"
	"classname" "info_teleport_destination"
}
add:
{
	"targetname" "alt_nuke"
	"StartDisabled" "0"
	"spawnflags" "1"
	"origin" "-5145 4640 -2344"
	"damage" "100000"
	"classname" "trigger_hurt"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -1619 -1134 -254,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 1619 1134 254,0.1,1"
}

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

;; stage 1,2 - convert nuke into teleport to prevent client crashing

modify:
{
	match:
	{
		"targetname" "/hurt_level_[1-2]/"
		"classname" "trigger_hurt"
	}
	replace:
	{
		"classname" "trigger_teleport"
	}
	insert:
	{
		"target" "alt_nuke_dest"
	}
}

modify:
{
	match:
	{
		"targetname" "hurt_spawn"
		"classname" "trigger_hurt"
	}
	replace:
	{
		"classname" "trigger_teleport"
	}
	insert:
	{
		"target" "alt_nuke_dest"
	}
}

;; convert ct fail nuke into teleport to prevent possible client crashing

modify:
{
	match:
	{
		"targetname" "trigger_kill_ct"
		"classname" "trigger_hurt"
	}
	replace:
	{
		"classname" "trigger_teleport"
	}
	insert:
	{
		"target" "alt_nuke_dest"
		"filtername" "filtre_humain"
	}
}

;; fix output spam

modify:
{
	match:
	{
		"targetname" "declanche_level_sup"
		"classname" "trigger_multiple"
	}
	replace:
	{
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "relay_goto_level_2,Trigger,,0,-1"
	}
	insert:
	{
		"OnStartTouch" "relay_goto_level_2,Trigger,,0,1"
	}
}

modify:
{
	match:
	{
		"classname" "trigger_once"
		"hammerid" "2341"
	}
	delete:
	{
		"OnStartTouch" "pont,EnableMotion,,60,-1"
		"OnStartTouch" "pont2,EnableMotion,,40,-1"
		"OnStartTouch" "fade_blanc,Fade,,65,-1"
		"OnStartTouch" "son_explo,PlaySound,,65,-1"
		"OnStartTouch" "win_level2,Enable,,67,-1"
		"OnStartTouch" "pont_indiana,Break,,61,-1"
	}
	insert:
	{
		"OnStartTouch" "pont,EnableMotion,,60,1"
		"OnStartTouch" "pont2,EnableMotion,,40,1"
		"OnStartTouch" "fade_blanc,Fade,,65,1"
		"OnStartTouch" "son_explo,PlaySound,,65,1"
		"OnStartTouch" "win_level2,Enable,,67,1"
		"OnStartTouch" "pont_indiana,Break,,61,1"
	}
}
modify:
{
	match:
	{
		"targetname" "win_level2"
		"classname" "trigger_multiple"
	}
	replace:
	{
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "relay_goto_level_3,Trigger,,0,-1"
		"OnStartTouch" "commande,Command,say ***WELL DONE !!!***,0,-1"
		"OnStartTouch" "commande,Command,say ***YOU REACHED END OF LEVEL 2***,2,-1"
		"OnStartTouch" "commande,Command,say ***UP TO LEVEL 3***,3,-1"
	}
	insert:
	{
		"OnStartTouch" "relay_goto_level_3,Trigger,,0,1"
		"OnStartTouch" "commande,Command,say ***WELL DONE !!!***,0,1"
		"OnStartTouch" "commande,Command,say ***YOU REACHED END OF LEVEL 2***,2,1"
		"OnStartTouch" "commande,Command,say ***UP TO LEVEL 3***,3,1"
	}
}

modify:
{
	match:
	{
		"classname" "trigger_once"
		"hammerid" "3121"
	}
	delete:
	{
		"OnStartTouch" "commande,Command,say ***YOU FINISHED LEVEL 3***,0,-1"
		"OnStartTouch" "commande,Command,say ***MAP WILL BE RESET***,1,-1"
		"OnStartTouch" "brush_goto_level1,Disable,,0,-1"
		"OnStartTouch" "hurt_level_3,Enable,,10,-1"
		"OnStartTouch" "son_explo,PlaySound,,10,-1"
		"OnStartTouch" "fade_blanc,Fade,,10,-1"
		"OnStartTouch" "anti_sortie,Close,,7,-1"
		"OnStartTouch" "brush_goto_XTREM,Disable,,0,-1"
		"OnStartTouch" "brush_goto_level3,Enable,,0,-1"
	}
	insert:
	{
		"OnStartTouch" "commande,Command,say ***YOU FINISHED LEVEL 3***,0,1"
		"OnStartTouch" "commande,Command,say ***MAP WILL BE RESET***,1,1"
		"OnStartTouch" "brush_goto_level1,Disable,,0,1"
		"OnStartTouch" "hurt_level_3,Enable,,10,1"
		"OnStartTouch" "son_explo,PlaySound,,10,1"
		"OnStartTouch" "fade_blanc,Fade,,10,1"
		"OnStartTouch" "anti_sortie,Close,,7,1"
		"OnStartTouch" "brush_goto_XTREM,Disable,,0,1"
		"OnStartTouch" "brush_goto_level3,Enable,,0,1"
	}
}

;; stage 1 - prevent players from getting stuck in traincart

modify:
{
	match:
	{
		"targetname" "path_17"
		"classname" "path_track"
	}
	replace:
	{
		"origin" "6209 -223 -1203"
	}
}

;; balance music volume

modify:
{
	match:
	{
		"message" "indiana_jones/xtrem_sound.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#indiana_jones/xtrem_sound.mp3"
	}
}
modify:
{
	match:
	{
		"message" "indiana_jones/xtrem_temple.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#indiana_jones/xtrem_temple.mp3"
	}
}
modify:
{
	match:
	{
		"message" "indiana_jones/xtrem2.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#indiana_jones/xtrem2.mp3"
	}
}
modify:
{
	match:
	{
		"message" "indiana_jones/music_dinamic.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#indiana_jones/music_dinamic.mp3"
	}
}
modify:
{
	match:
	{
		"message" "indiana_jones/son_temple.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#indiana_jones/son_temple.mp3"
	}
}
modify:
{
	match:
	{
		"message" "indiana_jones/indiana_theme.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#indiana_jones/indiana_theme.mp3"
	}
}
modify:
{
	match:
	{
		"message" "indiana_jones/indiana_fin.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#indiana_jones/indiana_fin.mp3"
	}
}
modify:
{
	match:
	{
		"message" "indiana_jones/farcry.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#indiana_jones/farcry.mp3"
	}
}
;; stage 1 - fix ending trigger origin

modify:
{
	match:
	{
		"classname" "trigger_once"
		"hammerid" "1601"
	}
	replace:
	{
		"origin" "8497 -3737 -1796"
	}
}

;; fix push item

modify:
{
	match:
	{
		"classname" "func_button"
		"origin" "-9497 4513 536.13"
		"hammerid" "107179"
	}
	replace:
	{
		"wait" "1"
	}
	insert:
	{
		"targetname" "skull_button"
	}
}
modify:
{
	match:
	{
		"targetname" "relay_crane_attak"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "skull_button,Lock,,0,-1"
		"OnTrigger" "skull_button,Unlock,,80,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "engage_XTREM"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "indy_xtrem,Enable,,0,-1"
	}
}

;; stage 1 - fix afk teleport

add:
{
	"model" "*458"
	"origin" "-10400 -140 -1187"
	"targetname" "tele_bunker"
	"target" "sortie"
	"StartDisabled" "1"
	"spawnflags" "1"
	"classname" "trigger_teleport"
}
add:
{
	"model" "*459"
	"origin" "-10456 -316 -1187"
	"targetname" "tele_bunker"
	"target" "sortie"
	"StartDisabled" "1"
	"spawnflags" "1"
	"classname" "trigger_teleport"
}

;; reduce infection time

modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "1820"
	}
	delete:
	{
		"OnNewGame" "commande,Command,zr_infect_spawntime_max 20,0,-1"
		"OnNewGame" "commande,Command,zr_infect_spawntime_min 15,0,-1"
	}
	insert:
	{
		"OnNewGame" "commande,Command,zr_infect_spawntime_max 15,0,-1"
		"OnNewGame" "commande,Command,zr_infect_spawntime_min 10,0,-1"
	}
}

;; stage 3 - fix afk teleport

modify:
{
	match:
	{
		"origin" "-10347 -11475 6002"
		"classname" "trigger_teleport"
		"hammerid" "2975"
	}
	replace:
	{
		"spawnflags" "1"
	}
}

;; reset targetname at spawn

add:
{
	"model" "*307"
	"wait" "0.1"
	"targetname" "spawn_reset"
	"StartDisabled" "0"
	"spawnflags" "1"
	"origin" "-9251.5 4689.5 -796.5"
	"classname" "trigger_multiple"
	"OnStartTouch" "!activator,AddOutput,targetname none,0,-1"
}
modify:
{
	match:
	{
		"targetname" "/tele_level_[1-3]/"
		"classname" "trigger_teleport"
	}
	insert:
	{
		"OnStartTouch" "!activator,AddOutput,targetname none,0,-1"
	}
}

;; fix item filter

modify:
{
	match:
	{
		"targetname" "porteur"
		"classname" "filter_activator_name"
	}
	replace:
	{
		"filtername" "jones"
	}
	insert:
	{
		"OnPass" "relay_crane_attak,Trigger,,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-9497 4513 536.13"
		"classname" "func_button"
		"hammerid" "107179"
	}
	replace:
	{
		"OnPressed" "porteur,TestActivator,,0,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "cut_crane"
		"classname" "weapon_knife"
	}
	delete:
	{
		"OnPlayerPickup" "!activator,AddOutput,targetname porteur,0,-1"
	}
	insert:
	{
		"OnPlayerPickup" "!activator,AddOutput,targetname jones,0,-1"
	}
}

;; stage 2 - fix truck telehop

modify:
{
	match:
	{
		"targetname" "tele_camion_t"
		"target" "retour_camion_t"
		"classname" "trigger_teleport"
	}
	insert:
	{
		"OnStartTouch" "!activator,AddOutput,absvelocity 0 0 0,0,-1"
	}
}

;; stage 2 - small ramp for ct's truck

add:
{
	"origin" "-14052 8401 2211"
	"targetname" "truck_ramp"
	"StartDisabled" "0"
	"spawnflags" "0"
	"solid" "6"
	"skin" "0"
	"parentname" "track_camion_ct"
	"SetBodyGroup" "0"
	"rendermode" "10"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"RandomAnimation" "0"
	"pressuredelay" "0"
	"PerformanceMode" "0"
	"model" "models/props_lab/blastdoor001b.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" "-55 0 0"
	"classname" "prop_dynamic"
}

;; stage 3 - help humans on water part

add:
{
	"model" "*265"
	"vrad_brush_cast_shadows" "0"
	"StartDisabled" "0"
	"spawnflags" "2"
	"Solidity" "0"
	"solidbsp" "0"
	"rendermode" "10"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "-7355 -646.34 4680.5"
	"invert_exclusion" "0"
	"InputFilter" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"classname" "func_brush"
}

;; stage 3 - fix torch

modify:
{
	match:
	{
		"targetname" "torche_1"
		"origin" "-10267 -11587.5 5871"
		"classname" "func_physbox"
	}
	replace:
	{
		"spawnflags" "543745"
	}
}

;; stage 2 - delay the trigger

modify:
{
	match:
	{
		"origin" "-12024.5 3618.5 1917.5"
		"classname" "trigger_once"
		"hammerid" "1859"
	}
	delete:
	{
		"OnStartTouch" "relay_start_poursuite,Trigger,,15,-1"
	}
	insert:
	{
		"OnStartTouch" "relay_start_poursuite,Trigger,,20,1"
	}
}


