add_namespace = arab_events

# Oman - Question of the brother
country_event = {
	id = arab_events.1
	title = arab_events.1.t
	desc = arab_events.1.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Demand Reduced Autonomy
		name = arab_events.1.a
		ZAN = {country_event = {id = arab_events.2}}

	}
	option = { ##Offer an Alliance
		name = arab_events.1.b
		ZAN = {country_event = {id = arab_events.3}}
	}
	option = { ##We afford to do do nothing
		name = arab_events.1.c
		set_country_flag = OMA_abanoned_colonial_empire
	}
}
country_event = {##ZAN - Oman demands we fall in line
	id = arab_events.2
	title = arab_events.2.t
	desc = arab_events.2.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Accept
		name = arab_events.2.a
		ai_chance = {
            factor = 40
        }
		set_country_flag = accepted_OMA_lordship
		OMA = {
			complete_national_focus = oma_vic_question_of_the_brother
			country_event = {id = arab_events.4}
		}
	}
	option = { ##Declare Independance
		name = arab_events.2.b
		ai_chance = {
            factor = 60
            modifier = {
                factor = 90
                is_historical_focus_on = yes
            }
        }
		OMA = {
			set_autonomy = {
				target = ZAN
				autonomy_state = autonomy_free
			}
			country_event = {id = arab_events.5}
		}
	}
}
country_event = {##ZAN - Oman offers an Alliance for our freedom
    id = arab_events.3
    title = arab_events.3.t
    desc = arab_events.3.d
    #picture = GFX_report_event_chinese_army_training
    is_triggered_only = yes
    
    option = { ##Accept
        name = arab_events.3.a
        ai_chance = {
            factor = 40
        }
        set_country_flag = accepted_OMA_alliance
        give_guarantee = FROM

        FROM = {
            set_autonomy = {
                target = ROOT
                autonomy_state = autonomy_free
            }
            give_guarantee = ROOT
            country_event = {id = arab_events.6}
        }
    }
    
    option = { ##Decline
        name = arab_events.3.b
        ai_chance = {
            factor = 60
        }
    }
}
country_event = {##OMA - ZAN falls in line
	id = arab_events.4
	title = arab_events.4.t
	desc = arab_events.4.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##ok
		name = arab_events.4.a
	}
}
country_event = { ##OMA - ZAN Declares Independance
    id = arab_events.5
    title = arab_events.5.t
    desc = arab_events.5.d
    is_triggered_only = yes
    
    option = { ##Bring them to Heel
        name = arab_events.5.a
        trigger = {
            has_manpower > 10000
            PS_pol_positive_null = yes
        }
        hidden_effect = {
            # First release Zanzibar
            set_autonomy = {
                target = ZAN
                autonomy_state = autonomy_free
            }
            # Then declare war
            declare_war_on = {
                target = FROM
                type = annex_everything
            }
            ZAN = { add_ideas = { ZAN_brothers_war } }
        }
        set_country_flag = OMA_brothers_war
    }
	option = { ##We don't have the power
		name = arab_events.5.b
		add_stability = -0.05
		set_autonomy = {
			target = ZAN
			autonomy_state = autonomy_free
		}
	}
	option = { ##bug
		name = arab_events.5.c
		trigger={
		ZAN={
			OR	= {
				has_country_flag = accepted_OMA_lordship
				has_country_flag = forced_under_OMA_lordship
			}
		}
		}
	}
}
country_event = {##OMA - ZAN accepts alliance
	id = arab_events.6
	title = arab_events.6.t
	desc = arab_events.6.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##ok
		name = arab_events.6.a
	}
}
country_event = {##ENG - OMA Declares Colonial Attention
	id = arab_events.7
	title = arab_events.7.t
	desc = arab_events.7.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##send warning
		name = arab_events.7.a
		trigger={
			has_completed_focus = ENG_focus_restore_peace_india
		}
		OMA={
			set_country_flag = OMA_warned_over_TCS
			country_event = {id = arab_events.8}
		}
	}
	option = { ##India Currently Conserns us more
		name = arab_events.7.b
		trigger={
			NOT = {has_completed_focus = ENG_focus_restore_peace_india}
		}
	}
}
country_event = {##OMA - ENG warns us to stay out of TCS
	id = arab_events.8
	title = arab_events.8.t
	desc = arab_events.8.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##ok
		name = arab_events.8.a
	}
}

country_event = {##OMA - policy towards Arabian Territory
	id = arab_events.9
	title = arab_events.9.t
	desc = arab_events.9.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Matain Claims
		name = arab_events.9.a
		add_state_claim = 1192
		add_state_claim = 1193
		add_state_claim = 1196
		add_state_claim = 658
	}
	option = { ##Demand return of TCS territories
		name = arab_events.9.b
		trigger = {
			NOT = {has_country_flag = OMA_warned_over_TCS}
		}
		add_state_claim = 1196
		add_state_core = 658
		add_state_claim = 1192
		add_state_claim = 1193
		ENG={country_event = {id = arab_events.10}}
	}
	option = { ##the TCS is lost to us
		name = arab_events.9.c
	}
}

country_event = {##ENG - OMA demands we hand over TCS
	id = arab_events.10
	title = arab_events.10.t
	desc = arab_events.10.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##No
		name = arab_events.10.a
		ai_chance = {
            factor = 90
			modifier = {
				factor = 0.9
				SRS = {exists = yes}
			}
        }
	}
	option = { ##Yes
		name = arab_events.10.b
		ai_chance = {
            factor = 10
			modifier = {
				factor = 2
				SRS = {exists = yes}
			}
			modifier = {
				factor = 2
				SRS = {
					AND={
						exists = yes
						has_war = no
					}
				}
			}
        }
		FROM={
			set_autonomy = {
				target = TCS
				autonomy_state = autonomy_colony
			}
			TCS={
				set_political_party = {
					ideology = autocracy
					popularity = 100
				}
			}
		}
	}
}
country_event = {##OMA - policy towards Persian Territory
	id = arab_events.11
	title = arab_events.11.t
	desc = arab_events.11.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Matain Claims
		name = arab_events.11.a
		add_state_claim = 795
	}
	option = { ##Demand return of Laristan territories
		name = arab_events.11.b
		add_state_core = 795
		PER={country_event = {id = arab_events.12}}
	}
	option = { ##Laristan is lost to us
		name = arab_events.11.c
	}
}

country_event = {##PER - OMA demands Laristan
	id = arab_events.12
	title = arab_events.12.t
	desc = arab_events.12.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##no
		name = arab_events.12.a
		ai_chance = {
            factor = 95
        }
	}
	option = { ##hand it over
		name = arab_events.12.b
		ai_chance = {
            factor = 5
        }
		FROM={transfer_state = 795}
	}
}
country_event = {##end of the OMA-ZAN war
	id = arab_events.13
	title = arab_events.13.t
	desc = arab_events.13.d
	#picture = GFX_report_event_chinese_army_training

	#is_triggered_only = yes
	#hidden = yes
	trigger={
		OMA={has_country_flag = OMA_brothers_war}
		tag = ZAN
		surrender_progress > 0.33
	}
	mean_time_to_happen = {
		days = 2
	}

	immediate = { ##ok
		OMA={
			increase_ps_by_two = yes
			clr_country_flag = OMA_brothers_war
			white_peace = ZAN
			white_peace = MOM
			set_autonomy = {
				target = ZAN
				autonomy_state = autonomy_colony
			}
			set_autonomy = {
				target = MOM
				autonomy_state = autonomy_colony
			}
			ZAN={
				set_country_flag = forced_under_OMA_lordship
				remove_ideas = {ZAN_brothers_war}
				set_political_party = {
					ideology = autocracy
					popularity = 100
				}
			}
			MOM={
				set_political_party = {
					ideology = autocracy
					popularity = 100
				}
			}
		}
	}
	option = { ##the war ends
		name = arab_events.13.a
		ai_chance = {
            factor = 100
        }
	}
}
country_event = {##Luguru Expedition
	id = arab_events.14
	title = arab_events.14.t
	desc = arab_events.14.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes
	#hidden = yes

	option = { ##move in
		name = arab_events.14.a
		trigger={
			904={
				owner ={
					is_ai = yes
					
				}
			}
			has_manpower > 199
		}
		transfer_state = 904
		add_manpower = -200

		ai_chance = {
            factor = 100
        }
	}
	option = { ##invade
		name = arab_events.14.b
		trigger={
			904={
				owner ={
					is_ai = yes
				}
			}
		}
		add_state_claim = 904
		904={
			owner = {
				ROOT={
					declare_war_on = {
						target = PREV
						type = annex_everything
					}
				}
			}
		}

		ai_chance = {
            factor = 100
        }
	}
}

