
; BossHP - adding entity to fix display of hands

modify:
{
	match:
	{
		"targetname" "b_handhpbackup"
		"classname" "math_counter"
	}
	insert:
	{
		"OnGetValue" "bosshp_fix_display,Trigger,,0.1,-1"
;		"OnGetValue" "point_servercommand,Command,say ongetvalue,0,-1"
	}
}

add:
{
	"origin" "0 0 0"
	"targetname" "bosshp_fix_display"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnTrigger" "!self,FireUser1,,0,-1"
;	"OnTrigger" "point_servercommand,Command,say relay triggered,0,-1"
	"OnUser1" "!self,FireUser2,,0.5,-1"
}


; Boss kill the hand counter when dead

modify:
{
	match:
	{
		"targetname" "b_hpcounter"
		"classname" "math_counter"
	}
	insert:
	{
		"OnHitMin" "b_handhpcounter,Kill,,0,-1"
	}
}


; BossHP - NPC Fix display - Add fix up to the breakable


; Wallmaster
add:
{
	"origin" "-9344.02 8296 3584"
	"targetname" "bosshp_fix_display_wallmaster"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnSpawn" "Wallmaster_Health,FireUser4,,0,1"
	"OnSpawn" "!self,Kill,,0.05,1"
}
modify:
{
	match:
	{
		"targetname" "WallmasterTemplate"
		"classname" "point_template"
	}
	insert:
	{
		"Template03" "bosshp_fix_display_wallmaster"
	}
}



; Gibdo
add:
{
	"origin" "-9344.02 8296 3584"
	"targetname" "bosshp_fix_display_gibdo"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnSpawn" "Gibdo_Health,FireUser4,,0,1"
	"OnSpawn" "!self,Kill,,0.05,1"
}
modify:
{
	match:
	{
		"targetname" "GibdoTemplate"
		"classname" "point_template"
	}
	insert:
	{
		"Template03" "bosshp_fix_display_gibdo"
	}
}



; Redead
add:
{
	"origin" "-9344.02 8296 3584"
	"targetname" "bosshp_fix_display_redead"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnSpawn" "Redead_Health,FireUser4,,0,1"
	"OnSpawn" "!self,Kill,,0.05,1"
}
modify:
{
	match:
	{
		"targetname" "RedeadTemplate"
		"classname" "point_template"
	}
	insert:
	{
		"Template11" "bosshp_fix_display_redead"
	}
}


; Stalfos

; Less base hp
modify:
{
	match:
	{
		"targetname" "Stalfos_Health"
		"classname" "func_physbox_multiplayer"
;		"health" "15000"
	}
	replace:
	{
		"health" "4000"
	}
}

add:
{
	"origin" "-9344.02 8296 3584"
	"targetname" "bosshp_fix_display_stalfos"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnUser1" "Stalfos_Health,AddHealth,1500,0,-1"
	"OnUser1" "!self,Kill,,2,1"
	"OnUser2" "Stalfos_Health,AddHealth,500,0,-1"
	"OnUser2" "!self,Kill,,2,1"
}
modify:
{
	match:
	{
		"targetname" "StalfosTemplate"
		"classname" "point_template"
	}
	insert:
	{
		"Template03" "bosshp_fix_display_stalfos"
	}
}


modify:
{
	match:
	{
		"targetname" "Boat_Fight_Adder"
		"classname" "trigger_multiple"
	}
	delete:
	{
		"OnStartTouch" "Stalfos_Health,AddHealth,1000,0,-1"
	}
	insert:
	{
		"OnStartTouch" "bosshp_fix_display_stalfos*,FireUser1,,0,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "Fight_1_Health_Adder"
		"classname" "trigger_multiple"
	}
	delete:
	{
; ontrigger didnt even act like onstarttouch, so the boss only got 1000 hp once
		"OnTrigger" "Stalfos_Health,AddHealth,1000,0,-1"
	}
	insert:
	{
		"OnStartTouch" "bosshp_fix_display_stalfos*,FireUser1,,0,-1"
	}
}

modify:
{
	match:
	{
		"targetname" "First_Fight_Counter"
		"classname" "math_counter"
	}
	delete:
	{
		"OnHitMax" "Stalfos_Health,Break,,0.1,-1"
	}
	insert:
	{
		"OnHitMax" "Stalfos_Health*,Break,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "Boat_Fight_Stalfos_Counter"
		"classname" "math_counter"
	}
	delete:
	{
		"OnHitMax" "Stalfos_Health,Break,,0.1,-1"
	}
	insert:
	{
		"OnHitMax" "Stalfos_Health*,Break,,0.1,-1"
	}
}



; Ghost Boat, move up down more 

