###########################
# New Rus Events
###########################

add_namespace = DES


country_event = { # Russian Military Mission
	id = DES.0
	title = DES.0.t
	desc = DES.0.d

	is_triggered_only = yes

	option = { # YES
		log = "[GetLogInfo]: event DES.0 option DES.0.a"
		name = DES.0.a
		ai_chance = { base = 1 }
		add_ideas = RUS_DES_generic_military_mission
		activate_targeted_decision = { target = RUS decision = DES_PER_motorized_cossack_division }
		FROM = {
			country_event = DES.1
			army_experience = 30
			hidden_effect = {
				send_volunteers_to_TARGET = yes
			}
		}
	}

	option = { # NO
		log = "[GetLogInfo]: event DES.0 option DES.0.b"
		name = DES.0.b
		ai_chance = { base = 0 }
		FROM = {
			country_event = DES.2
		}
	}
}
country_event = { # Recipient accepts
	id = DES.1
	title = DES.1.t
	desc = DES.1.d

	is_triggered_only = yes

	option = { # Nice
		log = "[GetLogInfo]: event DES.1 option DES.1.a"
		name = DES.1.a
	}
}
country_event = { # Recipient declines
	id = DES.2
	title = DES.2.t
	desc = DES.2.d

	is_triggered_only = yes

	option = { # Ok
		log = "[GetLogInfo]: event DES.2 option DES.2.a"
		name = DES.2.a

	}
}

country_event = { # French Military Mission
	id = DES.3
	title = DES.3.t
	desc = DES.3.d

	is_triggered_only = yes

	option = { # YES
		log = "[GetLogInfo]: event DES.3 option DES.0.a"
		name = DES.0.a
		ai_chance = { base = 1 }
		add_ideas = FRA_DES_generic_military_mission
		add_popularity = { ideology = syndicalist popularity = 0.04 }
		activate_targeted_decision = { target = FRA decision = DES_EGY_new_marine_division }
		FROM = {
			country_event = DES.1
			army_experience = 30
			hidden_effect = {
				send_volunteers_to_TARGET = yes
			}
		}
	}

	option = { # NO
		log = "[GetLogInfo]: event DES.3 option DES.0.b"
		name = DES.0.b
		ai_chance = { base = 0 }
		FROM = {
			country_event = DES.2
		}
	}
}

country_event = { # German Military Mission
	id = DES.4
	title = DES.4.t
	desc = DES.4.d

	is_triggered_only = yes

	option = { # YES
		log = "[GetLogInfo]: event DES.4 option DES.0.a"
		name = DES.0.a
		ai_chance = { base = 1 }
		add_ideas = GER_DES_generic_military_mission
		FROM = {
			country_event = DES.1
			army_experience = 30
			hidden_effect = {
				send_volunteers_to_TARGET = yes
			}
		}
	}

	option = { # NO
		log = "[GetLogInfo]: event DES.4 option DES.0.b"
		name = DES.0.b
		ai_chance = { base = 0 }
		FROM = {
			country_event = DES.2
		}
	}
}


country_event = { # Begin Ashgabat Accord
	id = DES.5
	title = DES.5.t
	desc = DES.5.d
	picture = GFX_report_event_RUS_riders

	is_triggered_only = yes

	option = { # we choose diplomacy
		log = "[GetLogInfo]: event DES.5 option DES.5.a"
		name = DES.5.a
		ai_chance = { base = 1 }
		PER = {
			country_event = {
    				id = DES.6
    				days = 2
			}
		}
	}

	option = { # we choose war
		log = "[GetLogInfo]: event DES.5 option DES.5.b"
		name = DES.5.b
		ai_chance = { base = 0 }
		add_war_support = 0.05
	}
}

country_event = { # Propose Ashgabat Accord Iran Receive
	id = DES.6
	title = DES.6.t
	desc = DES.6.d
	picture = GFX_report_event_RUS_riders

	is_triggered_only = yes

	option = { # we also choose diplomacy
		log = "[GetLogInfo]: event DES.6 option DES.6.a"
		name = DES.6.a
		ai_chance = { base = 1 }
		RUS = {
			country_event = {
    				id = DES.7
    				days = 2
			}
		}
		custom_effect_tooltip = DES_ashgabat_tt
	}

	option = { # we also choose war
		log = "[GetLogInfo]: event DES.6 option DES.6.b"
		name = DES.6.b
		ai_chance = { base = 0 }
		add_war_support = 0.05
	}
}

