;---------------------------------------------------------------------------------------
; Template the item relay in joueurnul's
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "point_template"
		"targetname" "Template_joueurnul"
		"origin" "-5464 1816 -2936"
		"hammerid" "2206148"
	}
	insert:
	{
		"Template02" "yume_item_relay1"
	}
}

;---------------------------------------------------------------------------------------
; End the zombie attack on mog's boss 2 seconds earlier
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "func_door"
		"targetname" "boss_avatarofevil_zombie1_platform_door"
	}
	delete:
	{
		"OnFullyClosed" "!self,Open,,14,1"
		"OnFullyClosed" "boss_avatarofevil_zombie1_platform_teleport,Kill,,14,1"
		"OnFullyClosed" "boss_avatarofevil_zombie1_platform_dest,Kill,,14,1"
	}
	insert:
	{
		"OnFullyClosed" "!self,Open,,12,1"
		"OnFullyClosed" "boss_avatarofevil_zombie1_platform_teleport,Kill,,12,1"
		"OnFullyClosed" "boss_avatarofevil_zombie1_platform_dest,Kill,,12,1"
	}
}

;---------------------------------------------------------------------------------------
; Increase the wave spawn delay from 10s to 15s
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_multiple"
		"targetname" "ww_globalTrigger"
	}
	replace:
	{
		"wait" "15"
	}
}

;---------------------------------------------------------------------------------------
; Spawn the item in wave room just about when the wall passes by the item platform
; Also change a semicolon in the tips message
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_once"
		"targetname" "ww_welcome"
	}
	delete:
	{
		"OnTrigger" "ww_item_relay1,Trigger,,0,1"
		"OnTrigger" "Server,Command,say ** Tips; Don't hold the jump key **,30,1"
	}
	insert:
	{
		"OnTrigger" "Server,Command,say ** Tips: Don't hold the jump key **,30,1"
	}
}
modify:
{
	match:
	{
		"classname" "func_breakable"
		"targetname" "ww_trigger_progress_1_plate"
	}
	insert:
	{
		"OnBreak" "ww_item_relay1,Trigger,,3,1"
	}
}

;---------------------------------------------------------------------------------------
; Add an item relay in xen's
;---------------------------------------------------------------------------------------
add:
{
	"origin" "-2400 0 -1872"
	"targetname" "xen_relay_item"
	"StartDisabled" "1"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnTrigger" "Map_ItemMaker_CT,ForceSpawnAtEntityOrigin,!caller,0.03,1"
	"OnTrigger" "Map_ItemCase_CT,PickRandomShuffle,,0,1"
}
modify:
{
	match:
	{
		"classname" "logic_case"
		"targetname" "Map_PlayedRoomCompareItem"
	}
	insert:
	{
		"OnUser1" "xen_relay_item,Enable,,0,-1"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_once"
		"targetname" "xen_relay_but_a_trigger_init"
	}
	insert:
	{
		"OnStartTouch" "xen_relay_item,Trigger,,0,1"
	}
}

;---------------------------------------------------------------------------------------
; Fix the blast particle not appearing when the containers are broken in xen's
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "prop_physics_override"
		"targetname" "xen_energy_break"
	}
	delete:
	{
		"OnBreak" "xen_energy_particle_blast,Start,,0,1"
	}
	insert:
	{
		"OnBreak" "xen_energy_particle_blast,Start,,0.02,1"
	}
}

;---------------------------------------------------------------------------------------
; Fix sound paths in berke's items
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "ambient_generic"
		"targetname" "berkeitemextra1stuff2"
	}
	replace:
	{
		"message" "zombieescape1/collabware1/spintime1.mp3"
	}
}
modify:
{
	match:
	{
		"classname" "ambient_generic"
		"targetname" "berkeitemextra4sound2"
	}
	replace:
	{
		"message" "zombieescape1/collabware1/dunk1.mp3"
	}
}
modify:
{
	match:
	{
		"classname" "ambient_generic"
		"targetname" "berkeitemextra4sound1"
	}
	replace:
	{
		"message" "zombieescape1/collabware1/balling1.mp3"
	}
}

;---------------------------------------------------------------------------------------
; Fix filter names in mog's items
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "pellet_hurt"
	}
	replace:
	{
		"filtername" "Filter_T"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_multiple"
		"targetname" "item_grimoire_fivedblasts_trigger"
	}
	replace:
	{
		"filtername" "Filter_T"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_multiple"
		"targetname" "item_grimoire_trigger"
	}
	replace:
	{
		"filtername" "Filter_T"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "dblast_hurt"
	}
	replace:
	{
		"filtername" "Filter_T"
	}
}

;---------------------------------------------------------------------------------------
; Make berke's spin item only freeze zombies for now, and shorten it to 15 seconds
;---------------------------------------------------------------------------------------

modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "berkeitemextra1stuff1"
	}
	delete:
	{
		"OnSpawn" "berkeitemextra1sprite1,Kill,,30,1"
		"OnSpawn" "berkeitemextra1dynamic1,Kill,,30,1"
		"OnSpawn" "berkeitemextra1multiple1,Disable,,30,1"
		"OnSpawn" "berkeitemextra1multiple1,Kill,,30.02,1"
		"OnSpawn" "berkeitemextra1stuff2,Kill,,30,1"
		"OnSpawn" "berkeitemextra1multiple1,AddOutput,OnStartTouch !self:FireUser1::0:64,7,1"
		"OnSpawn" "berkeitemextra1multiple1,AddOutput,OnEndTouch !activator:FireUser1::0:64,7,1"
		"OnSpawn" "berkeitemextra2rotating2,FireUser1,,30,1"
		"OnSpawn" "berkeitemextra1maker1,Kill,,30,1"
		"OnSpawn" "berkeitemextra1counter1,Kill,,30,1"
		"OnSpawn" "berkeitemextra1case1,Kill,,30,1"
	}
	insert:
	{
		"OnSpawn" "berkeitemextra1sprite1,Kill,,15,1"
		"OnSpawn" "berkeitemextra1dynamic1,Kill,,15,1"
		"OnSpawn" "berkeitemextra1multiple1,Disable,,15,1"
		"OnSpawn" "berkeitemextra1multiple1,Kill,,15.02,1"
		"OnSpawn" "berkeitemextra1stuff2,Volume 0,,14.98,1"
		"OnSpawn" "berkeitemextra2rotating2,FireUser1,,15,1"
		"OnSpawn" "berkeitemextra1maker1,Kill,,15,1"
		"OnSpawn" "berkeitemextra1counter1,Kill,,15,1"
		"OnSpawn" "berkeitemextra1case1,Kill,,15,1"
		"OnSpawn" "berkeitemextra1stuff2,Kill,,15,1"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_multiple"
		"targetname" "berkeitemextra1multiple1"
	}
	delete:
	{
		"OnUser1" "berkeitemextra1counter1,Add,1,0,64"
	}
}


;---------------------------------------------------------------------------------------
; Set auto exposure on xen's
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_once"
		"targetname" "xen_relay_but_a_trigger_init"
	}
	insert:
	{
		"OnTrigger" "tonemap_controller,SetAutoExposureMax,2,0,1"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_teleport"
		"targetname" "xen_end_teleport_ct"
	}
	insert:
	{
		"OnStartTouch" "tonemap_controller,FireUser1,,0,1"
	}
}

;---------------------------------------------------------------------------------------
; End the music later on library
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "library_relay_teleport_end"
	}
	delete:
	{
		"OnTrigger" "Music_Library,FadeOut,7,15,1"
	}
	insert:
	{
		"OnUser1" "Music_Library,FadeOut,7,0,1"
	}
}

;---------------------------------------------------------------------------------------
; little typo, nothing to see here
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_once"
		"targetname" "library_replicant_trigger_end_hold"
	}
	delete:
	{
		"OnStartTouch" "Server,Command,say ** Zombies teleport in 5 seconds,15,1"
	}
	insert:
	{
		"OnStartTouch" "Server,Command,say ** Zombies teleport in 5 seconds **,15,1"
	}
}

;---------------------------------------------------------------------------------------
; Tweak fog on library
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "env_fog_controller"
		"targetname" "Map_Fog"
	}
	delete:
	{
		"OnUser3" "!self,SetEndDist,1,0,-1"
	}
	insert:
	{
		"OnUser3" "!self,SetEndDist,16384,0,-1"
	}
}

;---------------------------------------------------------------------------------------
; Fix a particle in grimoire item
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "info_particle_system"
		"targetname" "item_grimoire_counter_fivedblast_particle"
	}
	replace:
	{
		"effect_name" "custom_particle_018"
	}
}

;---------------------------------------------------------------------------------------
; Extend the item info text for zm toss item
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "game_text"
		"targetname" "itemtoss_text"
	}
	replace:
	{
		"holdtime" "10"
	}
}

;---------------------------------------------------------------------------------------
; Add nostar's item relay to template
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "point_template"
		"targetname" "Template_Nostar"
	}
	insert:
	{
		"Template03" "nostar_item_relay1"
	}
}

;---------------------------------------------------------------------------------------
; Add mog's item relay to template
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "point_template"
		"targetname" "Template_Mog"
	}
	replace:
	{
		"Template01" "Music_ZombiePanic*"
		"Template02" "zombiepanic_item_relay1"
	}
}

;---------------------------------------------------------------------------------------
; Disable the zm spawn tp during camera sequences to prevent a nasty exploit
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "game_zone_player"
		"targetname" "/.*setter/"
	}
	insert:
	{
		"OnUser1" "Spawn_Tele_T,Disable,,0,-1"
	}
}
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "xen_relay_start"
	}
	insert:
	{
		"OnUser1" "Spawn_Tele_T,Enable,,9,1"
	}
}
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "xen_floor1_relay"
	}
	insert:
	{
		"OnUser1" "Spawn_Tele_T,Enable,,9,1"
	}
}modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "xen_floor2_relay"
	}
	insert:
	{
		"OnUser1" "Spawn_Tele_T,Enable,,9,1"
	}
}

;---------------------------------------------------------------------------------------
; Increase the room cooldown from 3 to 4 rounds
;---------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "math_counter"
		"targetname" "/Map_Room_Counter_.*/"
	}
	replace:
	{
		"max" "5"
	}
}