country_event = {##OMA - enforce will on MAJ
	id = arab_events.18
	title = arab_events.18.t
	desc = arab_events.18.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	immediate={
		country_event ={id = arab_events.21 days = 25}
	}

	option = { ##Occupy
		name = arab_events.18.a
		ai_chance = {
            factor = 100
        }
		trigger={
			559={
				owner = {is_ai = yes}
			}
			has_manpower > 499
		}
		add_manpower = -500
		transfer_state = 559
	}
	option = { ##demand transfer of state
		name = arab_events.18.b
		ai_chance = {
            factor = 50
        }
		trigger={
			559={is_capital = no}
		}
		559={
			owner = {country_event ={id = arab_events.19}}
		}
	}
	option = { ##vassalise them
		name = arab_events.18.c
		ai_chance = {
            factor = 50
        }
		trigger={
			559={is_capital = yes}
		}
		559={
			if={
				limit={
					owner = {is_ai = yes}
				}
				owner={ROOT={puppet = PREV}}
			}
			else={
				owner = {country_event ={id = arab_events.20}}
			}
		}
	}
}

country_event = {##OMA demands submition
	id = arab_events.19
	title = arab_events.19.t
	desc = arab_events.19.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Accept
		name = arab_events.19.a
		FROM={puppet = ROOT}
	}
	option = { ##Decline
		name = arab_events.19.b
		trigger={
			has_political_power > 99
		}
		add_political_power = -100
	}
}

country_event = {##OMA demands vassalisation of 559(somalia)
	id = arab_events.20
	title = arab_events.20.t
	desc = arab_events.20.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Accept
		name = arab_events.20.a
		ai_chance = {
            factor = 80
        }
		PREV={transfer_state = 559}
	}
	option = { ##Decline
		name = arab_events.20.b
		ai_chance = {
            factor = 20
        }

	}
}

country_event = {
    id = arab_events.21
    title = arab_events.21.t
    desc = arab_events.21.d
    #picture = GFX_report_event_chinese_army_training
    is_triggered_only = yes

    #option = { ##Occupy
    #    name = arab_events.18.a
    #    ai_chance = {
    #        factor = 100
    #    }
    #    trigger={
    #        821={
    #            owner = {is_ai = yes}
    #        }
    #        has_manpower > 999
    #    }
    #    add_manpower = -1000
    #    transfer_state = 821
    #}

    option = { ##demand transfer of state
        name = arab_events.18.b
        ai_chance = {
            factor = 50
        }
        trigger = {
            821 = { is_capital = no }
        }
        821 = {
            owner = { country_event = { id = arab_events.22 } }
        }
    }

    option = { ##vassalise them
        name = arab_events.18.c
        ai_chance = {
            factor = 50
        }
        trigger = {
            821 = { is_capital = yes }
        }
        821 = {
            if = {
                limit = {
                    owner = { 
                        is_ai = yes
                        is_subject = no
                    }
                }
                owner = { ROOT = { puppet = PREV } }
            }
            else = {
                owner = { country_event = { id = arab_events.20 } }
            }
        }
        1165 = {
            if = {
                limit = {
                    owner = { 
                        is_ai = yes
                        is_subject = no
                    }
                }
                owner = { ROOT = { puppet = PREV } }
            }
            else = {
                owner = { country_event = { id = arab_events.20 } }
            }
        }
    }
}

country_event = {##OMA demands transfer of 821(somalia)
	id = arab_events.22
	title = arab_events.22.t
	desc = arab_events.22.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Accept
		name = arab_events.22.a
		ai_chance = {
            factor = 80
        }
		PREV={transfer_state = 821 transfer_state = 1165}
	}
	option = { ##Decline
		name = arab_events.20.b
		ai_chance = {
            factor = 20
        }

	}
}

country_event = {##OMA - our british policy
	id = arab_events.23
	title = arab_events.23.t
	desc = arab_events.23.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##friendly
		name = arab_events.23.a
		ai_chance = {
            factor = 60
        }
	}
	option = { ##neutral
		name = arab_events.23.b
		ai_chance = {
            factor = 30
        }
		diplomatic_relation = {
			country = ENG
			relation = military_access
			active = no
		}
	}
	option = { ##hostile
		name = arab_events.23.c
		ai_chance = {
            factor = 10
        }
		diplomatic_relation = {
			country = ENG
			relation = non_aggression_pact
			active = no
		}
		diplomatic_relation = {
			country = ENG
			relation = military_access
			active = no
		}
	}
}

country_event = {##OMA - modernisation
	id = arab_events.24
	title = arab_events.24.t
	desc = arab_events.24.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##aim for complete modernisation
		name = arab_events.24.a#starts a longer harder process, but the results bring the nation on par with the west, easier with the colonial tree
		ai_chance = {
            factor = 60
        }
		set_country_flag = OMA_western
		add_ideas = {
			OMA_agressive_modernisation
		}
	}
	option = { ##just intergrate the better ideas
		name = arab_events.24.b# shorter but with less benifits, better for a oman that can't hold onto ZAN
		ai_chance = {
            factor = 30
        }
		set_country_flag = OMA_western
		add_ideas = {
			OMA_modernisation
		}
	}
	option = { ##our ways are the best
		name = arab_events.24.c#going isolationist
		ai_chance = {
            factor = 10
        }
		add_stability = 0.05
		set_country_flag = OMA_isolation
	}
}

