
namespace = FemRule

#reserved: FemRule.100 to FemRule.199

#######################################
# FEMALE RULER EVENTS
# Written by Rylock
#######################################

# an older ruler has a daughter as his/her heir
character_event = {
	id = FemRule.100
	title = EVTNAME_FemRule_100
	desc = EVTDESC_FemRule_100
	
	picture = GFX_evt_noblewoman
	
	only_rulers = yes
	only_playable = yes
	min_age = 30
	capable_only = yes
	prisoner = no

	
	trigger = {
		num_of_children = 1
		primary_title = {
			has_law = cognatic_succession #This should probably only fire on agnatic-cognatic succession. It makes no sense for true-cognatic and wouldn't come up for agnatic anyway.
			#NOT = { has_law = agnatic_succession }# not needed for logic, should improve performance
		}
		current_heir = {
			is_female = yes
			age = 6
			NOT = { age = 16 }
			OR = {
				father = { character = ROOT }
				mother = { character = ROOT }
			}
		}
		NOR = {
			trait = teaching_daughter
			has_character_modifier = hoping_for_son_timer
			has_character_flag = misogyny
			any_spouse = { is_pregnant = yes }
			any_consort = { is_pregnant = yes }
			any_lover = { is_pregnant = yes }
			is_pregnant = yes
		}
	}
	
	mean_time_to_happen = {
		years = 15
		modifier = {
			factor = 0.5
			age = 45
			is_female = yes
		}
		modifier = {
			factor = 0.75
			age = 55
		}
		modifier = {
			factor = 0.75
			age = 60
		}
		modifier = {
			factor = 0.75
			age = 65
		}
		modifier = {
			factor = 0.5
			is_female = yes
		}
		modifier = {
			factor = 0.5
			trait = cynical
		}
		modifier = {
			factor = 0.75
			is_ill = yes
		}
		modifier = {
			factor = 0.75
			NOT = { health = 3.1 }
		}
		modifier = {
			factor = 0.5
			NOT = { health = 2.1 }
		}
		modifier = {
			factor = 0.25
			NOT = { health = 1.1 }
		}
		modifier = {
			factor = 0.25 
			OR = {
				trait = eunuch
				trait = celibate
				NOT = { fertility = 0.05 }
			}
		}
		modifier = {
			factor = 0.1 # players will want this faster
			ai = no
		}
		modifier = {
			factor = 0.5
			current_heir = {
				is_smart_trigger = yes
			}
		}
		modifier = {
			factor = 0.5
			current_heir = { is_strong_trigger = yes }
		}
		modifier = {
			factor = 2
			current_heir = { is_weak_trigger = yes }
		}
		modifier = {
			factor = 5
			current_heir = { trait = inbred }
		}
		modifier = {
			factor = 5
			current_heir = {
				is_dumb_trigger = yes
			}
		}		
		modifier = {
			factor = 2
			NOR = {
				is_pagan_religion = yes
				religion_group = zoroastrian_group
			}
		}	
	}

	option = { # I shall raise her to rule
		name = EVTOPTA_FemRule_100
		ai_chance = {
			factor = 25
			modifier = {
				factor = 1.25
				age = 40
			}
			modifier = {
				factor = 1.5
				age = 50
			}
			modifier = {
				factor = 1.5
				age = 60
			}
			modifier = {
				factor = 2
				age = 70
			}
			modifier = {
				factor = 2
				age = 80
			}
			modifier = {
				factor = 0.5
				NOR = {
					is_pagan_religion = yes
					religion_group = zoroastrian_group
				}
			}
			modifier = {
				factor = 1.5
				is_ill = yes
			}
			modifier = {
				factor = 1.5
				NOT = { health = 3 }
			}
			modifier = {
				factor = 1.25
				trait = leper
			}
			modifier = {
				factor = 1.25
				is_maimed_trigger = yes
			}
			modifier = {
				factor = 1.5
				NOT = { fertility = 0.15 }
			}
		}
		add_trait = teaching_daughter
		current_heir = {
			opinion = {
				who = ROOT
				modifier = favoured_heiress
				years = 100
			}
			if = {
				limit = {
					ROOT = {
						NOT = {
							any_realm_character = {
								educator = { character = ROOT }
								count = 2
							}
						}
					}
				}
				set_guardian = ROOT
				hidden_tooltip = {
					character_event = { id = 2484 }
				}
			}
		}
		any_dynasty_member = {
			limit = {
				is_female = no
				NOT = { trait = content }
				NOT = { trait = humble }
				NOT = { trait = incapable }
				NOT = { is_friend = ROOT }
			}
			opinion = { who = ROOT modifier = opinion_upset years = 5 }
			ROOT = {
				current_heir = { 
					reverse_opinion = { who = PREVPREV modifier = covets_inheritance years = 5 }
				}
			}
		}
	}
	option = { # I might still have a son
		name = EVTOPTB_FemRule_100
		trigger = {
			NOT = { trait = celibate }
			NOT = { trait = eunuch }
			OR = {
				NOT = { age = 45 }
				is_female = no
			}
			NOT = { age = 65 }
		}
		ai_chance = {
			factor  = 75
			modifier = {
				factor = 1.25
				trait = lustful
			}
			modifier = {
				factor = 2
				any_spouse = {
					fertility = 0.33
				}
			}
			modifier = {
				factor = 2
				fertility = 0.33
			}
			modifier = {
				factor = 2
				fertility = 0.5
			}
			modifier = {
				factor = 0.5
				NOT = { fertility = 0.15 }
			}
			modifier = {
				factor = 0
				NOT = { fertility = 0.05 }
			}
		}
		add_character_modifier = {
			name = hoping_for_son_timer
			duration = 1825
			hidden = yes
		}
		current_heir = {
			prestige = -10
			opinion = {
				who = ROOT
				modifier = not_feeling_apreciated
				years = 5
			}
			hidden_tooltip = {
				character_event = { id = FemRule.101 }
			}
		}
	}
	
	option = { # Never--player-only option to not see this event again, AI will have chance to reconsider if appropriate
		name = EVTOPTC_FemRule_100
		ai_chance = {
			factor = 0
		}
		set_character_flag = misogyny
		current_heir = {
			prestige = -20
			opinion = {
				who = ROOT
				modifier = not_feeling_apreciated
				years = 10
			}
			hidden_tooltip = {
				character_event = { id = FemRule.101 }
			}
		}
	}	
}

