########################
#### IRANIAN EVENTS ####
########################

add_namespace = PER_industrial_events
add_namespace = PER_imperial_events
add_namespace = PER_revolution_events
add_namespace = PER_communist_events
add_namespace = PER_fascist_events
add_namespace = PER_foreign_policy_events
add_namespace = PER_ssb_events

###########################
#### INDUSTRIAL EVENTS ####
###########################

country_event = { #Iran sells oil 
	id = PER_industrial_events.1
	title = PER_industrial_events.1.t
	desc = PER_industrial_events.1.desc
	picture = GFX_report_event_generic_stock_traders

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Accept
		name = PER_industrial_events.1.a
		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				has_government = FROM
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 24
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > 49
				}
			}
			modifier = {
				factor = 2
				FROM = {
					is_major = yes
				}
			}
		}
		effect_tooltip = {
			ROOT = { give_guarantee = FROM }
			FROM = {
				give_resource_rights = {
					receiver = ROOT
					state = 413
				}
				add_offsite_building = { type = industrial_complex  level = 3 }
			}
		}
		custom_effect_tooltip = PER_resource_rights_on_war_tt
		
		hidden_effect = {
			FROM = { 
				country_event = { id = PER_industrial_events.2 hours = 2 }
			}
		}
	}
	option = { #Refuse
		name = PER_industrial_events.1.b
		ai_chance = {
			base = 2
			modifier = {
				factor = 5
				has_opinion = {
					target = FROM
					value < 0
				}
			}
			modifier = {
				factor = 5
				strength_ratio = {
				    tag = FROM
				    ratio > 1.5
				}
			}
		}
		set_country_flag = PER_refused_oil_flag
		FROM = { 
			country_event = { id = PER_industrial_events.3 hours = 2 }
		}
	}
}

country_event = { #Iran gives away resource rights
	id = PER_industrial_events.2
	title = PER_industrial_events.2.t
	desc = PER_industrial_events.2.desc
	picture = GFX_report_event_generic_sign_treaty2

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Great
		name = PER_industrial_events.2.a
		FROM = { 
			give_guarantee = ROOT 
			set_country_flag = PER_has_PER_resource_rights
		}
		ROOT = {
			give_resource_rights = {
				receiver = FROM
				state = 413
			}
		}
		add_offsite_building = { type = industrial_complex  level = 3 }
		set_country_flag = PER_sold_oil_flag
		custom_effect_tooltip = PER_resource_rights_on_war_tt
	}
}
country_event = { #FROM doesn't want our oil
	id = PER_industrial_events.3
	title = PER_industrial_events.3.t
	desc = PER_industrial_events.3.desc
	picture = GFX_report_event_journalists_speech

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #bad
		name = PER_industrial_events.3.a
		clr_country_flag = PER_offers_oil_flag
	}
}

#########################
#### IMPERIAL EVENTS ####
#########################

country_event = { #Iran asks Soviets for non-aggression pact
	id = PER_imperial_events.1
	title = PER_imperial_events.1.t
	desc = PER_imperial_events.1.desc
	picture = GFX_report_event_generic_sign_treaty1 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #yes
		name = PER_imperial_events.1.a
		ai_chance = {
			base = 10
			modifier = {
				factor = 90
				has_opinion = {
					target = FROM
					value > 29
				}
			}
		}
			diplomatic_relation = { 
				country = FROM #target country
				relation = non_aggression_pact 
				active = yes #yes to add relation, no to cancel existing one
			}
		FROM = {
			country_event = { id = PER_imperial_events.2 hours = 1 }
		}
	}

	option = { #no
		name = PER_imperial_events.1.b
		FROM = {
			country_event = { id = PER_imperial_events.3 hours = 1 }
		}
	}
}

country_event = { #Soviets say yes
	id = PER_imperial_events.2
	title = PER_imperial_events.2.t
	desc = PER_imperial_events.2.desc
	picture = GFX_report_event_generic_handshake 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #yippee!!
		name = PER_imperial_events.2.a
	}
}

country_event = { #Soviets say no
	id = PER_imperial_events.3
	title = PER_imperial_events.3.t
	desc = PER_imperial_events.3.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Nejjjjj
		name = PER_imperial_events.3.a
	}
}

country_event = { #Iran demands Baluchistan from the Raj
	id = PER_imperial_events.10
	title = PER_imperial_events.10.t
	desc = PER_imperial_events.10.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #We have no choice
		name = PER_imperial_events.10.a
		ai_chance = {
			base = 10
			modifier = {
				factor = 90
				strength_ratio = { 
					tag = PER ratio > 1.5 }
			}
		}
		effect_tooltip = {
			PER = {
				transfer_state = 988
				transfer_state = 444
				transfer_state = 1012
			}
		}

		FROM = {
			country_event = { id = PER_imperial_events.11 hours = 1 }
		}

		hidden_effect = {
			PER = {
				transfer_state = 988
				988 = { set_state_flag = RAJ_resistance_already_squashed_flag }
				transfer_state = 444
				444 = { set_state_flag = RAJ_resistance_already_squashed_flag}
				transfer_state = 1012
				1012 = { set_state_flag = RAJ_resistance_already_squashed_flag}
			}
		}
	}

	option = { #For a price
		name = PER_imperial_events.10.b
		ai_chance = {
			base = 30
			modifier = {
				factor = 70
				has_opinion = {
					target = FROM
					value > 39
				}
			}
		}
		FROM = {
			country_event = { id = PER_imperial_events.12 hours = 1 }
		}
	}

	option = { #They can go to hell
		name = PER_imperial_events.10.c
		ai_chance = {
			base = 30
		}
		PER = {
			country_event = { id = PER_imperial_events.16 hours = 1 }
		}
	}
}

country_event = { #Raj gives us Baluchistan
	id = PER_imperial_events.11
	title = PER_imperial_events.11.t
	desc = PER_imperial_events.11.desc
	picture = GFX_report_event_generic_handshake 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Excellent
		name = PER_imperial_events.11.a
	}
}

country_event = { #Raj counter offer
	id = PER_imperial_events.12
	title = PER_imperial_events.12.t
	desc = PER_imperial_events.12.desc
	picture = GFX_report_event_generic_sign_treaty2 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #We agree
		name = PER_imperial_events.12.a
		ai_chance = {
			base = 80
		}
		effect_tooltip = {
			PER = {
				transfer_state = 988
				transfer_state = 444
				add_timed_idea = {
					idea = PER_paying_for_baluchistan_idea
					days = 365
				}
			}
			RAJ = {
				add_timed_idea = {
					idea = PER_sold_baluchistan_idea
					days = 365
				}
			}
		}

		FROM = {
			country_event = { id = PER_imperial_events.13 hours = 1 }
		}

		hidden_effect = {
			PER = {
				transfer_state = 988
				988 = { set_state_flag = RAJ_resistance_already_squashed_flag}
				transfer_state = 444
				444 = { set_state_flag = RAJ_resistance_already_squashed_flag}
				add_timed_idea = {
					idea = PER_paying_for_baluchistan_idea
					days = 365
				}
			}
			RAJ = {
				add_timed_idea = {
					idea = PER_sold_baluchistan_idea
					days = 365
				}
			}
		}
	}

	option = { #We will take it by force then
		name = PER_imperial_events.12.b
		ai_chance = {
			base = 20
		}
			effect_tooltip = {
				PER = {
				create_wargoal = {
					target = RAJ
					type = annex_everything
				}
			}
		}
		FROM = {
			country_event = { id = PER_imperial_events.14 hours = 1 }
		}
	}

	option = { #Not Worth the Risk
		name = PER_imperial_events.12.c
		ai_chance = {
			base = 5
			modifier = {
				factor = 95
				strength_ratio = { 
					tag = RAJ ratio > 1.5 }
			}
		}
		FROM = {
			country_event = { id = PER_imperial_events.15 hours = 1 }
		}
	}
}

country_event = { #Iran agrees to pay for Baluchistan
	id = PER_imperial_events.13
	title = PER_imperial_events.13.t
	desc = PER_imperial_events.13.desc
	picture = GFX_report_event_generic_handshake 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Excellent
		name = PER_imperial_events.13.a
	}
}

country_event = { #Iran declares War
	id = PER_imperial_events.14
	title = PER_imperial_events.14.t
	desc = PER_imperial_events.14.desc
	picture = GFX_report_event_001 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Ruh Roh Raggy
		name = PER_imperial_events.14.a

		PER = {
			create_wargoal = {
				target = RAJ
				type = annex_everything
			}
		}
	}
}

country_event = { #Iran backs down
	id = PER_imperial_events.15
	title = PER_imperial_events.15.t
	desc = PER_imperial_events.15.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Thank goodness
		name = PER_imperial_events.15.a
	}
}

country_event = { #India refuses
	id = PER_imperial_events.16
	title = PER_imperial_events.16.t
	desc = PER_imperial_events.16.desc
	picture = GFX_report_event_001 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #TO WAR
		name = PER_imperial_events.16.a

		PER = {
			create_wargoal = {
				target = RAJ
				type = annex_everything
			}
		}
	}
}

country_event = { #Reza Shah Pahlavi is Assassinated
	id = PER_imperial_events.20
	title = PER_imperial_events.20.t
	desc = PER_imperial_events.20.desc
	picture = GFX_report_event_generic_funeral 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #RIP
		name = PER_imperial_events.20.a

	}
}

country_event = { #Persepolis Party
	id = PER_imperial_events.30
	title = PER_imperial_events.30.t
	desc = PER_imperial_events.30.desc
	picture = GFX_report_event_PER_persepolis_party 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Celebration good
		name = PER_imperial_events.30.a

	}
}

country_event = { #Dating Simulator
	id = PER_imperial_events.40
	title = PER_imperial_events.40.t
	desc = PER_imperial_events.40.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Girliepop number 1
		name = PER_imperial_events.40.a
		ai_chance = {
			base = 90
		}
		custom_effect_tooltip = available_political_advisor
		show_ideas_tooltip = PER_fawzia_faud
		set_country_flag = PER_fawzia_married
	}

	option = { #Girliepop number 2
		name = PER_imperial_events.40.b
		ai_chance = {
			base = 5
		}
		custom_effect_tooltip = available_political_advisor
		show_ideas_tooltip = PER_teymourtash
		set_country_flag = PER_teymourtash_married
	}

	option = { #Girliepop number 3
		name = PER_imperial_events.40.c
		ai_chance = {
			base = 5
		}
		custom_effect_tooltip = available_political_advisor
		show_ideas_tooltip = PER_irandokht
		set_country_flag = PER_irandokht_married
	}
}