country_event = {
    id = arab_events.25
    title = arab_events.25.t
    desc = arab_events.25.desc
    is_triggered_only = yes
    
    option = {
        name = arab_events.25.a
        trigger = {
            has_stability > 0.1
            OR = {
                owns_state = 821
                owns_state = 559
                owns_state = 1165
            }
        }
        add_stability = -0.05
        ai_chance = { factor = 50 }
        SOM = {
            set_cosmetic_tag = SOM_OMA_colony
            transfer_state = 821
            821 = { add_core_of = PREV }
            transfer_state = 559
            559 = { add_core_of = PREV }
            transfer_state = 1165
            1165 = { add_core_of = PREV }
            OMA = {
                OMA_Ali_bin_Said_al-Said = {
                    add_corps_commander_role = {
                        skill = 1
                        attack_skill = 1
                        defense_skill = 1
                        planning_skill = 1
                        logistics_skill = 1
                    }
                    set_nationality = SOM
                }
            }
            OMA_Ali_bin_Said_al-Said = {
                add_country_leader_role = {
                    Promote_leader = yes
                    Country_leader = {
                        ideology = despotism
                        expire = "1893.1.1.1"
                        traits = { inexperienced_imperialist }
                    }
                }
                remove_unit_leader_role = yes
            }
        }
        set_autonomy = {
            target = SOM
            autonomy_state = autonomy_colony
        }
        SOM = {
            set_political_party = {
                ideology = autocracy
                popularity = 100
            }
        }
    }

    option = {
        name = arab_events.25.b
        ai_chance = { factor = 20 }
        trigger = {
            MAJ = { is_subject_of = ROOT }  # Fixed trigger
        }
        add_stability = -0.025
        set_autonomy = {
            target = MAJ
            autonomy_state = autonomy_colony
        }
        MAJ = {
            set_cosmetic_tag = SOM_OMA_colony
            set_political_party = {
                ideology = autocracy
                popularity = 100
            }
            if = {
                limit = {
                    NOT = { owns_state = 821 }
                    OR = {
                        GLD = {
                            is_subject_of = ROOT  # Fixed check
                            owns_state = 821
                        }
                        OMA = { owns_state = 821 }
                    }
                }
                if = {
                    limit = { GLD = { is_subject_of = ROOT } }  # Fixed check
                    add_to_variable = {
                        var = MAJ.Tribal_army_num
                        value = GLD.Tribal_army_num
                    }
                }
                transfer_state = 821
                add_state_core = 821
            }
            if = {
                limit = {
                    NOT = { owns_state = 1165 }
                    OR = {
                        GLD = {
                            is_subject_of = ROOT  # Fixed check
                            owns_state = 1165
                        }
                        OMA = { owns_state = 1165 }
                    }
                }
                if = {
                    limit = { GLD = { is_subject_of = ROOT } }  # Fixed check
                    add_to_variable = {
                        var = MAJ.Tribal_army_num
                        value = GLD.Tribal_army_num
                    }
                }
                transfer_state = 1165
                add_state_core = 1165
            }
        }
    }

    option = {
        name = arab_events.25.c
        ai_chance = { factor = 20 }
        trigger = {
            GLD = { is_subject_of = ROOT }  # Fixed trigger
        }
        add_stability = -0.025
        set_autonomy = {
            target = GLD
            autonomy_state = autonomy_colony
        }
        GLD = {
            set_cosmetic_tag = SOM_OMA_colony
            set_political_party = {
                ideology = autocracy
                popularity = 100
            }
            if = {
                limit = {
                    NOT = { owns_state = 559 }
                    OR = {
                        MAJ = {
                            is_subject_of = ROOT  # Fixed check
                            owns_state = 559
                        }
                        OMA = { owns_state = 559 }
                    }
                }
                if = {
                    limit = { MAJ = { is_subject_of = ROOT } }  # Fixed check
                    add_to_variable = {
                        var = GLD.Tribal_army_num
                        value = MAJ.Tribal_army_num
                    }
                }
                transfer_state = 559
                add_state_core = 559
            }
        }
    }

    option = {
        name = arab_events.25.d
        ai_chance = { factor = 10 }
        add_political_power = -100
        add_stability = 0.1
    }
}

country_event = {##TCS - OMA demands annexation
	id = arab_events.26
	title = arab_events.26.t
	desc = arab_events.26.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##No
		name = arab_events.26.a
		ai_chance = {
            factor = 90
        }
	}
	option = { ##Yes
		name = arab_events.26.b
		ai_chance = {
            factor = 10
        }
		FROM={
			set_autonomy = {
				target = TCS
				autonomy_state = autonomy_colony
			}
			TCS={
				set_political_party = {
					ideology = autocracy
					popularity = 100
				}
			}
		}
		OVERLORD={
			country_event ={id = arab_events.20}#inform about TCS submition
		}
	}
}

country_event = {##OMA - a choice of india
	id = arab_events.27
	title = arab_events.27.t
	desc = arab_events.27.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Sepoys
		name = arab_events.27.a
		ai_chance = {
            factor = 50
        }
		SRS={
			country_event ={id = arab_events.28}
		}
	}
	option = { ##raj
		name = arab_events.27.b
		ai_chance = {
            factor = 50
        }
		RAJ={
			country_event ={id = arab_events.28}
		}
	}
}
country_event = {##India - OMA offers cheaper trade
	id = arab_events.28
	title = arab_events.28.t
	desc = arab_events.28.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##agreed
		name = arab_events.26.a
		ai_chance = {
            factor = 95
        }
		OMA={
			add_ideas={
				OMA_indian_oman_trade
			}
		}
		add_ideas={
			OMA_oman_indian_trade
		}
	}
	option = { ##no
		name = arab_events.26.b
		ai_chance = {
            factor = 5
        }
	}
}
country_event = {##OMA - Finalise foreign policy
	id = arab_events.29
	title = arab_events.29.t
	desc = arab_events.29.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Influencal[going full modernisation plus still has colonial empire]
		name = arab_events.29.a
		ai_chance = {
            factor = 95
        }
		trigger={
			ZAN = {has_country_flag = accepted_OMA_lordship}
			has_idea = OMA_agressive_modernisation
		}
		set_country_flag = OMA_Colonial_cadidate
		add_political_power = 75
	}
	option = { ##increase our trade
		name = arab_events.29.b
		ai_chance = {
            factor = 5
        }
		add_ideas = {
			export_focus
		}
	}
	option = { ##remain a trading nation
		name = arab_events.29.c
		ai_chance = {
            factor = 5
        }
		add_stability = 0.025
	}
	option = { ##cut ourselves off
		name = arab_events.29.e
		ai_chance = {
            factor = 5
        }
		add_ideas = {
			closed_economy
		}
		add_stability = 0.05
	}
}
country_event = {###ZAN - OMA tribute is due
	id = arab_events.30
	title = arab_events.30.t
	desc = arab_events.30.d
	picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes
	# trigger = {
		# is_subject_of = OMA
		# tag = ZAN
		# NOT = {
			# has_country_flag = accepted_OMA_lordship
		# }
		# NOT={has_idea = ZAN_OMAtribute}
		# OMA={
			# NOT={
				# has_completed_focus = oma_vic_reign_ZAN_in
			# }
		# }
	# }
	# mean_time_to_happen = {
		# days = 360
	# }

	option = {#pay
		name = arab_events.30.a
		add_timed_idea = {
			idea = ZAN_OMAtribute
			days = 30
		}
		ai_chance = {
            factor = 10
        }
	}
	option = {#break free
		name = arab_events.30.b
		ai_chance = {
            factor = 90
        }
		trigger = {
			NOT = {
				has_country_flag = accepted_OMA_lordship
				has_country_flag = forced_under_OMA_lordship
			}
		}
		OMA = {country_event = {id = arab_events.5}}
	}
}