# daughter learns that her parent is hoping for a son
character_event = {
	id = FemRule.101
	desc = EVTDESC_FemRule_101
	picture = GFX_evt_noblewoman
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_101 #I must earn my right to rule
		if = {
			limit = { NOT = { trait = content } }
			random_list = {
				50 = { }
				30 = { add_trait = ambitious }
				20 = { add_trait = diligent }
			}
		}
		if = {
			limit = { trait = content }
			remove_trait = content
		}
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = diligent
			}
			modifier = {
				factor = 3
				trait = ambitious
			}
		}
	}
	
	option = {
		name = EVTOPTB_FemRule_101 #But I deserve to rule!
		if = {
			limit = { NOT = { trait = humble } }
			random_list = {
				50 = { }
				30 = { add_trait = proud }
				20 = { add_trait = envious }
			}
		}
		if = {
			limit = { trait = humble }
			remove_trait = humble
		}
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = envious
			}
			modifier = {
				factor = 3
				trait = proud
			}
		}
	}
	
	option = {
		name = EVTOPTC_FemRule_101 #I must bow to his/her wishes.
		if = {
			limit = { NOT = { trait = ambitious } }
			random_list = {
				50 = { }
				30 = { add_trait = content }
				20 = { add_trait = humble }
			}
		}
		if = {
			limit = { trait = ambitious }
			remove_trait = ambitious
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 3
				trait = content
			}
			modifier = {
				factor = 2
				trait = humble
			}
			modifier = {
				factor = 2
				trait = trusting
			}
		}
	}
}

# the favored heiress is no longer the heir
character_event = {
	id = FemRule.105
	desc = EVTDESC_FemRule_105
	picture = GFX_evt_child_sword
	
	only_rulers = yes
	min_age = 31
	only_playable = yes
	
	trigger = {
		trait = teaching_daughter
		current_heir = {
			NOT = {
				has_opinion_modifier = { who = ROOT modifier = favoured_heiress }
			}
		}
	}
	
	mean_time_to_happen = {
		months = 1
	}
	
	option = {
		name = EVTOPTA_FemRule_105 #I have a son now. That's all that matters.
		trigger = {
			current_heir = {
				is_female = no
				OR = {
					father = { character = ROOT }
					mother = { character = ROOT }
				}
			}
		}
		remove_trait = teaching_daughter
		clr_character_flag = will_acknowledge_bastards
		clr_character_flag = no_pledging_to_daughter
		any_child = {
			limit = {
				has_opinion_modifier = { who = ROOT modifier = favoured_heiress }
			}
			remove_opinion = { who = ROOT modifier = favoured_heiress }
		}
		any_dynasty_member = {
			limit = {
				is_female = no
				NOT = { trait = content }
				NOT = { trait = humble }
				NOT = { trait = incapable }
				NOT = { is_friend = ROOT }
			}
			remove_opinion = { who = ROOT modifier = opinion_upset }
			ROOT = {
				any_child = {
					limit = { reverse_has_opinion_modifier = { who = PREVPREV modifier = covets_inheritance } }
					reverse_remove_opinion = { who = PREVPREV modifier = covets_inheritance }
				}
			}
		}
	}
	
	option = {
		name = EVTOPTB_FemRule_105 #I have another daughter who can take her place.
		trigger = {
			current_heir = {
				is_female = yes
				OR = {
					father = { character = ROOT }
					mother = { character = ROOT }
				}
			}
		}
		clr_character_flag = no_pledging_to_daughter
		current_heir = {
			opinion = {
				who = ROOT
				modifier = favoured_heiress
				years = 100
			}
		}
		any_dynasty_member = {
			limit = {
				is_female = no
				NOT = { trait = content }
				NOT = { trait = humble }
				NOT = { trait = incapable }
				NOT = { is_friend = ROOT }
			}
			ROOT = {
				current_heir = { 
					reverse_opinion = { who = PREVPREV modifier = covets_inheritance years = 5 }
				}
			}
		}
	}
	
	option = {
		name = EVTOPTC_FemRule_105 #There is nothing to be done.
		trigger = {
			NOT = {
				current_heir = {
					OR = {
						father = { character = ROOT }
						mother = { character = ROOT }
					}
				}
			}
		}
		remove_trait = teaching_daughter
		clr_character_flag = will_acknowledge_bastards
		clr_character_flag = no_pledging_to_daughter
	}
}

# event for a bastard to be acknowledged by a willing liege parent
character_event = {
	id = FemRule.111
	desc = EVTDESC_FemRule_111
	picture = GFX_evt_emissary
	
	capable_only = yes
	
	trigger = {
		trait = bastard
		NOT = { trait = eunuch }
		NOT = { trait = celibate }
		any_liege = {
			has_character_flag = will_acknowledge_bastards
			any_child = { character = ROOT }
			OR = {
				ROOT = { is_female = no }
				NOT = { any_child = { is_female = no } }
			}
		}
		NOT = { has_character_flag = acknowledged_bastard }
	}
	
	mean_time_to_happen = {
		months = 3
		modifier = {
			factor = 0.5
			is_adult = yes
			NOT = { age = 30 }
		}
		modifier = {
			factor = 0.75
			is_married = yes
		}
		modifier = {
			factor = 0.25
			trait = genius
		}
		modifier = {
			factor = 0.5
			OR = {
				trait = quick
				trait = shrewd
			}
		}
		modifier = {
			factor = 0.75
			OR = {
				is_strong_trigger = yes
				trait = fair
			}
		}
		modifier = {
			factor = 0.5
			OR = {
				trait = grey_eminence
				trait = brilliant_strategist
			}
		}
		modifier = {
			factor = 0.75
			OR = {
				trait = charismatic_negotiator
				trait = midas_touched
				trait = skilled_tactician
			}
		}
		modifier = {
			factor = 1.5
			age = 40
		}
		modifier = {
			factor = 1.5
			NOT = { health = 3.1 }
		}
		modifier = {
			factor = 1.5
			OR = {
				trait = amateurish_plotter
				trait = naive_appeaser
				trait = indulgent_wastrel
				trait = misguided_warrior
				trait = detached_priest
			}
		}
		modifier = {
			factor = 0.75
			trait = ambitious
		}
		modifier = {
			factor = 0.75
			OR = {
				trait = diligent
				trait = just
				trait = kind
				trait = brave
			}
		}
		modifier = {
			factor = 1.5
			OR = {
				trait = cruel
				trait = craven
				trait = content
				trait = slothful
				trait = arbitrary
			}
		}
		modifier = {
			factor = 2
			trait = homosexual
		}
		modifier = {
			factor = 2
			OR = {
				is_weak_trigger = yes
				trait = blinded
				is_maimed_trigger = yes
			}
		}
		modifier = {
			factor = 2
			OR = {
				trait = slow
				trait = dull
			}
		}
		modifier = {
			factor = 3
			trait = imbecile
		}
		modifier = {
			factor = 3
			trait = inbred
		}
	}
	
	option = {
		name = EVTOPTA_FemRule_111
		custom_tooltip = {
			text = EVTTOOLTIP_FemRule_111
			set_character_flag = acknowledged_bastard
		}
	}
}