country_event = { #Reza Shah Pahlavi survives!!
	id = PER_imperial_events.50
	title = PER_imperial_events.50.t
	desc = PER_imperial_events.50.desc
	picture = GFX_report_event_PER_reza_shah_pahlavi 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Yippee!
		name = PER_imperial_events.50.a

	}
}

country_event = { #Iran asks Germany for non-aggression pact
	id = PER_imperial_events.60
	title = PER_imperial_events.60.t
	desc = PER_imperial_events.60.desc
	picture = GFX_report_event_generic_sign_treaty1 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #yes
		name = PER_imperial_events.60.a
		ai_chance = {
			base = 10
			modifier = {
				factor = 90
				has_opinion = {
					target = FROM
					value > 29
				}
			}
		}
			diplomatic_relation = { 
				country = FROM #target country
				relation = non_aggression_pact 
				active = yes #yes to add relation, no to cancel existing one
			}
		FROM = {
			country_event = { id = PER_imperial_events.61 hours = 1 }
		}
	}

	option = { #no
		name = PER_imperial_events.60.b
		FROM = {
			country_event = { id = PER_imperial_events.62 hours = 1 }
		}
	}
}

country_event = { #Germany say yes
	id = PER_imperial_events.61
	title = PER_imperial_events.61.t
	desc = PER_imperial_events.61.desc
	picture = GFX_report_event_generic_handshake 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #yippee!!
		name = PER_imperial_events.61.a
	}
}

country_event = { #Germany say no
	id = PER_imperial_events.62
	title = PER_imperial_events.62.t
	desc = PER_imperial_events.62.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Nejjjjj
		name = PER_imperial_events.62.a
	}
}

country_event = { #Royal Visit to Germany
	id = PER_imperial_events.70
	title = PER_imperial_events.70.t
	desc = PER_imperial_events.70.desc
	picture = GFX_report_event_PER_shah_inspection 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Jaaaaaa
		name = PER_imperial_events.70.a
		hidden_effect = {
			PER = {
			country_event = {
				id = PER_imperial_events.71
				hours = 1
			}
		}
	}
		GER = {
				add_opinion_modifier = {
				target = PER
				modifier = large_increase
				}
				add_political_power = 75
			}
		}

	option = { #Nejjjjj
		name = PER_imperial_events.70.b
		PER = {
			country_event = {
				id = PER_imperial_events.72
				hours = 1
			}
		}
	}
}

country_event = { #Germany lets us in
	id = PER_imperial_events.71
	title = PER_imperial_events.71.t
	desc = PER_imperial_events.71.desc
	picture = GFX_report_event_PER_shah_inspection 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #yippee!
		name = PER_imperial_events.71.a
		PER = {
				add_opinion_modifier = {
				target = GER
				modifier = large_increase
				}
				add_political_power = 75
			}
		}
	}

country_event = { #Germany say no
	id = PER_imperial_events.72
	title = PER_imperial_events.72.t
	desc = PER_imperial_events.72.desc
	picture = GFX_report_event_generic_sign_treaty2 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #sadge
		name = PER_imperial_events.72.a
	}
}

country_event = { #Peace SOV preemptive
	id = PER_imperial_events.110
	title = PER_imperial_events.110.t
	desc = PER_imperial_events.110.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #yes
		name = PER_imperial_events.110.a
		ai_chance = {
			base = 95
		}
			SOU = {
			white_peace = {
				tag = PER
				}
			}
			PER = {
					transfer_state = 584
					transfer_state = 229
					transfer_state = 230
					transfer_state = 231
					
					country_event = {
						id = PER_imperial_events.111
						hours = 1
					}
				}
			}

	option = { #naur
		name = PER_imperial_events.110.b
		ai_chance = {
			base = 5
		}
		country_event = {
				id = PER_imperial_events.112
				hours = 1
			}
		}
	}

country_event = { #release the border states
	id = PER_imperial_events.111
	title = PER_imperial_events.111.t
	desc = PER_imperial_events.111.desc
	picture = GFX_report_event_generic_sign_treaty3 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #yippee
		name = PER_imperial_events.111.a

		# Georgia
			IF = {
				limit = { 231 = { is_owned_and_controlled_by = PER }}
				release_autonomy = {
					target = GEO
					autonomy_state = autonomy_puppet
					freedom_level = 0.5
				}
			}
			# Armenia
			IF = {
				limit = { 230 = { is_owned_and_controlled_by = PER }}
				release_autonomy = {
					target = ARM
					autonomy_state = autonomy_puppet
					freedom_level = 0.5
				}
			}

			# Azerbaijan
			IF = {
				limit = { 229 = { is_owned_and_controlled_by = PER }}
				release_autonomy = {
					target = AZR
					autonomy_state = autonomy_puppet
					freedom_level = 0.5
				}
			}

			# Turkmenistan
			IF = {
				limit = { 584 = { is_owned_and_controlled_by = PER }}
				release_autonomy = {
					target = TMS
					autonomy_state = autonomy_puppet
					freedom_level = 0.5
				}
			}
		}
	}

country_event = { #the fight continues
	id = PER_imperial_events.112
	title = PER_imperial_events.112.t
	desc = PER_imperial_events.112.desc
	picture = GFX_report_event_generic_battle 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #sadge
		name = PER_imperial_events.112.a
	}
}

country_event = { #Negotiating Capitulations ENG
	id = PER_imperial_events.120
	title = PER_imperial_events.120.t
	desc = PER_imperial_events.120.desc
	picture = GFX_report_event_generic_sign_treaty2 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #yes
		name = PER_imperial_events.120.a
		ai_chance = {
			base = 95
		}

		effect_tooltip = {
			ROOT = { puppet = PER }
			PER = {
				set_rule = { can_join_factions = no }
				set_rule = { can_decline_call_to_war = yes }
				mark_focus_tree_layout_dirty = yes
			}

			every_state = {
				limit = {
					is_controlled_by = ROOT 
					is_core_of = PER 
				}
				transfer_state_to = PER
			}
		}

		PER = {
			country_event = {
				id = PER_imperial_events.121
				hours = 1
			}
		}
	}

	option = { #naur
		name = PER_imperial_events.120.b
		ai_chance = {
			base = 5
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		PER = {
			country_event = {
				id = PER_imperial_events.122
				hours = 1
			}
		}
	}
}

country_event = { #Negotiating Capitulations ENG
	id = PER_imperial_events.121
	title = PER_imperial_events.121.t
	desc = PER_imperial_events.121.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	immediate = { #Iran keeps it government form, so save party popularities
		set_variable = { PER_democratic_popularity = PER.party_popularity_100@democratic }
		clamp_variable = {
			var = PER_democratic_popularity
			min = 0
			max = 100
		}
		set_variable = { PER_communism_popularity = PER.party_popularity_100@communism }
		clamp_variable = {
			var = PER_communism_popularity
			min = 0
			max = 100
		}
		set_variable = { PER_neutrality_popularity = PER.party_popularity_100@neutrality }
		clamp_variable = {
			var = PER_neutrality_popularity
			min = 0
			max = 100
		}
		set_variable = { PER_fascism_popularity = PER.party_popularity_100@fascism }
		clamp_variable = {
			var = PER_fascism_popularity
			min = 0
			max = 100
		}
	}

	option = { #Puppet time
		name = PER_imperial_events.121.a
		ai_chance = {
			base = 95
		}

		FROM = { puppet = PER }
			PER = {
				set_rule = { can_join_factions = no }
				set_rule = { can_decline_call_to_war = yes }
			}

			every_state = {
				limit = {
					is_controlled_by = FROM 
					is_core_of = PER 
				}
				transfer_state_to = PER
			}
		hidden_effect = {
			PER = {
			set_popularities = { #Iran keeps it government form
				democratic = PER_democratic_popularity
				fascism = PER_fascism_popularity
				communism = PER_communism_popularity
				neutrality = PER_neutrality_popularity
			}
				set_politics = { ruling_party = neutrality }
			}
		}
		mark_focus_tree_layout_dirty = yes
	}
}

country_event = { #the fight continues
	id = PER_imperial_events.122
	title = PER_imperial_events.122.t
	desc = PER_imperial_events.122.desc
	picture = GFX_report_event_generic_battle 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #sadge
		name = PER_imperial_events.122.a
	}
}

country_event = { #Negotiating Capitulations SOV
	id = PER_imperial_events.130
	title = PER_imperial_events.130.t
	desc = PER_imperial_events.130.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #yes
		name = PER_imperial_events.130.a
		ai_chance = {
			base = 95
		}

		effect_tooltip = {
			SOU = {
			IF = {
				limit = {
					has_wargoal_against = PER
				}
				remove_wargoal = {
				    type = all
				    target = PER
				}
			}
			white_peace = {
				tag = PER
				}

			PER = {
				every_owned_state = {
					limit = {
						OR = {
							state = 420 #Gilan
							state = 1000 #East Azerbaijan
							state = 419 #West Azerbaijan
							state = 1001 #kurdistan
							state = 1004 #North Khorasan
							state = 416 #Khorasan
							is_controlled_by = SOU
						}
					}
					display_individual_scopes = yes
					SOU = {
						transfer_state = PREV
					}
				}
			}		
		}
	}

		PER = {
			country_event = {
				id = PER_imperial_events.131
				hours = 1
			}
		}
	}

	option = { #naur
		name = PER_imperial_events.130.b
		ai_chance = {
			base = 5
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
				PER = {
					country_event = {
					id = PER_imperial_events.132
					hours = 1
				}
			}
		}
	}

country_event = { #Negotiating Capitulations SOV
	id = PER_imperial_events.131
	title = PER_imperial_events.131.t
	desc = PER_imperial_events.131.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #cede territory time
		name = PER_imperial_events.131.a
		ai_chance = {
			base = 95
		}
		SOU = {
				IF = {
					limit = {
						has_wargoal_against = PER
					}
					remove_wargoal = {
					    type = all
					    target = PER
					}
				}
			white_peace = {
				tag = PER
				}
			PER = {
				every_owned_state = {
					limit = {
						OR = {
							state = 420 #Gilan
							state = 1000 #East Azerbaijan
							state = 419 #West Azerbaijan
							state = 1001 #kurdistan
							state = 1004 #North Khorasan
							state = 416 #Khorasan
							is_controlled_by = SOU
						}
					}
					display_individual_scopes = yes
					SOU = {
						transfer_state = PREV
					}
				}
			}	
		}
	}
}