country_event = {##OMA demands annexation of MAH
	id = arab_events.31
	title = arab_events.31.t
	desc = arab_events.31.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Accept
		name = arab_events.31.a
		ai_chance = {
            factor = 80
        }
		OMA={
			transfer_state = 1196
			add_state_core = 1196
		}
		hidden_effect={#ENG is threatened, goes after the other hadhramaut states
			ENG = {country_event ={id = arab_events.73 days = 720}}
		}
	}
	option = { ##Decline
		name = arab_events.31.b
		ai_chance = {
            factor = 20
        }
		OMA={country_event = {id = arab_events.35}}
	}
}
country_event = {##OMA intervention into MAH
	id = arab_events.32
	title = arab_events.32.t
	desc = arab_events.32.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##use diplomatic means
		name = arab_events.32.a
		ai_chance = {
            factor = 80
        }
		add_political_power = -20
		MAH = {country_event = {id = arab_events.31 days = 3}}
	}
	option = { ##use military means
		name = arab_events.32.b
		ai_chance = {
            factor = 20
        }
		start_border_war = {
			change_state_after_war = no
			attacker = {
				state = 294
				num_provinces = 1
				on_win = arab_events.33
				on_lose = arab_events.34
			}

			defender = {
				state = 1196
				num_provinces = 1
				on_win = arab_events.34
				on_lose = arab_events.33
			}
		}
		hidden_effect={
			set_border_war_data = {
				attacker = 294
				defender = 1196
				combat_width = 15
			}
		}
	}
}
country_event = {##OMA wins vs MAH
	id = arab_events.33
	title = arab_events.33.t
	desc = arab_events.33.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##great
		name = arab_events.33.a
		ai_chance = {
            factor = 80
        }
		OMA={
			transfer_state = 1196
			add_state_core = 1196
		}
		hidden_effect={#ENG is threatened, goes after the other hadhramaut states
			ENG = {country_event ={id = arab_events.73 days = 720}}
		}
	}
}
country_event = {##MAH wins vs OMA
	id = arab_events.34
	title = arab_events.34.t
	desc = {
		text = arab_events.34.d
		trigger={tag = OMA}
	}
	desc = {
		text = arab_events.34.da
		trigger = {NOT ={tag = OMA}}
	}
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes


	option = { ##Accept
		name = arab_events.34.a
		trigger={tag = OMA}
		add_stability = -0.05
		add_political_power = -50
		set_country_flag = OMA_lost_MAH_war
	}
	option = { ##Accept
		name = arab_events.34.b
		ai_chance = {
            factor = 80
        }
		trigger={
			tag = MAH
		}
		ENG = {country_event = {id = arab_events.43 days = 3}}
	}
	option = { ##Accept
		name = arab_events.34.c
		ai_chance = {
            factor = 20
        }
		trigger={
			tag = MAH
		}
	}
}
country_event = {##MAH refuses
	id = arab_events.35
	title = arab_events.35.t
	desc = arab_events.35.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##invade
		name = arab_events.35.b
		ai_chance = {
            factor = 70
        }
		add_stability = -0.05
		start_border_war = {
			change_state_after_war = no
			attacker = {
				state = 294
				num_provinces = 1
				on_win = arab_events.33
				on_lose = arab_events.34
			}

			defender = {
				state = 1196
				num_provinces = 1
				on_win = arab_events.34
				on_lose = arab_events.33
			}
		}
		set_border_war_data = {
			attacker = 294
			defender = 1196
			combat_width = 15
		}
	}
	option = { ##continue to work on MAH
		name = arab_events.35.b
		ai_chance = {
            factor = 30
        }
	}
}
country_event = {##MAH - Aden offer protection
	id = arab_events.36
	title = arab_events.36.t
	desc = arab_events.36.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Accept
		name = arab_events.36.a
		ai_chance = {
            factor = 100
        }
		ENG={
			puppet = ROOT
			country_event={id = arab_events.38}
		}
	}
	option = { ##refuse
		name = arab_events.36.b
		ai_chance = {
            factor = 0
        }
	}
}
country_event = {##ENG - expansion into Hadhramaut
	id = arab_events.37
	title = arab_events.37.t
	desc = arab_events.37.d
	#picture = GFX_report_event_chinese_army_training

	#is_triggered_only = yes
	trigger={
		date > 1862.01.01
		date < 1870.01.01
		MAH = {
			exists = yes
			is_subject = no
		}
		tag = ENG
	}
	mean_time_to_happen={
		days = 60
	}

	option = { ##agreed, send a delegation to MAH
		name = arab_events.37.a
		ai_chance = {
            factor = 100
        }
		MAH = {
			country_event={id = arab_events.36 days = 2}
		}
	}
	option = { ##refuse
		name = arab_events.37.b
		ai_chance = {
            factor = 0
        }
	}
}
country_event = {##ENG - MAH agrees
	id = arab_events.38
	title = arab_events.38.t
	desc = arab_events.38.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##great
		name = arab_events.38.a
	}
}
country_event = {##ENG - establish control of Hadhramaut
	id = arab_events.39
	title = arab_events.39.t
	desc = arab_events.39.d
	#picture = GFX_report_event_chinese_army_training

	#is_triggered_only = yes
	trigger={
		date > 1886.01.01
		date < 1895.01.01
		tag = ENG
		OR={
			MAH = {is_subject_of = ENG}
			owns_state = 1196
		}
	}
	mean_time_to_happen={
		days = 60
	}

	option = { ##agreed, sign the deal
		name = arab_events.39.a
		ai_chance = {
            factor = 100
        }
		annex_country = { target = MAH transfer_troops = yes }
		add_state_core = 1196
		hidden_effect ={country_event={id = arab_events.40 days = 720}}
	}
	option = { ##refuse
		name = arab_events.39.b
		ai_chance = {
            factor = 0
        }
	}
}
country_event = {##ENG - finish control over Hadhramaut
	id = arab_events.40
	title = arab_events.40.t
	desc = arab_events.40.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##send the envoys
		name = arab_events.40.a
		ai_chance = {
            factor = 100
        }
		QUA={country_event={id = arab_events.41 days = 2}}
		KAT={country_event={id = arab_events.41 days = 2}}
	}
	option = { ##refuse
		name = arab_events.40.b
		ai_chance = {
            factor = 0
        }
	}
}
country_event = {##QUA/KAT - Aden offer integration
	id = arab_events.41
	title = arab_events.41.t
	desc = arab_events.41.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Accept
		name = arab_events.41.a
		ai_chance = {
            factor = 100
        }
		FROM={
			annex_country = { target = ROOT transfer_troops = yes }
			country_event={id = arab_events.42 days = 2}
		}
	}
	option = { ##refuse
		name = arab_events.41.b
		ai_chance = {
            factor = 0
        }
	}
}
country_event = {##ENG - QUA/KAT accept
	id = arab_events.42
	title = arab_events.42.t
	desc = arab_events.42.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Accept
		name = arab_events.42.a
		ai_chance = {
            factor = 100
        }
	}
}
country_event = {##ENG - MAH has offered to submit
	id = arab_events.43
	title = arab_events.43.t
	desc = arab_events.43.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##great
		name = arab_events.43.a
		puppet = FROM
	}
}
country_event = {##OMA - death of Thuwaini
	id = arab_events.44
	title = arab_events.44.t
	desc = arab_events.44.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	trigger={
		tag=OMA
		date>1866.04.01
		date<1872.01.01
		has_country_leader = {
			name = "Thuwaini bin Said"
			ruling_only = yes
		}
	}
	mean_time_to_happen={
		days = 100
	}

	immediate={
		OMA_Salim_bin_Thuwaini={
			add_country_leader_role = {
				Promote_leader = yes
				Country_leader = {
					ideology = despotism
					expire = "1898.9.19.1"
				}
			}
		}
		retire_character = OMA_Thuwaini_bin_Said
		complete_national_focus = oma_vic_death_of_thuwaini
	}

	option = { ##long live Salim
		name = arab_events.44.a
		hidden_effect={
			if={
				limit={
					OR={
						has_idea = OMA_oman_muskat_divide
						has_idea = OMA_oman_muskat_divide_2
						has_idea = OMA_oman_muskat_divide_3
						has_idea = OMA_oman_muskat_divide_4
						has_idea = OMA_oman_muskat_divide_5
						has_idea = OMA_increasing_oman_muskat_divide
					}
				}
				set_variable = {OMA_salims_side = 2}
				if={
					limit={
						has_idea = OMA_oman_muskat_divide
					}
					set_variable = {OMA_azzans_side = 1}
				}
				else_if={
					limit={
						has_idea = OMA_oman_muskat_divide_2
					}
					set_variable = {OMA_azzans_side = 2}
				}
				else_if={
					limit={
						has_idea = OMA_oman_muskat_divide_3
					}
					set_variable = {OMA_azzans_side = 3}
				}
				else_if={
					limit={
						has_idea = OMA_oman_muskat_divide_4
					}
					set_variable = {OMA_azzans_side = 4}
				}
				else_if={
					limit={
						has_idea = OMA_oman_muskat_divide_5
					}
					set_variable = {OMA_azzans_side = 5}
				}
				else_if={
					limit={
						has_idea = OMA_increasing_oman_muskat_divide
					}
					set_variable = {OMA_azzans_side = 6}
				}
				country_event = {id = arab_events.45 days = 100 random = 110}
			}
			else={

			}
		}
	}
}
country_event = {##OMA - Imamate of Oman Disputed
	id = arab_events.45
	title = arab_events.45.t
	desc = arab_events.45.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes
	immediate={
		hidden_effect={
			797={
				set_demilitarized_zone = yes
			}
			add_popularity = {
				ideology = fundamentalism
				popularity = 0.15
			}
		}
	}

	option = { ##Reconize Azzam
		name = arab_events.45.a
		random_list={
			75={
				custom_effect_tooltip = Azzan_marches_east
				hidden_effect={
					country_event = {id = arab_events.46 days = 30 random = 60}
					set_country_flag=Azzan_marches_east
					add_ideas={OMA_tribal_ibadhi_fanaticism}
				}
			}
			25={
				custom_effect_tooltip = Azzan_accepts_deal
				hidden_effect={
					country_event = {id = arab_events.46 days = 30 random = 60}
					set_country_flag=Azzan_accepts_deal
				}
			}
		}
	}
	option = { ##fight for Salim
		name = arab_events.45.b
		country_event = {id = arab_events.47 days = 30 random = 60}
		set_country_flag=Azzan_marches_east
		add_ideas={OMA_tribal_ibadhi_fanaticism}
		add_manpower=-2000
	}
}
country_event = {##OMA - Azzans reply
	id = arab_events.46
	title = arab_events.46.t
	desc = {
		trigger={
			has_country_flag=Azzan_marches_east
		}
		text = arab_events.46.d
	}
	desc = {
		trigger={
			has_country_flag=Azzan_accepts_deal
		}
		text = arab_events.46.da
	}
	desc = {
		trigger={
			NOT={
				has_country_flag=Azzan_marches_east
				has_country_flag=Azzan_accepts_deal
			}
		}
		text = arab_events.46.db
	}
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##damn
		name = arab_events.46.a
		trigger={
			has_country_flag=Azzan_marches_east
		}
		country_event={id=arab_events.47}
	}
	option = { ##great
		name = arab_events.46.b
		trigger={
			has_country_flag=Azzan_accepts_deal

		}
		unlock_national_focus = oma_vic_the_imam_and_the_sultan
		797={set_demilitarized_zone = no}
	}
}
country_event = {##OMA - Azzan marches east WIP
	id = arab_events.47
	title = arab_events.47.t
	desc = arab_events.47.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##the results of this are based on focuses taken
		name = arab_events.47.a
		OMA_muscat_and_oman_divide_increase_3 = yes
		country_event ={id= arab_events.70 days = 10}
	}
}

