###############
# Job Ambitions
###############

obj_become_master_of_ceremonies = {
	type = character
	
	allow = {
		age = 16
		is_female = no
		independent = no
		is_landed = no
		prisoner = no
		is_councillor = no
		NOT = { trait = incapable }
	}
	chance = {
		factor = 100
		modifier = {
			factor = 0.01
			trait = content
		}
		modifier = {
			factor = 1.25
			from_ruler_dynasty = yes
		}
		modifier = {
			factor = 1.5
			trait = poet
		}
		modifier = {
			factor = 1.5
			trait = falconer
		}
		modifier = {
			factor = 2.0
			trait = ambitious
		}
	}
	success = {
		has_job_title = job_master_of_ceremonies
	}
	abort = {
		is_landed = yes
	}
	effect = {
		change_diplomacy = 1
	}
}


obj_become_master_of_arms = {
	type = character
	allow = {
		age = 16
		is_female = no
		independent = no
		is_landed = no
		prisoner = no
		is_councillor = no
		NOT = { trait = incapable }
	}
	chance = {
		factor = 100
		modifier = {
			factor = 0.01
			trait = content
		}
		modifier = {
			factor = 0.1
			trait = craven
		}
		modifier = {
			factor = 1.25
			from_ruler_dynasty = yes
		}
		modifier = {
			factor = 1.5
			trait = hunter
		}
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 2.0
			trait = ambitious
		}
	}
	success = {
		has_job_title = job_master_of_arms
	}
	abort = {
		is_landed = yes
	}
	effect = {
		change_martial = 1
	}
}


obj_become_master_of_the_guard = {
	type = character
	allow = {
		age = 16
		is_female = no
		independent = no
		is_landed = no
		prisoner = no
		is_councillor = no
		NOT = { trait = incapable }
	}
	chance = {
		factor = 100
		modifier = {
			factor = 0.01
			trait = content
		}
		modifier = {
			factor = 0.1
			trait = kind
		}
		modifier = {
			factor = 0.1
			trait = honest
		}
		modifier = {
			factor = 1.25
			from_ruler_dynasty = yes
		}
		modifier = {
			factor = 1.5
			trait = envious
		}
		modifier = {
			factor = 2.0
			trait = deceitful
		}
		modifier = {
			factor = 2.0
			trait = ambitious
		}
	}
	success = {
		has_job_title = job_master_of_the_guard
	}
	abort = {
		is_landed = yes
	}
	effect = {
		change_intrigue = 1
	}
}


###############
# PLOTS
###############

# Gain title
plot_attack_title = {
	type = attack_title
	plot = yes
	potential = {
		age = 16
		is_female = no
		independent = yes
		prisoner = no
		NOT = { trait = incapable }
	}
	allow = {
		any_independent_neighbor = {
			character = ROOT
		}
	}
	chance = {
		factor = 100
		modifier = {
			factor = 0.25
			trait = content
		}
		modifier = {
			factor = 2.0
			trait = envious
		}
		modifier = {
			factor = 10.0
			trait = ambitious
		}
	}
	success = {
		always = no
	}
	abort = {
		OR = {
			ROOT = { independent = no }
			independent = no
		}
	}
	abort_effect = {
	}
	expose_effect = {
	}
	effect = {
	}
}

# Break free of clan
plot_form_clan = {
	type = form_clan
	plot = yes
	potential = {
		age = 16
		is_female = no
		independent = no
		prisoner = no
		NOT = { trait = incapable }
	}
	allow = {
		is_liege = ROOT
	}
	chance = {
		factor = 100
		modifier = {
			factor = 0.25
			trait = content
		}
		modifier = {
			factor = 0.25
			from_ruler_dynasty = yes
		}
		modifier = {
			factor = 2.0
			trait = envious
		}
		modifier = {
			factor = 10.0
			trait = ambitious
		}
		modifier = {
			factor = 0.1
			opinion = { who = ROOT value = 50 }
		}
		modifier = {
			factor = 1.25
			NOT = { opinion = { who = ROOT value = 0 } }
		}
		modifier = {
			factor = 2.0
			NOT = { opinion = { who = ROOT value = -25 } }
		}
		modifier = {
			factor = 5.0
			NOT = { opinion = { who = ROOT value = -50 } }
		}
	}
	success = {
		ROOT = { independent = yes }
	}
	abort = {
		NOT = { is_liege = ROOT }
	}
	abort_effect = {
	}
	expose_effect = {
	}
	effect = {
	}
}

# Usurp clan leadership
plot_take_over_clan = {
	type = take_over_clan
	plot = yes
	potential = {
		age = 16
		is_female = no
		independent = no
		prisoner = no
		NOT = { trait = incapable }
	}
	allow = {
		dynasty = ROOT
		is_liege = ROOT
		civil_war = no
		ROOT = { is_primary_heir = no }
		civil_war = no
	}
	chance = {
		factor = 100
		modifier = {
			factor = 0.25
			trait = content
		}
		modifier = {
			factor = 2.0
			trait = envious
		}
		modifier = {
			factor = 10.0
			trait = ambitious
		}
		modifier = {
			factor = 0.1
			opinion = { who = ROOT value = 50 }
		}
		modifier = {
			factor = 1.25
			NOT = { opinion = { who = ROOT value = 0 } }
		}
		modifier = {
			factor = 2.0
			NOT = { opinion = { who = ROOT value = -25 } }
		}
		modifier = {
			factor = 5.0
			NOT = { opinion = { who = ROOT value = -50 } }
		}
	}
	success = {
		holder = ROOT
	}
	abort = {
		OR = {
			NOT = { is_liege = ROOT }
			civil_war = yes
		}
	}
	abort_effect = {
	}
	expose_effect = {
	}
	effect = {
	}
}
