;---------------------------------------------------------------
;Stripper by Lishang:http://steamcommunity.com/id/FFXIV_Lishang/
;---------------------------------------------------------------
modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "290378"
	}
	insert:
	{
		"OnMapSpawn" "Server,Command,say < Map fixed >,5,1"
	}
}

;----------------------
;Fix Zombie Gravity Bug
;----------------------
modify:
{
	match:
	{
		"targetname" "Item_Initial_Relay"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "Temp_Maker,AddOutput,angles 0 0 0,0,1"
	}
}

;---------------------------------------------------------------------------
;Fix trigger_hurt Damage Type (Behemoth_Self_Fire_Hurt & Behemoth_Self_Hurt)
;---------------------------------------------------------------------------
modify:
{
	match:
	{
		"targetname" "Behemoth_Self_Fire_Hurt"
		"classname" "trigger_hurt"
	}
	replace:
	{
		"damagetype" "0"
	}
}

modify:
{
	match:
	{
		"targetname" "Behemoth_Self_Hurt"
		"classname" "trigger_hurt"
	}
	replace:
	{
		"damagetype" "0"
	}
}

;-----------
;Fix Garland
;-----------
;Trigger
;-------
modify:
{
	match:
	{
		"targetname" "Garland_Trigger"
		"classname" "trigger_once"
		"hammerid" "1467884"
	}
	delete:
	{
		"OnStartTouch" "Spawn_Door_*,Open,,0,1"
		"OnStartTouch" "Explosion_Maker,ForceSpawnAtEntityOrigin,Garland_HP_Add,0,1"
		"OnStartTouch" "Garland_HP_Add,FireUser1,,0,1"
	}
	insert:
	{
		"OnStartTouch" "Boss_Template_Garland,ForceSpawn,,0,1"
		"OnStartTouch" "Explosion_Maker,ForceSpawnAtEntityOrigin,Spawn_Door,0,1"
		"OnStartTouch" "Spawn_Door_*,Open,,0.01,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Garland_Trigger"
		"classname" "trigger_once"
		"hammerid" "1284428"
	}
	delete:
	{
		"OnStartTouch" "Boss_Template_Garland,ForceSpawn,,0,1"
	}
	insert:
	{
		"OnStartTouch" "Garland_Dynamic,FireUser1,,0,1"
		"OnStartTouch" "Garland_Breakable,SetDamageFilter,Filter_Team_Human,0,1"
		"OnStartTouch" "Spawn_Door_*,Close,,28,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Boss_Template_Garland"
		"classname" "point_template"
	}
	delete:
	{
		"OnEntitySpawned" "Garland_Dynamic,FireUser1,,0,1"
		"OnEntitySpawned" "Spawn_Door_*,Close,,28,1"
		"OnEntitySpawned" "!self,Kill,,28.01,1"
	}
	insert:
	{
		"Template12" "Garland_HP_Add"
		"Template13" "Garland_HP_Counter"
		"OnEntitySpawned" "Garland_HP_Add,FireUser1,,1,1"
		"OnEntitySpawned" "!self,Kill,,1.01,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Garland_Breakable"
		"classname" "func_physbox_multiplayer"
	}
	replace:
	{
		"damagefilter" "Filter_Nada"
	}
}

;---------------------
;Garland HP (55,40,12)
;---------------------
modify:
{
	match:
	{
		"targetname" "Garland_HP_Counter"
		"classname" "math_counter"
	}
	replace:
	{
		"startvalue" "55"
		"max" "2615"
	}
}

modify:
{
	match:
	{
		"targetname" "Garland_HP_Add"
		"classname" "trigger_multiple"
	}
	delete:
	{
		"OnStartTouch" "Garland_HP_Counter,Add,98,0,-1"
	}
	insert:
	{
		"OnStartTouch" "Garland_HP_Counter,Add,40,0,-1"
	}
}

modify:
{
	match:
	{
		"targetname" "Garland_Lazer_Hurt"
		"classname" "trigger_hurt"
	}
	delete:
	{
		"OnHurtPlayer" "Garland_HP_Counter,Subtract,38,0,-1"
	}
	insert:
	{
		"OnHurtPlayer" "Garland_HP_Counter,Subtract,12,0,-1"
	}
}