country_event = {##OMA - foreign interests
	id = arab_events.48
	title = arab_events.48.t
	desc = arab_events.48.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##woo Britain
		name = arab_events.48.a
		ENG={
			country_event={id = arab_events.49}
		}
		ai_chance = {
            factor = 75
            modifier = {
                factor = 100
                is_historical_focus_on = yes
            }
        }
	}
	option = { ##woo France
		name = arab_events.48.b
		FRA={
			country_event={id = arab_events.49}
		}
		ai_chance = {
            factor = 25
        }
	}
}

country_event = {##ENG/FRA - Omani Envoys
	id = arab_events.49
	title = arab_events.49.t
	desc = {
		text = arab_events.49.d
		trigger={tag = ENG}
	}
	desc = {
		text = arab_events.49.da
		trigger={tag = FRA}
	}
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##agree to assist for the offered deal
		name = arab_events.49.a
		FROM={
			add_to_variable={ OMA_salims_side = 3}
		}
		if={
			limit={
				tag = FRA
			}
			FROM={add_ideas={OMA_trade_consessions_to_FRA}}
		}
		else={
			FROM={add_ideas={OMA_trade_consessions_to_ENG}}
		}
	}
	option = { ##agree to assist for more
		name = arab_events.49.b
		FROM={
			add_to_variable={ OMA_salims_side = 2}
			add_political_power = -50
		}
		if={
			limit={
				tag = FRA
			}
			FROM={add_ideas={OMA_trade_consessions_to_FRA_2}}
		}
		else={
			FROM={add_ideas={OMA_trade_consessions_to_ENG_2}}
		}
	}
	option = { ##ignore them
		name = arab_events.49.c

	}
}

country_event = {##OMA - expansion of the muscat garrison
	id = arab_events.50
	title = arab_events.50.t
	desc = arab_events.50.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Spend a lot
		name = arab_events.50.a
		add_manpower=-1000
		add_political_power=-25
		add_to_variable={ OMA_salims_side = 2}
		294={
			add_building_construction = {
				type = bunker
				level = 2
				instant_build = yes
				province = 10760
			}
		}

	}
	option = { ##Spend a bit
		name = arab_events.50.b
		add_manpower=-500
		add_political_power=-10
		add_to_variable={ OMA_salims_side = 1}
		294={
			add_building_construction = {
				type = bunker
				level = 1
				instant_build = yes
				province = 10760
			}
		}
	}
	option = { ##Spend little
		name = arab_events.50.c
		add_political_power=-5

	}
}

