#Persian events
namespace = FEE_Persia_Events

# The Qizilbash
country_event = {
	id = FEE_Persia_Events.1
	title = FEE_Persia_Events.1.T
	desc = FEE_Persia_Events.1.D
	picture = HORDE_ON_HORSEBACK_eventPicture

	fire_only_once = yes

	trigger = {
		tag = PER
		NOT = { is_year = 1600 }
		religion = shiite
	}

	mean_time_to_happen = {
		months = 4
	}

	option = { #They are here for us now, that is all that matters.
		name = FEE_Persia_Events.1.OPT1

		add_mil_power = 50
		add_country_modifier = {
			name = fee_per_the_qizilbash
			duration = -1
		}
	}
}

# The Qizilbash Lend Their Support
country_event = {
	id = FEE_Persia_Events.2
	title = FEE_Persia_Events.2.T
	desc = FEE_Persia_Events.2.D
	picture = MILITARY_CAMP_eventPicture

	trigger = {
		tag = PER
		NOT = { has_country_flag = fee_per_end_qizilbash_influence }
		OR = {
			NOT = { has_country_flag = fee_per_qizilbash_support }
			had_country_flag = {
				flag = fee_per_qizilbash_support
				days = 3650
			}
		}
		has_country_modifier = fee_per_the_qizilbash
		any_country = {
			any_owned_province = {
				OR = {
					is_core = ROOT
					is_permanent_claim = ROOT
				}
			}
			war_with = ROOT
		}
	}

	mean_time_to_happen = {
		months = 18
	}

	immediate = {
		hidden_effect = {
			clr_country_flag = fee_per_qizilbash_support
			set_country_flag = fee_per_qizilbash_support
		}
	}

	option = { #United for the Shah!
		name = FEE_Persia_Events.2.OPT1

		add_manpower = 1
		add_army_tradition = 5
	}

	option = { # Ask for their guidance
		name = FEE_Persia_Events.2.OPT2

		add_mil_power = 50
		create_general = {
			tradition = 33
			add_shock = 1
		}
	}
}

# The Qizilbash Fight for Power
country_event = {
	id = FEE_Persia_Events.3
	title = FEE_Persia_Events.3.T
	desc = FEE_Persia_Events.3.D
	picture = HORDE_ON_HORSEBACK_eventPicture

	trigger = {
		tag = PER
		has_country_modifier = fee_per_the_qizilbash
		NOT = {	legitimacy = 80 }
		NOT = { has_country_flag = fee_per_end_qizilbash_influence }
		OR = {
			NOT = { has_country_flag = fee_per_qizilbash_fight }
			had_country_flag = {
				flag = fee_per_qizilbash_fight
				days = 3650
			}
		}
	}

	mean_time_to_happen = {
		months = 6
	}

	option = { # Long live the Shah!
		name = FEE_Persia_Events.3.OPT1

		hidden_effect = {
			set_country_flag = fee_per_qizilbash_fight
		}
		random_owned_province = {
			spawn_rebels = {
				type = pretender_rebels
				size = 2
			}
			add_unrest = 15
		}
		random_owned_province = {
			spawn_rebels = {
				type = pretender_rebels
				size = 1
			}
		}
	}

	option = { # Let us ensure the loyalty of the tribes.
		name = FEE_Persia_Events.3.OPT2

		hidden_effect = {
			set_country_flag = fee_per_qizilbash_fight
		}
		add_dip_power = -100
	}
}

# Qizilbash Plot!
country_event = {
	id = FEE_Persia_Events.4
	title = FEE_Persia_Events.4.T
	desc = FEE_Persia_Events.4.D
	picture = LIBERUM_VETO_eventPicture

	trigger = {
		tag = PER
		NOT = { has_country_flag = fee_per_end_qizilbash_influence }
		has_country_modifier = fee_per_the_qizilbash
		has_advisor = yes
	}

	mean_time_to_happen = {
		months = 360
	}

	option = { # The situation will only get worse if we interfere.
		name = FEE_Persia_Events.4.OPT1

		kill_advisor = random
		add_stability = -1
	}

	option = { # We will not be slaves to the whims of the tribes!
		name = FEE_Persia_Events.4.OPT2

		kill_advisor = random
		random_owned_province = {
			spawn_rebels = {
				type = noble_rebels
				size = 2
			}
		}
	}
}