# ai event to acknowledge a bastard if very old and heirless
character_event = {
	id = FemRule.113
	desc = EVTDESC_FemRule_113
	picture = GFX_evt_council
	
	only_playable = yes
	only_rulers = yes
	religion_group = christian
	only_men = yes
	min_age = 50
	capable_only = yes
	prisoner = no
	is_patrician = no
	ai = yes
	
	trigger = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		piety = 20
		NOR = {
			trait = immortal
			current_heir = { dynasty = ROOT }
			current_heir = { father = { character = ROOT } }
			any_spouse = { is_pregnant = yes }
			any_consort = { is_pregnant = yes }
		}
		OR = {
			AND = {
				primary_title = { NOT = { has_law = enatic_succession } }
				any_child = {
					is_female = no
					is_alive = yes
					NOT = { trait = eunuch }
					NOT = { trait = celibate }
					is_liege_or_above = ROOT
				}
			}
			AND = {
				primary_title = { NOT = { has_law = agnatic_succession } }
				any_child = {
					is_female = yes
					is_alive = yes
					NOT = { trait = eunuch }
					NOT = { trait = celibate }
					is_liege_or_above = ROOT
				}
			}
		}		
		primary_title = {
			OR = {
				has_law = succ_gavelkind
				has_law = succ_primogeniture
				has_law = succ_seniority
			}
		}
		NOR = {
			has_character_flag = will_acknowledge_bastards
			has_character_flag = will_not_acknowledge_bastards
		}
	}
	
	mean_time_to_happen = {
		months = 60
		modifier = {
			factor = 5
			trait = zealous
		}
		modifier = {
			factor = 3
			OR = {
				trait = proud
				trait = cruel
				trait = content
			}
		}
		modifier = {
			factor = 0.5
			trait = cynical
		}
		modifier = {
			factor = 0.75
			trait = kind
		}
		modifier = {
			factor = 0.5
			NOT = { health = 3.1 }
		}
		modifier = {
			factor = 0.5
			NOT = { health = 2.1 }
		}
		modifier = {
			factor = 0.5
			NOT = { fertility = 0.1 }
		}
		modifier = {
			factor = 0.75
			age = 60
		}
		modifier = {
			factor = 0.75
			age = 65
		}
		modifier = {
			factor = 0.75
			age = 70
		}
	}
	
	option = {
		name = EVTOPTA_FemRule_113
		ai_chance = {
			factor = 60
			modifier = {
				factor = 2
				trait = cynical
			}
			modifier = {
				factor = 2
				trait = kind
			}
			modifier = {
				factor = 5
				primary_title = { tier = EMPEROR }
			}
			modifier = {
				factor = 2.5
				primary_title = { tier = KING }
			}
			modifier = {
				factor = 1.5
				primary_title = { tier = DUKE }
			}
		}
		piety = -20
		set_character_flag = will_acknowledge_bastards
	}
	
	option = {
		name = EVTOPTB_FemRule_113
		ai_chance = {
			factor = 40
			modifier = {
				factor = 3
				trait = zealous
			}
			modifier = {
				factor = 2
				OR = {
					trait = proud
					trait = cruel
					trait = content
				}
			}
		}
		set_character_flag = will_not_acknowledge_bastards
	}
}