country_event = {##JSH - Battle of Mulayda begins
	id = arab_events.51
	title = arab_events.51.t
	desc = arab_events.51.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = JSH
		#date>1891.01.20
		NJD={exists = yes}
	}

	option = { ##attack
		name = arab_events.51.a
		start_border_war = {
			change_state_after_war = yes
			attacker = {
				state = 292
				num_provinces = 4
				on_win = arab_events.52
				on_lose = arab_events.53
				on_cancel = arab_events.54
			}

			defender = {
				state = 916
				num_provinces = 4
				on_win = arab_events.53
				on_lose = arab_events.52
				on_cancel = arab_events.52
			}
		}
		ai_chance = {
            factor = 75
            modifier = {
                factor = 100
                is_historical_focus_on = yes
            }
        }

	}
	option = { ##back down
		name = arab_events.51.b
		add_political_power=-5
		ai_chance = {
            factor = 25
            modifier = {
                factor = 0
                is_historical_focus_on = yes
            }
        }
	}
}
country_event = {##NJD/JSH - rasids win
	id = arab_events.52
	title = arab_events.52.t
	desc = arab_events.52.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##ok
		name = arab_events.52.a
	}
}
country_event = {##NJD/JSH - sauds win
	id = arab_events.53
	title = arab_events.53.t
	desc = arab_events.53.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##ok
		name = arab_events.53.a
	}
}
country_event = {##NJD/JSH - should not happen, but here in case
	id = arab_events.54
	title = arab_events.54.t
	desc = arab_events.54.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##ok
		name = arab_events.54.a
	}
}
###Nejd's musical chairs
country_event = {##NJD - Abdallah ibn Faisal ibn Turki takes over
	id = arab_events.55
	title = arab_events.55.t
	desc = arab_events.55.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = NJD
		#date>1865.4.1
		has_country_leader = {
			name = "Faisal bin Turki bin Abdullah Al Saud"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.55.a
		NJD_Abdallah_ibn_Faisal_ibn_Turki_Al_Saud = {
			add_country_leader_role = {
				Promote_leader = yes
				Country_leader = {
					ideology = despotism
					expire = "1900.1.1.1"
				}
			}
		}
	}
}
country_event = {##NJD - Saud bin Faisal bin Turki takes over
	id = arab_events.56
	title = arab_events.56.t
	desc = arab_events.56.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = NJD
		#date>1871.2.1
		has_country_leader = {
			name = "Abdallah ibn Faisal ibn Turki Al Saud"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.56.a
		NJD_Saud_bin_Faisal_ibn_Turki_Al_Saud = {
			add_country_leader_role = {
				Promote_leader = yes
				Country_leader = {
					ideology = despotism
					expire = "1875.1.1.1"
				}
			}
		}
		NJD_Abdallah_ibn_Faisal_ibn_Turki_Al_Saud={
			remove_country_leader_role = {
			  ideology = despotism
			}
		}
	}
}
country_event = {##NJD - Abdallah ibn Faisal ibn Turki takes over again
	id = arab_events.57
	title = arab_events.57.t
	desc = arab_events.57.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = NJD
		#date>1871.11.1
		has_country_leader = {
			name = "Saud bin Faisal bin Turki Al Saud"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.57.a
		NJD_Abdallah_ibn_Faisal_ibn_Turki_Al_Saud = {
			add_country_leader_role = {
				Promote_leader = yes
				Country_leader = {
					ideology = despotism
					expire = "1875.1.1.1"
				}
			}
		}
		NJD_Saud_bin_Faisal_ibn_Turki_Al_Saud ={
			remove_country_leader_role = {
			  ideology = despotism
			}
		}
	}
}
country_event = {##NJD - Saud bin Faisal bin Turki Al Saud takes over again
	id = arab_events.58
	title = arab_events.58.t
	desc = arab_events.58.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = NJD
		#date>1873.5.20
		has_country_leader = {
			name = "Abdallah ibn Faisal ibn Turki Al Saud"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.58.a
		NJD_Saud_bin_Faisal_ibn_Turki_Al_Saud = {
			add_country_leader_role = {
				Promote_leader = yes
				Country_leader = {
					ideology = despotism
					expire = "1875.1.1.1"
				}
			}
		}
		NJD_Abdallah_ibn_Faisal_ibn_Turki_Al_Saud={
			remove_country_leader_role = {
			  ideology = despotism
			}
		}
	}
}
country_event = {##NJD - Saud bin Faisal bin Turki Al Saud dies, Abdul Rahman bin Faisal takes over
	id = arab_events.59
	title = arab_events.59.t
	desc = arab_events.59.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = NJD
		#date>1875.1.1
		has_country_leader = {
			name = "Saud bin Faisal bin Turki Al Saud"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.59.a
		retire_character =  NJD_Saud_bin_Faisal_ibn_Turki_Al_Saud
		NJD_Abdul_Rahman_bin_Faisal_Al_Saud = {
			add_country_leader_role = {
				Promote_leader = yes
				Country_leader = {
					ideology = despotism
					expire = "1928.1.1.1"
				}
			}
		}
	}
}
country_event = {##NJD - Abdallah ibn Faisal ibn Turki takes over yet again
	id = arab_events.60
	title = arab_events.60.t
	desc = arab_events.60.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = NJD
		#date>1876.1.1
		has_country_leader = {
			name = "Abdul Rahman bin Faisal Al Saud"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.60.a
		NJD_Abdallah_ibn_Faisal_ibn_Turki_Al_Saud = {
			add_country_leader_role = {
				Promote_leader = yes
				Country_leader = {
					ideology = despotism
					expire = "1900.1.1.1"
				}
			}
		}
		NJD_Abdul_Rahman_bin_Faisal_Al_Saud ={
			remove_country_leader_role = {
			  ideology = despotism
			}
		}
	}
}
country_event = {##NJD - Abdul Rahman bin Faisal strikes back
	id = arab_events.61
	title = arab_events.61.t
	desc = arab_events.61.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = NJD
		#date>1889.1.1
		has_country_leader = {
			name = "Abdallah ibn Faisal ibn Turki Al Saud"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.61.a
		retire_character =  NJD_Abdallah_ibn_Faisal_ibn_Turki_Al_Saud
		NJD_Abdul_Rahman_bin_Faisal_Al_Saud = {
			add_country_leader_role = {
				Promote_leader = yes
				Country_leader = {
					ideology = despotism
					expire = "1928.1.1.1"
				}
			}
		}
	}
}
country_event = {##NJD - resurgence of Al Saud
	id = arab_events.62
	title = arab_events.62.t
	desc = arab_events.62.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = NJD
		#date>1902.1.13
	}

	option = { ##ok
		name = arab_events.62.a
		if={
			limit={
				NOT={
					owns_state = 916
				}
			}
			transfer_state = 916
			add_manpower = 10000
				drop_cosmetic_tag = yes
		JSH={country_event={id=arab_events.63}}
		}
		retire_character =  NJD_Abdallah_ibn_Faisal_ibn_Turki_Al_Saud
		NJD_ibn_saud= {
			add_country_leader_role = {
				Promote_leader = yes
				Country_leader = {
					ideology = despotism
					expire = "1953.11.9.1"
				}
			}
		}
	}
}
country_event = {##JSH - sauds retake Riyadh
	id = arab_events.63
	title = arab_events.63.t
	desc = arab_events.63.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##ok
		name = arab_events.63.a
	}
}
###jabal Shammar's musical chairs
country_event = {##JSH - Mutʿib I bin ʿAbdullah takes over
	id = arab_events.64
	title = arab_events.64.t
	desc = arab_events.64.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = JSH
		#date>1868.3.15
		has_country_leader = {
			name = "Talal bin 'Abdullah"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.64.a
		create_country_leader = {
			name = "Mutʿib I bin ʿAbdullah"
			desc = "POLITICS_TEMP_DESC"
			picture = "Portrait_JSH_Mut_ib_I_bin_Abdullah.dds"
			expire = 1900.1.1
			ideology = despotism
		}
	}
}
country_event = {##JSH - Bandar ben Talal al-Rachid takes over
	id = arab_events.65
	title = arab_events.65.t
	desc = arab_events.65.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = JSH
		#date>1869.2.14
		has_country_leader = {
			name = "Mutʿib I bin ʿAbdullah"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.65.a
		create_country_leader = {
			name = "Bandar ben Talal al-Rachid"
			desc = "POLITICS_TEMP_DESC"
			picture = "Portrait_JSH_Bandar_ben_Talal_al-Rachid.dds"
			expire = 1900.1.1
			ideology = despotism
		}
	}
}
country_event = {##JSH - Muhammad I bin 'Abdullah takes over
	id = arab_events.66
	title = arab_events.66.t
	desc = arab_events.66.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = JSH
		#date>1869.10.2
		has_country_leader = {
			name = "Bandar ben Talal al-Rachid"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.66.a
		create_country_leader = {
			name = "Muhammad I bin 'Abdullah"
			desc = "POLITICS_TEMP_DESC"
			picture = "Portrait_JSH_Muhammad_I_bin_Abdullah.dds"
			expire = 1900.1.1
			ideology = despotism
		}
	}
}
country_event = {##JSH - ʿAbd al-ʿAzīz bin Mutʿib takes over
	id = arab_events.67
	title = arab_events.67.t
	desc = arab_events.67.d
	#picture = GFX_report_event_chinese_army_training

	fire_only_once = yes
	is_triggered_only = yes
	trigger={
		tag = JSH
		#date>1897.6.8
		has_country_leader = {
			name = "Muhammad I bin 'Abdullah"
			ruling_only = yes
		}
	}

	option = { ##ok
		name = arab_events.67.a
		create_country_leader = {
			name = "ʿAbd al-ʿAzīz bin Mutʿib"
			desc = "POLITICS_TEMP_DESC"
			picture = "Portrait_JSH_Abd_al-Aziz_bin_Mut_ib.dds"
			expire = 1920.1.1
			ideology = despotism
		}
	}
}
country_event = {##OMA - Gaining the support of Hinawi
	id = arab_events.68
	title = arab_events.68.t
	desc = arab_events.68.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Offer them a place in the government
		name = arab_events.68.a
		random_list = {
			44 = {#agreed
				modifier = {
					factor = 0.5
					has_idea = OMA_ghafiri_in_government
				}
				custom_effect_tooltip = OMA_Hinawi_gives_support
				add_to_variable={ OMA_salims_side = 4}
				add_ideas = {OMA_hinawi_in_government}
			}
			56 = {#refuses
				custom_effect_tooltip = OMA_Hinawi_backs_azzan
				add_to_variable={ OMA_azzans_side = 5}
			}
		}
	}
	option = { ##Give Them gifts of wealth
		name = arab_events.68.b
		add_timed_idea={days = 200 idea = OMA_paying_the_hinawi}
		random_list = {
			33 = {#agreed
				modifier = {
					factor = 0.5
					has_idea = OMA_ghafiri_in_government
				}
				custom_effect_tooltip = OMA_Hinwai_gives_support
				add_to_variable={ OMA_salims_side = 4}
			}
			67 = {#refuses
				custom_effect_tooltip = OMA_Hinwai_backs_azzan
				add_to_variable={ OMA_azzans_side = 5}
			}
		}
	}
	option = { ##Give Them gifts of power
		name = arab_events.68.c
		trigger={
			has_political_power > 49
		}
		add_political_power = -50
		random_list = {
			33 = {#agreed
				modifier = {
					factor = 0.5
					has_idea = OMA_ghafiri_in_government
				}
				custom_effect_tooltip = OMA_Hinwai_gives_support
				add_to_variable={ OMA_salims_side = 4}
			}
			67 = {#refuses
				custom_effect_tooltip = OMA_Hinwai_backs_azzan
				add_to_variable={ OMA_azzans_side = 5}
			}
		}
	}
	option = { ##Threaten them
		name = arab_events.68.e
		random_list = {
			15 = {#agreed
				modifier = {
					factor = 0.5
					has_idea = OMA_ghafiri_in_government
				}
				custom_effect_tooltip = OMA_Hinwai_gives_support
				add_to_variable={ OMA_salims_side = 4}
			}
			75 = {#refuses
				custom_effect_tooltip = OMA_Hinwai_backs_azzan
				add_to_variable={ OMA_azzans_side = 5}
			}
		}
	}
}
country_event = {##OMA - Gaining the support of Hinawi
	id = arab_events.69
	title = arab_events.69.t
	desc = arab_events.69.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##Offer them a place in the government
		name = arab_events.68.a
		random_list = {
			44 = {#agreed
				modifier = {
					factor = 0.5
					has_idea = OMA_hinawi_in_government
				}
				custom_effect_tooltip = OMA_Ghafiri_gives_support
				add_to_variable={ OMA_salims_side = 4}
				add_ideas = {OMA_ghafiri_in_government}
			}
			56 = {#refuses
				custom_effect_tooltip = OMA_Ghafiri_backs_azzan
				add_to_variable={ OMA_azzans_side = 5}
			}
		}
	}
	option = { ##Give Them gifts of wealth
		name = arab_events.68.b
		add_timed_idea={days = 200 idea = OMA_paying_the_ghafiri}
		random_list = {
			33 = {#agreed
				modifier = {
					factor = 0.5
					has_idea = OMA_hinawi_in_government
				}
				custom_effect_tooltip = OMA_Ghafiri_gives_support
				add_to_variable={ OMA_salims_side = 4}
			}
			10={#Stays neutral
				modifier = {
					factor = 0.8
					has_idea = OMA_hinawi_in_government
				}
				custom_effect_tooltip = OMA_Ghafiri_remains_neutral
			}
			57 = {#refuses
				custom_effect_tooltip = OMA_Ghafiri_backs_azzan
				add_to_variable={ OMA_azzans_side = 5}
			}
		}
	}
	option = { ##Give Them gifts of power
		name = arab_events.68.c
		trigger={
			has_political_power > 49
		}
		add_political_power = -50
		random_list = {
			33 = {#agreed
				modifier = {
					factor = 0.5
					has_idea = OMA_hinawi_in_government
				}
				custom_effect_tooltip = OMA_Ghafiri_gives_support
				add_to_variable={ OMA_salims_side = 4}
			}
			10={#Stays neutral
				modifier = {
					factor = 0.8
					has_idea = OMA_hinawi_in_government
				}
				custom_effect_tooltip = OMA_Ghafiri_remains_neutral
			}
			57 = {#refuses
				custom_effect_tooltip = OMA_Ghafiri_backs_azzan
				add_to_variable={ OMA_azzans_side = 5}
			}
		}
	}
	option = { ##Threaten them
		name = arab_events.68.e
		random_list = {
			15 = {#agreed
				modifier = {
					factor = 0.5
					has_idea = OMA_hinawi_in_government
				}
				custom_effect_tooltip = OMA_Ghafiri_gives_support
				add_to_variable={ OMA_salims_side = 4}
			}
			20={#Stays neutral
				modifier = {
					factor = 0.8
					has_idea = OMA_hinawi_in_government
				}
				custom_effect_tooltip = OMA_Ghafiri_remains_neutral
			}
			65 = {#refuses
				custom_effect_tooltip = OMA_Ghafiri_backs_azzan
				add_to_variable={ OMA_azzans_side = 5}
			}
		}
	}
}
country_event = {##OMA - the battle begins
	id = arab_events.70
	title = arab_events.70.t
	desc = arab_events.70.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes

	option = { ##results of the battle
		name = arab_events.70.a
		if={
			limit={
				check_variable = {
					var = OMA_azzans_side
					value = OMA_salims_side
					compare = greater_than_or_equals
				}
			}
			set_country_flag = OMA_azzans_victory
		}
		else={
			set_country_flag = OMA_salims_victory
		}
		country_event={id=arab_events.71 } #days = 5
	}
}
country_event = {##OMA - results of the battle
	id = arab_events.71
	title = arab_events.71.t
	desc = {
		text = arab_events.71.d
		trigger={
			NOT={
				has_country_flag = OMA_azzans_victory
				has_country_flag = OMA_salims_victory
			}
		}
	}
	#Azzans victory
	desc = {#uk backed oman, but the tribes did not
		text = arab_events.71.da1
		trigger={
			has_country_flag = OMA_azzans_victory
			OR={
				has_idea = OMA_trade_consessions_to_ENG
				has_idea = OMA_trade_consessions_to_ENG_2
			}
		}
	}
	desc = {#france backed oman, but the tribes did not
		text = arab_events.71.da2
		trigger={
			has_country_flag = OMA_azzans_victory
			OR={
				has_idea = OMA_trade_consessions_to_FRA
				has_idea = OMA_trade_consessions_to_FRA_2
			}
		}
	}
	desc = {#default
		text = arab_events.71.da
		trigger={
			has_country_flag = OMA_azzans_victory
		}
	}
	#Salims Victory
	desc = {#default
		text = arab_events.71.ds
		trigger={
			has_country_flag = OMA_salims_victory
		}
	}
	#picture = GFX_report_event_chinese_army_training

	immediate={
		797={set_demilitarized_zone = no}
	}

	is_triggered_only = yes

	option = { ##azzan wins
		name = arab_events.71.a
		trigger={
			has_country_flag = OMA_azzans_victory
		}
		complete_national_focus = oma_vic_the_imam_and_the_sultan
		##form azzans government
		hidden_effect={
			set_popularities = {
				anarchism = 0
				ideology_social_liberalism = 0
				ideology_radical_socialism = 0
				social_egalitarianism = 0
				centrism = 0
				traditional_conservatism = 0
				radical_democracy = 0
				chauvinist_populism = 0
				autocracy = 0
				fundamentalism = 100
			}
		}
		set_politics = {
			ruling_party = fundamentalism
		}
		create_country_leader = {
			name = "Azzan bin Qais"
			desc = "POLITICS_TEMP_DESC"
			picture = "Portrait_OMA_Azzan_bin_Qais.dds"
			expire = 1871.02.10
			ideology = islamist
		}
		hidden_effect={#azzan ignores pledge to pay FRA/ENG
			remove_ideas={
				OMA_trade_consessions_to_FRA
				OMA_trade_consessions_to_FRA_2
				OMA_trade_consessions_to_ENG
				OMA_trade_consessions_to_ENG_2
			}
			#the tribes that put azzan in power get government jobs
			if={
				limit={
					has_idea=OMA_ghafiri_in_government
				}
				remove_ideas = {OMA_ghafiri_in_government}
			}
			else = {
				add_ideas = {OMA_ghafiri_in_government}
			}
			if={
				limit={
					has_idea=OMA_hinawi_in_government
				}
				remove_ideas = {OMA_hinawi_in_government}
			}
			else = {
				add_ideas = {OMA_hinawi_in_government}
			}
		}
	}
	option = { ##Salim wins
		name = arab_events.71.b
		trigger={
			has_country_flag = OMA_salims_victory
		}
		complete_national_focus = oma_vic_the_imam_and_the_sultan
		add_stability = 0.1
	}
	option={
		name = arab_events.71.c
		trigger={
			NOT={
				has_country_flag = OMA_salims_victory
				has_country_flag = OMA_azzans_victory
			}
		}
	}
}

