##########################################
# COUNCILLOR TITLES
##########################################

#	attribute: This attribute is added to the ruler's for governance purposes
#	viceroy: This is the Viceroy title for de jure Kingdoms
#	allow: conditions for the character to hold the title
#	gain_effect: fires when the title is granted
#	lose_effect: fires when a title is lost if dismissal_trigger evaluates to false
#	The other fields are all character modifiers.

job_chancellor = {
	is_chancellor = yes
	attribute = diplomacy
	dignity = 0.33
	opinion_effect = 15
	
	monthly_salary = 0.1
	monthly_prestige = 0.015
	
	allow = {
		OR = {
			AND = {
				OR = {
					is_female = no
					AND = {
						religion = cathar
						liege = { religion = cathar }
					}
				}
				is_adult = yes
			}
			has_character_flag = special_chancellor
		}
		
		prisoner = no
		NOT = { trait = incapable }
	}
	gain_effect = {
			add_character_modifier = {
			name = member_of_government
			duration = 730
		}
			add_character_modifier = {
			name = head_of_government
			duration = 730
		}
		add_trait=new_council
		remove_trait=new_steward
		remove_trait=new_priest
		remove_trait=new_spy
		remove_trait=new_marshal
		remove_trait=hist_council
		remove_trait=hist_marshal
		remove_trait=hist_spy
		remove_trait=hist_steward
		remove_trait=hist_priest
	}
	lose_effect = {
		opinion = { who = FROM modifier = opinion_fired_from_council }
		remove_character_modifier = member_of_government
		remove_character_modifier = head_of_government
		remove_trait=new_council
		remove_trait=hist_marshal
		remove_trait=new_steward
		remove_trait=new_priest
		remove_trait=hist_spy
		add_trait=hist_council
	}
	
	action = action_improve_relations
	action = action_fabricate_claims
	action = action_sow_dissent

	lift_fow = yes
}

# NOTE: The allow trigger for this job also determines who can command armies!
job_marshal = {
	is_marshal = yes
	attribute = martial
	dignity = 0.33
	opinion_effect = 15
	
	monthly_salary = 0.1
	monthly_prestige = 0.015
	
	allow = {
		OR = {
			AND = {
				OR = {
					is_female = no
					AND = {
						religion = cathar
						liege = { religion = cathar }
					}
				}
				OR = {
					NOT = { religion = hindu }
					trait = kshatriya
				}
				is_adult = yes
			}
			has_character_flag = special_marshal
		}
		
		prisoner = no
		NOT = { trait = incapable }
		NOT = { has_character_flag = guru }
	}
	
	gain_effect = {
			add_character_modifier = {
			name = member_of_government
			duration = 730
			}
			add_character_modifier = {
			name = head_of_military
			duration = 730
			}
		add_trait=new_marshal
		remove_trait=new_steward
		remove_trait=new_priest
		remove_trait=new_spy
		remove_trait=new_council
		remove_trait=hist_council
		remove_trait=hist_marshal
		remove_trait=hist_spy
		remove_trait=hist_steward
		remove_trait=hist_priest
		}
	lose_effect = {
		opinion = { who = FROM modifier = opinion_fired_from_council }
		remove_character_modifier = member_of_government
		remove_character_modifier = head_of_military
		remove_trait=new_council
		remove_trait=hist_marshal
		remove_trait=new_steward
		remove_trait=new_priest
		remove_trait=hist_spy
		add_trait=hist_marshal
	}
	
	action = action_assist_arrest
	action = action_train_troops
	action = action_advance_mil_tech

	lift_fow = yes
}

job_treasurer = {
	is_treasurer = yes
	attribute = stewardship
	dignity = 0.2
	opinion_effect = 15
	
	monthly_salary = 0.1
	monthly_prestige = 0.015
	
	allow = {
		OR = {
			AND = {
				OR = {
					is_female = no
					AND = {
						religion = cathar
						liege = { religion = cathar }
					}
				}
				is_adult = yes
			}
			has_character_flag = special_treasurer
		}
		prisoner = no
		NOT = { trait = incapable }
		NOT = { has_character_flag = guru }
	}
	gain_effect = {
			add_character_modifier = {
			name = member_of_government
			duration = 730
			}
			add_character_modifier = {
			name = head_of_finance
			duration = 730
			}
		add_trait=new_steward
		remove_trait=new_marshal
		remove_trait=new_priest
		remove_trait=new_spy
		remove_trait=new_council
		remove_trait=hist_council
		remove_trait=hist_marshal
		remove_trait=hist_spy
		remove_trait=hist_steward
		remove_trait=hist_priest
	}
	lose_effect = {
		opinion = { who = FROM modifier = opinion_fired_from_council }
		remove_character_modifier = member_of_government
		remove_character_modifier = head_of_finance
		remove_trait=new_council
		remove_trait=hist_marshal
		remove_trait=new_steward
		remove_trait=new_priest
		remove_trait=hist_spy
		add_trait=hist_steward
	}
	
	action = action_squeeze_peasants
	action = action_oversee_construction
	action = action_advance_eco_tech

	lift_fow = yes
}