country_event = { #the fight continues
	id = PER_imperial_events.132
	title = PER_imperial_events.132.t
	desc = PER_imperial_events.132.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #sadge
		name = PER_imperial_events.132.a
	}
}

country_event = { #REBELLION
	id = PER_imperial_events.140
	title = PER_imperial_events.140.t
	desc = PER_imperial_events.140.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # Hell No
		name = PER_imperial_events.140.a
		ai_chance = {
			base = 90
		}
		PER = {
			country_event = {
				id = PER_imperial_events.141
				hours = 4 
				random_hours = 8 
			}
		}
	}

	# OK
	option = {
		name = BBA_ethiopia_fascist_events.20.b
		ai_chance = {
			base = 5
		}
		PER = {
			country_event = {
				id = PER_imperial_events.142
				hours = 4 
				random_hours = 8 
			}
		}
	}
}

country_event = { #REBELLION
	id = PER_imperial_events.142
	title = PER_imperial_events.142.t
	desc = PER_imperial_events.142.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Declaring Independence
		name = PER_imperial_events.142.a
		ai_chance = {
			base = 90
		}	
		FROM = {
			set_autonomy = {
				target = ROOT 
				autonomy_state = autonomy_free
				end_wars = yes
				end_civil_wars = no
			}
		}
		# Leave Faction 
		IF = {
			limit = {
				FROM = { is_in_faction_with = ROOT }
			}
			ROOT = { leave_faction = yes }
		}
		every_other_country = {
			limit = {
				has_war_with = FROM
				has_war_with = ROOT
			}
			white_peace = ROOT
		}
	}
}

country_event = { #REBELLION
	id = PER_imperial_events.141
	title = PER_imperial_events.141.t
	desc = PER_imperial_events.141.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { #Fighting For Independence
		name = PER_imperial_events.141.a
		ai_chance = {
			base = 90
		}	

		hidden_effect = {
				FROM = {
					set_autonomy = {
						target = ROOT  
						autonomy_state = autonomy_free
						end_wars = yes 
						end_civil_wars = no
					}
				}
				every_owned_state = {
					teleport_armies = {
						limit = {
							NOT = { tag = ROOT}
							OR = {
								tag = FROM
								is_in_faction_with = FROM
							}
						}
						to_state_array = owned_controlled_states
					}
				}
				
			}
			# Leave Faction 
			IF = {
				limit = {
					FROM = { is_in_faction_with = ROOT }
				}
				ROOT = { leave_faction = yes }
			}
			ROOT = {
				declare_war_on = {
				target = FROM 
				type = independence_wargoal
			}
			# Make peace with enemies of Overlord 
			every_other_country = {
				limit = {
					has_war_with = FROM
					has_war_with = ROOT
				}
				white_peace = ROOT
			}
		}

	}
}

country_event = { #White Peace Defensive
	id = PER_imperial_events.150
	title = PER_imperial_events.150.t
	desc = PER_imperial_events.150.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # Yes we peace
		name = PER_imperial_events.150.a
		ai_chance = {
			base = 90
		}
		PER = {
			country_event = {
				id = PER_imperial_events.151
				hours = 1 
				random_hours = 3 
			}
		}
		IF = {
			limit = {
				ROOT = {
					is_faction_leader = yes
				}
			}
			every_enemy_country = {
				limit = {
					is_ally_with = ROOT
				}
				country_event = {
					id = PER_imperial_events.153
					hours = 4 
					random_hours = 8 
				}
			}
		}
		custom_effect_tooltip = if_they_accept_tt
		effect_tooltip = {
			ROOT = {
			white_peace = {
				tag = PER
				}
			}
		}
	}

	option = { # No we fight
		name = PER_imperial_events.150.b
		ai_chance = {
			base = 10
		}
		PER = {
			country_event = {
				id = PER_imperial_events.152
				hours = 4 
				random_hours = 8 
			}
		}
	}
}

country_event = { #White Peace activated
	id = PER_imperial_events.151
	title = PER_imperial_events.151.t
	desc = PER_imperial_events.151.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # Yes we peace
		name = PER_imperial_events.151.a
		ai_chance = {
			base = 90
		}
		FROM = {
			white_peace = {
				tag = PER
				}
			}
		}
	}

country_event = { #White Peace denied
	id = PER_imperial_events.152
	title = PER_imperial_events.152.t
	desc = PER_imperial_events.152.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # nooooooo
		name = PER_imperial_events.152.a
		ai_chance = {
			base = 90
		}
	}
}

country_event = { #White Peace for faction allies
	id = PER_imperial_events.153
	title = PER_imperial_events.153.t
	desc = PER_imperial_events.153.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # I guess we have no choice
		name = PER_imperial_events.153.a
		ai_chance = {
			base = 90
		}
		ROOT = {
			white_peace = {
				tag = PER
				}
			}
		}
	}

country_event = { #reparations but for neighbors
	id = PER_imperial_events.160
	title = PER_imperial_events.160.t
	desc = PER_imperial_events.160.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # Yes we peace
		name = PER_imperial_events.160.a
		ai_chance = {
			base = 50
			modifier = {
				factor = 100
				ROOT = {
					any_war_score < 49
				}
			}
		}
		PER = {
			country_event = {
				id = PER_imperial_events.161
				hours = 4 
				random_hours = 8 
			}
		}
		IF = {
			limit = {
				ROOT = {
					is_faction_leader = yes
				}
			}
			every_enemy_country = {
				limit = {
					is_ally_with = ROOT
				}
				country_event = {
					id = PER_imperial_events.153
					hours = 4 
					random_hours = 8 
				}
			}
		}
		custom_effect_tooltip = if_they_accept_tt
		effect_tooltip = {
			ROOT = {
			white_peace = {
				tag = PER
			}
			IF = {
				limit = {
					tag = AFG
				}
				PER = {
					transfer_state = 415
					transfer_state = 1009
				}
			}

			ELSE_IF = {
				limit = {
					tag = IRQ
				}
				PER = {
					transfer_state = 1276
					transfer_state = 1279
					transfer_state = 1280
					transfer_state = 1281
					transfer_state = 1282
				}
			}

			ELSE_IF = {
				limit = {
					tag = TUR
				}
				PER = {
					transfer_state = 800
					transfer_state = 352
					transfer_state = 350
					transfer_state = 344
				}
			}

			ELSE_IF = {
				limit = {
					tag = RAJ
				}
				PER = {
					transfer_state = 988
					transfer_state = 444
				}
			}

			ELSE_IF = {
				limit = {
					tag = SOU
				}
				PER = {
					transfer_state = 584
					transfer_state = 229
					transfer_state = 230
					transfer_state = 231
				}
			}

			ELSE_IF = {
				limit = {
					tag = ENG
				}
				PER = {
					transfer_state = 765
					transfer_state = 658
					transfer_state = 656
				}
			}
		}
	}
}

	option = { # No we fight
		name = PER_imperial_events.160.b
		ai_chance = {
			base = 50
		}
		PER = {
			country_event = {
				id = PER_imperial_events.162
				hours = 4 
				random_hours = 8 
			}
		}
	}
}

country_event = { #Reparations activated
	id = PER_imperial_events.161
	title = PER_imperial_events.161.t
	desc = PER_imperial_events.161.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # Yes we peace
		name = PER_imperial_events.161.a
		ai_chance = {
			base = 100
		}
		FROM = {
			white_peace = {
				tag = PER
			}
			IF = {
				limit = {
					tag = AFG
				}
				PER = {
					transfer_state = 415
					transfer_state = 1009
				}
			}

			ELSE_IF = {
				limit = {
					tag = IRQ
				}
				PER = {
					transfer_state = 1276
					transfer_state = 1279
					transfer_state = 1280
					transfer_state = 1281
					transfer_state = 1282
				}
			}

			ELSE_IF = {
				limit = {
					tag = TUR
				}
				PER = {
					transfer_state = 800
					transfer_state = 352
					transfer_state = 350
					transfer_state = 344
				}
			}

			ELSE_IF = {
				limit = {
					tag = RAJ
				}
				PER = {
					transfer_state = 988
					transfer_state = 444
				}
			}

			ELSE_IF = {
				limit = {
					tag = SOU
				}
				PER = {
					transfer_state = 584
					transfer_state = 229
					transfer_state = 230
					transfer_state = 231
				}
			}

			ELSE_IF = {
				limit = {
					tag = ENG
				}
				PER = {
					transfer_state = 765
					transfer_state = 658
					transfer_state = 656
				}
			}
			PER = {
				add_offsite_building = {
	  				type = industrial_complex
	   				level = 2
	  			}
			}
		}
	}
}

country_event = { #Reparations Denied
	id = PER_imperial_events.162
	title = PER_imperial_events.162.t
	desc = PER_imperial_events.162.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # nooooooo
		name = PER_imperial_events.162.a
		ai_chance = {
			base = 90
		}
	}
}

country_event = { #reparations but for far away
	id = PER_imperial_events.170
	title = PER_imperial_events.170.t
	desc = PER_imperial_events.170.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # Yes we peace
		name = PER_imperial_events.170.a
		ai_chance = {
			base = 50
			modifier = {
				factor = 100
				ROOT = {
					any_war_score < 49
				}
			}
		}
		PER = {
			country_event = {
				id = PER_imperial_events.171
				hours = 4 
				random_hours = 8 
			}
		}
		IF = {
			limit = {
				ROOT = {
					is_faction_leader = yes
				}
			}
			every_enemy_country = {
				limit = {
					is_ally_with = ROOT
				}
				country_event = {
					id = PER_imperial_events.153
					hours = 4 
					random_hours = 8 
				}
			}
		}
		custom_effect_tooltip = if_they_accept_tt
		ROOT = {
			add_timed_idea = {
				idea = PER_enemy_war_reparations_idea
				days = 730
			}
			add_offsite_building = {
  				type = industrial_complex
   				level = 2
  			}
		}
	}

	option = { # No we fight
		name = PER_imperial_events.170.b
		ai_chance = {
			base = 50
		}
		PER = {
			country_event = {
				id = PER_imperial_events.172
				hours = 4 
				random_hours = 8 
			}
		}
	}
}