country_event = {##OMA - Asscent of Turki
	id = arab_events.72
	title = {
		text = arab_events.72.t#Death in Battle
		trigger={
			has_country_flag = OMA_azzans_victory
		}
	}
	title = {
		text = arab_events.72.ta#Bomb rocks the palace
		trigger={
			has_country_flag = Azzan_accepts_deal
		}
	}
	title = {
		text = arab_events.72.tb#Plague
		trigger={
			has_country_flag = OMA_salims_victory
		}
	}

	desc = {#
		text = arab_events.72.da1
		trigger={
			has_country_flag = OMA_azzans_victory
		}
	}
	desc = {#Bomb rocks the palace - British implicated
		text = arab_events.72.da2
		trigger={
			has_country_flag=Azzan_accepts_deal
		}
	}
	desc = {#Dies via a disease outbreak
		text = arab_events.72.ds
		trigger={
			has_country_flag = OMA_salims_victory
		}
	}
	#picture = GFX_report_event_chinese_army_training
	trigger={
		tag = OMA
		date > 1871.01.01
		NOT={
			has_country_leader = {name = "Turki bin Said" ruling_only = yes}
		}
		date < 1874.01.01
	}
	fire_only_once = yes
	immediate={
		hidden_effect={
			retire_country_leader = yes
			set_popularities = {
				anarchism = 0
				ideology_social_liberalism = 0
				ideology_radical_socialism = 0
				social_egalitarianism = 0
				centrism = 0
				traditional_conservatism = 0
				radical_democracy = 0
				chauvinist_populism = 0
				autocracy = 100
				fundamentalism = 0
			}
			set_politics = {
				ruling_party = autocracy
			}
			create_country_leader = {
				name = "Turki bin Said"
				desc = "POLITICS_TURKI_BIN_SAID_DESC"
				picture = "Portrait_Oman_Turki_bin_Said.dds"
				expire = "1888.4.4"
				ideology = despotism
				traits = {

				}
			}
			# OMA_Turki_bin_Said={
			
			# }
		}
	}

	option = { ##azzan wins
		name = arab_events.72.a

		##form azzans government
	}
}

