targeted_decisions = {
	create_mercenary_company_feudal = {
		only_playable = yes
		filter = home_court
		ai_target_filter = home_court
		ai_check_interval = 12
		from_potential = {
			is_playable = yes
			is_landed = yes
			mercenary = no
			holy_order = no
			has_dlc = "Zeus"
		
			OR = {
				ai = no
				AND = {
					OR = {
						trait = brilliant_strategist
						trait = fortune_builder
					}
					OR = {
						higher_tier_than = COUNT
						AND = {
							is_republic = yes
							higher_tier_than = BARON
						}
					}
					NOR = {
						is_primary_war_attacker = yes
						is_primary_war_defender = yes
					}
				}
			}
			NOR = {
				government = nomadic_government
				has_character_modifier = mercenary_traditions
			}
		}
		
		potential = {
			can_be_mercenary_leader_potential_trigger = yes
		}
		
		allow = {
			can_be_mercenary_leader_allow_trigger = yes
			FROM = {
				NOT = { has_mercenary_band = yes }
				wealth = 50
			}
		}
		effect = {
			FROM = {
				wealth = -50
				custom_tooltip = {
					text = CREATE_DYNAMIC_MERC_TOOLTIP
					hidden_tooltip = {
						primary_title = {
							create_title = {
								tier = DUKE
								name = DYNAMIC_MERCENARY_COMPANY_FEUDAL
								landless = yes
								temporary = yes
								adventurer = yes
								custom_created = yes
								culture = ROOT
								holder = ROOT
								base_title = THIS
								mercenary = yes
								replace_captain_on_death = yes
								siphons_income_to_creator = 0.15
								ruler = "CAPTAIN"
								ruler_female = "CAPTAIN"
								foa = "CAPTAIN_FOA"
							}
						}
						ROOT = {
							set_defacto_liege = THIS
						}
					}
				}
			}
			set_character_flag = is_mercenary_leader
			set_character_flag = mercenary_ambition_1
			primary_title = {
				set_title_flag = ze_dyn_merc
				set_title_flag = not_hired
			}
		}
		ai_will_do = {
			factor = 0.01
			
			modifier = { 
				factor = 0
				controls_religion = yes
			}
			
		}
	}

	dissolve_mercenary_company_feudal = {
		only_playable = yes
		ai_target_filter = dynasty
		
		from_potential = {
			is_playable = yes
			is_landed = yes
			has_dlc = "Zeus"
		}
		potential = {
			replace_mercenary_captain_potential_trigger = yes
		}
		allow = {
			replace_mercenary_captain_allow_trigger = yes
		}
		effect = {
			character_event = { id = ZE.11020 }
		}
		ai_will_do = {
			factor = 0
		}
	}

	change_council_job = {
		only_rulers = yes
		filter = realm
		ai_target_filter = self 
		
		from_potential = {
			has_dlc = "Zeus"
			is_ruler = yes
		}
		potential = {
			change_council_job_potential_trigger = yes
		}
		allow = {
			NOT = {
				has_character_modifier = in_seclusion
			}
		}
		effect = {
			hidden_tooltip = {
				character_event = { id = ZE.6020 }
			}
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	ask_wards_liege_to_allow_culture_religion_swap = {
		only_playable = yes
		filter = sub_realm
		ai_target_filter = home_court
		ai_check_interval = 12
		
		from_potential = {
			is_playable = yes
			has_dlc = "Zeus"
		}
		
		potential = {
			prisoner = no
			is_adult = no
			is_landed = no
			NOR = { 
				has_character_flag = guardian_asked_to_change_focus
				has_focus = focus_ch_heritage
				character = FROM
				liege = { character = FROM }
			}
			host = {
				OR = {
					character = FROM
					is_liege_or_above = FROM
				}
			}
			NOT = {
				educator = {
					culture = ROOT
					religion = ROOT
				}
			}
		}
		
		allow = { 
			NOT = { 
				age = 10
			}
		}
		
		effect = {
			set_character_flag = guardian_asked_to_change_focus
			liege = {
				if = {
					limit = { FROM = { holds_favor_on = PREV } }
					tooltip = { reverse_remove_favor = FROM }
				}
				letter_event = { id = ZE.2130 days = 5 }
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOT = { host = { character = FROM } }
			}
			modifier = {
				factor = 0.25
			}
			modifier = {
				factor = 4
				liege = {
					FROM = { holds_favor_on = PREV }
				}
			}
			modifier = {
				factor = 2
				NOT = { educator = { religion = ROOT } }
				FROM = { trait = zealous }
			}
			modifier = {
				factor = 0.25
				NOT = { educator = { religion = ROOT } }
				FROM = { trait = cynical }
			}
			modifier = {
				factor = 2
				NOT = { educator = { culture = ROOT } }
				FROM = { trait = diligent }
			}
			modifier = {
				factor = 0.5
				trait = slothful
			}
			modifier = {
				factor = 0.5
				trait = humble
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 0
				NOT = {
					educator = {
						culture = FROM
						religion = FROM
					}
				}
			}
		}
	}

	ask_for_pardon = {
		only_playable = yes
		filter = liege
		ai_target_filter = liege
		
		is_high_prio = yes
		
		from_potential = {
			has_dlc = "Zeus"
			is_playable = yes
			NOT = { trait = incapable }
		}
		potential = {
			ROOT = { is_liege_or_above = FROM }
			has_regent = no
			OR = {
				has_opinion_modifier = { who = FROM modifier = opinion_dishonorable }
				has_opinion_modifier = { who = FROM modifier = opinion_traitor }
				has_opinion_modifier = { who = FROM modifier = opinion_rebel_traitor }
				has_opinion_modifier = { who = FROM modifier = opinion_regicide_traitor }
				has_opinion_modifier = { who = FROM modifier = opinion_targeted_by_adventurer }
				has_opinion_modifier = { who = FROM modifier = slut_seductress }
				has_opinion_modifier = { who = FROM modifier = attempted_murder_of_spouse }
				has_opinion_modifier = { who = FROM modifier = attempted_murder_of_child }
				has_opinion_modifier = { who = FROM modifier = attempted_murder_of_parent }
				has_opinion_modifier = { who = FROM modifier = attempted_murder_of_sibling }
				has_opinion_modifier = { who = FROM modifier = attempted_murder_of_vassal }
				has_opinion_modifier = { who = FROM modifier = attempted_murder }
				has_opinion_modifier = { who = FROM modifier = opinion_spouse_slayer }
				has_opinion_modifier = { who = FROM modifier = opinion_murder_attempt }
				has_opinion_modifier = { who = FROM modifier = opinion_killed_close_kin }
				has_opinion_modifier = { who = FROM modifier = opinion_fatwa_target }
				has_opinion_modifier = { who = FROM modifier = opinion_refused_order }
				has_opinion_modifier = { who = FROM modifier = opinion_witch }
				has_opinion_modifier = { who = FROM modifier = opinion_takfir }
				has_opinion_modifier = { who = FROM modifier = opinion_unfaithful_wife }
				has_opinion_modifier = { who = FROM modifier = opinion_unfaithful_husband }
				has_opinion_modifier = { who = FROM modifier = opinion_cuckolded }
				has_opinion_modifier = { who = FROM modifier = opinion_charge_heresiarch }
				has_opinion_modifier = { who = FROM modifier = opinion_charge_infidel }
				has_opinion_modifier = { who = FROM modifier = opinion_charge_deviant }
				has_opinion_modifier = { who = FROM modifier = opinion_charge_illegitimate }
				has_opinion_modifier = { who = FROM modifier = opinion_charge_traitor }
				has_opinion_modifier = { who = FROM modifier = opinion_charge_slanderer }
				has_opinion_modifier = { who = FROM modifier = abuse_of_office }
				has_opinion_modifier = { who = FROM modifier = attempted_kidnapping }
				has_opinion_modifier = { who = FROM modifier = attempted_kidnapping_of_kin }
				has_opinion_modifier = { who = FROM modifier = attempted_kidnapping_of_vassal }
				has_opinion_modifier = { who = FROM modifier = attempted_murder_of_close_kin }
				has_opinion_modifier = { who = FROM modifier = devious_plotter }
				has_opinion_modifier = { who = FROM modifier = killed_vassal }
				has_opinion_modifier = { who = FROM modifier = mad_heretic }
				has_opinion_modifier = { who = FROM modifier = opinion_civil_war_loser }
				has_opinion_modifier = { who = FROM modifier = opinion_independent }
				has_opinion_modifier = { who = FROM modifier = opinion_kidnapped_kin }
				has_opinion_modifier = { who = FROM modifier = opinion_eloped_target }
			}
		}
		allow = {
			owes_favor_to = FROM
		}
		effect = {
			hidden_tooltip = {
				FROM = { save_event_target_as = pardon_target }
				character_event = { id = ZE.8120 }
			}
		}
		ai_will_do = {
			factor = 1000
		}
	}
	
	change_composition_mercenary_company_feudal = {
		only_playable = yes
		ai_target_filter = dynasty
		ai_check_interval = 12
		from_potential = {
			is_playable = yes
			is_landed = yes
			has_dlc = "Zeus"
			has_mercenary_band = yes
		}
		potential = {
			replace_mercenary_captain_potential_trigger = yes
		}
		allow = {
			FROM = {
				wealth = 50
			}
			replace_mercenary_captain_allow_trigger = yes
		}
		effect = {
			character_event = { id = ZE.23100 }
		}
		ai_will_do = {
			factor = 0.01
		}
	}
	
	send_troops_mercenary_company_feudal = {
		only_playable = yes
		ai_target_filter = dynasty
		ai_check_interval = 12
		from_potential = {
			is_playable = yes
			is_landed = yes
			has_dlc = "Zeus"
			has_mercenary_band = yes
		}
		potential = {
			replace_mercenary_captain_potential_trigger = yes
		}
		allow = {
			FROM = {
				wealth = 50
			}
			replace_mercenary_captain_allow_trigger = yes
		}
		effect = {
			character_event = { id = ZE.23105 }
		}
		ai_will_do = {
			factor = 0.01
		}
	}
	
	introduce_heir = {
		only_playable = yes
		is_high_prio = yes
		
		filter = home_court
		ai_target_filter = home_court
		ai_check_interval = 12
		
		only_rulers = yes
	
		from_potential = {
			is_playable = yes
			has_ambition = obj_groom_an_heir
			has_regent = no
			num_of_vassals = 7
		}
		
		potential = {
			is_child_of = FROM
			host = { character = FROM }
			is_ruler = no
			dynasty = FROM
			can_inherit_trigger = yes
			NOR = {
				trait = incapable
				trait = celibate
				is_ascetic_trigger = yes
				has_character_flag = introduced_heir
				any_sibling = {
					is_alive = yes
					has_character_flag = introduced_heir
				}
			}
			OR = {
				AND = {
					FROM = {
						OR = {
							has_law = succ_gavelkind
							has_law = succ_primogeniture
							has_law = succ_turkish_succession
							has_law = succ_nomad_succession
						}
					}
					is_primary_heir = FROM
				}
				AND = {
					FROM = {
						OR = {
							is_vice_royalty = yes
							has_law = succ_feudal_elective
						}							
					}
					any_heir_title = {
						tier = COUNT
						holder = FROM
						location = { is_capital = yes }
					}
				}
			}
		}
		allow = {
			age = 12
			prisoner = no
			is_ill = no
			NOT = { is_inaccessible_trigger = yes }
			FROM = {
				war = no
				NOT = { is_inaccessible_trigger = yes }
			}
		}
		effect = {
			custom_tooltip = {
				text = introduce_heir_custom_tooltip
				hidden_tooltip = {
					set_character_flag = introduced_heir
					save_event_target_as = introduced_heir
					FROM = { character_event = { id = ZE.22900 } }
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 10
				age = 15
			}
			modifier = {
				factor = 10
				FROM = { higher_tier_than = DUKE }
			}
		}
	}
	
	ask_wards_liege_to_allow_faith_focus = {
		only_playable = yes
		filter = sub_realm
		ai_target_filter = home_court
		ai_check_interval = 12
		
		from_potential = {
			is_playable = yes
			has_dlc = "Zeus"
		}
		
		potential = {
			prisoner = no
			is_adult = no
			is_landed = no
			NOR = {
				has_character_flag = guardian_asked_to_change_focus
				has_focus = focus_ch_faith
				character = FROM
			}
			host = {
				OR = {
					character = FROM
					is_liege_or_above = FROM
				}
			}
			NOT = { liege = { character = FROM } }
			OR = {
				is_landed = no
				liege = { character = FROM }
			}
			NOT = {
				educator = {
					religion = ROOT
				}
			}
		}
		
		allow = {
			NOT = {
				age = 10
			}
		}
		
		effect = {
			set_character_flag = guardian_asked_to_change_focus
			if = {
				limit = {
					liege = { character = FROM }
				}
				hidden_tooltip = {
					clear_focus = yes
				}
				set_focus = focus_ch_faith
				break = yes
			}
			hidden_tooltip = {
				liege = {
					letter_event = { id = ZE.2140 days = 5 }
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOT = { host = { character = FROM } }
			}
			modifier = {
				factor = 0
				NOT = {
					educator = {
						religion = FROM
					}
				}
			}
			modifier = {
				factor = 0.5
			}
		}
	}
	
	change_wards_focus_to_faith  = {
		only_playable = yes
		filter = court
		ai_target_filter = court
		ai_check_interval = 12
		
		from_potential = {
			is_playable = yes
			has_dlc = "Zeus"
		}
		
		potential = {
			is_adult = no
			NOR = {
				has_character_flag = guardian_asked_to_change_focus
				has_focus = focus_ch_faith
				character = FROM
			}
			host = { character = FROM }
			OR = {
				liege = { character = FROM }
				prisoner = yes
			}
			OR = {
				is_landed = no
				is_liege_or_above = FROM
				prisoner = yes
			}
			NOT = {
				educator = {
					religion = ROOT
				}
			}
		}
		
		allow = {
			NOT = {
				age = 10
			}
		}
		
		effect = {
			set_character_flag = guardian_asked_to_change_focus
			if = {
				limit = {
					OR = {
						liege = { character = FROM }
						prisoner = yes
					}
				}
				hidden_tooltip = {
					clear_focus = yes
				}
				set_focus = focus_ch_faith
				break = yes
			}
			hidden_tooltip = {
				liege = {
					letter_event = { id = ZE.2140 days = 5 }
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
			}
		}
	}
}