country_event = { #Reparations activated
	id = PER_imperial_events.171
	title = PER_imperial_events.171.t
	desc = PER_imperial_events.171.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # Yes we peace
		name = PER_imperial_events.171.a
		ai_chance = {
			base = 100
		}
		FROM = {
			add_timed_idea = {
				idea = PER_enemy_war_reparations_idea
				days = 730
			}
			white_peace = {
				tag = PER
			}
		}
	}
}

country_event = { #Reparations Denied
	id = PER_imperial_events.172
	title = PER_imperial_events.172.t
	desc = PER_imperial_events.172.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # nooooooo
		name = PER_imperial_events.172.a
		ai_chance = {
			base = 90
		}
	}
}

country_event = { #swearing fealty (generic)
	id = PER_imperial_events.180
	title = PER_imperial_events.180.t
	desc = PER_imperial_events.180.desc
	picture = GFX_report_event_generic_read_write 

	fire_only_once = yes

	is_triggered_only = yes

	option = { # Yes we peace
		name = PER_imperial_events.180.a
		ai_chance = {
			base = 90
		}
		PER = {
			country_event = {
				id = PER_imperial_events.181
				hours = 4 
				random_hours = 8 
			}
		}
		custom_effect_tooltip = if_they_accept_tt
		effect_tooltip = {
			ROOT = { puppet = FROM }
			FROM = {
				set_rule = { can_join_factions = no }
				set_rule = { can_decline_call_to_war = yes }
			}

			every_state = {
				limit = {
					is_controlled_by = ROOT 
					is_core_of = FROM 
				}
				transfer_state_to = FROM
			}
		}
	}

	option = { # No we fight
		name = PER_imperial_events.180.b
		ai_chance = {
			base = 10
		}
		PER = {
			country_event = {
				id = PER_imperial_events.182
				hours = 4 
				random_hours = 8 
			}
		}
	}
}

country_event = { #Fealty Accepted
	id = PER_imperial_events.181
	title = PER_imperial_events.181.t
	desc = PER_imperial_events.181.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # Yes we peace
		name = PER_imperial_events.181.a

		ai_chance = {
			base = 100
		}

		FROM = { puppet = ROOT }
		ROOT = {
			set_rule = { can_join_factions = no }
			set_rule = { can_decline_call_to_war = yes }
			mark_focus_tree_layout_dirty = yes
		}
		every_state = {
			limit = {
				is_controlled_by = FROM 
				is_core_of = ROOT 
			}
			transfer_state_to = ROOT
		}
		IF = {
			limit = {
				has_dynamic_modifier = {
					modifier = PER_opposition_modifier
				}
			}
			remove_dynamic_modifier = {
				modifier = PER_opposition_modifier
			}
		}

		IF = {
			limit = {
				FROM = {
					has_government = democratic
				}
			}
			ROOT = {
				complete_national_focus = PER_free_elections
			}
		}
		IF = {
			limit = {
				FROM = {
					has_government = fascism
				}
			}
			ROOT = {
				complete_national_focus = PER_roll_back_reforms
			}
		}
		IF = {
			limit = {
				FROM = {
					has_government = communism
					original_tag = SOU
				}
			}
			ROOT = {
				complete_national_focus = PER_strengthen_the_tudeh
				complete_national_focus = PER_soviet_alignment
			}
			ELSE = {
				limit = {
					FROM = {
						has_government = communism
						NOT = {
							original_tag = SOU
						}
					}
				}
				ROOT = {
					complete_national_focus = PER_elevate_the_iran_party
					complete_national_focus = PER_iranian_socialism
				}
			}
		}
	}
}

country_event = { #Fealty Rejected
	id = PER_imperial_events.182
	title = PER_imperial_events.182.t
	desc = PER_imperial_events.182.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # nooooooo
		name = PER_imperial_events.182.a
		ai_chance = {
			base = 90
		}
		add_political_power = -50
		add_war_support = 0.1
	}
}

country_event = { #Pushing Negotiations
	id = PER_imperial_events.190
	title = PER_imperial_events.190.t
	desc = PER_imperial_events.190.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # Yes we peace
		name = PER_imperial_events.190.a
		ai_chance = {
			base = 90
		}
		PER = {
			country_event = {
				id = PER_imperial_events.191
				hours = 4 
				random_hours = 8 
			}
		}
		IF = {
			limit = {
				ROOT = {
					is_faction_leader = yes
				}
			}
			every_enemy_country = {
				limit = {
					is_ally_with = ROOT
				}
				country_event = {
					id = PER_imperial_events.153
					hours = 4 
					random_hours = 8 
				}
			}
		}
		custom_effect_tooltip = if_they_accept_tt
		effect_tooltip = {
			IF = {
				limit = {
					has_country_flag = PER_invading_country_flag
				}
				FROM = {
					give_resource_rights = {
						receiver = ROOT
						state = 413
					}
					give_resource_rights = {
						receiver = ROOT
						state = 412
					}
					white_peace = {
						tag = ROOT
					}
				}
			}
			ELSE = {
				add_political_power = 100
				add_war_support = 0.05
			}
		}
	}

	option = { # No we fight
		name = PER_imperial_events.190.b
		ai_chance = {
			base = 10
		}
		PER = {
			country_event = {
				id = PER_imperial_events.192
				hours = 4 
				random_hours = 8 
			}
		}
	}
}

country_event = { #Pushing Negotiations Accepted
	id = PER_imperial_events.191
	title = PER_imperial_events.191.t
	desc = PER_imperial_events.191.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # accepted
		name = PER_imperial_events.191.a
		ai_chance = {
			base = 90
		}

		IF = {
			limit = {
				FROM = { has_country_flag = PER_invading_country_flag }
			}
			ROOT = {
				give_resource_rights = {
					receiver = FROM
					state = 413
				}
				give_resource_rights = {
					receiver = FROM
					state = 412
				}
				white_peace = {
					tag = FROM
				}
			}
		}
		ELSE = {
			add_political_power = 100
			add_war_support = 0.05
		}

		every_country = {
			limit = {
				has_war_with = ROOT
				OR = {
					is_subject_of = FROM
					has_subject = FROM
					is_in_faction_with = FROM
				}
			}
			white_peace = {
				tag = ROOT
			}
		}

	}
}

country_event = { #Pushing Negotiations Rejected
	id = PER_imperial_events.192
	title = PER_imperial_events.192.t
	desc = PER_imperial_events.192.desc
	picture = GFX_report_event_generic_read_write 

	#fire_only_once = yes

	is_triggered_only = yes

	option = { # nooooooo
		name = PER_imperial_events.192.a
		ai_chance = {
			base = 90
		}
	}
}

#The Saadabad Pact
country_event = {
	id = PER_imperial_events.200
	title = PER_imperial_events.200.t
	desc = PER_imperial_events.200.desc
	picture = GFX_report_event_tur_the_saadabad_pact

	is_triggered_only = yes
	
	option = {
		name = PER_imperial_events.200.a #we are stronger together!
		ai_chance = {
			factor = 100
			modifier = {
				is_historical_focus_on = yes
				factor = 100
			}
		}
		add_political_power = 120
		custom_effect_tooltip = SSB_if_join_tt
		hidden_effect = {
			add_ai_strategy = {
				type = befriend
				id = event_target:SSB_leader
				value = 100
			}
			set_country_flag = PER_saadabad_pact_member

			set_variable = { SSB_trade_cost_for_target_factor = 0 }
			set_variable = { SSB_production_speed_infrastructure_factor = 0 }
			set_variable = { SSB_trade_opinion_factor = 0 }
			set_variable = { SSB_cic_to_target_factor = 0 }
			set_variable = { SSB_mic_to_target_factor = 0 }
			set_variable = { SSB_production_speed_arms_factory_factor = 0 }
			set_variable = { SSB_war_support_factor = 0 }
			set_variable = { SSB_stability_factor = 0 }
			set_variable = { SSB_experience_gain_army = 0 }
			set_variable = { SSB_experience_gain_air = 0 }
			set_variable = { SSB_experience_gain_navy = 0 }
			set_variable = { SSB_country_resource_oil = 0 }
			set_variable = { SSB_country_resource_chromium = 0 }
			set_variable = { SSB_army_defence_against_major_factor = 0 }
			set_variable = { SSB_army_defence_against_minor_factor = 0 }
			set_variable = { SSB_conscription_factor = 0 }
			set_variable = { SSB_intelligence_agency_defense = 0 }
			set_variable = { SSB_production_factory_efficiency_gain_factor = 0 }
			set_variable = { SSB_acclimatization_hot_climate_gain_factor = 0 }
			set_variable = { SSB_heat_attrition_factor = 0 }
			set_variable = { SSB_special_forces_cap = 0 }
			set_variable = { SSB_local_resources_factor = 0 }

			set_variable = { SSB_justify_war_goal_time = 0 }
			set_variable = { SSB_opinion_gain_monthly = 0 }
			set_variable = { SSB_annex_cost_factor = 0 }
			set_variable = { SSB_political_power_factor = 0 }

			set_variable = { SSB_agency_upgrade_time = 0 }

			add_dynamic_modifier = { modifier = SSB_saadabad_pact }
			add_to_variable = {
				var = SSB_stability_factor
				value = 0.05
				tooltip = stability_factor_tt
			}
		
			event_target:SSB_leader = { 
				country_event = { id = PER_imperial_events.201 hours = 6 random = 8 }
				add_ai_strategy = {
					type = befriend
					id = ROOT
					value = 100
				}
			}

			every_country = {
				limit = {
					has_dynamic_modifier = { modifier = SSB_saadabad_pact }
					NOT = { tag = ROOT }
				}
				add_ai_strategy = {
					type = befriend
					id = ROOT
					value = 100
				}
				diplomatic_relation = {
					country = ROOT
					relation = non_aggression_pact
					active = yes
				}
				add_opinion_modifier = {
					target = ROOT
					modifier = SSB_saadabad_pact_member
				}
				reverse_add_opinion_modifier = {
				    target = ROOT
				    modifier = SSB_saadabad_pact_member
				}
			}
		}
	}
	option = {
		name = PER_imperial_events.200.b #Turkey does not hold our best interests at heart
		ai_chance = {
			factor = 1
			modifier = {
				is_historical_focus_on = yes
				factor = 0
			}
		}
		add_war_support = 0.05
		hidden_effect = {
			event_target:SSB_leader = { country_event = { id = PER_imperial_events.202 hours = 6 random = 8 } }
		}
	}
}

