namespace = FEE_Habsan_Events

# The Janjira State
country_event = {
	id = FEE_Habsan_Events.1
	title = FEE_Habsan_Events.1.T
	desc = FEE_Habsan_Events.1.D
	picture = GOOD_WITH_MONARCH_eventPicture

	fire_only_once = yes

	trigger = {
		is_or_was_tag = { tag = JAJ }
		is_year = 1489
		religion_group = muslim
		OR = {
			is_free_or_tributary_trigger = yes
			AND = {
				is_subject_other_than_tributary_trigger = yes
				overlord = {
					has_reform = indian_sultanate_reform
				}
			}
		}
	}

	option = {
		name = FEE_Habsan_Events.1.OPT1

		ai_chance = { factor = 100 }

		change_government = republic
		add_government_reform = pirate_republic_reform
		change_primary_culture = amhara
		set_ruler_culture = amhara
		random_country = {
			limit = {
				NOT = { tag = ROOT }
				religion_group = muslim
				NOT = { war_with = ROOT }
				capital_scope = {
					superregion = india_superregion
				}
				ai = yes
				NOT = {
					any_country = {
						NOT = { tag = ROOT }
						religion_group = muslim
						NOT = { war_with = ROOT }
						capital_scope = {
							superregion = india_superregion
						}
						ai = yes
						PREV = {
							NOT = { total_development = PREV }
						}
					}
				}
			}
			create_guarantee = ROOT
		}
	}

	option = {
		name = FEE_Habsan_Events.1.OPT2

		ai_chance = { factor = 0 }

		add_prestige_or_monarch_power = { amount = 5 }
		change_primary_culture = amhara
		set_ruler_culture = amhara
	}
}