﻿add_namespace = SyriaDecisions
add_namespace = SyriaDecisionsNews

### Druzes or FSA are willing to let go of Golan ###
#Start negotiations
country_event = {
	
	id = SyriaDecisions.0
	
	title = SyriaDecisions.0.t
	desc = SyriaDecisions.0.desc
	picture = GFX_Golan
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	option = {
		name = SyriaDecisions.0.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.0.a executed"		#Agree
		ai_chance = {
			factor = 60
			modifier = {	
				factor = 2			#More helpful if it's the Druze asking
				FROM = {
					original_tag = DRU 
				}
			}
		}
		FROM = { country_event = { id = SyriaDecisions.1 days = 3 } }
		custom_effect_tooltip = TT_SYR_GAIN_20_INFLUENCE
		hidden_effect = {
			FROM = {
				set_temp_variable = { influence_gain = 20 }
				for_loop_effect = {
					end = influence_array^num
					value = v
					if = {
						limit = {
							check_variable = { influence_array^v = ROOT }
						}
						add_to_variable = { influence_array_val^v = influence_gain }
						set_country_flag = found
					}
				}
				if = {
					limit = { NOT = { has_country_flag = found } }
						add_to_array = { influence_array = ROOT.id }
						add_to_array = { influence_array_val = influence_gain }
				}
				clr_country_flag = found
				recalculate_influence = yes
			}
		}
		if = {
			limit = { FROM = { original_tag = DRU } }
			add_ai_strategy = {
				type = support
				id = "DRU"
				value = 200
			}
			add_ai_strategy = {
				type = send_volunteers_desire
				id = "DRU"
				value = 200
			}
		}
		if = {
			limit = { FROM = { original_tag = FSA } }
			add_ai_strategy = {
				type = support
				id = "FSA"
				value = 200
			}
			add_ai_strategy = {
				type = send_volunteers_desire
				id = "FSA"
				value = 200
			}
		}
	}
	option = {
		name = SyriaDecisions.0.b
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.0.b executed"		#No
		ai_chance = {
			factor = 40
			modifier = {
				factor = 0.5
				FROM = {
					original_tag = DRU
				}
			}
		}
		FROM = { country_event = { id = SyriaDecisions.2 days = 3 } }
	}
}

#Israel agrees
country_event = {

	id = SyriaDecisions.1
	
	title = SyriaDecisions.1.t
	desc = SyriaDecisions.1.desc
	picture = GFX_Golan
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	option = {
		name = SyriaDecisions.1.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.1.a executed"		#Ok
		ai_chance = {
			factor = 100
		}
		remove_state_core = 587
		remove_state_claim = 587
		hidden_effect = { news_event = { id = SyriaDecisionsNews.0 hours = 6 } }
		set_country_flag = Relinquished_Golan
	}
}

#Israel refuses
country_event = {

	id = SyriaDecisions.2
	
	title = SyriaDecisions.2.t
	desc = SyriaDecisions.2.desc
	picture = GFX_Golan
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	option = {
		name = SyriaDecisions.2.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.2.a executed"		#Damn
		ai_chance = {
			factor = 100
		}
	}
}

### Alawite state is willing to let go of Hatay ###
#Start negotiations
country_event = {
	
	id = SyriaDecisions.3
	
	title = SyriaDecisions.3.t
	desc = SyriaDecisions.3.desc
	picture = GFX_Hatay
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	option = {
		name = SyriaDecisions.3.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.3.a executed"		#Agree
		ai_chance = {
			factor = 80
		}
		FROM = { country_event = { id = SyriaDecisions.4 days = 3 } }
		custom_effect_tooltip = TT_SYR_GAIN_20_INFLUENCE
		hidden_effect = {
			FROM = {
				set_temp_variable = { influence_gain = 20 }
				for_loop_effect = {
					end = influence_array^num
					value = v
					if = {
						limit = {
							check_variable = { influence_array^v = ROOT }
						}
						add_to_variable = { influence_array_val^v = influence_gain }
						set_country_flag = found
					}
				}
				if = {
					limit = { NOT = { has_country_flag = found } }
						add_to_array = { influence_array = ROOT.id }
						add_to_array = { influence_array_val = influence_gain }
				}
				clr_country_flag = found
				recalculate_influence = yes
			}
		}
		add_ai_strategy = {
			type = support
			id = "ALA"
			value = 200
		}
		add_ai_strategy = {
			type = send_volunteers_desire
			id = "ALA"
			value = 200
		}
	}
	option = {
		name = SyriaDecisions.3.b
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.3.b executed"		#No
		ai_chance = {
			factor = 20
		}
		FROM = { country_event = { id = SyriaDecisions.5 days = 3 } }
	}
}