modify:
{
	match:
	{
		"targetname" "Boat_Tracktrain_Path_2"
		"classname" "path_track"
;		"origin" "3684 -6528 -1664"
	}
	replace:
	{
		"origin" "3684 -6528 -1728"
	}
}
modify:
{
	match:
	{
		"targetname" "Boat_Tracktrain_Path_4"
		"classname" "path_track"
;		"origin" "3684 -4113 -1664"
	}
	replace:
	{
		"origin" "3684 -4113 -1728"
	}
}
modify:
{
	match:
	{
		"targetname" "Boat_Tracktrain_Path_6"
		"classname" "path_track"
;		"origin" "3684 -259 -1664"
	}
	replace:
	{
		"origin" "3684 -259 -1728"
	}
}
modify:
{
	match:
	{
		"targetname" "Boat_Tracktrain_Path_8"
		"classname" "path_track"
;		"origin" "3684 2976 -1664"
	}
	replace:
	{
		"origin" "3684 2976 -1728"
	}
}

modify:
{
	match:
	{
		"targetname" "Boat_Tracktrain_Path_10"
		"classname" "path_track"
	}
	delete:
	{
		"OnPass" "Boat_Tracktrain,SetSpeed,500,0,-1"
	}
	insert:
	{
		"OnPass" "Boat_Tracktrain,AddOutput,startspeed 500,0,-1"
		"OnPass" "Boat_Tracktrain,SetSpeedReal,500,0.03,-1"
	}
}


; Bongo bongo sound - reduce volume

modify:
{
	match:
	{
		"targetname" "murmur"
		"classname" "ambient_generic"
	}
	replace:
	{
		"health" "3"
		"message" "#oot_shadow_temple/bongo_bongo_sounds/bongo_bongo_murmur_sound.mp3"
	}
}

; boss music - add an extra ambient generic to increase volume  + loop

modify:
{
	match:
	{
		"targetname" "Boss_Start"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "b_music,PlaySound,,11,1"
	}
	insert:
	{
		"OnStartTouch" "b_music,FireUser1,,11,1"
	}
}


modify:
{
	match:
	{
		"targetname" "b_hpcounter"
		"classname" "math_counter"
	}
	insert:
	{
		"OnHitMin" "b_music,Kill,,0.05,-1"
	}
}


modify:
{
	match:
	{
		"targetname" "b_music"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#oot_shadow_temple/shadow_temple_music/shadow_temple_boss_music.mp3"
	}
	insert:
	{
		"OnUser1" "!self,PlaySound,,0,-1"
		"OnUser1" "!self,FireUser1,,153,-1"
	}
}

add:
{
	"origin" "-12584 5600 -5936"
	"volstart" "0"
	"targetname" "b_music"
	"spinup" "0"
	"spindown" "0"
	"spawnflags" "49"
	"radius" "1250"
	"preset" "0"
	"pitchstart" "100"
	"pitch" "100"
	"message" "#oot_shadow_temple/shadow_temple_music/shadow_temple_boss_music.mp3"
	"lfotype" "0"
	"lforate" "0"
	"lfomodvol" "0"
	"lfomodpitch" "0"
	"health" "10"
	"fadeoutsecs" "0"
	"fadeinsecs" "0"
	"cspinup" "0"
	"classname" "ambient_generic"
}


; attacks Hands fading in and out

modify:
{
	match:
	{
		"targetname" "/attackhand.*/"
;		"model" "models/moltard/oot/monster/bongobongo_hand.mdl"
		"classname" "prop_dynamic"
	}
	replace:
	{
		"renderamt" "0"
		"rendermode" "1"
	}
	insert:
	{
		"OnUser1" "!self,Alpha,50,0.07,1"
		"OnUser1" "!self,Alpha,100,0.15,1"
		"OnUser1" "!self,Alpha,150,0.20,1"
		"OnUser1" "!self,Alpha,200,0.30,1"
		"OnUser1" "!self,Alpha,255,0.40,1"
		
		"OnUser2" "!self,Alpha,200,0.10,1"
		"OnUser2" "!self,Alpha,150,0.20,1"
		"OnUser2" "!self,Alpha,100,0.30,1"
		"OnUser2" "!self,Alpha,50,0.37,1"
		"OnUser2" "!self,Alpha,0,0.45,1"
		"OnUser2" "!self,KillHierarchy,,0.50,1"
	}
}

modify:
{
	match:
	{
		"targetname" "/attackmaker.*/"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "attackhand*,FireUser1,,0.01,-1"
	}
}


modify:
{
	match:
	{
		"targetname" "b_moveforward"
		"classname" "func_door"
	}
	insert:
	{
		"OnClose" "attackhand5,FireUser2,,2,-1"
		"OnClose" "attackhand6,FireUser2,,2,-1"
	}
}


; Bongo bongo fade in and out (+ its hands)