country_event = { # Ashgabat Accord back to Russia
	id = DES.7
	title = DES.7.t
	desc = DES.7.d
	picture = GFX_report_event_RUS_riders

	is_triggered_only = yes

	option = { # deal
		log = "[GetLogInfo]: event DES.7 option DES.7.a"
		name = DES.7.a
		ai_chance = { base = 1 }
		activate_mission = DES_ashgabat_accord_mission
		custom_effect_tooltip = DES_ashgabat_tt
		activate_targeted_decision = { target = 418 decision = DES_tabriz_ashgabat_railroad }
		activate_targeted_decision = { target = 411 decision = DES_tehran_bandar_abbas_railroad }
	}

	option = { # no deal
		log = "[GetLogInfo]: event DES.7 option DES.7.b"
		name = DES.7.b
		ai_chance = { base = 0 }
		add_war_support = 0.05
	}
}

country_event = { # Ashgabat Secret Clause
	id = DES.8
	title = DES.8.t
	desc = DES.8.d
	picture = GFX_report_event_RUS_riders

	is_triggered_only = yes

	option = { # deal
		log = "[GetLogInfo]: event DES.8 option DES.8.a"
		name = DES.8.a
		ai_chance = { base = 1 }
		activate_targeted_decision = { target = 229 decision = DES_ashgabat_secret_clause }
	}

}

country_event = { # Mission to Istanbul
	id = DES.9
	title = DES.9.t
	desc = DES.9.d
	picture = GFX_OTT_Troops_Istanbul

	is_triggered_only = yes

	option = { # depart
		log = "[GetLogInfo]: event DES.9 option DES.9.a"
		name = DES.9.a
		ai_chance = { base = 1 }
		OTT = {
			country_event = {
    				id = DES.10
    				days = 2
			}
		}
	}

}

country_event = { # Mission to Istanbul - Ottoman side
	id = DES.10
	title = DES.10.t
	desc = DES.10.d
	picture = GFX_OTT_Troops_Istanbul

	is_triggered_only = yes

	option = { # let's make an offer
		log = "[GetLogInfo]: event DES.10 option DES.10.a"
		name = DES.10.a
		ai_chance = { base = 1 }
		GER = {
			country_event = {
    				id = DES.11
    				days = 2
			}
		}
	}

	option = { # no need to talk with the Germans
		log = "[GetLogInfo]: event DES.10 option DES.10.b"
		name = DES.10.b
		ai_chance = { base = 0 }
		GER = {
			country_event = {
    				id = DES.12
    				days = 2
			}
		}
	}

}

country_event = { # Ottoman Offer back to Germany
	id = DES.11
	title = DES.11.t
	desc = DES.11.d
	picture = GFX_OTT_Troops_Istanbul

	is_triggered_only = yes

	option = { # deal
		log = "[GetLogInfo]: event DES.11 option DES.11.a"
		name = DES.11.a
		ai_chance = { base = 1 }
		activate_mission = DES_baghdad_rail_mission
		activate_targeted_decision = { target = OTT decision = DES_combined_armoured_train_research }
		activate_targeted_decision = { target = 350 decision = DES_berlin_baghdad_renovate_railroad } 
		custom_effect_tooltip = DES_baghdad_tt
	}

	option = { # pass
		log = "[GetLogInfo]: event DES.11 option DES.11.b"
		name = DES.11.b
		ai_chance = { base = 0 }
	}
}

country_event = { # Ottoman says no
	id = DES.12
	title = DES.12.t
	desc = DES.12.d
	picture = GFX_OTT_Troops_Istanbul

	is_triggered_only = yes

	option = { # pity
		log = "[GetLogInfo]: event DES.12 option DES.12.a"
		name = DES.12.a
		ai_chance = { base = 1 }
	}
}

