﻿###########################
# Persia Events
###########################

add_namespace = persia

# Persians Demand (Syria)
country_event = {
	id = persia.1
	title = persia.1.t
	desc = persia.1.d
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes
	
	option = { # Accept demands
		name = persia.1.a
		ai_chance = { 
			factor = 90 
		}

		PER = { 
			transfer_state = 680
			transfer_state = 677
			transfer_state = 554
			transfer_state = 553
		}
		hidden_effect = {
			news_event = { id = news.500 days = 1 }
		}
	}
	
	option = { # Refuse demands
		name = persia.1.b
		ai_chance = { 
			factor = 10 
		}
		effect_tooltip = {
			PER = {
				create_wargoal = {
				type = take_state_focus
				target = FRA
				generator = { 554 }
				}
			}
		}
		hidden_effect = {
			news_event = { id = news.501 hours = 6 }
			PER = {
				country_event = { id = persia.2 days = 1 }
			}
		}
	}
}


# France Refuses Demands
country_event = {
	id = persia.2
	title = persia.2.t
	desc = persia.2.d
	picture = GFX_report_event_soviet_tanks_snow
	
	is_triggered_only = yes
	
	option = {
		name = persia.2.a
		create_wargoal = {
			type = take_state
			target = FRA
			generator = { 554 }
		}				
	}
}

# Tehran University
news_event = {
	id = persia.10
	title = persia.10.t
	desc =persia.10.d
	picture = GFX_news_event_herman_goring
	
	fire_only_once = yes
	is_triggered_only = yes

	option = {
		name = persia.10.a
		trigger = { TAG = PER }
	}
}

# Iranian Civil War
country_event = {
	id = persia.3
	title = persia.3.t
	desc = persia.3.d
	picture = GFX_report_event_spain_civil_war_soldiers
	
	fire_only_once = yes
	is_triggered_only = yes

	option = { 
		name = persia.3.a
		hidden_effect = {
			set_capital = 411
			start_civil_war = {
				ideology = neutrality
				capital = 266
				states = { 266 417 420 418 416 419 }
			}
			random_country = {
				limit = {
					original_tag = PER
					has_government = neutrality
				}
				set_equipment_fraction = 0.5
				set_national_unity = 0.9
				add_popularity = {
					ideology = neutrality
					popularity = 1
				}
			# Tehran
			266 = {
				add_building_construction = {
					type = industrial_complex
					level = 4
					instant_build = yes
				}
				add_building_construction = {
					type = arms_factory
					level = 6
					instant_build = yes
				}
				add_extra_state_shared_building_slots = 10
				}
			# Khorasan
			416 = {
				add_building_construction = {
					type = industrial_complex
					level = 3
					instant_build = yes
				}
				add_extra_state_shared_building_slots = 3
				}
			# Gilan
			420 = {
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
				add_extra_state_shared_building_slots = 1
				}
			# Azerbaijan
			419 = {
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
				add_extra_state_shared_building_slots = 4
				}
				load_oob = "PER_Civil_War"
			}
			news_event = { hours = 6 id = news.502 }
			set_country_flag = iranian_civil_war
		}
		custom_effect_tooltip = reformation_chosen
	}
}

# Western Educated Elites
country_event = {
	id = persia.4
	title = persia.4.t
	desc = persia.4.d
	picture = GFX_report_event_degaulle_inspect_troops
	
	trigger = {
		tag = PER
		NOT = { has_government = democratic }
		NOT = { has_country_flag = PER_night_of_purification }
		democratic < 0.5
	}

	mean_time_to_happen = {
		days = 320
	}

	option = {
		name = persia.4.a
		add_popularity = {
			ideology = democratic
			popularity = 0.05
		}
	}
}

# Kayhan Established
country_event = {
	id = persia.8
	title = persia.8.t
	desc = persia.8.d
	picture = GFX_report_event_communist_leader
	
	fire_only_once = yes
	
	trigger = {
		tag = PER
		NOT = { has_country_flag = PER_night_of_purification }
		democratic > 0.5 
	}

	mean_time_to_happen = {
		days = 5
	}

	option = {
		name = persia.8.a
		# Tehran
		266 = {
			add_building_construction = {
				type = infrastructure
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = radar_station
				level = 1
				instant_build = yes
			}
		}
		add_popularity = {
			ideology = democratic
			popularity = 0.05
		}
	}
}

# Soviet Support of Communists
country_event = {
	id = persia.5
	title = persia.5.t
	desc = persia.5.d
	picture = GFX_report_event_communists_cheer
	
	trigger = {
		tag = PER
		NOT = { has_government = communism }
		NOT = { has_country_flag = PER_night_of_purification }
		communism < 0.5 
	}

	mean_time_to_happen = {
		days = 320
	}

	option = {
		name = persia.5.a
		add_popularity = {
			ideology = communism
			popularity = 0.05
		}
	}
}