modify:
{
	match:
	{
		"targetname" "lefthand"
;		"model" "models/moltard/oot/monster/bongobongo_hand.mdl"
		"classname" "prop_dynamic"
	}
	replace:
	{
		"renderamt" "0"
		"rendermode" "1"
	}
	insert:
	{
		"OnUser1" "!self,Alpha,50,0.07,1"
		"OnUser1" "!self,Alpha,100,0.15,1"
		"OnUser1" "!self,Alpha,150,0.20,1"
		"OnUser1" "!self,Alpha,200,0.30,1"
		"OnUser1" "!self,Alpha,255,0.40,1"
		
		"OnUser2" "b_righthandtarget,Kill,,0,1"
		"OnUser2" "righthand_hurt,Kill,,0,1"
		"OnUser2" "!self,ClearParent,,0,-1"
		"OnUser2" "!self,Alpha,200,0.10,1"
		"OnUser2" "!self,Alpha,150,0.20,1"
		"OnUser2" "!self,Alpha,100,0.30,1"
		"OnUser2" "!self,Alpha,50,0.37,1"
		"OnUser2" "!self,Alpha,0,0.45,1"
		"OnUser2" "!self,KillHierarchy,,0.50,1"
	}
}
modify:
{
	match:
	{
		"targetname" "righthand"
;		"model" "models/moltard/oot/monster/bongobongo_hand.mdl"
		"classname" "prop_dynamic"
	}
	replace:
	{
		"renderamt" "0"
		"rendermode" "1"
	}
	insert:
	{
		"OnUser1" "!self,Alpha,50,0.07,1"
		"OnUser1" "!self,Alpha,100,0.15,1"
		"OnUser1" "!self,Alpha,150,0.20,1"
		"OnUser1" "!self,Alpha,200,0.30,1"
		"OnUser1" "!self,Alpha,255,0.40,1"
		
		"OnUser2" "b_righthandtarget,Kill,,0,1"
		"OnUser2" "righthand_hurt,Kill,,0,1"
		"OnUser2" "!self,ClearParent,,0,-1"
		"OnUser2" "!self,Alpha,200,0.0.07,1"
		"OnUser2" "!self,Alpha,150,0.14,1"
		"OnUser2" "!self,Alpha,100,0.21,1"
		"OnUser2" "!self,Alpha,50,0.28,1"
		"OnUser2" "!self,Alpha,0,0.35,1"
		"OnUser2" "!self,KillHierarchy,,0.50,1"
	}
}

modify:
{
	match:
	{
		"targetname" "bongobongo"
		"classname" "prop_dynamic"
	}
	replace:
	{
		"renderamt" "0"
		"rendermode" "1"
		"StartDisabled" "0"
	}
	insert:
	{
		"OnUser1" "!self,Alpha,50,0.07,-1"
		"OnUser1" "!self,Alpha,100,0.15,-1"
		"OnUser1" "!self,Alpha,150,0.20,-1"
		"OnUser1" "!self,Alpha,200,0.30,-1"
		"OnUser1" "!self,Alpha,255,0.40,-1"
		
		"OnUser2" "!self,Alpha,200,0.10,-1"
		"OnUser2" "!self,Alpha,150,0.20,-1"
		"OnUser2" "!self,Alpha,100,0.30,-1"
		"OnUser2" "!self,Alpha,50,0.37,-1"
		"OnUser2" "!self,Alpha,0,0.45,-1"
	}
}


modify:
{
	match:
	{
		"targetname" "Boss_Start"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "bongobongo,Enable,,5,1"
		"OnStartTouch" "bongobongo,Disable,,16,1"
		"OnStartTouch" "righthandmaker,ForceSpawnAtEntityOrigin,righthandmaker,5,1"
		"OnStartTouch" "lefthandmaker,ForceSpawnAtEntityOrigin,lefthandmaker,5,1"
	}
	insert:
	{
		"OnStartTouch" "bongobongo,FireUser1,,4.5,1"
		"OnStartTouch" "bongobongo,FireUser2,,15.5,1"
		
		"OnStartTouch" "righthandmaker,ForceSpawnAtEntityOrigin,righthandmaker,4.50,1"
		"OnStartTouch" "lefthandmaker,ForceSpawnAtEntityOrigin,lefthandmaker,4.50,1"
		
		"OnStartTouch" "b_lefthandtarget,SetDamageFilter,zombie,4.52,1"
		"OnStartTouch" "b_righthandtarget,SetDamageFilter,zombie,4.52,1"
		
		"OnStartTouch" "b_lefthandtarget,SetDamageFilter,human,16,1"
		"OnStartTouch" "b_righthandtarget,SetDamageFilter,human,16,1"
	}
}