country_event = { # Diplomacy test event
	id = DES.13
	title = DES.13.t
	desc = DES.13.d

	is_triggered_only = yes

	option = { # Ok
		name = DES.13.a
		white_peace = OTT
		white_peace = AZR
		white_peace = OMA
		white_peace = LBA
		

	}
}

country_event = { # Diplomacy test event
	id = DES.14
	title = DES.13.t
	desc = DES.13.d

	is_triggered_only = yes

	option = { # Ok
		name = DES.13.a
		white_peace = EGY
		white_peace = IRQ
		white_peace = SYR
		white_peace = LBA
		white_peace = OMA
		white_peace = MOR
	}
}

country_event = { # Iran test event
	id = DES.15
	title = DES.13.t
	desc = DES.13.d

	is_triggered_only = yes

	option = { # Ok
		name = DES.13.a
		white_peace = EGY
		white_peace = IRQ
		white_peace = SYR
		white_peace = LBA
		white_peace = OMA
		white_peace = MOR
	}
}

country_event = { # Declaration of Persepolis
	id = DES.16
	title = DES.16.t
	desc = DES.16.d
	picture = GFX_event_DES_persepolis

	is_triggered_only = yes

	option = { # Ok
		name = DES.16.a

		hidden_effect = {
			news_event = {
    				id = DESnews.3
    				days = 1
			}
		}
	}
}

country_event = { # Invite to the Charter of Revival
	id = DES.17
	title = DES.17.t
	desc = DES.17.d
	picture = GFX_report_event_generic_diplomacy1

	is_triggered_only = yes

	option = { # yes
		name = DES.17.a
		ai_chance = { base = 1 }
		PER_add_to_sphere_effect = yes
		PER = {
			country_event = {
    				id = DES.18
    				days = 1
			}
		}
	}

	option = { # no
		name = DES.17.b
		ai_chance = { base = 0 }
		PER = {
			country_event = {
    				id = DES.19
    				days = 1
			}
		}
	}
}

country_event = { # They accepted
	id = DES.18
	title = DES.18.t
	desc = DES.18.d

	is_triggered_only = yes

	option = { # yes
		name = DES.18.a
		add_political_power = 25
	}

}

country_event = { # They refused
	id = DES.19
	title = DES.19.t
	desc = DES.19.d

	is_triggered_only = yes

	option = { # yes
		name = DES.19.a
		add_political_power = -10
	}

}