# ai event to stop trying to acknowledge a bastard if conditions change
character_event = {
	id = FemRule.114
	
	hide_window = yes
	
	only_playable = yes
	only_rulers = yes
	only_men = yes
	min_age = 50
	capable_only = yes
	prisoner = no
	has_character_flag = will_acknowledge_bastards

	trigger = {
		OR = {
			is_patrician = yes
			AND = {
				is_feudal = no
				is_tribal = no
			}
			NOT = { religion_group = christian }
			trait = immortal
			current_heir = { dynasty = ROOT }
			current_heir = { father = { character = ROOT } }
			any_spouse = { is_pregnant = yes }
			any_consort = { is_pregnant = yes }		
			primary_title = {
				NOR = {
					has_law = succ_gavelkind
					has_law = succ_primogeniture
					has_law = succ_seniority
				}
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		clr_character_flag = will_acknowledge_bastards
	}
}

### Events that deal with a female with martial traits

character_event = { #Martial Lady
	id = FemRule.120
	desc = EVTDESC_FemRule_120
	picture = GFX_evt_girl_with_sword
	
	min_age = 16
	only_women = yes
	
	trigger = {
		NOT = { trait = martial_lady }
		NOT = { has_character_flag = made_fem_martial_choice }
		NOR = {
			is_pagan_religion = yes
			religion_group = zoroastrian_group
		}
		OR = {
			trait = holy_warrior
			has_crusade_trait_trigger = yes
			trait = misguided_warrior
			trait = tough_soldier
			trait = skilled_tactician
			trait = brilliant_strategist
		}
	}
	
	mean_time_to_happen = {
		months = 1
	}
	
	immediate = {
		set_character_flag = made_fem_martial_choice
		remove_trait = martial_lady_tengri
		remove_trait = martial_lady_pagan
	}
	
	option = {
		name = EVTOPTA_FemRule_120
		ai_chance = {
			factor = 40
			modifier = {
				factor = 2
				trait = bastard
			}
			modifier = {
				factor = 0.5
				OR = {
					is_ruler = yes
					any_heir_title = { always = yes }
				}
			}
			modifier = {
				factor = 0.5
				liege = { is_close_relative = ROOT }
			}
			modifier = {
				factor = 1.5
				martial = 10
			}
			modifier = {
				factor = 1.5
				martial = 12
			}
			modifier = {
				factor = 1.5
				martial = 14
			}
			modifier = {
				factor = 1.5
				martial = 16
			}
			modifier = {
				factor = 0.1
				NOT = { martial = 5 }
			}
		}
		add_trait = martial_lady
	}
	option = {
		name = EVTOPTB_FemRule_120
		ai_chance = {
			factor = 60
			modifier = {
				factor = 0
				dynasty = 0
			}
			modifier = {
				factor = 0.1
				NOR = {
					any_claim = { always = yes }
					any_heir_title = { always = yes }
					any_pretender_title = { always = yes }
					father = { is_ruler = yes }
					mother = { is_ruler = yes }
				}
			}	
			modifier = {
				factor = 1.5
				NOT = { martial = 8 }
			}
		}
		change_martial = -2
	}
}

character_event = { #Tengri Martial Lady
	id = FemRule.125
	desc = EVTDESC_FemRule_125
	picture = GFX_evt_girl_with_sword
	
	min_age = 16
	only_women = yes	
	
	trigger = {
		NOT = { trait = martial_lady_tengri }
		NOT = { has_character_flag = made_fem_martial_choice }
		OR = {
			religion = tengri_pagan
			religion = tengri_pagan_reformed
			religion_group = zoroastrian_group
		}
		OR = {
			trait = holy_warrior
			has_crusade_trait_trigger = yes
			trait = misguided_warrior
			trait = tough_soldier
			trait = skilled_tactician
			trait = brilliant_strategist
		}
	}
	
	mean_time_to_happen = {
		months = 1
	}
	
	immediate = {
		set_character_flag = made_fem_martial_choice
		remove_trait = martial_lady
		remove_trait = martial_lady_pagan
	}
	
	option = {
		name = EVTOPTA_FemRule_120
		ai_chance = {
			factor = 60
			modifier = {
				factor = 2
				trait = bastard
			}
			modifier = {
				factor = 0.5
				OR = {
					is_ruler = yes
					any_heir_title = { always = yes }
				}
			}
			modifier = {
				factor = 0.5
				liege = { is_close_relative = ROOT }
			}
			modifier = {
				factor = 1.5
				martial = 10
			}
			modifier = {
				factor = 1.5
				martial = 12
			}
			modifier = {
				factor = 1.5
				martial = 14
			}
			modifier = {
				factor = 1.5
				martial = 16
			}
			modifier = {
				factor = 0.1
				NOT = { martial = 5 }
			}
		}
		add_trait = martial_lady_tengri
	}
	option = {
		name = EVTOPTB_FemRule_125
		ai_chance = {
			factor = 40
			modifier = {
				factor = 0
				dynasty = 0
			}
			modifier = {
				factor = 0.1
				NOR = {
					any_claim = { always = yes }
					any_heir_title = { always = yes }
					any_pretender_title = { always = yes }
					father = { is_ruler = yes }
					mother = { is_ruler = yes }
				}
			}	
			modifier = {
				factor = 1.5
				NOT = { martial = 8 }
			}
		}
		change_martial = -2
	}
}

character_event = { #Shield Maiden
	id = FemRule.130
	desc = EVTDESC_FemRule_125
	picture = GFX_evt_girl_with_sword

	min_age = 16
	only_women = yes
	religion_group = pagan_group
	
	trigger = {
		NOT = { trait = martial_lady_pagan }
		NOT = { has_character_flag = made_fem_martial_choice }
		NOR = {
			religion = tengri_pagan
			religion = tengri_pagan_reformed
		}
		OR = {
			trait = holy_warrior
			has_crusade_trait_trigger = yes
			trait = berserker
			trait = viking
			trait = sea_queen
			trait = misguided_warrior
			trait = tough_soldier
			trait = skilled_tactician
			trait = brilliant_strategist
		}
	}
	
	mean_time_to_happen = {
		months = 1
	}
	
	immediate = {
		set_character_flag = made_fem_martial_choice
		remove_trait = martial_lady_tengri
		remove_trait = martial_lady
	}
	
	option = {
		name = EVTOPTA_FemRule_120
		ai_chance = {
			factor = 75
			modifier = {
				factor = 2
				trait = bastard
			}
			modifier = {
				factor = 0.5
				OR = {
					is_ruler = yes
					any_heir_title = { always = yes }
				}
			}
			modifier = {
				factor = 0.5
				liege = { is_close_relative = ROOT }
			}
			modifier = {
				factor = 1.5
				martial = 10
			}
			modifier = {
				factor = 1.5
				martial = 12
			}
			modifier = {
				factor = 1.5
				martial = 14
			}
			modifier = {
				factor = 1.5
				martial = 16
			}
			modifier = {
				factor = 0.1
				NOT = { martial = 5 }
			}
		}
		add_trait = martial_lady_pagan
	}
	option = {
		ai_chance = {
			factor = 25
			modifier = {
				factor = 0
				dynasty = 0
			}
			modifier = {
				factor = 0.1
				NOR = {
					any_claim = { always = yes }
					any_heir_title = { always = yes }
					any_pretender_title = { always = yes }
					father = { is_ruler = yes }
					mother = { is_ruler = yes }
				}
			}	
			modifier = {
				factor = 1.5
				NOT = { martial = 8 }
			}
		}
		name = EVTOPTB_FemRule_125
		change_martial = -2
	}
}

### Vassal is concerned at liege's martial upbringing of daughter

# Girl is being trained martially
character_event = {
	id = FemRule.134
	
	hide_window = yes
	
	min_age = 6
	max_age = 15
	only_women = yes
	prisoner = no
	capable_only = yes
	lacks_dlc = "Zeus"
	
	trigger = {
		NOR = {
			is_inaccessible_trigger = yes
			trait = bastard
			is_pagan_religion = yes
			religion_group = zoroastrian_group
		}
		guardian = {
			OR = {
				trait = misguided_warrior
				trait = tough_soldier
				trait = skilled_tactician
				trait = brilliant_strategist
			}
		}
		liege = {
			OR = {
				any_child = { character = ROOT }
				dynasty = ROOT
			}
			NOR = {
				is_pagan_religion = yes
				religion_group = zoroastrian_group
			}
		}
		any_realm_character = {
			is_adult = yes
			prisoner = no
			is_ill = no
			health = 3.0
			NOR = {
				is_inaccessible_trigger = yes
				trait = incapable
				trait = stressed
				trait = depressed
				trait = cynical
				trait = misguided_warrior
				trait = tough_soldier
				trait = skilled_tactician
				trait = brilliant_strategist
				trait = martial_lady_pagan
				trait = martial_lady_tengri
				trait = martial_lady
				any_realm_character = {
					guardian = { character = PREVPREV }
					count = 2
				}
			}
			ROOT = {
				liege = {
					NOT = { character = PREVPREV }
					religion = PREVPREV
					same_realm = PREVPREV
					NOT = { is_rival = PREVPREV }
					OR = {
						any_child = { character = ROOT }
						ROOT = { is_close_relative = PREVPREV }
					}
					OR = {
						AND = {
							opinion = { who = PREVPREV value = 25 }
							reverse_opinion = { who = PREVPREV value = 25 }
						}
						is_allied_with = PREVPREV
						is_close_relative = PREVPREV
						ROOT = { is_close_relative = PREVPREV }
					}
				}
			}
			OR = {
				NOT = { has_character_flag = asked_martial_daughter }
				had_character_flag = { flag = asked_martial_daughter days = 1825 }
			}
		}
		OR = {
			NOT = { has_character_flag = martial_daughter }
			had_character_flag = { flag = martial_daughter days = 730 }
		}
	}
	
	mean_time_to_happen = {
		months = 60
		modifier = {
			factor = 0.75
			age = 10
		}
		modifier = {
			factor = 0.5
			age = 12
		}
		modifier = {
			factor = 0.5
			age = 14
		}
	}
	
	immediate = {
		clr_character_flag = martial_daughter
		set_character_flag = martial_daughter
		random_realm_character = {
			limit = {
				is_adult = yes
				prisoner = no
				is_ill = no
				health = 3.0
				NOR = {
					is_inaccessible_trigger = yes
					trait = incapable
					trait = stressed
					trait = depressed
					trait = cynical
					trait = misguided_warrior
					trait = tough_soldier
					trait = skilled_tactician
					trait = brilliant_strategist
					trait = martial_lady_pagan
					trait = martial_lady_tengri
					trait = martial_lady
					any_realm_character = {
						guardian = { character = PREVPREV }
						count = 2
					}
				}
				ROOT = {
					liege = {
						NOT = { character = PREVPREV }
						religion = PREVPREV
						same_realm = PREVPREV
						NOT = { is_rival = PREVPREV }
						OR = {
							any_child = { character = ROOT }
							ROOT = { is_close_relative = PREVPREV }
						}
						OR = {
							is_allied_with = PREVPREV
							is_close_relative = PREVPREV
							ROOT = { is_close_relative = PREVPREV }
						}
					}
				}
				OR = {
					NOT = { has_character_flag = asked_martial_daughter }
					had_character_flag = { flag = asked_martial_daughter days = 1825 }
				}
			}
			ROOT = { set_character_flag = found_guardian }
			character_event = { id = FemRule.135 }
		}
		random_realm_character = {
			limit = {
				is_adult = yes
				prisoner = no
				is_ill = no
				health = 3.0
				NOR = {
					is_inaccessible_trigger = yes
					trait = incapable
					trait = stressed
					trait = depressed
					trait = cynical
					trait = misguided_warrior
					trait = tough_soldier
					trait = skilled_tactician
					trait = brilliant_strategist
					trait = martial_lady_pagan
					trait = martial_lady_tengri
					trait = martial_lady
					any_realm_character = {
						guardian = { character = PREVPREV }
						count = 2
					}
				}
				ROOT = {
					NOT = { has_character_flag = found_guardian }
					liege = {
						NOT = { character = PREVPREV }
						religion = PREVPREV
						same_realm = PREVPREV
						NOT = { is_rival = PREVPREV }
						OR = {
							any_child = { character = ROOT }
							ROOT = { is_close_relative = PREVPREV }
						}
						opinion = { who = PREVPREV value = 25 }
						reverse_opinion = { who = PREVPREV value = 25 }
					}
				}
				OR = {
					NOT = { has_character_flag = asked_martial_daughter }
					had_character_flag = { flag = asked_martial_daughter days = 1825 }
				}
			}
			ROOT = { set_character_flag = found_guardian }
			character_event = { id = FemRule.135 }
		}
		clr_character_flag = found_guardian
	}
}

# Relative of the girl becomes aware of her training
character_event = {
	id = FemRule.135
	desc = EVTDESC_FemRule_135
	picture = GFX_evt_girl_with_sword

	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA_FemRule_135" # Ask to mentor the girl
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				FROM = { is_close_relative = ROOT }
			}
			modifier = {
				factor = 1.25
				diplomacy = 12
			}
			modifier = {
				factor = 1.25
				stewardship = 12
			}
			modifier = {
				factor = 1.5
				trait = zealous
			}
			modifier = {
				factor = 0.25
				OR = {
					trait = slothful
					trait = craven
					trait = trusting
					trait = content
				}
			}
			modifier = {
				factor = 0.25
				OR = {
					trait = amateurish_plotter
					trait = naive_appeaser
					trait = indulgent_wastrel
					trait = detached_priest
				}
			}
			modifier = {
				factor = 0.5
				OR = {
					trait = flamboyant_schemer
					trait = underhanded_rogue
					trait = thrifty_clerk
					trait = martial_cleric
				}
			}
		}
		clr_character_flag = asked_martial_daughter
		set_character_flag = asked_martial_daughter
		FROM = {
			liege = {
				letter_event = {
					id = FemRule.136
					tooltip = "EVTTOOLTIP2481"
				}
			}
		}
	}
	option = {
		name = "EVTOPTB2480" # Ignore it
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.5
				FROM = { is_close_relative = ROOT }
			}
			modifier = {
				factor = 1.25
				FROM = {
					liege = {
						NOT = { reverse_opinion = { who = ROOT value = 25 } }
					}
				}
			}
			modifier = {
				factor = 1.25
				FROM = {
					liege = {
						NOT = { reverse_opinion = { who = ROOT value = 0 } }
					}
				}
			}
			modifier = {
				factor = 0.5
				FROM = {
					liege = { is_friend = ROOT }
				}
			}
			modifier = {
				factor = 0.5
				OR = {
					trait = grey_eminence
					trait = midas_touched
				}
			}
			modifier = {
				factor = 0.5
				trait = zealous
			}
			modifier = {
				factor = 0.75
				trait = diligent
			}
			modifier = {
				factor = 0.75
				trait = ambitious
			}
		}
		clr_character_flag = asked_martial_daughter
		set_character_flag = asked_martial_daughter
		FROM = { clr_character_flag = martial_daughter }
	}
}