#The Saadabad Pact - Country Accepts
country_event = {
	id = PER_imperial_events.201
	title = PER_imperial_events.201.t
	desc = PER_imperial_events.201.desc
	picture = GFX_report_event_tur_the_saadabad_pact

	is_triggered_only = yes
	
	option = {
		name = PER_imperial_events.201.a #true and honest friends!
		add_political_power = 25
		effect_tooltip = { 
			diplomatic_relation = {
				country = FROM
				relation = non_aggression_pact
				active = yes
			}
		}
	}
}

#The Saadabad Pact - Country Rejects
country_event = {
	id = PER_imperial_events.202
	title = PER_imperial_events.202.t
	desc = PER_imperial_events.202.desc
	picture = GFX_report_event_tur_politician_march

	is_triggered_only = yes
	
	option = {
		name = PER_imperial_events.202.a #stick it out alone then
	}
}

#Middle Eastern Anchluss
country_event = {
	id = PER_imperial_events.210
	title = PER_imperial_events.210.t
	desc = PER_imperial_events.210.desc
	picture = GFX_report_event_tur_politician_march

	is_triggered_only = yes
	
	#yes
	option = {
		name = PER_imperial_events.210.a
		ai_chance = {
			base = 50
			modifier = {
				has_war_support < 0.5
				factor = 2
			}
			modifier = {
				strength_ratio = { tag = PER ratio < 0.8 }
				factor = 2
			}
		}

		PER = {
				country_event = {
					id = PER_imperial_events.211
					hours = 1
				}
			} 
		}

	#no
	option = {
		name = PER_imperial_events.210.b 
		ai_chance = {
			base = 25
			modifier = {
				has_war_support > 0.5
				factor = 1.5
			}
			modifier = {
				strength_ratio = { tag = PER ratio > 1.5 }
				factor = 2
			}
		}

		PER = {
				country_event = {
					id = PER_imperial_events.212
					hours = 1
				}
			}
		}
	}

country_event = {
	id = PER_imperial_events.211
	title = PER_imperial_events.211.t
	desc = PER_imperial_events.211.desc
	picture = GFX_report_event_tur_politician_march

	is_triggered_only = yes
	
	#good
	option = {
		name = PER_imperial_events.211.a 
		
		IF = {
			limit = {
				FROM = {
					OR = {
						owns_state = 415
						owns_state = 1009
						owns_state = 1276
						owns_state = 1279
						owns_state = 1280
						owns_state = 1281
						owns_state = 1282
					}
				}
			}
			every_state = {
				limit = {
					is_owned_by = FROM
					OR = {
						state = 415
						state = 1009
						state = 1276
						state = 1279
						state = 1280
						state = 1281
						state = 1282
					}
				}
				transfer_state_to = ROOT
			}
		}

	}
}

country_event = {
	id = PER_imperial_events.212
	title = PER_imperial_events.212.t
	desc = PER_imperial_events.212.desc
	picture = GFX_report_event_tur_politician_march

	is_triggered_only = yes
	
	#bad
	option = {
		name = PER_imperial_events.212.a 

		create_wargoal = {
			type = take_claimed_state
			target = FROM
		}	

	}

}

# Picking a new prime minister
country_event = {
	id = PER_imperial_events.220
	title = PER_imperial_events.220.t
	desc = PER_imperial_events.220.desc
	picture = GFX_report_event_generic_read_write
	fire_only_once = yes
	is_triggered_only = yes
	# guy 1
	option = {
		name = PER_imperial_events.220.a
		ai_chance = {
			base = 0
		}
		hidden_effect = { retire_country_leader = yes }
		promote_character = {
			character = PER_mohammad_mosaddegh 
			ideology = conservatism 
		}
	}
	# guy 2
	option = {
		name = PER_imperial_events.220.b
		ai_chance = {
			base = 10
		}
		hidden_effect = { retire_country_leader = yes }
		promote_character = {
			character = PER_mohammad_ali_foroughi 
			ideology = conservatism 
		}
	}
	# guy 3
	#option = {
	#	name = PER_imperial_events.220.c
	#	ai_chance = {
	#		base = 2
	#	}
	#	retire_country_leader = yes
	#	promote_character = {
	#		character = PER_abol_ghasem_kashani 
	#		ideology = conservatism 
	#	}
	#}
}

# Qajar Event Chain
country_event = {
	id = PER_imperial_events.230
	title = PER_imperial_events.230.t
	desc = PER_imperial_events.230.desc
	picture = GFX_report_event_generic_read_write
	fire_only_once = yes
	is_triggered_only = yes

	# No Monarch in Power
	option = {
		name = PER_imperial_events.230.a
		ai_chance = {
			base = 0
		}

		trigger = {
			PER = {
				OR = {
					has_government = communism
					has_government = democratic
					has_government = fascism
				}
			}
		}
		hidden_effect = { 
			retire_country_leader = yes
		}
		set_party_name = {
				ideology = neutrality
				long_name = PER_qajar_dynasty_party_long
				name = PER_qajar_dynasty_party
			}
		promote_character = {
			character = PER_mohammad_hassan_mirza 
			ideology = despotism 
		}
		set_cosmetic_tag = PER_persia
		
		IF = {
			limit = {
				has_idea = PER_constitutional_shah
			}
			remove_ideas = PER_constitutional_shah
		}
		
		PER = {
			country_event = {
				id = PER_imperial_events.233
				hours = 1
			}
		}
	}

	# Depose the Pahlavis
	option = {
		name = PER_imperial_events.230.b
		ai_chance = {
			base = 0
		}

		trigger = {
			NOT = {
				PER = {
					OR = {
						has_government = communism
						has_government = democratic
						has_government = fascism
					}
				}
			}
		}

		effect_tooltip = {
			hidden_effect = { 
				retire_country_leader = yes
				set_country_flag = PER_pahlavis_deposed_flag
			}
			promote_character = {
				character = PER_mohammad_hassan_mirza 
				ideology = despotism 
			}
			set_party_name = {
				ideology = neutrality
				long_name = PER_qajar_dynasty_party_long
				name = PER_qajar_dynasty_party
			}
			set_cosmetic_tag = PER_persia
			custom_effect_tooltip =	generic_skip_one_line_tt
			custom_effect_tooltip = available_political_advisor
			show_ideas_tooltip = PER_reza_shah_pahlavi
			PER_mohammed_reza_pahlavi = {
				remove_trait = {
					trait = compassionate_gentleman
					slot = political_advisor
				}
				add_trait = {
					trait = PER_disinherited_heir_trait
					slot = political_advisor
				} 
			}
		}
		PER = {
			country_event = {
				id = PER_imperial_events.231
				hours = 1
			}
		}
	}

	# Exile the Pahlavis
	option = {
		name = PER_imperial_events.230.c
		ai_chance = {
			base = 10
		}
		trigger = {
			NOT = {
				PER = {
					OR = {
						has_government = communism
						has_government = democratic
						has_government = fascism
					}
				}
			}
		}
		effect_tooltip = {
			hidden_effect = { 
				retire_country_leader = yes
				set_global_flag = PER_pahlavis_exiled_flag
			}
			promote_character = {
				character = PER_mohammad_hassan_mirza 
				ideology = despotism 
			}
			set_party_name = {
				ideology = neutrality
				long_name = PER_qajar_dynasty_party_long
				name = PER_qajar_dynasty_party
			}
			set_cosmetic_tag = PER_persia
			custom_effect_tooltip =	generic_skip_one_line_tt
			PER_reza_shah_pahlavi = {
				set_nationality = SAF
			}
			PER_mohammed_reza_pahlavi = {
				set_nationality = SAF
				remove_trait = {
					trait = compassionate_gentleman
					slot = political_advisor
				}
				add_trait = {
					trait = PER_disinherited_heir_trait
					slot = political_advisor
				} 
			}
			custom_effect_tooltip = generic_skip_one_line_tt
			add_autonomy_score = {
				value = 75
				localization = PER_reinstate_qajars
			}
		}
		custom_effect_tooltip = generic_skip_one_line_tt
		PER = {
			country_event = {
				id = PER_imperial_events.232
				hours = 1
			}
		}
	}
}

country_event = {
	id = PER_imperial_events.231
	title = PER_imperial_events.231.t
	desc = PER_imperial_events.231.desc
	picture = GFX_report_event_generic_sign_treaty2
	fire_only_once = yes
	is_triggered_only = yes
	# Yes we have Deposed the Pahlavis
	option = {
		name = PER_imperial_events.231.a
		ai_chance = {
			base = 10
		}

		hidden_effect = { 
				retire_country_leader = yes
				set_country_flag = PER_pahlavis_deposed_flag
			}
			promote_character = {
				character = PER_mohammad_hassan_mirza 
				ideology = despotism 
			}
			set_party_name = {
				ideology = neutrality
				long_name = PER_qajar_dynasty_party_long
				name = PER_qajar_dynasty_party
			}
			custom_effect_tooltip =	generic_skip_one_line_tt
			set_cosmetic_tag = PER_persia
			custom_effect_tooltip =	generic_skip_one_line_tt
			custom_effect_tooltip = available_political_advisor
			show_ideas_tooltip = PER_reza_shah_pahlavi
			PER_mohammed_reza_pahlavi = {
				remove_trait = {
					trait = compassionate_gentleman
					slot = political_advisor
				}
				add_trait = {
					trait = PER_disinherited_heir_trait
					slot = political_advisor
				} 
			}
			PER = {
				country_event = {
					id = PER_imperial_events.233
					hours = 3
				}
			}
		}
	}

country_event = {
	id = PER_imperial_events.232
	title = PER_imperial_events.232.t
	desc = PER_imperial_events.232.desc
	picture = GFX_report_event_generic_sign_treaty2
	fire_only_once = yes
	is_triggered_only = yes
	# Yes we have exiled the Pahlavis
	option = {
		name = PER_imperial_events.232.a
		ai_chance = {
			base = 10
		}

		hidden_effect = { 
				retire_country_leader = yes
				set_global_flag = PER_pahlavis_exiled_flag
			}
			set_party_name = {
				ideology = neutrality
				long_name = PER_qajar_dynasty_party_long
				name = PER_qajar_dynasty_party
			}
			promote_character = {
				character = PER_mohammad_hassan_mirza 
				ideology = despotism 
			}
			set_cosmetic_tag = PER_persia
			custom_effect_tooltip =	generic_skip_one_line_tt
			PER_reza_shah_pahlavi = {
				set_nationality = SAF
			}
			PER_mohammed_reza_pahlavi = {
				set_nationality = SAF
				remove_trait = {
					trait = compassionate_gentleman
					slot = political_advisor
				}
				add_trait = {
					trait = PER_disinherited_heir_trait
					slot = political_advisor
				} 
			}
			custom_effect_tooltip = generic_skip_one_line_tt
			add_autonomy_score = {
				value = 75
				localization = PER_reinstate_qajars
			}
			custom_effect_tooltip = generic_skip_one_line_tt

		PER = {
			country_event = {
				id = PER_imperial_events.233
				hours = 3
			}
		}
	}
}

