# I'm an Amazon! I should have enatic succession! No dirty enatic-cognatic, THANK YOU!

character_event = {
	id = amareturn.800
	desc = amareturn.800
	
	only_rulers = yes
	
	trigger = {
		religion_group = amazon
		primary_title = {
			NOT = {
				has_law = enatic_succession
			}
		}
	}	
	
	mean_time_to_happen = {
		months = 1
	}
		
	immediate = {		
		primary_title = {
			add_law = enatic_succession
		}
	}
	
	option = {
		name = OK	
		any_vassal = {
			limit = {
				religion_group = amazon
				has_opinion_modifier = { who = ROOT modifier = succ_law_change }
				}
			character_event = { id = amareturn.899 }
		}
			# opinion = { modifier = amazon_likes_change_to_enatic who = ROOT years = 10 }
			# }
	}
}

character_event = {
	id = amareturn.899
	desc = amareturn.899
	
	is_triggered_only = yes
	
	trigger = {
		religion_group = amazon
		OR = {
			has_opinion_modifier = { who = FROM modifier = succ_law_change }
			has_opinion_modifier = { who = FROM modifier = bad_succ_law_change }
			has_opinion_modifier = { who = FROM modifier = good_succ_law_change }
		}
	}
	
	option = {
		name = OK
		remove_opinion = { who = FROM modifier = good_succ_law_change }
		remove_opinion = { who = FROM modifier = bad_succ_law_change }
		remove_opinion = { who = FROM modifier = succ_law_change }
	}
}

# Give non-feudal Barony to female character; abdicate to spouse if liege is not player

character_event = {
	id = amareturn.801
	desc = amareturn.801
	
	only_rulers = yes
	only_men = yes
	
	trigger = {
		ai = yes
		OR = {
			AND = {
				is_feudal = no
				religion_group = amazon
				num_of_baron_titles = 1
				lower_tier_than = COUNT
			}
			AND = {
				religion_group = amazon
				liege = {
					ai = yes
				}
				is_married = yes
				primary_spouse = {
					religion_group = amazon
				}
			}
		}
		is_female = no
		any_courtier = { is_female = yes }
	}
		
	mean_time_to_happen = {
		days = 1
	}
		
	option = {
		name = OK			
		# Abdicate to spouse, if married
		if = {
			limit = {
				is_married = yes
				any_spouse = {
					is_female = yes
					religion_group = amazon
				}
			}
			random_spouse = {
				limit = {
					is_female = yes
					religion_group = amazon
				}
				ROOT = {
					abdicate_to = PREV
				}
			}
		}
		
		# Otherwise, to female courtier
		if = {
			limit = {
				OR = {
					is_married = no
					NOT = {
						any_spouse = {
							is_female = yes
							religion_group = amazon
						}
					}
				}
			}
			random_courtier = {
				limit = {
					is_female = yes
					religion_group = amazon
				}
				ROOT = {
					abdicate = PREV
				}
			}
			}
		}
	}

#Create a suitable courtier to abdicate to		
character_event = {
	id = amareturn.802
	desc = amareturn.802
	
	only_men = yes
	only_rulers = yes
	
	trigger = {
		is_feudal = no
		religion_group = amazon
		num_of_baron_titles = 1
		lower_tier_than = COUNT
		is_female = no
		NOT = { any_courtier = { is_female = yes } }
	}
		
	mean_time_to_happen = {
		days = 1
	}
		
	option = {
		name = OK
		create_character = {
			female = yes
			random_traits = yes
			religion = hellenic_amazon
		}
	}
}

# Abdicate to spouse

character_event = {
	id = amareturn.900
	desc = amareturn.900
	
	only_men = yes
	only_rulers = yes
	
	trigger = {
		ai = yes
		liege = { #Player can grant to men if he really wants to
			ai = yes
			religion_group = amazon
		}
		primary_title = {
			is_recent_grant = yes
		}
		is_female = no
		is_married = yes
		spouse = { #Player won't receive free counties and titles this way
			ai = yes
			religion_group = amazon
		}
		religion_group = amazon
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = OK
		abdicate = yes
		abdicate_to = spouse
		move_character = spouse
	}
}

character_event = {
	id = amareturn.1000
	desc = amareturn.1000
	
	only_men = yes
	only_rulers = yes
	
	trigger = {
		ai = yes
		primary_title = {
			title = d_matriarch
		}
		is_female = no
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = OK
		create_random_priest = {
			female = yes
			culture = sarmatian
			religion = hellenic_amazon
			random_traits = yes
		}
		new_character = {
			ROOT = {
				any_demesne_title = {
					gain_title = PREVPREV
				}
			}
		}
	}
}