#Turkey agrees
country_event = {

	id = SyriaDecisions.4
	
	title = SyriaDecisions.4.t
	desc = SyriaDecisions.4.desc
	picture = GFX_Hatay
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	option = {
		name = SyriaDecisions.4.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.4.a executed"		#Ok
		ai_chance = {
			factor = 100
		}
		remove_state_core = 158
		remove_state_claim = 158
		hidden_effect = { news_event = { id = SyriaDecisionsNews.1 hours = 6 } }
		set_country_flag = Relinquished_Hatay
	}
}

#Turkey refuses
country_event = {

	id = SyriaDecisions.5
	
	title = SyriaDecisions.5.t
	desc = SyriaDecisions.5.desc
	picture = GFX_Hatay
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	option = {
		name = SyriaDecisions.5.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.5.a executed"		#Damn
		ai_chance = {
			factor = 100
		}
	}
}

### Offer Rojava a deal ###
country_event = {

	id = SyriaDecisions.6
	
	title = SyriaDecisions.6.t
	desc = SyriaDecisions.6.desc
	picture = GFX_Rojava
	
	is_triggered_only = yes
	
	fire_only_once = yes 
	
	option = {
		name = SyriaDecisions.6.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.6.a executed"		#Join the war
		ai_chance = {
			factor = 80
			modifier = {
				factor = 0.125
				has_war = yes
			}
			modifier = {
				factor = 0.8
				FROM = { original_tag = SYR }
			}
		}
		if = {
			limit = {
				FROM = {
					original_tag = FSA
					has_war_with = SYR
				}
			}
			add_to_war = {
				targeted_alliance = FSA
				enemy = SYR
			}
		}
		if = {
			limit = {
				FROM = {
					original_tag = FSA
					has_war_with = NUS
				}
			}
			add_to_war = {
				targeted_alliance = FSA
				enemy = NUS
			}
		}
		if = {
			limit = {
				FROM = {
					original_tag = SYR
					has_war_with = FSA
				}
			}
			add_to_war = {
				targeted_alliance = SYR
				enemy = FSA
			}
		}
		if = {
			limit = {
				FROM = {
					original_tag = SYR
					has_war_with = NUS
				}
			}
			add_to_war = {
				targeted_alliance = SYR
				enemy = NUS
			}
		}
		FROM = { country_event = { id = SyriaDecisions.7 days = 3 } }
	}
	option = {
		name = SyriaDecisions.6.b
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.6.b executed"		#No
		ai_chance = {
			factor = 20
			modifier = {
				factor = 4.5
				has_war = yes
			}
			modifier = {
				factor = 1.25
				FROM = { original_tag = SYR }
			}
		}
		FROM = { country_event = { id = SyriaDecisions.8 days = 3 } }
	}
}

#Rojava agrees
country_event = {

	id = SyriaDecisions.7
	
	title = SyriaDecisions.7.t
	desc = SyriaDecisions.7.desc
	picture = GFX_Rojava
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	option = {
		name = SyriaDecisions.7.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.7.a executed"		#Ok
		ai_chance = {
			factor = 100
		}
		set_country_flag = Deal_With_Rojava
		remove_state_core = 575
		remove_state_core = 571
		remove_state_core = 193
		if = {
			limit = { owns_state = 575 }
			ROJ = { transfer_state = 575 }
		}
		if = {
			limit = { owns_state = 571 }
			ROJ = { transfer_state = 571 }
		}
		if = {
			limit = { owns_state = 193 }
			ROJ = { transfer_state = 193 }
		}
	}
}