country_event = { # Invite to the Treaty of Persepolis
	id = DES.20
	title = DES.20.t
	desc = DES.20.d
	picture = GFX_report_event_generic_diplomacy1

	is_triggered_only = yes

	option = { # yes
		name = DES.20.a
		ai_chance = { 
			base = 10
			modifier = {
				factor = 0
				tag = AZR
				OR = {
					AZR = {  is_guaranteed_by = GER }
					GER = { has_completed_focus = GER_pax_germanica }
				}
			}
			modifier = {
				factor = 0
				tag = ARM
				FROM = { both_socialist_or_both_not_socialist = no }
			}
			modifier = {
				factor = 0
				tag = KDR
				PER = { owns_state = 819 }
			}
			modifier = {
				factor = 0
				tag = IRQ
				OR = {
					IRQ = { has_socialist_government = yes }
					IRQ = { is_guaranteed_by = EGY }
					IRQ = { has_completed_focus = IRQ_Bismarck_of_the_Arabs }
					IRQ = { 
						fighting_army_strength_ratio = {
    							tag = PER
    							ratio > 0.5
						}
					}
				}
			}
			modifier = {
				factor = 0
				OR = { 
					tag = SAU
					tag = JBS
				}
				owns_state = 679 #Mecca
				owns_state = 754
			}
			modifier = {
				factor = 0
				tag = SYR
			}
			modifier = {
				factor = 0
				tag = TUR
				OR = {
					TUR = { 
						owns_state = 344 #Adana
					}
					has_government = paternal_autocrat
				}
			}
		}
		effect_tooltip = {
			if = {
				limit = { is_faction_leader = yes }
				dismantle_faction = yes
				var:FROM.faction_leader = { add_to_faction = ROOT }
				every_other_country = {
					limit = {
						is_in_faction_with = ROOT
						is_subject = no
					}
					var:FROM.faction_leader = { add_to_faction = PREV }
				}
			}
			apply_faction_joining_effects = yes
		}
		leave_economic_sphere = yes
		PER_add_to_sphere_effect = yes
		if = {
			limit = {
				OR = {
					tag = SAU
					tag = JBS
				}
			}
			add_state_claim = 679 #Mecca
			add_state_claim = 754
		}
		PER = {
			country_event = {
    				id = DES.21
    				days = 1
			}
		}
	}

	option = { # no
		name = DES.20.b
		ai_chance = { 
			base = 0
			modifier = {
				add = 100
				tag = AZR
				OR = {
					AZR = { is_guaranteed_by = GER }
					GER = { has_completed_focus = GER_pax_germanica }
				}
			}
			modifier = {
				add = 100
				tag = ARM
				FROM = { both_socialist_or_both_not_socialist = no }
			}
			modifier = {
				add = 100
				tag = KDR
				PER = { owns_state = 819 }
			}
			modifier = {
				add = 100
				tag = IRQ
				OR = {
					IRQ = { has_socialist_government = yes }
					IRQ = { is_guaranteed_by = EGY }
					IRQ = { has_completed_focus = IRQ_Bismarck_of_the_Arabs }
					IRQ = { 
						fighting_army_strength_ratio = {
    							tag = PER
    							ratio > 0.5
						}
					}
				}
			}
			modifier = {
				add = 100
				OR = { 
					tag = SAU
					tag = JBS
				}
				owns_state = 679 #Mecca
				owns_state = 754
			}
			modifier = {
				add = 100
				tag = SYR
			}
			modifier = {
				add = 100
				tag = TUR
				TUR = { 
					owns_state = 344 #Adana
				}
			}
		}
		set_country_flag = PER_refused_charter_of_revival
		PER = {
			country_event = {
    				id = DES.22
    				days = 1
			}
		}
	}
}

country_event = { # They accepted
	id = DES.21
	title = DES.21.t
	desc = DES.21.d

	is_triggered_only = yes

	option = { # yes
		name = DES.21.a
		if = {
			limit = { FROM = { is_faction_leader = yes } }
			every_other_country = {
				limit = {
					is_in_faction_with = FROM
					is_subject = no
				}
				var:ROOT.faction_leader = { add_to_faction = PREV }
			}
		}
		faction_leader = { add_to_faction = FROM }
	}

}

country_event = { # They refused
	id = DES.22
	title = DES.22.t
	desc = DES.22.d

	is_triggered_only = yes

	option = { # yes
		name = DES.22.a
		add_opinion_modifier = {
			target = FROM
			modifier = KR_disapproves_of_govt
		}
		if = {
			limit = {
				has_non_aggression_pact_with = FROM
			}
			diplomatic_relation = {
    				country = FROM
    				relation = non_aggression_pact
    				active = no
			}
		}
	}

}