;--------------------------
;Laser Speed (1500 -> 1450)
;--------------------------
modify:
{
	match:
	{
		"targetname" "Garland_Lazer_Move"
		"classname" "func_movelinear"
	}
	replace:
	{
		"speed" "1450"
	}
}

;--------------------------------------------------------------------------------------------------------------------------
;Fix Game Text (GFLClan) (Level_Text Channel : 1) (Boss_Text Channel : 2) (Music_Text & Item_Text & FFXIV_Text Channel : 5)
;--------------------------------------------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"targetname" "FFXIV_Boss_Text"
		"classname" "game_text"
	}
	replace:
	{
		"y" ".825"
		"channel" "3"
	}
}

modify:
{
	match:
	{
		"classname" "game_text"
		"x" ".015"
		"y" ".38"
		"channel" "5"
	}
	replace:
	{
		"y" ".4"
		"channel" "4"
	}
}

;----------------
;Fix Teleport Bug
;----------------
;TP_AFK_Behemoth
;---------------
modify:
{
	match:
	{
		"targetname" "TP_AFK_Behemoth"
		"classname" "trigger_teleport"
	}
	delete:
	{
		"OnUser1" "!self,Enable,,0,1"
	}
	insert:
	{
		"OnUser1" "!self,AddOutput,target TD_Ultimate_Begin,0,1"
		"OnUser1" "!self,Enable,,0.01,1"
	}
}

;-----------------
;TP_AFK_Entrance_1
;-----------------
modify:
{
	match:
	{
		"targetname" "Kill"
		"classname" "logic_case"
	}
	delete:
	{
		"OnCase04" "TP_AFK_Entrance_1,Kill,,0,1"
		"OnCase03" "Star_5_Wall,Kill,,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Stage_Template_Ultimate"
		"classname" "point_template"
	}
	delete:
	{
		"Template14" "Garland_HP_*"
	}
	insert:
	{
		"OnEntitySpawned" "TP_AFK_Entrance_1,FireUser1,,2,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button1_Case"
		"classname" "logic_case"
	}
	insert:
	{
		"OnCase03" "Star_5_Wall,FireUser1,,15,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Stage_Template_Savage"
		"classname" "point_template"
	}
	insert:
	{
		"OnEntitySpawned" "Star_5_Particle,Stop,,8,1"
	}
}

;---------------
;TP_AFK_Entrance
;---------------
modify:
{
	match:
	{
		"targetname" "Button2_Case"
		"classname" "logic_case"
	}
	delete:
	{
		"OnUser2" "TP_AFK_Entrance,FireUser1,,40,1"
	}
	insert:
	{
		"OnUser2" "TP_AFK_Entrance,FireUser1,,39.5,1"
		"OnCase03" "Star_5_Wall,Kill,,0,1"
	}
}

;--------
;TP_Spawn
;--------
modify:
{
	match:
	{
		"targetname" "Ultima_Weapon_HP_Counter"
		"classname" "math_counter"
	}
	insert:
	{
		"OnHitMin" "TP_Spawn,AddOutput,target TD_Ultimate_End,0,1"
	}
}


;-----------------
;ReMake Sword Oath
;-----------------
modify:
{
	match:
	{
		"targetname" "Item_Oath_Template_Sword"
		"classname" "point_template"
	}
	delete:
	{
		"Template08" "Item_Sword_Push"
		"Template09" "Item_Sword_Hurt"
	}
}

modify:
{
	match:
	{
		"targetname" "Item_Sword_HP_Counter"
		"classname" "math_counter"
	}
	replace:
	{
		"startvalue" "3"
		"max" "3"
	}
}

modify:
{
	match:
	{
		"targetname" "Item_Sword_Path_2"
		"classname" "path_track"
	}
	delete:
	{
		"OnPass" "Item_Sword_Push,Enable,,0.6,1"
	}
	insert:
	{
		"OnPass" "Item_Oath_Template_Sword_Push,ForceSpawn,,0.6,1"
	}
}

filter:
{
	"targetname" "Item_Sword_Hurt"
	"classname" "point_hurt"
}

add:
{
	"targetname" "Item_Oath_Template_Sword_Push"
	"classname" "point_template"
	"origin" "8432 -9856 -5112"
	"spawnflags" "2"
	"Template01" "Item_Sword_Relay"
	"Template02" "Item_Sword_Measure"
	"Template03" "Item_Sword_Push"
}