# Rahbar Established
country_event = {
	id = persia.7
	title = persia.7.t
	desc = persia.7.d
	picture = GFX_report_event_communist_leader
	
	fire_only_once = yes
	
	trigger = {
		tag = PER
		NOT = { has_country_flag = PER_night_of_purification }
		communism > 0.5 
	}

	mean_time_to_happen = {
		days = 5
	}

	option = {
		name = persia.7.a
		# Tehran
		266 = {
			add_building_construction = {
				type = infrastructure
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = radar_station
				level = 1
				instant_build = yes
			}
		}
		add_popularity = {
			ideology = communism
			popularity = 0.1
		}
	}
}

# Night of Purification
country_event = {
	id = persia.6
	title = persia.6.t
	desc = persia.6.d
	
	picture = GFX_report_event_british_inspect_troops
	
	fire_only_once = yes

	trigger = {
		tag = PER
		has_government = fascism
	}

	mean_time_to_happen = {
		days = 5
	}

	option = {
		name = persia.6.a
		custom_effect_tooltip = PER_night_of_redemption_hidden_effect
		hidden_effect = {
			set_country_flag = PER_night_of_purification
			}
			
		413 = {
			add_manpower = -15000
		}
		266 = {
			add_manpower = -15000
		}
		419 = {
			add_manpower = -15000
		}
		416 = {
			add_manpower = -15000
		}
		411 = {
			add_manpower = -15000
		}
		412 = {
			add_manpower = -15000
		}
	}
	
	option = {
		name = persia.6.b
		add_popularity = {
			ideology = fascism
			popularity = 0.2
		}
	}
}

# Student Movement
country_event = {
	id = persia.9
	title = persia.9.t
	desc = persia.9.d
	picture = GFX_report_event_crowd_in_prague
	
	trigger = {
		tag = PER
		NOT = { has_government = fascism }
		has_completed_focus = PER_establish_tehran_university
		fascism < 0.5 
	}

	mean_time_to_happen = {
		days = 320
	}

	option = {
		name = persia.9.a
		add_popularity = {
			ideology = fascism
			popularity = 0.05
		}
	}
}

# Nationalized Oil
country_event = {
	id = persia.11
	title = persia.11.t
	desc = persia.11.d
	picture = GFX_report_event_fascist_speech
	
	is_triggered_only = yes

	option = { # Do Nothing
		name = persia.11.a
		ai_chance = { 
			factor = 30 
		}
		hidden_effect = {
			news_event = { hours = 12 id = news.506 }
		}
	}
	
	option = { # Claim Persia
		name = persia.11.b
		ai_chance = { 
			factor = 70
		}
		ENG = {
			create_wargoal = {
			type = take_state_focus
			target = PER
			generator = { 413 }
			}
		}
		hidden_effect = {
			news_event = { hours = 12 id = news.507 }
		}
	}
}

# Fate of Yemen & Oman
country_event = {
	id = persia.12
	title = persia.12.t
	desc = persia.12.d
	picture = GFX_report_event_fascist_speech
	
	trigger = {
		tag = PER
		has_completed_focus = PER_gulf_claims
		fascism > 0.5 
		PER = { 
			controls_state = 292
			controls_state = 679
			controls_state = 678 
		}
	}
	
	fire_only_once = yes
	
	mean_time_to_happen = {
		days = 120
	}

	option = { # Do Nothing
		name = persia.12.a
		ai_chance = { 
			factor = 30 
		}
	}
	
	option = { # Claim their land
		name = persia.12.b
		ai_chance = { 
			factor = 70
		}
		PER = {
			create_wargoal = {
			type = take_state_focus
			target = YEM
			generator = { 293 }
			}
		}
		PER = {
			create_wargoal = {
			type = take_state_focus
			target = OMA
			generator = { 294 }
			}
		}
		hidden_effect = {
			news_event = { hours = 12 id = news.508 }
		}
	}
}

# Afghan Reunification
country_event = {
	id = persia.13
	title = persia.13.t
	desc = persia.13.d
	picture = GFX_report_event_fascist_speech
	
	trigger = {
		tag = PER
		NOT = { has_completed_focus = PER_claim_afghanistan } 
		fascism > 0.5 
		NOT = { 
			415 = { is_owned_by = PER } 
			267 = { is_owned_by = PER } 
		}
	}
	
	fire_only_once = yes
	
	mean_time_to_happen = {
		days = 150
	}

	option = { # Do Nothing
		name = persia.13.a
		ai_chance = { 
			factor = 30 
		}
	}
	
	option = { # Claim their land
		name = persia.13.b
		ai_chance = { 
			factor = 70
		}
		complete_national_focus = PER_claim_afghanistan
	}
}

# Kurdish Incorporation
country_event = {
	id = persia.14
	title = persia.14.t
	desc = persia.14.d
	picture = GFX_report_event_fascist_speech
	
	trigger = {
		tag = PER
		352 = { is_owned_by = PER } 
		350 = { is_owned_by = PER } 
		353 = { is_owned_by = PER } 
	}
	
	fire_only_once = yes
	
	mean_time_to_happen = {
		days = 180
	}

	option = { # Welcome Home Brothers
		name = persia.14.a
		ai_chance = { 
			factor = 30 
		}
		352 = { add_core_of = PER }
		350 = { add_core_of = PER }
		353 = { add_core_of = PER }	
	}
}