country_event = { # Dealing with Iraq
	id = DES.23
	title = DES.23.t
	desc = DES.23.d

	trigger = {
		tag = PER
		is_subject = no
		676 = { 
			is_owned_by = PER
			is_fully_controlled_by = PER
			is_claimed_by = PER
		}
		349 = { 
			is_owned_by = PER
			is_fully_controlled_by = PER
			is_claimed_by = PER
		}
		291 = { 
			is_owned_by = PER
			is_fully_controlled_by = PER
			is_claimed_by = PER
		}
		812 = { 
			is_owned_by = PER
			is_fully_controlled_by = PER
			is_claimed_by = PER
		}
		NOT = { country_exists = OTT }
		has_completed_focus = PER_deal_with_iraq
	}

	fire_only_once = yes
	immediate = {
		676 = { enable_state_integration_80_compliance = yes }
		349 = { enable_state_integration_80_compliance = yes }
		291 = { enable_state_integration_80_compliance = yes }
		812 = { enable_state_integration_80_compliance = yes }
	}

	option = { # autonomy
		name = DES.23.a
		ai_chance = { 
			base = 10
		}
		add_stability = -0.1
		add_political_power = -100
		676 = { #mosul
			add_resistance = 5
			add_compliance = 5
			add_dynamic_modifier = { modifier = PER_iraqi_autonomy_state_dyn }
		}
		349 = { #kirkuk
			add_resistance = 5
			add_compliance = 5
			add_dynamic_modifier = { modifier = PER_iraqi_autonomy_state_dyn }
		}
		if = {
			limit = { NOT = { has_idea = PER_shiite_solidarity_idea } }
			291 = { #baghdad
				add_resistance = 5
				add_compliance = 5
				add_dynamic_modifier = { modifier = PER_iraqi_autonomy_state_dyn }
			}
		}
		else_if = {
			limit = { has_idea = PER_shiite_solidarity_idea }
			custom_effect_tooltip = shiite_solidarity_land_because_tt
			291 = { enable_state_integration_50_compliance = yes } #quicker
		}
		if = {
			limit = { NOT = { has_idea = PER_shiite_solidarity_idea } }
			812 = { #basra
				add_resistance = 5
				add_compliance = 5
				add_dynamic_modifier = { modifier = PER_iraqi_autonomy_state_dyn }
			}
		}
		else_if = {
			limit = { has_idea = PER_shiite_solidarity_idea }
			812 = { enable_state_integration_50_compliance = yes } #quicker
		}
	}

	option = { # centralized rule
		name = DES.23.b
		ai_chance = { 
			base = 0
		}
		add_stability = -0.15
		add_political_power = -150
		676 = { #mosul
			add_resistance = 30
			add_compliance = -25
		}
		349 = { #kirkuk
			add_resistance = 30
			add_compliance = -25
		}
		291 = { #baghdad
			add_resistance = 25
			add_compliance = -20
		}
		812 = { #basra
			add_resistance = 25
			add_compliance = -20
		}
	}
}

country_event = { # Dealing with Kurd
	id = DES.24
	title = DES.24.t
	desc = DES.24.d


	trigger = {
		tag = PER
		is_subject = no
		owns_state = 352
		owns_state = 819
		owns_state = 417
		owns_state = 421
		NOT = { country_exists = OTT }
		has_completed_focus = PER_pacify_kurdistan
	}

	fire_only_once = yes

	immediate = {
		352 = { 
			enable_state_integration_80_compliance = yes 
			add_claim_by = PER
		}
		819 = { 
			enable_state_integration_80_compliance = yes
			add_claim_by = PER
		}
	}


	option = { # autonomy
		name = DES.24.a
		ai_chance = { 
			base = 1
		}
		add_stability = -0.1
		set_global_flag = PER_established_kurdish_autonomy
		if = {
			limit = { has_idea = PER_DES_kurdish_resistance }
			remove_ideas = PER_DES_kurdish_resistance
		}
		add_timed_idea = {
    			idea = PER_DES_fading_kurdish_resistance
    			days = 365
		}
		352 = {
			add_resistance = 5
			add_compliance = 5
			add_dynamic_modifier = { modifier = PER_kurdish_autonomy_state_dyn }
		}
		819 = {
			add_resistance = 5
			add_compliance = 5
			add_dynamic_modifier = { modifier = PER_kurdish_autonomy_state_dyn }
		}
		if = {
			limit = {
				350 = { 
					is_fully_controlled_by = PER 
					is_owned_by = PER
				}
			}
			350 = { #Diyarbakir
				add_resistance = 5
				add_compliance = 5
				add_dynamic_modifier = { modifier = PER_kurdish_autonomy_state_dyn }
				hidden_effect = { enable_state_integration_80_compliance = yes }
			}
		}
	}

	option = { # bigger autonomy
		name = DES.24.b
		ai_chance = { 
			base = 0
		}
		set_global_flag = PER_established_kurdish_autonomy
		if = {
			limit = { has_idea = PER_DES_kurdish_resistance }
			remove_ideas = PER_DES_kurdish_resistance
		}
		add_timed_idea = {
    			idea = PER_DES_fading_kurdish_resistance
    			days = 180
		}
		352 = {
			add_compliance = 15
			add_dynamic_modifier = { modifier = PER_kurdish_autonomy_state_dyn }
		}
		819 = {
			add_compliance = 15
			add_dynamic_modifier = { modifier = PER_kurdish_autonomy_state_dyn }
		}
		if = {
			limit = {
				350 = { 
					is_fully_controlled_by = PER 
					is_owned_by = PER
				}
			}
			350 = { #Diyarbakir
				add_compliance = 15
				add_dynamic_modifier = { modifier = PER_kurdish_autonomy_state_dyn }
				hidden_effect = { enable_state_integration_80_compliance = yes }
			}
		}
		417 = {
			add_dynamic_modifier = { modifier = PER_kurdish_autonomy_state_dyn }
		}
		421 = {
			add_dynamic_modifier = { modifier = PER_kurdish_autonomy_state_dyn }
		}
	}

	option = { # centralized rule
		name = DES.24.c
		ai_chance = { 
			base = 0
		}
		add_stability = -0.15
		if = {
			limit = { has_idea = PER_DES_kurdish_resistance }
			remove_ideas = PER_DES_kurdish_resistance
		}
		add_timed_idea = {
    			idea = PER_DES_heating_kurdish_resistance
    			days = 730
		}
		352 = {
			add_resistance = 30
			add_compliance = -15
		}
		819 = {
			add_resistance = 30
			add_compliance = -15
		}
		if = {
			limit = {
				350 = { 
					is_fully_controlled_by = PER 
					is_owned_by = PER
				}
			}
			350 = { #Diyarbakir
				add_resistance = 30
				add_compliance = -15
				hidden_effect = { enable_state_integration_80_compliance = yes }
			}
		}
	}
}