add:
{
	"targetname" "Item_Sword_Relay"
	"classname" "logic_relay"
	"origin" "8432 -9856 -5112"
	"spawnflags" "1"
	"StartDisabled" "0"
	"OnSpawn" "!self,Kill,,0,1"
	"OnSpawn" "Item_Sword_Push,SetParent,Item_Sword_Dynamic,0.03,1"
	"OnSpawn" "Item_Sword_Measure,Kill,,0.06,1"
}

add:
{
	"targetname" "Item_Sword_Measure"
	"classname" "logic_measure_movement"
	"origin" "8416 -9856 -5112"
	"MeasureTarget" "Item_Sword_Dynamic"
	"MeasureReference" "Item_Sword_Push"
	"Target" "Item_Sword_Push"
	"TargetReference" "Item_Sword_Push"
	"TargetScale" "1"
	"MeasureType" "0"
}

modify:
{
	match:
	{
		"targetname" "Item_Sword_Push"
		"classname" "trigger_multiple"
	}
	replace:
	{
		"classname" "trigger_push"
		"StartDisabled" "0"
	}
	delete:
	{
		"parentname" "Item_Sword_Train"
		"wait" "1"
		"OnStartTouch" "!activator,AddOutput,BaseVelocity 0 0 500,0,-1"
		"OnStartTouch" "Item_Sword_Hurt,Hurt,,0,-1"
	}
	insert:
	{
		"pushdir" "0 0 0"
		"speed" "710"
		"alternateticksfix" "0"
	}
}

;---------------
;Fix Item Origin
;---------------
modify:
{
	match:
	{
		"targetname" "Item_Origin_Case_Ultimate"
		"classname" "logic_case"
	}
	delete:
	{
		"OnCase01" "Temp_Maker,AddOutput,origin 4352 -576 128,0,1"
	}
	insert:
	{
		"OnCase01" "Temp_Maker,AddOutput,origin 4800 -640 128,0,1"
	}
}

;--------------------------------------
;Fix Behemoth HP (GFLClan) (400 -> 420)
;--------------------------------------
modify:
{
	match:
	{
		"targetname" "Filter_Team_Human_Case"
		"classname" "logic_case"
	}
	delete:
	{
		"OnCase02" "Behemoth_HP_Initial,Add,100,0,-1"
	}
	insert:
	{
		"OnCase02" "Behemoth_HP_Initial,Add,150,0,-1"
	}
}

;--------------------------------------------------------
;Fix Item Knife (Weapon Name & Weapon Strip & Item Clear)
;--------------------------------------------------------
;Weapon Name
;-----------
modify:
{
	match:
	{
		"targetname" "Knife_Alteci_Weapon"
		"classname" "weapon_knife"
	}
	delete:
	{
		"OnUser1" "Knife_Alteci_Strip,Kill,,0,1"
	}
	insert:
	{
		"OnPlayerPickup" "!self,AddOutput,targetname Knife_Alteci_Knife,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Garuda_Weapon"
		"classname" "weapon_knife"
	}
	delete:
	{
		"OnUser1" "Knife_Garuda_Strip,Kill,,0,1"
	}
	insert:
	{
		"OnPlayerPickup" "!self,AddOutput,targetname Knife_Garuda_Knife,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Gravity_Weapon"
		"classname" "weapon_knife"
	}
	delete:
	{
		"OnUser1" "Knife_Gravity_Strip,Kill,,0,1"
	}
	insert:
	{
		"OnPlayerPickup" "!self,AddOutput,targetname Knife_Gravity_Weapon,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Heal_Weapon"
		"classname" "weapon_knife"
	}
	delete:
	{
		"OnUser1" "Knife_Heal_Strip,Kill,,0,1"
	}
	insert:
	{
		"OnPlayerPickup" "!self,AddOutput,targetname Knife_Heal_Weapon,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Ice_Weapon"
		"classname" "weapon_knife"
	}
	delete:
	{
		"OnUser1" "Knife_Ice_Strip,Kill,,0,1"
	}
	insert:
	{
		"OnPlayerPickup" "!self,AddOutput,targetname Knife_Ice_Weapon,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Malefic_Weapon"
		"classname" "weapon_knife"
	}
	delete:
	{
		"OnUser1" "Knife_Malefic_Strip,Kill,,0,1"
	}
	insert:
	{
		"OnPlayerPickup" "!self,AddOutput,targetname Knife_Malefic_Weapon,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Vyraal_Weapon"
		"classname" "weapon_knife"
	}
	delete:
	{
		"OnUser1" "Knife_Vyraal_Strip,Kill,,0,1"
	}
	insert:
	{
		"OnPlayerPickup" "!self,AddOutput,targetname Knife_Vyraal_Knife,0,1"
	}
}