# The girl's liege is asked by the relative to let him/her raise the child
letter_event = {
	id = FemRule.136
	desc = EVTDESC_FemRule_136

	is_triggered_only = yes

	option = {
		name = EVTOPTA_FemRule_136 #Agree to let them raise her
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.1
				OR = {
					trait = martial_lady_tengri
					trait = martial_lady_pagan
					trait = martial_lady
				}
			}
			modifier = {
				factor = 2
				trait = zealous
			}
			modifier = {
				factor = 1.5
				trait = shy
			}
			modifier = {
				factor = 1.5
				trait = content
			}
			modifier = {
				factor = 1.5
				trait = humble
			}
			modifier = {
				factor = 0.5
				FROM = {
					OR = {
						trait = amateurish_plotter
						trait = naive_appeaser
						trait = indulgent_wastrel
						trait = detached_priest
					}
				}
			}
			modifier = {
				factor = 2
				FROMFROM = {
					OR = {
						is_weak_trigger = yes
						trait = dwarf
						trait = craven
						trait = hunchback
						NOT = { martial = 4 }
					}
				}
			}
			modifier = {
				factor = 0.75
				any_ward = { character = FROMFROM }
			}
			modifier = {
				factor = 0.5
				current_heir = { character = FROMFROM }
				any_ward = { character = FROMFROM }
			}
		}
		FROMFROM = {
			opinion = {
				modifier = opinion_disgruntled
				who = ROOT
				years = 10
			}
		}
		FROM = {
			letter_event = {
				id = FemRule.137
				tooltip = "EVTTOOLTIP2482"
			}
		}
	}
	option = {
		name = EVTOPTB_FemRule_136 #Refuse
		ai_chance = {
			factor = 50
			modifier = {
				factor = 3
				NOT = {
					any_child = { is_female = no }
				}
			}
			modifier = {
				factor = 1.5
				NOT = {
					opinion = { who = FROM value = 25 }
				}
			}
			modifier = {
				factor = 2
				NOT = {
					opinion = { who = FROM value = 0 }
				}
			}
			modifier = {
				factor = 2
				trait = cynical
			}
			modifier = {
				factor = 1.5
				is_female = yes
			}
			modifier = {
				factor = 1.5
				trait = proud
			}
			modifier = {
				factor = 0.5
				FROM = {
					OR = {
						trait = grey_eminence
						trait = midas_touched
					}
				}
			}
			modifier = {
				factor = 2
				FROMFROM = {
					OR = {
						is_strong_trigger = yes
						trait = tall
						trait = brave
						martial = 10
					}
				}
			}
			modifier = {
				factor = 1.25
				any_ward = { character = FROMFROM }
			}
		}
		FROMFROM = {
			opinion = {
				modifier = opinion_pleased
				who = ROOT
				years = 2
			}
		}
		FROM = {
			letter_event = {
				id = FemRule.138
				tooltip = "EVTTOOLTIP2483"
			}
		}
	}
}