modify:
{
	match:
	{
		"targetname" "b_handhpcounter"
		"classname" "math_counter"
	}
	delete:
	{
		"OnHitMin" "b_hit,PlaySound,,0,-1"
		"OnHitMin" "bongobongo,Enable,,0,-1"
		"OnHitMin" "bongobongo,Disable,,25,-1"
		"OnHitMin" "b_target,SetDamageFilter,human,0,-1"
		"OnHitMin" "b_target,SetDamageFilter,zombie,25,-1"
		"OnHitMin" "b_handhpbackup,GetValue,,25,-1"
	}
	insert:
	{
		"OnHitMin" "bongobongo,FireUser1,,0,-1"
		"OnHitMin" "bongobongo,FireUser2,,25.5,-1"
		"OnHitMin" "b_hit,PlaySound,,0,-1"

		"OnHitMin" "b_target,SetDamageFilter,human,0.5,-1"
		"OnHitMin" "b_target,SetDamageFilter,zombie,25.5,-1"
		"OnHitMin" "b_handhpbackup,GetValue,,25.5,-1"
	}
}

modify:
{
	match:
	{
		"targetname" "lefthandmaker"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "lefthand,FireUser1,,0.01,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "righthandmaker"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "righthand,FireUser1,,0.01,-1"
	}
}



modify:
{
	match:
	{
		"targetname" "b_rotatetimer"
		"classname" "logic_timer"
	}
	delete:
	{
		"OnTimer" "righthandmove1,KillHierarchy,,0,-1"
		"OnTimer" "lefthandmove1,KillHierarchy,,0,-1"
	}
	insert:
	{
		"OnTimer" "righthand,FireUser2,,0,-1"
		"OnTimer" "lefthand,FireUser2,,0,-1"
		"OnTimer" "righthandmove1,KillHierarchy,,0.03,-1"
		"OnTimer" "lefthandmove1,KillHierarchy,,0.03,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "b_hpcounter"
		"classname" "math_counter"
	}
	delete:
	{
		"OnHitMin" "lefthandmove1,KillHierarchy,,0,-1"
		"OnHitMin" "righthandmove1,KillHierarchy,,0,-1"
	}
	insert:
	{
		"OnHitMin" "lefthandmaker,Kill,,0,-1"
		"OnHitMin" "righthandmaker,Kill,,0,-1"
		"OnHitMin" "righthand,FireUser2,,0,-1"
		"OnHitMin" "lefthand,FireUser2,,0,-1"
		"OnHitMin" "righthandmove1,KillHierarchy,,0.03,-1"
		"OnHitMin" "lefthandmove1,KillHierarchy,,0.03,-1"
	}
}
modify:
{
	match:
	{
		"classname" "logic_auto"
	}
	delete:
	{
		"OnMapSpawn" "Server,Command,mp_roundtime 999,0,-1"
	}
	insert:
	{
		"OnMapSpawn" "Server,Command,mp_roundtime 59,0,-1"
		"OnMapSpawn" "Server,Command,sv_enablebunnyhopping 0,0,-1"
	}
}

;move around item origins so they dont block the view
; fire

modify:
{
	match:
	{
		"targetname" "DinsFire_Item_Weapon"
	}
	replace:
	{
		"origin" "-10359 2035 741"
	}
}
modify:
{
	match:
	{
		"targetname" "DinsFire_Particle2"
	}
	replace:
	{
		"origin" "-10370 2032 744"
	}
}
modify:
{
	match:
	{
		"targetname" "Wood_Box_1_Breakable"
	}
	replace:
	{
		"origin" "-10354 2025 748"
	}
}

; fairy

modify:
{
	match:
	{
		"targetname" "Fairy_Item_Weapon"
	}
	replace:
	{
		"origin" "-6894 1250 612"
	}
}
modify:
{
	match:
	{
		"targetname" "Fairy_Particle2"
	}
	replace:
	{
		"origin" "-6864 1248 600"
	}
}

; lens

modify:
{
	match:
	{
		"targetname" "LensOfTruth_Item_Weapon"
	}
	replace:
	{
		"origin" "12242 12535 6044"
	}
}


;; _

;; teleport boss back if he fell down during ship bossfight

add:
{
	"origin" "3680 -1696 -1423"
	"targetname" "ShipTarget"
	"spawnflags" "0"
	"angles" "0 0 0"
	"classname" "info_target"
}
add:
{
	"model" "*180"
	"UseLandmarkAngles" "0"
	"target" "ShipTarget"
	"StartDisabled" "0"
	"spawnflags" "8"
	"origin" "3484 -348 -4064"
	"CheckDestIfClearForPlayer" "0"
	"classname" "trigger_teleport"
}
add:
{
	"model" "*183"
	"UseLandmarkAngles" "0"
	"target" "ShipTarget"
	"StartDisabled" "0"
	"spawnflags" "8"
	"origin" "3756 -4544 -4064"
	"CheckDestIfClearForPlayer" "0"
	"classname" "trigger_teleport"
}