country_event = {
	id = PER_imperial_events.233
	title = PER_imperial_events.233.t
	desc = PER_imperial_events.233.desc
	picture = GFX_report_event_generic_military_parade
	fire_only_once = yes
	is_triggered_only = yes

	# Fully reinstate the Qajars
	option = {
		name = PER_imperial_events.233.a
		ai_chance = {
			base = 10
		}
	}
}

################################
#### OOPERATION COUNTENANCE ####
################################

# Ultimatum to Iran - Event for Iran
country_event = {
	id = PER_foreign_policy_events.1
	title = PER_foreign_policy_events.1.t
	desc = PER_foreign_policy_events.1.desc
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes
			
	option = { # Become a puppet
		name = PER_foreign_policy_events.1.a

		ai_chance = {
			base = 1
			modifier = {
				add = 0.5
				has_opinion = {
					target = FROM
					value > 75
				}
			}
			modifier = {
				add = 0.5
				OR = {
					FROM = {
						has_government = communism
						communism > 0.5
					}
					FROM = {
						has_government = democratic
						democratic > 0.5
					}
					FROM = {
						has_government = fascism
						fascism > 0.5
					}
					FROM = {
						has_government = neutrality
						neutrality > 0.5
					}
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.8
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.5
				}
			}
			modifier = {
				factor = 2
				strength_ratio = {
					tag = FROM
					ratio < 0.2
				}
			}
			modifier = {
				factor = 100
				is_in_faction_with = FROM
			}
			modifier = {
				factor = 0
				OR = {
					AND = {
						is_in_faction = yes
						NOT = { is_in_faction_with = FROM }
					}
					AND = {
						is_subject = yes
						NOT = { is_subject_of = FROM }
					}
				}
			}
		}

		set_politics = { ruling_party = FROM }
		FROM = {
			puppet = ROOT
			add_to_faction = ROOT
			hidden_effect = {
				country_event = { id = NSB_soviet_foreign_politics_events.150 hours = 1 }
			}
		}
	}

	option = { #REFUSE
		name = PER_foreign_policy_events.1.b

		ai_chance = {
			base = 50
			modifier = {
				factor = 2
				is_historical_focus_on = yes
			}
		}

		FROM = {
			hidden_effect = {
				country_event = { id = PER_foreign_policy_events.2 hours = 1 }
			}
		}

		hidden_effect = {
			add_opinion_modifier = {
				target = FROM
				modifier = SOV_pressured_our_government
			}
		}

		custom_effect_tooltip = germany.126.warning
	}
}

country_event = {
	id = PER_foreign_policy_events.2
	title = PER_foreign_policy_events.2.t
	desc = PER_foreign_policy_events.2.desc
	picture = GFX_report_event_generic_sign_treaty1

	is_triggered_only = yes
			
	option = { #Respect
		name = PER_foreign_policy_events.2.a
		
		ai_chance = {
			base = 0
			modifier = {
				add = 1
				FROM = { original_tag = PER }
				original_tag = ENG
			}
		}
	}

	option = { #Make Preparations -> Iran
		name = PER_foreign_policy_events.2.b

		trigger = {
			FROM = { original_tag = PER }
			original_tag = ENG
			is_subject = no
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					strength_ratio = {
						tag = FROM
						ratio < 0.6
					}
					surrender_progress > 0.25
				}
			}
		}

		IF = {
			limit = {
				has_dlc = "Graveyard of Empires"
			}
			set_country_flag = PER_operation_countenance_flag
		}

		set_global_flag = PER_british_invasion_of_iran_flag
		
		activate_mission = SOV_preparations_for_operation_countenance
		custom_effect_tooltip = SOV_preparations_for_operation_countenance_tt

		custom_effect_tooltip = SOV_operation_countenance_successful_tt
		effect_tooltip = {
			puppet = PER
			transfer_state = 419 #Tibriz (AZB)
			transfer_state = 420 #Gilan (AZB)
			transfer_state = 416 #Khorasan
			transfer_state = 1000 #East Azerbaijan
			transfer_state = 1004 #North Khorasan
			PER = {
				give_resource_rights = { receiver = ENG state = 411 }
				give_resource_rights = { receiver = ENG state = 412 }
				give_resource_rights = { receiver = ENG state = 413 }
			}
		}
	}

	option = { #Joint Invasion with ENG -> Iran
		name = PER_foreign_policy_events.2.c

		trigger = {
			FROM = { original_tag = PER }
			original_tag = ENG
			is_subject = no
			country_exists = SOU
			NOT = { has_war_with = SOU }
			NOT = { is_justifying_wargoal_against = SOU }
		}

		ai_chance = {
			base = 10
			modifier = {
				factor = 100
				is_in_faction_with = SOU
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > -25
				}
			}
			modifier = {
				factor = 5
				has_opinion = {
					target = FROM
					value > 50
				}
			}
			modifier = {
				factor = 0
				OR = {
					strength_ratio = {
						tag = FROM
						ratio < 0.6
					}
					surrender_progress > 0.25
				}
			}
		}

		SOU = { country_event = { id = PER_foreign_policy_events.3
 hours = 6 random_hours = 3 } }

		effect_tooltip = {
			custom_effect_tooltip = if_they_accept_tt
			activate_mission = SOV_preparations_for_operation_countenance
			SOU = { activate_mission = SOV_preparations_for_operation_countenance }
			custom_effect_tooltip = SOV_preparations_for_operation_countenance_tt

			custom_effect_tooltip = SOV_operation_countenance_successful_tt
			ENG = {
				puppet = PER
			}
			SOU = {
				transfer_state = 419 #Tibriz (AZB)
				transfer_state = 420 #Gilan (AZB)
				transfer_state = 416 #Khorasan
				transfer_state = 1000 #East Azerbaijan
				transfer_state = 1004 #North Khorasan
			}
			PER = {
				give_resource_rights = { receiver = SOU state = 411 }
				give_resource_rights = { receiver = SOU state = 412 }
				give_resource_rights = { receiver = ENG state = 413 }
				give_military_access = SOU
			}

			custom_effect_tooltip = if_they_refuse_tt
			activate_mission = SOV_preparations_for_operation_countenance
			custom_effect_tooltip = SOV_operation_countenance_successful_tt
			puppet = PER
			transfer_state = 419 #Tibriz (AZB)
			transfer_state = 420 #Gilan (AZB)
			transfer_state = 416 #Khorasan
			transfer_state = 1000 #East Azerbaijan
			transfer_state = 1004 #North Khorasan
			PER = {
				give_resource_rights = { receiver = SOU state = 411 }
				give_resource_rights = { receiver = SOU state = 412 }
				give_resource_rights = { receiver = SOU state = 413 }
			}
		}
	}
}

# Anglo-Soviet Invasion of Iran proposal - Event for SOV
country_event = {
	id = PER_foreign_policy_events.3
	title = PER_foreign_policy_events.3.t
	desc = PER_foreign_policy_events.3.desc
	picture = GFX_report_event_stalin_meeting

	is_triggered_only = yes
			
	option = { #Agree
		name = PER_foreign_policy_events.3.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 100
				is_in_faction_with = FROM
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value > -25
				}
			}
			modifier = {
				factor = 5
				has_opinion = {
					target = FROM
					value > 50
				}
			}
			modifier = {
				factor = 0
				OR = {
					NOT = {
						any_enemy_country = {
							is_major = yes
							has_war_with = FROM
						}
					}
					has_war_with = PER
					has_guaranteed = PER
					has_non_aggression_pact_with = PER
					is_in_faction_with = PER
					is_subject = yes
					strength_ratio = {
						tag = FROM
						ratio < 0.6
					}
					surrender_progress > 0.5
				}
			}
		}

		IF = {
			limit = {
				has_dlc = "Graveyard of Empires"
			}
			set_country_flag = PER_operation_countenance_flag
		}
		
		set_global_flag = SOV_agreed_anglo_soviet_invasion_of_iran_flag

		effect_tooltip = {
			activate_mission = SOV_preparations_for_operation_countenance
			custom_effect_tooltip = SOV_preparations_for_operation_countenance_tt

			custom_effect_tooltip = SOV_operation_countenance_successful_tt
			puppet = PER
			SOU = {
				transfer_state = 419 #Tibriz (AZB)
				transfer_state = 420 #Gilan (AZB)
				transfer_state = 416 #Khorasan
				transfer_state = 1000 #East Azerbaijan
				transfer_state = 1004 #North Khorasan
			}
			PER = {
				give_resource_rights = { receiver = SOU state = 411 }
				give_resource_rights = { receiver = SOU state = 412 }
				give_resource_rights = { receiver = ENG state = 413 }
				give_military_access = SOU
			}
		}

		FROM = { country_event = { id = PER_foreign_policy_events.4 hours = 1 } }
	}

	option = { #Reject
		name = PER_foreign_policy_events.3.b

		ai_chance = {
			base = 1
		}

		custom_effect_tooltip = NSB_soviet_foreign_politics_events.153_soviets_alone_tt
		hidden_effect = {
			FROM = { country_event = { id = PER_foreign_policy_events.5 hours = 4 } }
			set_global_flag = PER_british_invasion_of_iran_flag
		}
	}
}

# Anglo-Soviet Invasion of Iran - SOV ACCEPTS - Event for ENG
country_event = {
	id = PER_foreign_policy_events.4
	title = PER_foreign_policy_events.4.t
	desc = PER_foreign_policy_events.4.desc
	picture = GFX_report_event_british_inspect_troops

	is_triggered_only = yes
			
	option = { #Good
		name = PER_foreign_policy_events.4.a

		activate_mission = SOV_preparations_for_operation_countenance		
		SOU = { activate_mission = SOV_preparations_for_operation_countenance }
		custom_effect_tooltip = SOV_preparations_for_operation_countenance_tt

		effect_tooltip = {
			custom_effect_tooltip = SOV_operation_countenance_successful_tt
			ENG = {
				puppet = PER
			}
			transfer_state = 419 #Tibriz (AZB)
			transfer_state = 420 #Gilan (AZB)
			transfer_state = 416 #Khorasan
			transfer_state = 1000 #East Azerbaijan
			transfer_state = 1004 #North Khorasan
			PER = {
				give_resource_rights = { receiver = SOU state = 411 }
				give_resource_rights = { receiver = SOU state = 412 }
				give_resource_rights = { receiver = ENG state = 413 }
				give_military_access = SOU
			}
		}
	}
}