#Rojava refuses
country_event = {

	id = SyriaDecisions.8
	
	title = SyriaDecisions.8.t
	desc = SyriaDecisions.8.desc
	picture = GFX_Rojava
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	option = {
		name = SyriaDecisions.8.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.8.a executed"		#Damn
		ai_chance = {
			factor = 100
		}
	}
}

#Hezbollah discovers Syrian spies
country_event = {

	id = SyriaDecisions.9
	
	title = SyriaDecisions.9.t
	desc = SyriaDecisions.9.desc
	picture = GFX_Hezbollah_Spies
	
	trigger = {
		original_tag = HEZ
		has_country_flag = HEZ_Infiltrated_by_SYR
		NOT = { is_subject_of = SYR }
		NOT = { is_subject_of = FSA }
		NOT = { is_subject_of = NUS }
	}
	
	fire_only_once = yes
	
	mean_time_to_happen = {
		months = 6
		modifier = {
			factor = 1.2
			any_country = {			#Infiltrator having intelligence community faction is better at infiltration
				has_country_flag = HEZ_Infiltrated_by_SYR
				NOT = { original_tag = HEZ }
				has_idea = intelligence_community
			}
		}
	}
	
	option = {
		name = SyriaDecisions.9.a		#Execute them and strike back
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.9.a executed"	
		ai_chance = { factor = 80 }
		random_country = {
			limit = {
				NOT = { original_tag = HEZ }
				has_country_flag = HEZ_Infiltrated_by_SYR
			}
			country_event = SyriaDecisions.10
			clr_country_flag = HEZ_Infiltrated_by_SYR
		}
		start_border_war = {
			change_state_after_war = yes
			attacker = {
				state = 553
				num_of_provinces = 1
			}
			defender = {
				state = 184
				num_of_provinces = 1
			}
		}
		clr_country_flag = HEZ_Infiltrated_by_SYR
		hidden_effect = { news_event = { id = SyriaDecisionsNews.3 hours = 6 } }
	}
	option = {
		name = SyriaDecisions.9.b		#Return them and request compensation
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.9.b executed"	
		ai_chance = { factor = 20 }
		random_country = {
			limit = {
				NOT = { original_tag = HEZ }
				has_country_flag = HEZ_Infiltrated_by_SYR
			}
			country_event = SyriaDecisions.11
			clr_country_flag = HEZ_Infiltrated_by_SYR
		}
		clr_country_flag = HEZ_Infiltrated_by_SYR
	}	
		
}
#Hezbollah attacks
country_event = {

	id = SyriaDecisions.10
	
	title = SyriaDecisions.10.t
	desc = SyriaDecisions.10.desc
	picture = GFX_Hezbollah_Spies
	
	is_triggered_only = yes
	
	option = {
		name = SyriaDecisions.10.a		#Damn
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.10.a executed"	
		ai_chance = { factor = 100 }
	}

}
#Hezbollah demands ransom for spies
country_event = {

	id = SyriaDecisions.11
	
	title = SyriaDecisions.11.t
	desc = SyriaDecisions.11.desc
	picture = GFX_Hezbollah_Spies
	
	is_triggered_only = yes
	
	option = {
		name = SyriaDecisions.11.a		#Pay up
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.11.a executed"	
		ai_chance = { factor = 80 }
		# CHANGE THIS TO MONEY AT SOME POINT!
		add_political_power = -100
		FROM = { country_event = SyriaDecisions.12 }
	}
	option = {
		name = SyriaDecisions.11.b		#Don't pay
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.11.b executed"	
		ai_chance = { factor = 20 }
		FROM = { country_event = SyriaDecisions.13 }
		if = {
			limit = { has_idea = intelligence_community }
			visually_display_opinion_fall_intelligence_community = yes
			set_country_flag = current_intelligence_community
			decrease_internal_faction_opinion = yes
		}	
	}

}
#Syria pays
country_event = {

	id = SyriaDecisions.12
	
	title = SyriaDecisions.12.t
	desc = SyriaDecisions.12.desc
	picture = GFX_Hezbollah_Spies
	
	is_triggered_only = yes
	
	option = {
		name = SyriaDecisions.12.a		#Good
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.12.a executed"	
		ai_chance = { factor = 100 }
		add_political_power = 100
	}

}
#Syria refuses to pay
country_event = {

	id = SyriaDecisions.13
	
	title = SyriaDecisions.13.t
	desc = SyriaDecisions.13.desc
	picture = GFX_Hezbollah_Spies
	
	is_triggered_only = yes
	
	option = {
		name = SyriaDecisions.13.a		#Attack
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.13.a executed"	
		ai_chance = { factor = 80 }
		start_border_war = {
			change_state_after_war = yes
			attacker = {
				state = 553
				num_of_provinces = 1
			}
			defender = {
				state = 184
				num_of_provinces = 1
			}
		}
		hidden_effect = { news_event = { id = SyriaDecisionsNews.3 hours = 6 } }
	}
	option = {
		name = SyriaDecisions.13.b		#Back down
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.13.b executed"
		ai_chance = { factor = 20 }
		relative_change_neg_10 = yes
	}

}