# The relative becomes the guardian of the girl
letter_event = {
	id = FemRule.137
	desc = "EVTDESC2482"

	is_triggered_only = yes

	option = {
		name = "EXCELLENT"
		FROMFROMFROM = {
			set_guardian = ROOT
			character_event = {
				id = 2484
				tooltip = "EVTTOOLTIP2484"
			}
		}
		opinion = {
			modifier = opinion_granted_guardianship
			who = FROM
			months = 24
		}
	}
}

# The request is denied
letter_event = {
	id = FemRule.138
	desc = EVTDESC_FemRule_138

	is_triggered_only = yes

	option = {
		name = EVTOPTA_FemRule_138
		opinion = {
			modifier = opinion_denied_guardianship
			who = FROM
			months = 24
		}
	}
}

### Lady's Champion Events

# champion retires
character_event = {
	id = FemRule.140
	desc = EVTDESC_FemRule_140
	picture = GFX_evt_knight_kneeling
	
	min_age = 50
	only_men = yes
	
	trigger = {
		OR = {
			has_minor_title = title_champion
			has_minor_title = title_ladys_champion
		}
		OR = {
			trait = incapable
			trait = infirm
			NOT = { health = 3.1 }
			NOT = { martial = 5 }
		}
		NOR = {
			has_character_flag = retired_champion
			has_character_flag = attending_tournament
		}
	}
	
	mean_time_to_happen = {
		months = 60
		modifier = {
			factor = 0.5
			NOT = { martial = 5 }
		}
		modifier = {
			factor = 1.5
			martial = 10
		}
		modifier = {
			factor = 1.5
			martial = 12
		}
		modifier = {
			factor = 1.5
			martial = 14
		}
		modifier = {
			factor = 1.5
			martial = 16
		}
		modifier = {
			factor = 0.01
			trait = incapable
		}
		modifier = {
			factor = 0.5
			NOT = { health = 2.1 }
		}
		modifier = {
			factor = 0.5
			NOT = { health = 1.1 }
		}
		modifier = {
			factor = 0.5
			age = 60
		}
		modifier = {
			factor = 0.5
			age = 65
		}
		modifier = {
			factor = 0.5
			age = 70
		}
	}
	
	option = {
		name = EVTOPTA_FemRule_140
		set_character_flag = retired_champion
		liege = {
			letter_event = {
				id = FemRule.141
				tooltip = "EVTTOOLTIP_FemRule_140"
			}
		}
	}
}

letter_event = {
	id = FemRule.141
	desc = EVTDESC_FemRule_141

	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_141
		if = {
			limit = {
				FROM = { has_minor_title = title_champion }
			}
			FROM = { remove_title = title_champion }
		}
		if = {
			limit = {
				FROM = { has_minor_title = title_ladys_champion }
			}
			FROM = { remove_title = title_ladys_champion }
		}
		opinion = {
			modifier = former_champion
			who = FROM
			years = 10
		}
		reverse_opinion = {
			modifier = former_champion
			who = FROM
			years = 10
		}
	}
}

# ask to become lady's champion
character_event = {
	id = FemRule.145
	desc = EVTDESC_FemRule_145
	picture = GFX_evt_knight_kneeling
	
	only_men = yes
	min_age = 16
	prisoner = no
	capable_only = yes
	is_sick = no
	
	trigger = {
		OR = {
			trait = misguided_warrior
			trait = tough_soldier
			trait = skilled_tactician
			trait = brilliant_strategist
		}
		NOR = {
			trait = craven
			health_traits = 1
			has_character_flag = retired_champion
			has_character_flag = ask_not_champion
			has_minor_title = title_ladys_champion
		}
		liege = {
			OR = {
				is_feudal = yes
				is_tribal = yes
			}
			is_adult = yes
			is_female = yes
			NOR = {
				religion = baltic_pagan_reformed
				religion = baltic_pagan
				religion = finnish_pagan_reformed
				religion = finnish_pagan
				religion = slavic_pagan_reformed
				religion = slavic_pagan
				religion = west_african_pagan_reformed
				religion = west_african_pagan
				religion = aztec
				has_character_flag = no_more_ask_for_champion
			}
			opinion = { who = ROOT value = 20 }
			reverse_opinion = { who = ROOT value = 20 }
			OR = {
				any_vassal = {
					has_minor_title = title_ladys_champion
					NOT = { martial = ROOT }
				}
				any_courtier = {
					has_minor_title = title_ladys_champion
					NOT = { martial = ROOT }
				}
				NOR = {
					any_vassal = { has_minor_title = title_ladys_champion }
					any_courtier = { has_minor_title = title_ladys_champion }
				}
			}
			OR = {
				ai = yes
				NOT = { has_character_flag = asked_for_champion }
				had_character_flag = { flag = asked_for_champion days = 365 }
			}
		}
	}
	
	mean_time_to_happen = {
		months = 60
		modifier = {
			factor = 0.5
			trait = ambitious
		}
		modifier = {
			factor = 2
			OR = {
				trait = duelist
				trait = poet
			}
		}
		modifier = {
			factor = 0.75
			trait = proud
		}
		modifier = {
			factor = 0.75
			trait = diligent
		}
		modifier = {
			factor = 0.75
			trait = envious
		}
		modifier = {
			factor = 2
			OR = {
				trait = scholar
				trait = gardener
			}
		}
		modifier = {
			factor = 3
			trait = content
		}
		modifier = {
			factor = 3
			trait = humble
		}
		modifier = {
			factor = 0.5
			liege = {
				any_lover = { character = ROOT }
			}
		}
		modifier = {
			factor = 0.75
			liege = {
				reverse_opinion = { who = ROOT value = 40 }
			}
		}
		modifier = {
			factor = 0.75
			liege = {
				reverse_opinion = { who = ROOT value = 60 }
			}
		}
		modifier = {
			factor = 0.75
			liege = {
				reverse_opinion = { who = ROOT value = 80 }
			}
		}
	}
	
	immediate = {
		liege = {  set_character_flag = asked_for_champion }
	}
	
	option = {
		name = EVTOPTA_FemRule_145
		liege = { letter_event = { id = FemRule.146 tooltip = EVTTOOLTIP_FemRule_145 } }
	}
	
	option = {
		trigger = {
			ai = no
		}
		name = EVTOPTB_FemRule_145
		set_character_flag = ask_not_champion
	}
}