job_spymaster = {
	is_spymaster = yes
	attribute = intrigue
	dignity = 0.1
	opinion_effect = 15
	
	monthly_salary = 0.1
	
	allow = {
		OR = {
			AND = {
				OR = {
					is_female = no
					liege = { 
						OR = {
							mother = { character = FROM }
							spouse = { character = FROM }
						}
					}
					AND = {
						religion_group = pagan_group
						liege = {
							religion_group = pagan_group
						}
					}
					AND = {
						religion = cathar
						liege = { religion = cathar }
					}
				}
				is_adult = yes
			}
			has_character_flag = special_spymaster
		}
		
		prisoner = no
		NOT = { trait = incapable }
		NOT = { has_character_flag = guru }
	}
	gain_effect = {
	add_character_modifier = {
			name = member_of_government
			duration = 730
			}
			add_character_modifier = {
			name = head_of_spies
			duration = 730
			}
		add_trait=new_spy
		remove_trait=new_marshal
		remove_trait=new_priest
		remove_trait=new_steward
		remove_trait=new_council
		remove_trait=hist_council
		remove_trait=hist_marshal
		remove_trait=hist_spy
		remove_trait=hist_steward
		remove_trait=hist_priest
	}
	lose_effect = {
		opinion = { who = FROM modifier = opinion_fired_from_council }
		remove_character_modifier = member_of_government
		remove_character_modifier = head_of_spies
		remove_trait=new_council
		remove_trait=hist_marshal
		remove_trait=new_steward
		remove_trait=new_priest
		remove_trait=hist_spy
		add_trait=hist_spy
}
	
	action = action_uncover_plots
	action = action_organize_spies
	action = action_study_technology

	lift_neighbor_fow = yes
}

job_spiritual = {
	is_spiritual = yes
	attribute = learning
	dignity = 0.15
	opinion_effect = 15
	
	monthly_salary = 0.1
	monthly_piety = 0.015
	
	allow = {
		prisoner = no
		liege = {
			religion = ROOT
		}
		OR = {
			AND = {
				is_adult = yes
				OR = {
					is_female = no
					AND = {
						religion_group = pagan_group
						NOT = { religion = aztec }
						NOT = { religion = aztec_reformed}
						NOT = { religion = tengri_pagan }
						NOT = { religion = tengri_pagan_reformed}
					}
					religion = cathar
					religion = bogomilist
				}
				OR = {
					NOT = { religion = hindu }
					trait = brahmin
				}
			}
			has_character_flag = special_spiritual
		}
		
		NOT = { trait = incapable }
		
		OR = {
			is_theocracy = yes
			liege = { religion_group = muslim }
			AND = {
				is_ruler = no
				has_autocephaly = no
			}
		}
		
		OR = {
			NOT = { religion_group = muslim }
			NOT = { liege = { religion_group = muslim } }
			trait = detached_priest
			trait = martial_cleric
			trait = scholarly_theologian
			trait = mastermind_theologian
		}
	}
	gain_effect = {
	add_character_modifier = {
			name = member_of_government
			duration = 730
			}
			add_character_modifier = {
			name = head_of_church
			duration = 730
			}
		add_trait=new_priest
		remove_trait=new_marshal
		remove_trait=new_spy
		remove_trait=new_steward
		remove_trait=new_council
		remove_trait=hist_council
		remove_trait=hist_marshal
		remove_trait=hist_spy
		remove_trait=hist_steward
		remove_trait=hist_priest
			
	}
	lose_effect = {
		opinion = { who = FROM modifier = opinion_fired_from_council }
		remove_character_modifier = member_of_government
		remove_character_modifier = head_of_church
		remove_trait=new_council
		remove_trait=hist_marshal
		remove_trait=new_steward
		remove_trait=new_priest
		remove_trait=hist_spy
		add_trait=hist_priest
	}
	dismiss_trigger = {
		NOT = { FROM = { religion_group = muslim } }
	}
	
	action = action_inquisition
	action = action_advance_cul_tech
	action = action_improve_rel_relations
	action = action_charity

	lift_fow = yes
}