;------------
;Weapon Strip
;------------
modify:
{
	match:
	{
		"targetname" "Item_LalaFell_Strip"
		"classname" "trigger_multiple"
	}
	replace:
	{
		"classname" "trigger_once"
	}
	delete:
	{
		"wait" "1"
		"OnStartTouch" "FFXIV_Strip,StripWeaponsAndSuit,,0,-1"
		"OnStartTouch" "FFXIV_Knife,Use,,1,-1"
	}
	insert:
	{
		"OnTrigger" "FFXIV_Strip,StripWeaponsAndSuit,,0,1"
		"OnTrigger" "FFXIV_Knife,Use,,1,1"
	}
}

modify:
{
	match:
	{
		"classname" "trigger_multiple"
		"filtername" "Filter_Zombie_None"
	}
	replace:
	{
		"classname" "trigger_once"
	}
	delete:
	{
		"wait" "1"
		"OnStartTouch" "FFXIV_Strip,StripWeaponsAndSuit,,0,-1"
		"OnStartTouch" "FFXIV_Knife,Use,,1,-1"
	}
	insert:
	{
		"OnTrigger" "FFXIV_Strip,StripWeaponsAndSuit,,0,1"
		"OnTrigger" "FFXIV_Knife,Use,,1,1"
	}
}

;----------
;Item Clear
;----------
modify:
{
	match:
	{
		"targetname" "Knife_Alteci_Filter_Clear"
		"classname" "filter_activator_name"
	}
	delete:
	{
		"OnPass" "Knife_Alteci_UI,Kill,,0.01,1"
		"OnPass" "Knife_Alteci_Relay_*,Kill,,0.01,1"
		"OnPass" "!self,Kill,,0.02,1"
	}
	insert:
	{
		"OnPass" "Knife_Alteci_Knife,FireUser2,,0.01,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Garuda_Filter_Clear"
		"classname" "filter_activator_name"
	}
	delete:
	{
		"OnPass" "Knife_Garuda_UI,Kill,,0.01,1"
		"OnPass" "Knife_Garuda_Relay_*,Kill,,0.01,1"
		"OnPass" "!self,Kill,,0.02,1"
	}
	insert:
	{
		"OnPass" "Knife_Garuda_Knife,FireUser2,,0.01,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Gravity_Filter_Clear"
		"classname" "filter_activator_name"
	}
	insert:
	{
		"OnPass" "Knife_Gravity_Weapon,Kill,,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Heal_Filter_Clear"
		"classname" "filter_activator_name"
	}
	insert:
	{
		"OnPass" "Knife_Heal_Weapon,Kill,,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Ice_Filter_Clear"
		"classname" "filter_activator_name"
	}
	insert:
	{
		"OnPass" "Knife_Ice_Weapon,Kill,,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Malefic_Filter_Clear"
		"classname" "filter_activator_name"
	}
	insert:
	{
		"OnPass" "Knife_Malefic_Weapon,Kill,,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Vyraal_Filter_Clear"
		"classname" "filter_activator_name"
	}
	delete:
	{
		"OnPass" "Knife_Vyraal_Text,Kill,,0,1"
		"OnPass" "Knife_Vyraal_Attack_Animation_Case,Kill,,0,1"
		"OnPass" "Knife_Vyraal_Counter,Kill,,0,1"
		"OnPass" "Knife_Vyraal_Text_Case,Kill,,0,1"
		"OnPass" "Knife_Vyraal_Attack_Case,Kill,,0,1"
		"OnPass" "Knife_Vyraal_Filter*,Kill,,0.01,1"
	}
	insert:
	{
		"OnPass" "Knife_Vyraal_Knife,FireUser2,,0,1"
	}
}