#Someone wants to be my champion
letter_event = {
	id = FemRule.146
	desc = EVTDESC_FemRule_146
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_146 #I accept his offer
		ai_chance = {
			factor = 70
			modifier = {
				factor = 0
				OR = {
					any_vassal = {
						has_minor_title = title_ladys_champion
						OR = {
							any_lover = { character = ROOT }
							any_spouse = { character = ROOT }
							is_friend = ROOT
						}
					}
					any_courtier = {
						has_minor_title = title_ladys_champion
						OR = {
							any_lover = { character = ROOT }
							any_spouse = { character = ROOT }
							is_friend = ROOT
						}
					}
				}
			}
		}
		any_vassal = {
			limit = { has_minor_title = title_ladys_champion }
			opinion = {
				modifier = opinion_very_disappointed
				who = ROOT
				years = 5
			}
			remove_title = title_ladys_champion
		}
		any_courtier = {
			limit = { has_minor_title = title_ladys_champion }
			opinion = {
				modifier = opinion_very_disappointed
				who = ROOT
				years = 5
			}
			remove_title = title_ladys_champion
		}
		FROM = {
			give_minor_title = title_ladys_champion
		}
	}
	
	option = {
		name = EVTOPTB_FemRule_146 #I shall keep my current champion
		trigger = {
			OR = {
				any_vassal = { has_minor_title = title_ladys_champion}
				any_courtier = { has_minor_title = title_ladys_champion }
			}
		}
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0.1
				OR = {
					any_spouse = { character = FROM }
					is_lover = FROM
					is_friend = FROM
				}
			}
			modifier = {
				factor = 0.1
				OR = {
					any_vassal = {
						has_minor_title = title_ladys_champion
						NOT = { reverse_opinion = { who = ROOT value = 0 } }
					}
					any_courtier = {
						has_minor_title = title_ladys_champion
						NOT = { reverse_opinion = { who = ROOT value = 0 } }
					}
				}
			}
		}
		any_vassal = {
			limit = { has_minor_title = title_ladys_champion }
			letter_event = { id = FemRule.147 tooltip = EVTTOOLTIP_FemRule_146 }
		}
		any_vassal = {
			limit = { has_minor_title = title_ladys_champion }
			letter_event = { id = FemRule.147 tooltip = EVTTOOLTIP_FemRule_146 }
		}
		FROM = {
			opinion = {
				modifier = opinion_disappointed
				who = ROOT
				years = 5
			}
		}
	}
	
	option = {
		name = EVTOPTC_FemRule_146 #No, and don't ask again.
		ai_chance = {
			factor = 0
		}
		FROM = {
			set_character_flag = ask_not_champion
			opinion = {
				modifier = opinion_very_disappointed
				who = ROOT
				years = 5
			}
		}
	}
	
	option = {
		name = EVTOPTD_FemRule_146 #I want no more requests such as these.
		ai_chance = {
			factor = 0
		}
		set_character_flag = no_more_ask_for_champion
		FROM = {
			opinion = {
				modifier = opinion_very_disappointed
				who = ROOT
				years = 5
			}
		}
	}
}

#champion hears of the request to replace him
letter_event = {
	id = FemRule.147
	desc = EVTDESC_FemRule_147
	
	is_triggered_only = yes
	
	trigger = {
		has_job_title = job_marshal
	}

	option = {
		name = EVTOPTA_FemRule_147 #I must try harder to be worthy
		random_list = {
			50 = { change_martial = 1 }
			50 = {
				modifier = {
					factor = 0
					trait = stressed
				}
				modifier = {
					factor = 0
					trait = depressed
				}
				add_trait = stressed
				hidden_tooltip = { character_event = { id = 38282 }	}
			}
		}
	}
	
	option = {
		name = EVTOPTB_FemRule_147 #So be it
		trigger = {
			NOT = { trait = ambitious }
			NOT = { trait = proud }
		}
		prestige = -5
	}
}

### Female hunting events

#the hunt begins
character_event = {
	id = FemRule.150
	desc = EVTDESC_FemRule_150
	picture = GFX_evt_grazia
	
	min_age =  16
	capable_only = yes
	prisoner = no
	only_women = yes
	has_character_flag = hunt_begin
	
	trigger = {
		has_character_modifier = holding_grand_hunt
		NOR = {
			has_character_flag = female_hunt_begin
			trait = martial_lady
			trait = martial_lady_pagan
			trait = martial_lady_tengri
		}
		OR = {
			NOT = { has_character_flag = hunt_event_happened }
			had_character_flag = {
				flag = hunt_event_happened
				days = 3
			}
		}
		had_character_flag = {
			flag = hunt_begin
			days = 3
		}
	}
	
	mean_time_to_happen = {
		days = 10
	}
	
	option = {
		name = EVTOPTA_FemRule_150
		set_character_flag = female_hunt_begin
		if = {
			limit = { trait = stressed }
			random = {
				chance = 20
				remove_trait = stressed
			}
		}
		if = {
			limit = { trait = depressed }
			random = {
				chance = 20
				remove_trait = depressed
			}
		}
	}
}