country_event = { # 
	id = DES.25
	title = DES.25.t
	desc = DES.25.d
	picture = GFX_report_event_ARM_landscape_mountain2

	trigger = {
		tag = PER
		is_subject = no
		owns_state = 352
		owns_state = 819
		owns_state = 417
		owns_state = 421
		NOT = { country_exists = OTT }
	}

	fire_only_once = yes

	immediate = {
		hidden_effect = {
			add_ideas = PER_DES_kurdish_resistance
			352 = {
				add_resistance = 30
				add_compliance = -15
			}
			819 = {
				add_resistance = 30
				add_compliance = -15
			}
			if = {
				limit = {
					350 = { 
						is_owned_by = PER
					}
				}
				350 = { #Diyarbakir
					add_resistance = 30
					add_compliance = -15
				}
			}
		}
	}

	option = { # oh no
		name = DES.25.a
		effect_tooltip = {
			add_ideas = PER_DES_kurdish_resistance
			352 = {
				add_resistance = 30
				add_compliance = -15
			}
			819 = {
				add_resistance = 30
				add_compliance = -15
			}
			if = {
				limit = {
					350 = { 
						is_owned_by = PER
					}
				}
				350 = { #Diyarbakir
					add_resistance = 30
					add_compliance = -15
				}
			}
		}
	}
}

country_event = { # Iran wants food
	id = DES.26
	title = DES.26.t
	desc = DES.26.d

	is_triggered_only = yes

	option = { # yes
		name = DES.26.a
		ai_chance = { base = 10 }
		add_ideas = PER_DES_food_import_RUS_side
		PER = { add_ideas = PER_DES_food_import_PER_side }
	}

	option = { # no
		name = DES.26.a
		ai_chance = { base = 0 }
	}
}

country_event = { # Iran no longer wants food
	id = DES.27
	title = DES.27.t
	desc = DES.27.d

	is_triggered_only = yes

	option = { # alas
		name = DES.27.a
		ai_chance = { base = 10 }
		effect_tooltip = {
			remove_ideas = PER_DES_food_import_RUS_side
			PER = { remove_ideas = PER_DES_food_import_PER_side }
		}
	}

}

country_event = { # Iran ending
	id = DES.28
	title = DES.28.t
	desc = DES.28.d
	picture = GFX_event_DES_oil_rig_sunrise

	is_triggered_only = yes

	option = { # and so it goes
		name = DES.28.a
		ai_chance = { base = 10 }
		custom_effect_tooltip = DES_PER_epilogue_tt
	}

}