country_event = {##ENG - establish control of Hadhramaut, oman controls Mahra
	id = arab_events.73
	title = arab_events.73.t
	desc = arab_events.73.d
	#picture = GFX_report_event_chinese_army_training

	is_triggered_only = yes
	# trigger={
		# date > 1886.01.01
		# date < 1895.01.01
		# tag = ENG
		# OMA = {owns_state = 1196}
	# }
	# mean_time_to_happen={
		# days = 60
	# }

	option = { ##agreed, send the envoys
		name = arab_events.73.a
		ai_chance = {
            factor = 100
        }
		QUA={country_event={id = arab_events.41 days = 2}}
		KAT={country_event={id = arab_events.41 days = 2}}
	}
	option = { ##refuse
		name = arab_events.73.b
		ai_chance = {
            factor = 0
        }
	}
}
country_event = {##ZAN - the anglo-zanzibar war, the fastest war in history
	id = arab_events.74
	title = arab_events.74.t
	desc = arab_events.74.d
	#picture = GFX_report_event_chinese_army_training
	
	major = yes
	
	fire_only_once = yes

	trigger={
		tag = ENG
		date>1897.8.27
		date<1900.1.1
		ZAN={
			exists = yes
			is_subject = no
			is_ai = yes
			owns_state = 1220
			NOT={owns_state = 825}
		}
	}

	option = { ##wow
		name = arab_events.74.a
		trigger={
			tag = ENG
		}
		annex_country = {
			target = ZAN
			transfer_troops = yes
		}
		1220={add_compliance = 80}

	}
	option = { ##what
		name = arab_events.74.b
		trigger={
			NOT={tag = ENG}
		}
	}
}

country_event = {##ZAN - founding of Utetrea (1860s)
	id = arab_events.75
	title = arab_events.75.t
	desc = arab_events.75.d
	#picture = GFX_report_event_chinese_army_training
	
	fire_only_once = yes
	is_triggered_only = yes

	trigger={
		tag = ZAN
	}
	immediate = {
		hidden_effect = {
			TIP={
				transfer_state = 899
			}
			899={
				add_core_of = TIP
				remove_core_of = BKW
			}
		}
	}

	option = { ##ok
		name = arab_events.75.a

	}
	option = { ##tag switch
		name = arab_events.75.b
		TIP={
			change_tag_from = ROOT
		}
	}
}

country_event = {##taking soctra
	id = arab_events.76
	title = arab_events.76.t
	desc = arab_events.76.d
	#picture = GFX_report_event_chinese_army_training
	
	fire_only_once = yes
	is_triggered_only = yes

	option = { ##take it
		name = arab_events.75.a
		transfer_state = 1312
	}
}