# Anglo-Soviet Invasion of Iran - SOV REFUSES - Event for ENG
country_event = {
	id = PER_foreign_policy_events.5
	title = PER_foreign_policy_events.5.t
	desc = PER_foreign_policy_events.5.desc
	picture = GFX_report_event_generic_sign_treaty2

	is_triggered_only = yes
	
	option = { #Ok
		name = PER_foreign_policy_events.5.a

		activate_mission = SOV_preparations_for_operation_countenance
		custom_effect_tooltip = SOV_preparations_for_operation_countenance_tt

		IF = {
			limit = {
				has_dlc = "Graveyard of Empires"
			}
			set_country_flag = PER_operation_countenance_flag
		}

		effect_tooltip = {
			custom_effect_tooltip = SOV_operation_countenance_successful_tt
			puppet = PER
			transfer_state = 419 #Tibriz (AZB)
			transfer_state = 420 #Gilan (AZB)
			transfer_state = 416 #Khorasan
			transfer_state = 1000 #East Azerbaijan
			transfer_state = 1004 #North Khorasan
			PER = {
				give_resource_rights = { receiver = ENG state = 411 }
				give_resource_rights = { receiver = ENG state = 412 }
				give_resource_rights = { receiver = ENG state = 413 }
			}
		}
	}
}

############################
#### REVOLUTION ####
############################

country_event = { # Civil War Imminent
	id = PER_revolution_events.1
	title = PER_revolution_events.1.t
	desc = PER_revolution_events.1.desc
	picture = GFX_report_event_generic_read_write 

	fire_only_once = no

	is_triggered_only = yes

	option = { #Rally the troops!
		name = PER_revolution_events.1.a
		hidden_effect = {
			set_global_flag = PER_civil_war_happened
			start_civil_war = {
				ideology = democratic
				size = 0.1
				army_ratio = 0.1
			    navy_ratio = 0
			    air_ratio = 0.5
			    states = all
			    states_filter = {

			    	is_capital = no
			    	is_controlled_by = PER
			    	
			    	NOT = {
		    				state = 266
		    				state = 418
		    				state = 417
		    				state = 1001
		    				state = 1000
		    				state = 420
		    				state = 419
		    			}
			    }
	
			    keep_all_characters = yes
			}
		}
	}
}

# Event for Iraq about Kurdish rebels
country_event = {
	id = PER_communist_events.1
	title = PER_communist_events.1.t
	desc = PER_communist_events.1.desc
	picture = GFX_report_event_spr_anarchists2
	fire_only_once = no
	is_triggered_only = yes
	option = {
		name = PER_communist_events.1.a
		ai_chance = {
			base = 10
		}
		add_stability = -0.1
		random_owned_state = {
			limit = {
				has_dynamic_modifier = { modifier = KUR_resistance_modifier }
			}
			effect_tooltip = {
				add_dynamic_modifier = { modifier = KUR_resistance_modifier }
			}
			custom_effect_tooltip = PER_communist_events_1_tt
		}
	}
}

# Event for Iran about crackdown
country_event = {
	id = PER_communist_events.2
	title = PER_communist_events.2.t
	desc = PER_communist_events.2.desc
	picture = GFX_report_event_spr_anarchists2
	fire_only_once = no
	is_triggered_only = yes
	option = {
		name = PER_communist_events.2.a
		ai_chance = {
			base = 10
		}
	}
}

# Event for Iraq about Kurdish uprising
country_event = {
	id = PER_communist_events.3
	title = PER_communist_events.3.t
	desc = PER_communist_events.3.desc
	picture = GFX_report_event_spr_anarchists2
	fire_only_once = no
	is_triggered_only = yes
	option = {
		name = PER_communist_events.3.a
		ai_chance = {
			base = 10
		}
		custom_effect_tooltip = PER_communist_events_3_tt
	}
}

country_event = {
	id = PER_communist_events.4
	title = PER_communist_events.4.t
	desc = PER_communist_events.4.desc
	picture = GFX_report_event_ITA_italian_civil_war
	fire_only_once = no
	is_triggered_only = yes
	option = {
		name = PER_communist_events.4.a
		ai_chance = {
			base = 10
		}
		custom_effect_tooltip = PER_communist_events_4_tt
	}
}

############# Gulf Crisis Event Chain #################

## PER Demands we withdraw from Gulf and Arabia
country_event = {
	id = PER_communist_events.5
	title = PER_communist_events.5.t
	desc = PER_communist_events.5.desc
	picture = GFX_report_event_merchant_ship_01
	fire_only_once = no
	is_triggered_only = yes
	# Agree to withdraw
	option = {
		name = PER_communist_events.5.a
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				has_war_with = FROM
			}
			modifier = {
				factor = 2
				has_war_with_major = yes
			}
		}
		FROM = {
			country_event = {
				id = PER_communist_events.6
				days = 7
				random_days = 4
			}
		}
		effect_tooltip = {
			every_owned_state = {
				limit = {
					state_is_fully_controlled_by_ROOT_or_subject = yes
					NOT = {
						is_core_of = ROOT
					}
					OR = {
						state = 656
						state = 859
						state = 678
						state = 658
						state = 1013
						state = 1014
						state = 765
						state = 294
						state = 1015
						state = 1016
						state = 659
						state = 293
				    }
				}
				transfer_state_to = FROM
			}
			every_subject_country = {
				limit = {
					capital_scope = {
						OR = {
						state = 656
						state = 859
						state = 678
						state = 658
						state = 1013
						state = 1014
						state = 765
						state = 294
						state = 1015
						state = 1016
						state = 659
						state = 293
						}
					}
				}
				PREV = {
					set_autonomy = {
						target = PREV
						autonomous_state = autonomy_free
					}
				}
			}
		}
	}
	# Refuse to withdraw
	option = {
		name = PER_communist_events.5.b
		ai_chance = {
			base = 3
			modifier = {
				factor = 2
				is_in_faction = yes				
			}
		}
		FROM = {
			country_event = {
				id = PER_communist_events.7
				days = 7
				random_days = 4
			}
		}
	}
}

# FROM agrees to withdraw
country_event = {
	id = PER_communist_events.6
	title = PER_communist_events.6.t
	desc = PER_communist_events.6.desc
	picture = GFX_report_event_merchant_ship_01
	fire_only_once = no
	is_triggered_only = yes
	option = {
		name = PER_communist_events.6.a
		ai_chance = {
			base = 10
		}
		FROM = {
			every_owned_state = {
				limit = {
					is_controlled_by = THIS
					NOT = {
						is_core_of = PREV
					}
					OR = {
						state = 656
						state = 859
						state = 678
						state = 658
						state = 1013
						state = 1014
						state = 765
						state = 294
						state = 1015
						state = 1016
						state = 659
						state = 293
	        		}
				}
				transfer_state_to = ROOT
			}
			every_subject_country = {
				limit = {
					any_owned_state = {
						OR = {
						state = 656
						state = 859
						state = 678
						state = 658
						state = 1013
						state = 1014
						state = 765
						state = 294
						state = 1015
						state = 1016
						state = 659
						state = 293
						}
					}
				}
				PREV = {
					set_autonomy = {
						target = PREV
						autonomous_state = autonomy_free
					}
				}
			}
		}
	}
}

# FROM refuses to withdraw
country_event = {
	id = PER_communist_events.7
	title = PER_communist_events.7.t
	desc = PER_communist_events.7.desc
	picture = GFX_report_event_merchant_ship_01
	fire_only_once = no
	is_triggered_only = yes
	# We wont backdown
	option = {
		name = PER_communist_events.7.a
		ai_chance = {
			base = 10
			modifier = {
				factor = 0.5
				has_war = yes
			}
		}
		send_embargo = FROM
		FROM = {
			country_event = {
				id = PER_communist_events.8
				days = 7
				random_days = 4
			}
		}
	}
	# We give up
	option = {
		name = PER_communist_events.7.b
		ai_chance = {
			base = 2
		}
		FROM = {
			country_event = {
				id = PER_communist_events.9
				days = 7
				random_days = 4
			}
		}
	}
}

# PER issues embargo 
country_event = {
	id = PER_communist_events.8
	title = PER_communist_events.8.t
	desc = PER_communist_events.8.desc
	picture = GFX_report_event_merchant_ship_01
	fire_only_once = no
	is_triggered_only = yes
	# Escalate 
	option = {
		name = PER_communist_events.8.a
		ai_chance = {
			base = 4
		}
		FROM = {
			country_event = {
				id = PER_communist_events.10
				days = 3
				random_days = 2
			}
		}
	}
	# Withdraw
	option = {
		name = PER_communist_events.8.b
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				has_war_with = FROM
			}
			modifier = {
				factor = 2
				has_war_with_major = yes
			}
		}
		FROM = {
			country_event = {
				id = PER_communist_events.9
				days = 3
				random_days = 2
			}
		}
	}
}

# PER backs down
country_event = {
	id = PER_communist_events.9
	title = PER_communist_events.9.t
	desc = PER_communist_events.9.desc
	picture = GFX_report_event_merchant_ship_01
	fire_only_once = no
	is_triggered_only = yes
	option = {
		name = PER_communist_events.9.a
		ai_chance = {
			base = 10
		}
		add_war_support = 0.1
		add_stability = 0.05
	}
}

# FROM sends the navy
country_event = {
	id = PER_communist_events.10
	title = PER_communist_events.10.t
	desc = PER_communist_events.10.desc
	picture = GFX_report_event_merchant_ship_01
	fire_only_once = no
	is_triggered_only = yes
	# Strike them first
	option = {
		name = PER_communist_events.10.a
		ai_chance = {
			base = 10
			modifier = { 
				factor =  0.2
				has_war = yes
			}
			modifier = {
				factor = 5
				is_in_faction_with = SOU
			}
		}
		add_war_support = 0.1
		declare_war_on = { 
			target = FROM
			type = liberate_wargoal
		}
	}
	# back down
	option = {
		name = PER_communist_events.10.b
		ai_chance = {
			base = 3
			modifier = {
				factor = 0
				has_war_with = FROM
			}
		}
		add_stability = -0.05
		FROM = {
			country_event = {
				id = PER_communist_events.9
				days = 1
			}
		}
	}
}