#the ruler makes a friend on the hunt
character_event = {
	id = FemRule.151
	desc = EVTDESC_FemRule_151
	picture = GFX_evt_grazia
	
	min_age =  16
	capable_only = yes
	prisoner = no
	only_women = yes
	has_character_flag = female_hunt_begin
	
	trigger = {
		has_character_modifier = holding_grand_hunt
		NOR = {
			has_character_flag = made_hunt_friend
			num_of_friends = 2
			trait = martial_lady
			trait = martial_lady_pagan
			trait = martial_lady_tengri
		}
		any_courtier = {
			is_female = yes
			religion = ROOT
			prisoner = no
			is_adult = yes
			is_abroad_trigger = no
			NOR = {
				num_of_friends = 2
				trait = incapable
				health_traits = 1
				is_friend = ROOT
				is_rival = ROOT
				trait = martial_lady
				trait = martial_lady_pagan
				trait = martial_lady_tengri
			}
		}
		OR = {
			NOT = { has_character_flag = hunt_event_happened }
			had_character_flag = {
				flag = hunt_event_happened
				days = 3
			}
		}
		had_character_flag = {
			flag = hunt_begin
			days = 3
		}
	}

	immediate = {
		set_character_flag = made_hunt_friend
	}
	
	mean_time_to_happen = {
		days = 100
		
		modifier = {
			factor = 0.33
			NOT = { has_character_flag = hunt_event_happened }
		}		
		modifier = {
			factor = 1.5
			has_character_flag = hunt_event_happened
		}
		modifier = {
			factor = 0.75
			trait = kind
		}
		modifier = {
			factor = 0.75
			trait = gregarious
		}
		modifier = {
			factor = 1.25
			trait = cruel
		}
		modifier = {
			factor = 1.25
			trait = content
		}
		modifier = {
			factor = 1.5
			trait = shy
		}
	}
	
	option = {
		name = EVTOPTA_FemRule_151 #I value this new friendship
		ai_chance = {
			factor = 70
			modifier = {
				factor = 0
				trait = shy
			}
		}
		random_courtier = {
			limit = {
				is_female = yes
				religion = ROOT
				prisoner = no
				is_adult = yes
				is_abroad_trigger = no
				NOR = {
					num_of_friends = 2
					trait = incapable
					health_traits = 1
					is_friend = ROOT
					is_rival = ROOT
					trait = martial_lady
					trait = martial_lady_pagan
					trait = martial_lady_tengri
				}
			}
			add_friend = ROOT
			ROOT = { add_friend = PREV }
		}
	}
	
	option = {
		name = EVTOPTB_FemRule_151 #It will not outlast the hunt
		ai_chance = {
			factor = 30
		}
		random_courtier = {
			limit = {
				is_female = yes
				religion = ROOT
				prisoner = no
				is_adult = yes
				is_abroad_trigger = no
				NOR = {
					num_of_friends = 2
					trait = incapable
					health_traits = 1
					is_friend = ROOT
					is_rival = ROOT
					trait = martial_lady
					trait = martial_lady_pagan
					trait = martial_lady_tengri
				}
			}
			opinion = {
				modifier = opinion_acquaintance
				who = ROOT
				years = 2
			}
		}
		if = {
			limit = {
				NOT = { trait = gregarious }
				NOT = { trait = shy }
			}
			random = {
				chance = 20
				add_trait = shy
			}
		}
		if = {
			limit = { trait = gregarious }
			random = {
				chance = 20
				remove_trait = gregarious
			}
		}
	}
}

#the ruler makes a rival on the hunt
character_event = {
	id = FemRule.152
	desc = EVTDESC_FemRule_152
	picture = GFX_evt_grazia
	
	min_age =  16
	capable_only = yes
	prisoner = no
	only_women = yes
	has_character_flag = female_hunt_begin
	
	trigger = {
		has_character_modifier = holding_grand_hunt
		NOR = {
			has_character_flag = made_hunt_rival
			num_of_rivals = 2
			trait = martial_lady
			trait = martial_lady_pagan
			trait = martial_lady_tengri
		}
		any_courtier = {
			is_female = yes
			religion = ROOT
			prisoner = no
			is_adult = yes
			is_abroad_trigger = no
			NOR = {
				num_of_rivals = 2
				trait = incapable
				health_traits = 1
				is_friend = ROOT
				is_rival = ROOT
				trait = martial_lady
				trait = martial_lady_pagan
				trait = martial_lady_tengri
			}
		}
		OR = {
			NOT = { has_character_flag = hunt_event_happened }
			had_character_flag = {
				flag = hunt_event_happened
				days = 3
			}
		}
		had_character_flag = {
			flag = hunt_begin
			days = 3
		}
	}
	
	immediate = {
		set_character_flag = made_hunt_rival
	}
	
	mean_time_to_happen = {
		days = 100
		
		modifier = {
			factor = 0.33
			NOT = { has_character_flag = hunt_event_happened }
		}		
		modifier = {
			factor = 1.5
			has_character_flag = hunt_event_happened
		}
		modifier = {
			factor = 1.5
			trait = kind
		}
		modifier = {
			factor = 1.5
			trait = gregarious
		}
		modifier = {
			factor = 0.75
			trait = cruel
		}
		modifier = {
			factor = 1.25
			trait = content
		}
		modifier = {
			factor = 0.5
			trait = envious
		}
	}
	
	option = {
		name = EVTOPTA_FemRule_152 #How dare she ruin my hunt!
		ai_chance = {
			factor = 70
		}
		random_courtier = {
			limit = {
				is_female = yes
				religion = ROOT
				prisoner = no
				is_adult = yes
				is_abroad_trigger = no
				NOR = {
					num_of_rivals = 2
					trait = incapable
					health_traits = 1
					is_friend = ROOT
					is_rival = ROOT
					trait = martial_lady
					trait = martial_lady_pagan
					trait = martial_lady_tengri
				}
			}
			add_rival = ROOT
			ROOT = { add_rival = PREV }
		}
	}
	
	option = {
		name = EVTOPTB_FemRule_152 #I will grit my teeth and hold my tongue
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0
				trait = wroth
			}
		}
		random_courtier = {
			limit = {
				is_female = yes
				religion = ROOT
				prisoner = no
				is_adult = yes
				is_abroad_trigger = no
				NOR = {
					num_of_friends = 2
					trait = incapable
					health_traits = 1
					is_friend = ROOT
					is_rival = ROOT
					trait = martial_lady
					trait = martial_lady_pagan
					trait = martial_lady_tengri
				}
			}
			reverse_opinion = {
				modifier = opinion_irritated
				who = ROOT
				years = 2
			}
		}
		if = {
			limit = {
				NOT = { trait = stressed }
			}
			random = {
				chance = 20
				add_trait = stressed
			}
		}
		if = {
			limit = {
				NOT = { trait = wroth }
				NOT = { trait = patient }
			}
			random = {
				chance = 20
				add_trait = patient
			}
		}
		if = {
			limit = { trait = wroth }
			random = {
				chance = 20
				remove_trait = wroth
			}
		}
	}
}