#Corruption in Hezbollah
country_event = {

	id = SyriaDecisions.14
	
	title = SyriaDecisions.14.t
	desc = SyriaDecisions.14.desc
	picture = GFX_Hezbollah_Spies
	
	trigger = {
		original_tag = HEZ
		has_country_flag = Discord_Between_HEZ_PER
		NOT = { is_subject_of = SYR }
		NOT = { is_subject_of = FSA }
		NOT = { is_subject_of = NUS }
	}
	
	fire_only_once = yes
	
	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 0.8
			any_country = {			#Infiltrator having intelligence community faction is better at infiltration
				has_country_flag = Discord_Between_HEZ_PER
				NOT = { original_tag = HEZ }
				has_idea = intelligence_community
			}
		}
	}
	
	immediate = {
		hidden_effect = {
			retire_country_leader = yes
		}
	}
	
	option = {
		name = SyriaDecisions.14.a		#Very suspicious
		log = "[GetDateText]: [This.GetName]: SyriaDecisions.14.a executed"
		ai_chance = { factor = 100 }
		clr_country_flag = Discord_Between_HEZ_PER
		leave_faction = ROOT
		hidden_effect = {
			random_country = {
				limit = { has_country_flag = Discord_Between_HEZ_PER }
				clr_country_flag = Discord_Between_HEZ_PER
			}
		}
	}

}

#Golan deal
news_event = {
	id = SyriaDecisionsNews.0
	title = SyriaDecisionsNews.0.t
	desc = SyriaDecisionsNews.0.d
	picture = GFX_news_Golan
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = SyriaDecisionsNews.0.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisionsNews.0.a executed"
	}
}

#Hatay deal
news_event = {
	id = SyriaDecisionsNews.1
	title = SyriaDecisionsNews.1.t
	desc = SyriaDecisionsNews.1.d
	picture = GFX_news_Hatay
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = SyriaDecisionsNews.1.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisionsNews.1.a executed"
	}
}

#Rojava deal
news_event = {
	id = SyriaDecisionsNews.2
	title = SyriaDecisionsNews.2.t
	desc = SyriaDecisionsNews.2.d
	picture = GFX_news_rojava_victory
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = SyriaDecisionsNews.2.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisionsNews.2.a executed"
	}
}

#Border war between Hezbollah and Syria
news_event = {
	id = SyriaDecisionsNews.3
	title = SyriaDecisionsNews.3.t
	desc = SyriaDecisionsNews.3.d
	picture = GFX_news_Hezbollah_Syria
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = SyriaDecisionsNews.3.a
		log = "[GetDateText]: [This.GetName]: SyriaDecisionsNews.3.a executed"
	}
}