# PER wants naval/air technology
country_event = {
	id = PER_communist_events.11
	title = PER_communist_events.11.t
	desc = PER_communist_events.11.desc
	picture = GFX_report_event_radar_01
	fire_only_once = no
	is_triggered_only = yes
	# Agree
	option = {
		name = PER_communist_events.11.a
		ai_chance = {
			base = 10
			modifier = { 
				factor =  0
				has_war = yes
			}
			modifier = {
				factor = 5
				is_in_faction_with = FROM
			}
		}
		FROM = {
			country_event = {
				id = PER_communist_events.12
				days = 7 
				random_days = 3
			}
			event_option_tooltip = PER_communist_events.12.a
		}
	}
	# Refuse
	option = {
		name = PER_communist_events.11.b
		ai_chance = {
			base = 1
		}
		FROM = {
			country_event = {
				id = PER_communist_events.13
				days = 7 
				random_days = 3
			}
		}
	}
}

# FROM agrees to share tech
country_event = {
	id = PER_communist_events.12
	title = PER_communist_events.12.t
	desc = PER_communist_events.12.desc
	picture = GFX_report_event_radar_01
	fire_only_once = no
	is_triggered_only = yes
	# Ok
	option = {
		name = PER_communist_events.12.a
		ai_chance = {
			base = 10
		}
		IF = {
			limit = {
				has_country_flag = PER_communist_tech_request_naval
			}
			clr_country_flag = PER_communist_tech_request_naval
			FROM = {
				set_technology = { basic_naval_mines = 1 }
				set_technology = { submarine_mine_laying = 1 }
			}
		}
		ELSE_IF = {
			limit = {
				has_country_flag = PER_communist_tech_request_air
			}
			clr_country_flag = PER_communist_tech_request_air
			IF = {
				limit = { has_dlc = "By Blood Alone"}
				set_technology = { iw_small_airframe = 1 }
				set_technology = { basic_small_airframe = 1 }
				set_technology = { aa_lmg = 1 }
				set_technology = { early_bombs = 1 }
			}
			ELSE = {
				set_technology = { early_fighter = 1 }
				set_technology = { naval_bomber1 = 1 }
			}
		}
	}
}

# FROM refuses to share tech
country_event = {
	id = PER_communist_events.13
	title = PER_communist_events.13.t
	desc = PER_communist_events.13.desc
	picture = GFX_report_event_radar_01
	fire_only_once = no
	is_triggered_only = yes
	# Ok
	option = {
		name = PER_communist_events.13.a
		ai_chance = {
			base = 10
		}
		clr_country_flag = PER_communist_tech_request_naval
		clr_country_flag = PER_communist_tech_request_air
	}
}

# FROM delivers tech
country_event = {
	id = PER_communist_events.14
	title = PER_communist_events.14.t
	desc = PER_communist_events.14.desc
	picture = GFX_report_event_radar_01
	fire_only_once = no
	is_triggered_only = yes
	# Ok
	option = {
		name = PER_communist_events.14.a
		ai_chance = {
			base = 10
		}
		add_opinion_modifier = {
			target = FROM
			modifier = medium_increase
		}
		IF = {
			limit = { 
				FROM = {
					has_country_flag = PER_communist_naval_tech_delivered
				}
			}
			clr_country_flag = PER_communist_naval_tech_delivered
			create_soviet_iranian_joint_submarine = yes
		}
		ELSE_IF = {
			limit = {
				FROM = {
					has_country_flag = PER_communist_air_tech_delivered
				}
			}
			clr_country_flag = PER_communist_air_tech_delivered
		}		
	}
}

country_event = {
	id = PER_communist_events.20
	title = PER_communist_events.20.t
	desc = PER_communist_events.20.desc
	picture = GFX_report_event_generic_read_write
	fire_only_once = no
	is_triggered_only = yes
	# Release the Republic of Mahabad
	option = {
		name = PER_communist_events.20.a
		ai_chance = {
			base = 50
		}
		custom_effect_tooltip = PER_republic_of_mahabad_tt
		hidden_effect = {
			SOU = {
			release = KUR
			puppet = KUR
		}
			KUR = {
				set_politics = {
					ruling_party = communism
					elections_allowed = no
				}
				add_popularity = {
					ideology = communism
					popularity = 0.51
				}
				set_cosmetic_tag = KUR_republic_of_mahabad_communism
			}
			IRQ = {
				IRQ_mustafa_barzani = {
					set_nationality = KUR
				}
				IRQ_ahmed_barzani = {
					set_nationality = KUR
				}
			}
			set_global_flag = kurdistan_exists_flag
			set_country_flag = IRQ_has_become_kurdistan_flag
		}
	}
	# Do not Release the Republic of Mahabad
	option = {
		name = PER_communist_events.20.b
		ai_chance = {
			base = 10
			modifier = {
				is_historical_focus_on = yes
				factor = 100
			}
		}
	}
}

# Picking a new puppet shah for the fascists
country_event = {
	id = PER_fascist_events.1
	title = PER_fascist_events.1.t
	desc = PER_fascist_events.1.desc
	picture = GFX_report_event_generic_read_write
	fire_only_once = yes
	is_triggered_only = yes
	# Continuity - Reza Shah
	option = {
		name = PER_fascist_events.1.a
		ai_chance = {
			base = 0
		}
		add_ideas = PER_constitutional_shah
	}
	# country_leader
	option = {
		name = PER_fascist_events.1.b
		ai_chance = {
			base = 10
		}
		add_country_leader_trait = PER_fascist_dynasty
	}
}

# (leader) invites to saadabad alliance
country_event = {
	id = PER_ssb_events.1
	title = PER_ssb_events.1.t
	desc = PER_ssb_events.1.desc
	picture = GFX_report_event_gre_cabinet_meeting
	is_triggered_only = yes

	# sure
	option = {
		name = PER_ssb_events.1.a
		ai_chance = {
			base = 10
		}
		event_target:SSB_leader = {
			add_to_faction = ROOT
			country_event = { id = PER_ssb_events.2 hours = 2}
		}
	}

	# no go away
	option = {
		name = PER_ssb_events.1.b
		ai_chance = {
			base = 0
		}
		event_target:SSB_leader = {
			country_event = { id = PER_ssb_events.3 hours = 2 }
		}
	}
}

# (country) accepts saadabad alliance
country_event = {
	id = PER_ssb_events.2
	title = PER_ssb_events.2.t
	desc = PER_ssb_events.2.desc
	picture = GFX_report_event_gre_cabinet_meeting
	is_triggered_only = yes

	# yay
	option = {
		name = PER_ssb_events.2.a
	}
}

# (country) declines request
country_event = {
	id = PER_ssb_events.3
	title = PER_ssb_events.3.t
	desc = PER_ssb_events.3.desc
	picture = GFX_report_event_gre_cabinet_meeting
	is_triggered_only = yes

	# yay
	option = {
		name = PER_ssb_events.3.a
	}
}

# turkey offer of subjigation
country_event = {
	id = PER_ssb_events.4
	title = PER_ssb_events.4.t
	desc = PER_ssb_events.4.desc
	picture = GFX_report_event_generic_conference
	is_triggered_only = yes

	# ye
	option = {
		name = PER_ssb_events.4.a
		ai_chance = {
			base = 4
			modifier = {
				factor = 4 
				OR = {
					tag = AFG
					tag = IRQ
				}
			}
		}

		TUR = {
			set_autonomy = {
				target=PREV
				autonomy_state = autonomy_dominion
				freedom_level = 0.2
				end_wars  = no
				end_civil_wars = no
			}
			country_event = { id = PER_ssb_events.5 hours = 5 }
		}
		try_build_civ_in_core_otherwise_build_in_controlled = yes
		try_build_civ_in_core_otherwise_build_in_controlled = yes
	}

	# no!
	option = {
		ai_chance = {
			base = 6
		}
		name = PER_ssb_events.4.b
		TUR = {
			country_event = { id = PER_ssb_events.6 hours = 5 }
		}
	}
}

# they said yes
country_event = {
	id = PER_ssb_events.5
	title = PER_ssb_events.5.t
	desc = PER_ssb_events.5.desc
	picture = GFX_report_event_generic_sign_treaty3
	is_triggered_only = yes

	option = {
		name = PER_ssb_events.5.a
	}
}

# they said no
country_event = {
	id = PER_ssb_events.6
	title = PER_ssb_events.6.t
	desc = PER_ssb_events.6.desc
	picture = GFX_report_event_poland_rejects
	is_triggered_only = yes

	option = {
		name = PER_ssb_events.6.a
	}
}

# AFG->all SSB | berlin baghdad railway is built
country_event = {
	id = PER_ssb_events.7
	title = PER_ssb_events.7.t
	desc = PER_ssb_events.7.desc
	picture = GFX_report_event_generic_train
	is_triggered_only = yes

	option = {
		name = PER_ssb_events.7.a
	}
}

# any SSB->all SSB | a country has broke the saadabad pact!
country_event = {
	id = PER_ssb_events.8
	title = PER_ssb_events.8.t
	desc = PER_ssb_events.8.desc
	picture = GFX_report_event_generic_sign_treaty3
	is_triggered_only = yes

	option = {
		name = PER_ssb_events.8.a
	}
}

# any SSB -> all SSB | tech sharing group notification
country_event = {
	id = PER_ssb_events.9
	title = PER_ssb_events.9.t
	desc = PER_ssb_events.9.desc
	picture = GFX_report_event_generic_conference
	is_triggered_only = yes

	option = {
		name = PER_ssb_events.9.a
	}
}

# PER -> all SSB | persia exports oil
country_event = {
	id = PER_ssb_events.10
	title = PER_ssb_events.10.t
	desc = PER_ssb_events.10.desc
	picture = GFX_report_event_generic_sign_treaty3
	is_triggered_only = yes

	option = {
		name = PER_ssb_events.10.a
		custom_effect_tooltip = SSB_oil_tt
	}
}

# TUR -> all SSB | turkey exports chromium
country_event = {
	id = PER_ssb_events.11
	title = PER_ssb_events.11.t
	desc = PER_ssb_events.10.desc
	picture = GFX_report_event_generic_sign_treaty3
	is_triggered_only = yes

	option = {
		name = PER_ssb_events.10.a
		custom_effect_tooltip = SSB_chromium_tt
	}
}