# Pressure From the Qizilbash
country_event = {
	id = FEE_Persia_Events.5
	title = FEE_Persia_Events.5.T
	desc = FEE_Persia_Events.5.D
	picture = ANGRY_MOB_eventPicture

	trigger = {
		tag = PER
		NOT = { has_country_flag = fee_per_end_qizilbash_influence }
		has_country_modifier = fee_per_the_qizilbash
		OR = {
			NOT = { has_ruler_flag = fee_per_resisted_qizilbash }
			had_ruler_flag = {
				flag = fee_per_resisted_qizilbash
				days = 3650
			}
		}
	}

	mean_time_to_happen = {
		months = 360
	}

	option = { # Let them have their way.
		name = FEE_Persia_Events.5.OPT1

		add_adm_power = -50
		add_mil_power = 25
	}

	option = { # Resist every way we can!
		name = FEE_Persia_Events.5.OPT2

		add_adm_power = -25
		add_dip_power = -25
		add_mil_power = -25
		hidden_effect = {
			set_ruler_flag = fee_per_resisted_qizilbash
		}
	}

	option = { # Those who oppose us will be driven out!
		name = FEE_Persia_Events.5.OPT3

		hidden_effect = {
			set_ruler_flag = fee_per_resisted_qizilbash
		}
		random_owned_province = {
			spawn_rebels = {
				type = noble_rebels
				size = 2
			}
		}
	}
}

# The Third Force
country_event = {
	id = FEE_Persia_Events.6
	title = FEE_Persia_Events.6.T
	desc = FEE_Persia_Events.6.D
	picture = FARMING_eventPicture

	fire_only_once = yes

	trigger = {
		tag = PER
		NOT = { has_country_flag = fee_per_end_qizilbash_influence }
		has_country_modifier = fee_per_the_qizilbash
		is_year = 1580
		mil = 3
		dip = 3
		adm = 3
		caucasia_region = {
			owned_by = ROOT
		}
	}

	mean_time_to_happen = {
		months = 120
	}

	option = { # We need them to reform our society!
		name = FEE_Persia_Events.6.OPT1

		add_manpower = 15
		random_owned_province = {
			limit = {
				NOT = { base_tax = 4 }
			}
			change_culture = armenian
			add_base_tax = 1
		}
		set_country_flag = fee_per_the_third_force
	}

	option = { # The Qizibash are no threat to the Shah.
		name = FEE_Persia_Events.6.OPT2

		add_stability_or_adm_power = yes
	}
}

# End of Tribal Independence
country_event = {
	id = FEE_Persia_Events.7
	title = FEE_Persia_Events.7.T
	desc = FEE_Persia_Events.7.D
	picture = GOOD_WITH_MONARCH_eventPicture

	trigger = {
		tag = PER
		NOT = { has_country_flag = fee_per_end_qizilbash_influence }
		has_country_modifier = fee_per_the_qizilbash
		has_country_flag = fee_per_the_third_force
	}

	mean_time_to_happen = {
		months = 180
	}

	option = { # No one will ever hold Persia hostage again!
		name = FEE_Persia_Events.7.OPT1

		hidden_effect = {
			set_country_flag = fee_per_end_qizilbash_influence
		}
		add_prestige_or_monarch_power = { amount = 20 }
		add_stability_or_adm_power = yes
		capital_scope = {
			add_base_tax = 1
		}
		hidden_effect = {
			remove_country_modifier = fee_per_the_qizilbash
		}
	}
}

#Decline of the Qizilbash
country_event = {
	id = FEE_Persia_Events.8
	title = FEE_Persia_Events.8.T
	desc = FEE_Persia_Events.8.D
	picture = REFORM_eventPicture

	trigger = {
		tag = PER
		is_year = 1610
		has_country_flag = fee_per_the_third_force
	}

	mean_time_to_happen = {
		months = 240
	}

	option = { # IT is time Persia looked to the future.
		name = FEE_Persia_Events.8.OPT1

		hidden_effect = {
			set_country_flag = fee_per_end_qizilbash_influence
		}
		remove_country_modifier = fee_per_the_qizilbash
		add_stability_or_adm_power = yes
	}
}