###########################
# Persian World News Events
###########################

# France Accepts Demands (Syria)
news_event = {
	id = news.500
	title = news.500.t
	desc = news.500.d
	picture = GFX_news_event_012
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = news.500.a
		trigger = {
			NOT = {
				TAG = PER
				TAG = FRA
				is_in_faction_with = PER
			}
		}
	}
	option = {
		name = news.500.b
		trigger = { TAG = PER }
	}
	option = {
		name = news.500.c
		trigger = { TAG = FRA }
	}
	option = {
		name = news.500.f
		trigger = {
			NOT = {
				TAG = PER
				TAG = FRA
			}
			is_in_faction_with = PER
		}
	}
}	

# France Refuses Demands
news_event = {
	id = news.501
	title = news.501.t
	desc = news.501.d
	picture = GFX_news_event_011
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = news.501.a
		trigger = {
			NOT = {
				TAG = PER
				TAG = FRA
				is_in_faction_with = PER
			}
		}
	}
	
	option = {
		name = news.501.b
		trigger = { TAG = PER }
	}
	
	option = {
		name = news.501.c
		trigger = { TAG = FRA }
	}
	
	option = {
		name = news.501.f
		trigger = {
			NOT = {
				TAG = PER
				TAG = FRA
			}
			is_in_faction_with = PER
		}
	}
}

# The Iranian Civil War
news_event = {
	id = news.502
	title = news.502.t
	desc = news.502.d
	picture = GFX_news_event_032
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = news.502.a
		trigger = {
			NOT = { original_tag = PER }
		}
	}
	
	option = {
		name = news.502.b
		trigger = { 
			original_tag = PER
		}
	}
}

# End of the Iranian Civil War (Victory)
news_event = {
	id = news.503
	title = news.503.t
	desc = news.503.d
	picture = GFX_news_event_033
	
	major = yes
	
	trigger = {
		has_country_flag = iranian_civil_war
		PER = { has_civil_war = no }
	}
	
	mean_time_to_happen = {
		days = 2
	}
	
	fire_only_once = yes
	
	immediate = {
		clr_country_flag = iranian_civil_war
		set_country_flag = reformist_victory
	}
	
	option = {
		name = news.503.a
		trigger = {
			NOT = { original_tag = PER }
		}
	}
	
	option = {
		name = news.503.b
		trigger = { original_tag = PER }
	}
}

# Karbala
news_event = {
	id = news.504
	title = news.504.t
	desc = news.504.d
	picture = GFX_news_event_003

	major = yes
	
	trigger = {
		291 = { is_controlled_by = PER }
		NOT = { has_global_flag = conquest_of_karbala }
	}
	
	immediate = {
		set_global_flag = conquest_of_karbala
	}
	
	mean_time_to_happen = {
		days = 2
	}
	
	option = {
		name = news.128.b
		trigger = { TAG = USA }
	}
}

# Mecca
news_event = {
	id = news.505
	title = news.505.t
	desc = news.505.d
	picture = GFX_news_event_003

	major = yes
	
	trigger = {
		679 = { is_controlled_by = PER }
		NOT = { has_global_flag = conquest_of_mecca }
	}
	
	immediate = {
		set_global_flag = conquest_of_mecca
	}
	
	mean_time_to_happen = {
		days = 2
	}
	
	option = {
		name = news.505.a
		trigger = { TAG = PER }
	}
	
	option = {
		name = news.505.b
		trigger = {
			NOT = { original_tag = PER }
		}
	}
}

# Fate of Persia (Britain capitulates)
news_event = {
	id = news.506
	title = news.506.t
	desc = news.506.d
	picture = GFX_news_event_023

	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = news.506.a
		trigger = { TAG = PER }
	}
	
	option = {
		name = news.506.b
		trigger = { TAG = ENG }
	}
	
	option = {
		name = news.506.c
		trigger = {
			NOT = {
				TAG = ENG
				TAG = PER
			}
		}
	}
}


# Fate of Persia (Britain claims Khuzestan)
news_event = {
	id = news.507
	title = news.507.t
	desc = news.507.d
	picture = GFX_news_event_023

	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = news.507.a
		trigger = { TAG = PER }
	}
	
	option = {
		name = news.507.b
		trigger = { TAG = ENG }
	}
	
	option = {
		name = news.507.c
		trigger = {
			NOT = {
				TAG = ENG
				TAG = PER
			}
		}
	}
}

# Fate of Yemen & Oman
news_event = {
	id = news.508
	title = news.508.t
	desc = news.508.d
	picture = GFX_news_event_023

	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = news.508.a
		trigger = { TAG = PER }
	}
	
	option = {
		name = news.508.b
		trigger = {
			NOT = {
				TAG = PER
			}
		}
	}
}
