###################################
#
# Zeus
# Ambition decisions
#
###################################

# Written by Markus Olsén

decisions = {
	
	request_council_position = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 3
		potential = {
			has_dlc = "Zeus"
			OR = {
				has_ambition = obj_become_chancellor
				has_ambition = obj_become_marshal
				has_ambition = obj_become_treasurer
				has_ambition = obj_become_spymaster
				has_ambition = obj_become_spiritual
			}
			OR = {
				NOT = { has_character_flag = council_membership_requested }
				had_character_flag = { flag = council_membership_requested days = 1825 }
			}
		}
		allow = {
			prisoner = no
			is_voter = no
			prestige = 100
			NOR = { 
				in_revolt = yes
				trait = incapable
				is_inaccessible_trigger = yes
				liege = { 
					OR = {
						in_revolt = yes
						primary_title = { has_law = council_privileges_1 }
						has_opinion_modifier = { who = ROOT modifier = requested_council_position }
						has_opinion_modifier = { who = ROOT modifier = opinion_refused_council }						
					}
				}
			}
		}
		effect = {
			prestige = -50
			custom_tooltip = {
				text = request_council_position_tooltip
				hidden_tooltip = {
					liege = {
						opinion = {
							modifier = requested_council_position
							who = ROOT
							years = 2
						}
						character_event = { id = ZE.6001 days = 3 }			
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOR = {
					among_most_powerful_vassals = 5
					relative_income_to_liege = 0.5
					liege = { is_friend = ROOT }
					liege = { owes_favor_to = ROOT }
					AND = {
						higher_tier_than = BARON
						OR = {
							trait = lunatic
							AND = {
								trait = proud
								trait = ambitious
							}
							AND = {
								has_ambition = obj_become_chancellor
								liege = { job_chancellor = { is_rival = ROOT } }
							}
							AND = {
								has_ambition = obj_become_marshal
								liege = { job_marshal = { is_rival = ROOT } }
							}
							AND = {
								has_ambition = obj_become_treasurer
								liege = { job_treasurer = { is_rival = ROOT } }
							}
							AND = {
								has_ambition = obj_become_spymaster
								liege = { job_spymaster = { is_rival = ROOT } }
							}
							AND = {
								has_ambition = obj_become_spiritual
								liege = { job_spiritual = { is_rival = ROOT } }
							}
							AND = {
								has_ambition = obj_become_spiritual
								liege = { rightful_religious_head = ROOT }
							}
						}
					}
				}
			}
		}
	}

	ask_for_land = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			is_playable = yes
			has_ambition = obj_land_for_son
			higher_tier_than = BARON 
		}
		allow = {
			NOR = { 
				prisoner = yes
				in_revolt = yes
				trait = incapable
				is_inaccessible_trigger = yes
				liege = { in_revolt = yes }
				liege = { has_opinion_modifier = { who = ROOT modifier = requested_land } }
			}
			any_child = {
				is_alive = yes
				is_female = no
				is_landed = no
				is_adult = yes
				prisoner = no
				NOR = {
					any_heir_title = { always = yes }
					trait = bastard
					trait = disinherited
					trait = incapable
					is_ascetic_trigger = yes
					trait = desert_father
					trait = eunuch
					age = 50
				}
				liege = {
					character = ROOT
				}
			}
			liege = { 
				any_demesne_title = {
					tier = COUNT 
					can_be_given_away = yes
					NOT = {
						location = {
							is_capital = yes
						}
					}
				} 
			}
		}
		effect = {
			prestige = -20
			custom_tooltip = {
				text = ask_for_land_tooltip
				hidden_tooltip = {
					liege = { 
						opinion = {
							modifier = requested_land
							who = ROOT
							years = 2
						}
						character_event = { id = ZE.6012 days = 3 }
					}
				}
			}
		}
		ai_will_do = {
			factor = 0.1

			modifier = {
				factor = 2
				trait = proud
			}

			modifier = {
				factor = 2
				trait = stubborn
			}

			modifier = {
				factor = 2
				trait = greedy
			}

			modifier = {
				factor = 2
				trait = ambitious
			}

			modifier = {
				factor = 0.5
				trait = content
			}

			modifier = {
				factor = 0.5
				trait = shy
			}

			modifier = {
				factor = 0.5
				trait = craven
			}

			modifier = {
				factor = 0.5
				trait = humble
			}
		}
	}
}