;----------------
;Fix Zombie Strip
;----------------
modify:
{
	match:
	{
		"targetname" "Filter_Zombie_None"
		"classname" "filter_multi"
	}
	replace:
	{
		"Negated" "1"
		"filtertype" "1"
		"Filter01" "Filter_Team_Human"
		"Filter02" "Filter_Zombie_Vyraal"
	}
	insert:
	{
		"Filter03" "Filter_Zombie_Alteci"
		"Filter04" "Filter_Zombie_Garuda"
		"Filter05" "Filter_Zombie_Gravity"
		"Filter06" "Filter_Zombie_Heal"
		"Filter07" "Filter_Zombie_Ice"
		"Filter08" "Filter_Zombie_Malefic"
	}
}

add:
{
	"targetname" "Filter_Zombie_Vyraal"
	"classname" "filter_activator_name"
	"origin" "-8280 -10632 -1528"
	"Negated" "0"
	"filtername" "Player_Vyraal"
}

add:
{
	"targetname" "Filter_Zombie_Alteci"
	"classname" "filter_activator_name"
	"origin" "-8280 -10648 -1528"
	"Negated" "0"
	"filtername" "Player_Alteci"
}

add:
{
	"targetname" "Filter_Zombie_Garuda"
	"classname" "filter_activator_name"
	"origin" "-8280 -10664 -1528"
	"Negated" "0"
	"filtername" "Player_Garuda"
}

add:
{
	"targetname" "Filter_Zombie_Gravity"
	"classname" "filter_activator_name"
	"origin" "-8296 -10632 -1528"
	"Negated" "0"
	"filtername" "Player_Gravity_Zombie"
}

add:
{
	"targetname" "Filter_Zombie_Heal"
	"classname" "filter_activator_name"
	"origin" "-8296 -10648 -1528"
	"Negated" "0"
	"filtername" "Player_Heal_Zombie"
}

add:
{
	"targetname" "Filter_Zombie_Ice"
	"classname" "filter_activator_name"
	"origin" "-8296 -10664 -1528"
	"Negated" "0"
	"filtername" "Player_Ice_Zombie"
}

add:
{
	"targetname" "Filter_Zombie_Malefic"
	"classname" "filter_activator_name"
	"origin" "-8296 -10680 -1528"
	"Negated" "0"
	"filtername" "Player_Malefic_Zombie"
}

;----------------
;Fix Stage 3 Boss
;----------------
modify:
{
	match:
	{
		"targetname" "Sanctuary_Keeper_HP_Counter"
		"classname" "math_counter"
	}
	replace:
	{
		"startvalue" "30"
		"max" "4830"
	}
}

modify:
{
	match:
	{
		"targetname" "Sanctuary_Keeper_Push"
		"classname" "trigger_push"
	}
	replace:
	{
		"speed" "250"
	}
}

modify:
{
	match:
	{
		"targetname" "Sanctuary_Keeper_Hurt"
		"classname" "trigger_hurt"
	}
	insert:
	{
		"OnStartTouch" "Odin_HP_Counter,Subtract,20,0,-1"
	}
}

modify:
{
	match:
	{
		"targetname" "Odin_HP_Counter"
		"classname" "math_counter"
	}
	replace:
	{
		"max" "1310"
	}
}

;----------
;Fix Garuda
;----------
modify:
{
	match:
	{
		"targetname" "Knife_Garuda_Trigger_Push"
		"classname" "trigger_push"
		"hammerid" "3793219"
	}
	replace:
	{
		"pushdir" "0 135 0"
	}
}

modify:
{
	match:
	{
		"targetname" "Knife_Garuda_Trigger_Push"
		"classname" "trigger_push"
		"hammerid" "3793242"
	}
	replace:
	{
		"pushdir" "0 45 0"
	}
}

;----------
;Disable bhop at the final stretch on ultimate
;----------

modify:
{
	match:
	{
		"targetname" "Ultimate_Trigger_Last"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "server,Command,sv_enablebunnyhopping 0,35,1"
	}
}

;----------
;...and re-enable it when a new round starts
;----------

modify:
{
	match:
	{
		"classname" "logic_auto"
	}
	insert:
	{
		"OnMapSpawn" "Server,Command,sv_enablebunnyhopping 1,0,1"
	}
}