########################################################
# MINOR TITLES
# Characters can have any number of these
########################################################
#	grant_limit: Max number of holders.
#	realm_in_name: Append the name of the country after the title (Queen [of Sweden])
#	allowed_to_hold: conditions for the character to hold the title
#	allowed_to_grant: conditions for a ruler to grant the title
#	regent: This is the title for regents (not really "minor")
#	gain_effect: fires when the title is granted
#	lose_effect: fires when a title is lost through most causes
#	retire_effect: fires when a title is lost due to the character stepping down
#	death_effect: fires when a title is lost due to the character dying
#	message: should fire a message to the its owner when set
#	The other fields are all character modifiers.

#######################################
# HARD: AUTO-GRANTED - DO NOT REMOVE!
#######################################

title_regent = {
	realm_in_name = yes
	dignity = 0.9
	revoke_allowed = no
	is_voter = yes
	
	monthly_salary = 0.1
	monthly_prestige = 0.5
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_appointed_regent = {
	is_high_prio = yes
	realm_in_name = yes
	dignity = 0.9
	grant_limit = 1
	opinion_effect = 10
	revoke_allowed = yes

	monthly_salary = 0.05
	monthly_prestige = 0.25

	allowed_to_hold = {
		is_adult = yes
		prisoner = no
		NOT = { trait = incapable }
		has_regent = no
	}
	
	allowed_to_grant = {
		has_regent = no
		NOT = {
			has_game_rule = {
				name = regencies
				value = off
			}
		}
	}
	revoke_trigger = {
		FROM = { has_regent = no }
	}

	gain_effect = {
	}

	lose_effect = {
	}
	message = yes
}

title_ruler_consort = {
	dignity = 0.88
	show_as_title = yes
	realm_in_name = yes
	spouse_context = yes # Title name as if the other gender version of the spouse's ruler title
	revoke_allowed = no
	
	monthly_salary = 0.1
	monthly_prestige = 0.25
	
	gain_effect = {
	}
	
	lose_effect = {
	}

	message = no
}

title_tanist = {
	dignity = 0.86
	show_as_title = yes
	realm_in_name = yes
	revoke_allowed = no
	
	monthly_salary = 0.07
	monthly_prestige = 0.25
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = no
}

title_queen_mother = {
	dignity = 0.85
	show_as_title = yes
	realm_in_name = yes
	revoke_allowed = no
	
	monthly_salary = 0.05
	monthly_prestige = 0.25
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = no
}

title_prince = {
	dignity = 0.8
	show_as_title = yes
	realm_in_name = yes
	revoke_allowed = no
	
	monthly_salary = 0.05
	monthly_prestige = 0.125
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = no
}

# Pagan consort
title_courtesan = {
	dignity = 0.05
#	realm_in_name = yes
	revoke_allowed = no
	
	monthly_salary = 0.02
	monthly_prestige = 0.025
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = no
}

# Commander, granted via its own interaction, so very special
title_commander = {
	is_high_prio = yes
	
	attribute = martial
	dignity = 0.05
	opinion_effect = 5
	realm_in_name = yes
	
	monthly_salary = 0.05
	monthly_prestige = 0.05
	
	revoke_allowed = no # Handled by diplomatic interaction
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		tooltip = { can_hold_title = job_marshal }
		hidden_tooltip = {
			can_be_marshal_trigger = yes
			OR = {
				is_councillor = no
				liege = { ai = no }
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}
	
	message = yes
}

#######################################
# SOFT: GRANTABLE - FULLY MODDABLE
#######################################

title_court_eunuch = {
	dignity = 0.01
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.02
	monthly_prestige = 0.05
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		trait = eunuch
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		NOT = { has_landed_title = e_byzantium }
		NOT = { has_landed_title = e_roman_empire }
		any_realm_character = {
			vassal_of = ROOT
			trait = eunuch
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_court_dwarf = {
	dignity = 0.01
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.02
	monthly_prestige = 0.05
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		trait = dwarf		
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		OR = {
			religion_group = christian
			religion_group = muslim
			religion_group = jewish_group
			religion = egyptian_pagan
			religion = aten_pagan
		}
		any_realm_character = {
			vassal_of = ROOT
			trait = dwarf
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_court_jester = {
	dignity = 0.01
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = -5
	
	monthly_salary = 0.02
	monthly_prestige = -0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}		
		NOT = { has_character_flag = guru }
	}
	
	allowed_to_grant = {
		is_feudal = yes
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		OR = {
			religion_group = christian
			religion_group = jewish_group
			is_pagan_religion = yes
			has_dharmic_religion_trigger = yes
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

# Keeper of the King's Swans
title_keeper_of_swans = {
	dignity = 0.05
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.01
	monthly_prestige = 0.1
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}		
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		NOT = { has_landed_title = e_byzantium }
		NOT = { has_landed_title = e_roman_empire }
		OR = {
			religion_group = christian
			religion_group = jewish_group
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_master_of_the_horse = {
	dignity = 0.06
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.1
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		hidden_tooltip = {
			can_be_marshal_trigger = yes
			OR = {
				is_councillor = no
				liege = { ai = no }
			}
		}
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		NOT = { has_landed_title = e_byzantium }
		NOT = { has_landed_title = e_roman_empire }
		OR = {
			religion_group = christian
			is_pagan_religion = yes
			religion_group = jewish_group
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_master_of_the_hunt = {
	dignity = 0.05
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.1
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = {
			primary_title = { temporary = yes }
		}
		is_adult = yes
		NOT = { trait = incapable }
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		hidden_tooltip = {
			can_be_marshal_trigger = yes
			OR = {
				is_councillor = no
				liege = { ai = no }
			}
		}
		NOT = { religion = jain }
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		NOT = { has_landed_title = e_byzantium }
		NOT = { has_landed_title = e_roman_empire }
		OR = {
			religion_group = christian
			is_pagan_religion = yes
			religion_group = jewish_group
			has_dharmic_religion_trigger = yes
		}
		NOT = { religion = jain }
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_high_almoner = {
	dignity = 0.03
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.1
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}		
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		NOT = { has_landed_title = e_byzantium }
		NOT = { has_landed_title = e_roman_empire }
		OR = {
			religion_group = christian
			religion_group = jewish_group
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_cupbearer = {
	dignity = 0.1
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.05
	monthly_prestige = 0.15
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		OR = {
			is_female = no
			AND = {
				is_feminist_trigger = yes
				ROOT = { is_feminist_trigger = yes }
			}
			ROOT = {
				primary_title = {
					OR = {						
						has_law = true_cognatic_succession 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession				
					}
				}
			}
		}
		NOT = { has_character_flag = guru }
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		NOT = { has_landed_title = e_byzantium }
		NOT = { has_landed_title = e_roman_empire }
		OR = {
			religion_group = christian
			religion_group = jewish_group
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_seneschal = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.05
	monthly_prestige = 0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		OR = {
			is_female = no
			AND = {
				is_feminist_trigger = yes
				ROOT = { is_feminist_trigger = yes }
			}
			ROOT = {
				primary_title = {
					OR = {						
						has_law = true_cognatic_succession 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
				}
			}
		}	
		NOT = { has_character_flag = guru }
		NOT = { trait = incapable }
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		NOT = { has_landed_title = e_byzantium }
		NOT = { has_landed_title = e_roman_empire }
		OR = {
			religion_group = christian
			religion_group = jewish_group
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_paramount_knight = {
	dignity = 0.8
	grant_limit = 0 
	opinion_effect = 0

	monthly_prestige = 0.5
	
	allowed_to_hold = {
		NOT = { trait = incapable }
	}

	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

# Byzantine Titles
title_despot = {
	dignity = 0.25
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 15
	
	monthly_salary = 0.1
	monthly_prestige = 0.125
	
	counts_as_purple_born = yes
	is_voter = yes
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		OR = {
			is_female = no
			AND = {
				is_feminist_trigger = yes
				FROM = { is_feminist_trigger = yes }
			}
			FROM = {
				primary_title = {
					OR = {						
						has_law = true_cognatic_succession 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
				}
			}
		}
		is_close_relative = FROM
		dynasty = FROM
		is_adult = yes
		NOT = { trait = incapable }
	}
	
	allowed_to_grant = {
		has_dlc = "Zeus"
		is_feudal = yes
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion = hellenic_pagan
		}
		any_close_relative = {
			NOT = { 
				primary_title = { temporary = yes } 
			}
			OR = {
				is_female = no
				AND = {
					is_feminist_trigger = yes
					PREV = { is_feminist_trigger = yes }
				}
				PREV = {
					primary_title = {
						OR = {						
							has_law = true_cognatic_succession 
							has_law = enatic_cognatic_succession
							has_law = enatic_succession
						}
					}
				}
			}
			is_close_relative = PREV
			dynasty = PREV
			is_adult = yes
			NOT = { trait = incapable }
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

## Duplicate title for players without conclave (is_voter disables the title)
title_despot_nc = {
	dignity = 0.25
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 15
	
	monthly_salary = 0.1
	monthly_prestige = 0.125
	
	counts_as_purple_born = yes
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		OR = {
			is_female = no
			AND = {
				is_feminist_trigger = yes
				FROM = { is_feminist_trigger = yes }
			}
			FROM = {
				primary_title = {
					OR = {						
						has_law = true_cognatic_succession 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
				}
			}
		}
		is_close_relative = FROM
		dynasty = FROM
		is_adult = yes
		NOT = { trait = incapable }
	}
	
	allowed_to_grant = {
		NOT = { has_dlc = "Zeus" }
		is_feudal = yes
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion = hellenic_pagan
		}
		any_child = {
			NOT = { 
				primary_title = { temporary = yes } 
			}
			OR = {
				is_female = no
				AND = {
					is_feminist_trigger = yes
					ROOT = { is_feminist_trigger = yes }
				}
				ROOT = {
					primary_title = {
						OR = {						
							has_law = true_cognatic_succession 
							has_law = enatic_cognatic_succession
							has_law = enatic_succession
						}
					}
				}
			}
			is_close_relative = ROOT
			is_adult = yes
			NOT = { trait = incapable }
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_sebastokrator = {
	dignity = 0.2
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.05
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_close_relative = FROM
		OR = {
			is_female = no
			AND = {
				is_feminist_trigger = yes
				ROOT = { is_feminist_trigger = yes }
			}
			ROOT = {
				primary_title = {
					OR = {						
						has_law = true_cognatic_succession 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
				}
			}
		}		
	}
	
	allowed_to_grant = {
		is_feudal = yes
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion = hellenic_pagan
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_caesar = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.05
	
	is_unique = yes
	
	allowed_to_hold = {
		OR = {
			primary_title = { temporary = no }
			NOT = {
				primary_title = {
					always = yes
				}
			}
		}
		always = yes
	}
	
	allowed_to_grant = {
		is_feudal = yes
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion = roman_pagan
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_kouropalates = {
	dignity = 0.10
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		OR = {
			is_female = no
			AND = {
				is_feminist_trigger = yes
				ROOT = { is_feminist_trigger = yes }
			}
			ROOT = {
				primary_title = {
					OR = {						
						has_law = true_cognatic_succession 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
				}
			}
		}		
	}
	
	allowed_to_grant = {
		is_feudal = yes
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion = hellenic_pagan
		}
	}
		
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_anthypatos = {
	dignity = 0.075
	grant_limit = 4
	opinion_effect = 5
	
	monthly_salary = 0.005
	monthly_prestige = 0.05
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		OR = {
			is_female = no
			AND = {
				is_feminist_trigger = yes
				ROOT = { is_feminist_trigger = yes }
			}
			ROOT = {
				primary_title = {
					OR = {						
						has_law = true_cognatic_succession 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
				}
			}
		}		
	}
	
	allowed_to_grant = {
		is_feudal = yes
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion = hellenic_pagan
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_imperial_eunuch = {
	dignity = 0.050
	grant_limit = 1
	opinion_effect = 30
	
	monthly_salary = 0.02
	monthly_prestige = 0.125
	
	allowed_to_hold = {
		is_ruler = no
		is_adult = yes
		is_female = no
		trait = eunuch
	}
	
	allowed_to_grant = {
		is_feudal = yes
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_group = hellenic_pagan_group
		}
		any_courtier = {
			is_ruler = no
			is_adult = yes
			is_female = no
			trait = eunuch
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

# Muslim World titles

title_food_taster = {
	dignity = 0.01
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = -5
	
	monthly_salary = 0.02
	monthly_prestige = -0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		is_female = no		
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		religion_group = muslim
	}
		
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_court_calligrapher = {
	dignity = 0.05
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.01
	monthly_prestige = 0.05
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		is_female = no		
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		religion_group = muslim
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_court_musician = {
	dignity = 0.06
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.1
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion_group = muslim
			has_dharmic_religion_trigger = yes
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_court_poet = {
	dignity = 0.05
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.1
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		is_female = no		
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion_group = muslim
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_chief_architect = {
	dignity = 0.03
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.1
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = {
			prisoner = no
			host = { NOT = { is_liege_of = ROOT } }
		}
		is_female = no		
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion_group = muslim
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_chief_qadi = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.05
	monthly_prestige = 0.15
	
	is_unique = yes
	is_voter = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		is_female = no
		religion_group = muslim
		liege = { religion = PREV }
		OR = {
			trait = detached_priest
			trait = martial_cleric
			trait = scholarly_theologian
			trait = mastermind_theologian
		}
	}

	allowed_to_grant = {
		has_dlc = "Zeus"
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		religion_group = muslim
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

## Duplicate title for players without conclave (is_voter disables the title)
title_chief_qadi_nc = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.05
	monthly_prestige = 0.15
	
	is_unique = yes
	
	allowed_to_hold = {
		OR = {
			primary_title = { temporary = no }
			NOT = {
				primary_title = {
					always = yes
				}
			}
		}
		is_adult = yes
		NOT = { trait = incapable }
		is_female = no
		religion_group = muslim
		liege = { religion = PREV }
		OR = {
			trait = detached_priest
			trait = martial_cleric
			trait = scholarly_theologian
			trait = mastermind_theologian
		}
	}

	allowed_to_grant = {
		NOT = { has_dlc = "Zeus" }
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		religion_group = muslim
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}
# MERCHANT REPUBLIC TITLES

# State Inquisitor
title_state_inquisitor = {
	dignity = 0.06
	realm_in_name = yes
	grant_limit = 3
	opinion_effect = 6
	
	monthly_salary = 0.02
	monthly_prestige = 0.1
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		OR = {
			is_female = no
			AND = {
				is_feminist_trigger = yes
				ROOT = { is_feminist_trigger = yes }
			}
			ROOT = {
				primary_title = {
					OR = {						
						has_law = true_cognatic_succession 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
				}
			}
		}		
	}

	allowed_to_grant = {
		is_merchant_republic = yes
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_high_admiral = {
	dignity = 0.1
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.05
	monthly_prestige = 0.15
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
			}
		}
	}
	
	allowed_to_grant = {
		is_merchant_republic = yes
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_high_judge = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.05
	monthly_prestige = 0.15
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		OR = {
			is_female = no
			AND = {
				is_feminist_trigger = yes
				ROOT = { is_feminist_trigger = yes }
			}
			ROOT = {
				primary_title = {
					OR = {						
						has_law = true_cognatic_succession 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
				}
			}
		}		
	}

	allowed_to_grant = {
		is_merchant_republic = yes
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

# Special - This title determines the heir of a Patrician
title_patrician_heir = {
	is_high_prio = yes
	
	dignity = 0.05
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 25
	
	patrician_heir = yes
	
	monthly_salary = 0.01
	monthly_prestige = 0.15
	
	allowed_to_hold = {
		OR = {
			primary_title = { temporary = no }
			NOT = {
				primary_title = {
					always = yes
				}
			}
		}
		is_female = no
		is_landed = no
		dynasty = FROM
		NOR = {
			trait = bastard
			trait = incapable
			is_ascetic_trigger = yes
			trait = eunuch
			trait = celibate
		}
	}

	allowed_to_grant = {
		is_patrician = yes
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

# NORSE PAGAN TITLES

title_volva = {
	dignity = 0.050
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		is_female = yes
		trait = mystic
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
		}
	}
	
	allowed_to_grant = {
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
		}
		any_realm_character = {
			vassal_of = ROOT
			is_adult = yes
			is_female = yes
			trait = mystic
			OR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
			}
		}
	}
		
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_lawspeaker = {
	dignity = 0.2
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
			religion = german_pagan
			religion = german_pagan_reformed
		}
	}
	
	allowed_to_grant = {
		NOT = { culture = icelandic }
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
			religion = german_pagan
			religion = german_pagan_reformed
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_drottseti = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
		}
		higher_tier_than = DUKE
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_court_skald = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		trait = poet
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
			religion = german_pagan
			religion = german_pagan_reformed
		}
		any_realm_character = {
			vassal_of = ROOT
			is_adult = yes
			trait = poet
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_marksman = {
	dignity = 0.1
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
				trait = shieldmaiden
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
				trait = shieldmaiden
			}
		}
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
			religion = german_pagan
			religion = german_pagan_reformed
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_ravenkeeper = {
	dignity = 0.05
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.005
	monthly_prestige = 0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = { 
				is_female = no
				can_hold_title = job_marshal
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
			}
		}
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
			religion = german_pagan
			religion = german_pagan_reformed
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_ravenseye = {
	dignity = 0.1
	realm_in_name = no
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.01
	monthly_prestige = 0.5
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_priest = yes
		is_adult = yes
		NOT = { trait = incapable } 
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
		}
		has_landed_title = d_norse_pagan_reformed
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_ravensbeak = {
	dignity = 0.1
	realm_in_name = no
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.01
	monthly_prestige = 0.5
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_priest = yes
		is_adult = yes
		NOT = { trait = incapable } 
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
		}
		has_landed_title = d_norse_pagan_reformed
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_hirdman = {
	dignity = 0.075
	grant_limit = 4
	opinion_effect = 5
	
	monthly_salary = 0.005
	monthly_prestige = 0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
				trait = shieldmaiden
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
				trait = shieldmaiden
			}
		}
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
			religion = german_pagan
			religion = german_pagan_reformed
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

# Champion of Midgard squire
title_champions_squire = {
	is_high_prio = yes
	attribute = martial
    dignity = 1
    realm_in_name = no
	grant_limit = 1
	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.1
	
	allowed_to_grant = {
		has_dlc = "Mystics"
		society_member_of = norse_champions
		ai = no
	}
	
	allowed_to_hold = {
		custom_tooltip = {
			text = court_physician_tooltip_1
			NOT = {
				primary_title = { temporary = yes } 
			}
		}
		is_adult = yes
		OR = {
			society_member_of = norse_champions
			is_in_society = no
		}

		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
		NOT = { age = 31 }
		prisoner = no
		is_ruler = no
		
		hidden_trigger = {
			liege = { society_member_of = norse_champions }
			ai = yes
			NOT = { has_character_flag = completed_squireship }
			OR = {
				trait = brilliant_strategist
				trait = skilled_tactician
				trait = brave
				trait = strong
				trait = robust
				trait = duelist
				trait = valhalla_bound
				trait = varangian
				trait = viking
				trait = ravager
				trait = seaking
				trait = sea_queen
				trait = shieldmaiden
				trait = robmodnorse_oathsman
				martial = 8
				combat_rating = 2
			}
			NOR = {
				trait = craven
				trait = weak
				trait = feeble
				trait = humble
				trait = infirm
				NOT = { martial = 4 }
				trait = incapable
			}
			OR = {
				is_female = no
				can_hold_title = job_marshal
				trait = shieldmaiden
				AND = {
					is_landed = yes
					is_priest = no
					is_republic = no
				}
			}
			NOR = {
				has_character_flag = society_join_block
				trait = robmodnorse_ex_grand_champion
			}
		}
	}

	revoke_trigger = {
		always = no
	}
	
	gain_effect = {
		if = {
			limit = { NOT = { society_member_of = norse_champions } }
			join_society = norse_champions
		}
		character_event = { id = robmodnorse.00371 days = 4500 random = 1000 }  #Some years later, the apprenticeship ends
		# TO DO: QUEST TO FIND SQUIRE
		#FROM = {
		#	if = {
		#		limit = { has_quest = quest_norse_champions_appoint_squire }
		#		character_event = { id = MNM.1409 }
		#	}
		#}
	}
	lose_effect = {
	}
	retire_effect = {
	}

	message = yes
}

# Beyð preferred heir
title_norse_preferred_heir = {
	is_high_prio = yes
    dignity = 2
    realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	monthly_salary = 0.1
	
	allowed_to_grant = {
		religion = norse_pagan_reformed
		higher_tier_than = DUKE
		primary_title = { has_law = succ_feudal_elective }
	}
	
	allowed_to_hold = {
		dynasty = FROM
		is_incapable = no
		NOT = { trait = bastard }
		custom_tooltip = {
			text = ROBMODNORSE_TT_PREF_HEIR_MALE
			hidden_tooltip = {
				OR = {
					is_female = no
					FROM = {
						primary_title = {
							NOT = { has_law = agnatic_succession }
						}
					}
				}
			}
		}
	}
	gain_effect = {
		add_character_modifier = {
			modifier = robmodnorse_preferred_heir
			duration = -1
		}
	}
	lose_effect = {
		remove_character_modifier = robmodnorse_preferred_heir
	}
	retire_effect = {
		remove_character_modifier = robmodnorse_preferred_heir
	}

	message = yes
}
# MONGOL PAGAN TITLES

title_baghatur = {
	dignity = 0.2
	realm_in_name = yes
	grant_limit = 2
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
	}

	allowed_to_grant = {
		OR = {
			AND = {
				is_nomadic = yes
				culture = mongol
			}
			AND = {
				OR = {
					is_feudal = yes
					is_tribal = yes
				}
				OR = {
					has_landed_title = e_mongol_empire
					has_landed_title = e_golden_horde
					has_landed_title = e_il-khanate
				}
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_cherbi = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
	}

	allowed_to_grant = {
		OR = {
			AND = {
				is_nomadic = yes
				culture = mongol
			}
			AND = {
				OR = {
					is_feudal = yes
					is_tribal = yes
				}
				OR = {
					has_landed_title = e_mongol_empire
					has_landed_title = e_golden_horde
					has_landed_title = e_il-khanate
				}
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_darkhan = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 2
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
	}

	allowed_to_grant = {
		OR = {
			AND = {
				is_nomadic = yes
				culture = mongol
			}
			AND = {
				OR = {
					is_feudal = yes
					is_tribal = yes
				}
				OR = {
					has_landed_title = e_mongol_empire
					has_landed_title = e_golden_horde
					has_landed_title = e_il-khanate
				}
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_noyan = {
	dignity = 0.075
	grant_limit = 4
	opinion_effect = 5
	
	monthly_salary = 0.005
	monthly_prestige = 0.05
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		is_ruler = no		
	}

	allowed_to_grant = {
		OR = {
			AND = {
				is_nomadic = yes
				culture = mongol
			}
			AND = {
				OR = {
					is_feudal = yes
					is_tribal = yes
				}
				OR = {
					has_landed_title = e_mongol_empire
					has_landed_title = e_golden_horde
					has_landed_title = e_il-khanate
				}
			}
		}
	}

	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_behi = {
	dignity = 0.1
	grant_limit = 2
	opinion_effect = 5
	
	monthly_salary = 0.05
	monthly_prestige = 0.05
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		is_female = yes
	}
	
	allowed_to_grant = {
		OR = {
			AND = {
				is_nomadic = yes
				culture = mongol
			}
			AND = {
				OR = {
					is_feudal = yes
					is_tribal = yes
				}
				OR = {
					has_landed_title = e_mongol_empire
					has_landed_title = e_golden_horde
					has_landed_title = e_il-khanate
				}
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_master_of_the_eagle = {
	dignity = 0.10
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
	}
	
	allowed_to_grant = {
		OR = {
			AND = {
				is_nomadic = yes
				culture = mongol
			}
			AND = {
				OR = {
					is_feudal = yes
					is_tribal = yes
				}
				OR = {
					has_landed_title = e_mongol_empire
					has_landed_title = e_golden_horde
					has_landed_title = e_il-khanate
				}
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}
# ZOROASTRIAN TITLES
title_shahrwaraz = {
	dignity = 0.2
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
			}
		}
		martial = 15		
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion_group = zoroastrian_group
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_kardarigan = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
			}
		}
		martial = 15		
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion_group = zoroastrian_group
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_shahin = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
			}
		}
		martial = 15		
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion_group = zoroastrian_group
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_pushtigban_salar = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
			}
		}
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion_group = zoroastrian_group
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_spahbod = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 4
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
			}
		}
	}

	allowed_to_grant = {
		higher_tier_than = DUKE
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion_group = zoroastrian_group
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_eran_ambaragbed = {
	dignity = 0.075
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.005
	monthly_prestige = 0.05
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
	}

	allowed_to_grant = {
		higher_tier_than = DUKE
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion_group = zoroastrian_group
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

# GENERIC PAGAN TITLES

title_champion = {
	dignity = 0.2
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.125
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		is_female = no
		prisoner = no
		NOR = {
			trait = incapable
			health_traits = 1
			has_character_flag = retired_champion
		}
		OR = {
			trait = misguided_warrior
			trait = tough_soldier
			trait = skilled_tactician
			trait = brilliant_strategist
		}
		OR = {
			FROM = { ai = no }
			AND = {
				opinion = { who = FROM value = 0 }
				reverse_opinion = { who = FROM value = 0 }
			}
		}		
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
			is_nomadic = yes
		}
		NOT = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_il-khanate
				religion = tengri_pagan
				religion = tengri_pagan_reformed
			}
		}
		OR = {			
			is_nomadic = yes
			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			
			religion = zun_pagan
			religion = zun_pagan_reformed
			religion = bon
			religion = tibetan_pagan
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_master_of_the_blade = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.125
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
			}
		}
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
			is_nomadic = yes
		}
		NOT = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_il-khanate
				religion = tengri_pagan
				religion = tengri_pagan_reformed
			}
		}
		OR = {
			is_nomadic = yes
			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			
			religion = zun_pagan
			religion = zun_pagan_reformed
			religion = bon
			religion = tibetan_pagan
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_master_of_the_bow = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.125
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
			}
		}
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
			is_nomadic = yes
		}
		NOT = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_il-khanate
				religion = tengri_pagan
				religion = tengri_pagan_reformed
			}
		}
		OR = {
			is_nomadic = yes
			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			
			religion = zun_pagan
			religion = zun_pagan_reformed
			religion = bon
			religion = tibetan_pagan
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_venerable_elder = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 4
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.125
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_chancellor
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_chancellor_trigger = yes
			}
		}
		age = 50		
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
			is_nomadic = yes
		}
		NOT = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_il-khanate
			}
		}
		OR = {
			is_nomadic = yes
			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
			religion = tengri_pagan
			religion = tengri_pagan_reformed
			religion = zun_pagan
			religion = zun_pagan_reformed
			religion = bon
			religion = tibetan_pagan
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

# TENGRI TITLES:

title_yabgu = {
	dignity = 0.25
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 15
	
	monthly_salary = 0.1
	monthly_prestige = 0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		OR = {
			is_female = no
			AND = {
				is_feminist_trigger = yes
				ROOT = { is_feminist_trigger = yes }
			}
			ROOT = {
				primary_title = {
					OR = {						
						has_law = true_cognatic_succession 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
				}
			}
		}
		is_close_relative = FROM		
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
			is_nomadic = yes
		}
		NOT = { culture = mongol }		
		NOR = {
			has_landed_title = e_mongol_empire
			has_landed_title = e_golden_horde
			has_landed_title = e_il-khanate
		}		
		OR = {
			religion = tengri_pagan
			religion = tengri_pagan_reformed
			AND = {
				culture_group = altaic
				NOR = {
					religion_group = christian
					religion_group = muslim
					religion_group = zoroastrian_group
				}
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_ishad = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 4
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.05
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
		tooltip = {
			OR = {
				is_female = no
				can_hold_title = job_marshal
			}
		}
		hidden_tooltip = {
			OR = {
				is_female = no
				can_be_marshal_trigger = yes
			}
		}
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
			is_nomadic = yes
		}
		NOT = { culture = mongol }
		NOR = {
			has_landed_title = e_mongol_empire
			has_landed_title = e_golden_horde
			has_landed_title = e_il-khanate
		}
		OR = {
			religion = tengri_pagan
			religion = tengri_pagan_reformed
			AND = {
				culture_group = altaic
				NOR = {
					religion_group = christian
					religion_group = muslim
					religion_group = zoroastrian_group
				}
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_kundur = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.125
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { trait = incapable }
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
			is_nomadic = yes
		}
		NOT = { culture = mongol }		
		NOR = {
			has_landed_title = e_mongol_empire
			has_landed_title = e_golden_horde
			has_landed_title = e_il-khanate
		}
		OR = {
			religion = tengri_pagan
			religion = tengri_pagan_reformed
			AND = {
				culture_group = altaic
				NOR = {
					religion_group = christian
					religion_group = muslim
					religion_group = zoroastrian_group
				}
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}
# INDIAN TITLES

title_master_of_the_royal_elephants = {
	dignity = 0.06
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.1
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		is_female = no
		NOT = { has_character_flag = guru }
		NOT = { trait = incapable }
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		NOT = { has_landed_title = e_byzantium }
		NOT = { has_landed_title = e_roman_empire }
		has_dharmic_religion_trigger = yes
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_royal_builder = {
	dignity = 0.03
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.05
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		is_female = no
		NOT = { has_character_flag = guru }
		NOT = { trait = incapable }
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		has_dharmic_religion_trigger = yes
		NOT = { has_landed_title = e_byzantium }
		NOT = { has_landed_title = e_roman_empire }
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_court_poet_india = {
	dignity = 0.05
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.1
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		is_female = no		
		NOT = { has_character_flag = guru }
		NOT = { trait = incapable }
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		has_dharmic_religion_trigger = yes
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_guru = {
	dignity = 0.050
	grant_limit = 1
	opinion_effect = 10
	monthly_salary = 0.02
	monthly_prestige = 0.25

	revoke_allowed = no
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		OR = {
			has_character_flag = guru
			has_character_flag = fake_guru
		}
		is_adult = yes
		OR = {
			has_dharmic_religion_trigger = yes
			religion = bon
		}
	}
	
	allowed_to_grant = { 
		OR = {
			has_dharmic_religion_trigger = yes
			religion = bon
		}
		any_realm_character = {
			vassal_of = ROOT
			OR = {
				has_character_flag = guru
				has_character_flag = fake_guru
			}
			is_adult = yes
			religion_group = indian_group
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}
title_genghis = {
	dignity = 10
	revoke_allowed = no
	
	realm_in_name = no
	show_as_title = yes
	
	replace_order = yes
	
	monthly_salary = 0
	monthly_prestige = 1.50
	
	gain_effect = {
	}
	lose_effect = {
	}
	
	message = yes
}

title_councilmember_king = {
	is_high_prio = yes
	dignity = 0.050
	grant_limit = 1
	opinion_effect = 10
	monthly_salary = 0.00
	monthly_prestige = 0.5
	is_voter = yes
	
	allowed_to_grant = {
		higher_tier_than = DUKE
		has_dlc = "Zeus"
		primary_title = { has_law = law_voting_power_1 }
	}
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		can_be_council_advisor_trigger = yes
	}
	revoke_trigger = {
		OR = {
			trait = incapable
			is_inaccessible_trigger = yes
			FROM = { NOT = { has_character_flag = lifetime_appointments } }
		}
	}	
	gain_effect = {
	}
	lose_effect = {
		if = {
			limit = { NOT = { has_character_flag = is_moving_councillor} }
			opinion = { who = FROM modifier = opinion_fired_from_council }
			opinion = { who = FROM modifier = opinion_recently_fired }
		}
		clr_character_flag = is_moving_councillor
	}
	retire_effect = {
	}

	message = yes
}

title_councilmember_emperor = {
	is_high_prio = yes
	dignity = 0.060
	grant_limit = 1
	opinion_effect = 10
	monthly_salary = 0.00
	monthly_prestige = 1.00
	is_voter = yes
	
	allowed_to_grant = {
		higher_tier_than = KING
		has_dlc = "Zeus"
		primary_title = { has_law = law_voting_power_1 }
	}
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		can_be_council_advisor_trigger = yes
	}
	revoke_trigger = {
		OR = {
			trait = incapable
			is_inaccessible_trigger = yes
			FROM = { NOT = { has_character_flag = lifetime_appointments } }
		}
	}	
	gain_effect = {
	}
	lose_effect = {
		if = {
			limit = { NOT = { has_character_flag = is_moving_councillor} }
			opinion = { who = FROM modifier = opinion_fired_from_council }
			opinion = { who = FROM modifier = opinion_recently_fired }
		}
		clr_character_flag = is_moving_councillor
	}
	retire_effect = {
	}

	message = yes
}

#TAOIST TITLES

title_court_architect = {
	dignity = 0.03
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.40
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			is_female = no
			liege = {
				OR = {
					primary_title = {
						has_law = female_council_law_3
					}
					primary_title = {
						has_law = female_council_law_4
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
		}
		NOT = { trait = incapable } 
	}

	allowed_to_grant = {
		is_feudal = yes
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		religion = taoist
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_zhangshi = {
	dignity = 0.05
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02
	monthly_prestige = 0.40
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			is_female = no
			liege = {
				OR = {
					primary_title = {
						has_law = female_council_law_2
					}
					primary_title = {
						has_law = female_council_law_3
					}
					primary_title = {
						has_law = female_council_law_4
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
		}
		NOT = { trait = incapable } 
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion = taoist
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_canjun = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.75
	
	is_unique = yes

	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			is_female = no
			liege = {
				OR = {
					primary_title = {
						has_law = female_council_law_3
					}
					primary_title = {
						has_law = female_council_law_4
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
		}
		NOT = { trait = incapable } 
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion = taoist
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_yuhou = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.75
	
	is_unique = yes

	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			is_female = no
			liege = {
				OR = {
					primary_title = {
						has_law = female_council_law_3
					}
					primary_title = {
						has_law = female_council_law_4
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
		}
		NOT = { trait = incapable } 
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion = taoist
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_historiographer = {
	dignity = 0.15
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.075
	monthly_prestige = 0.75

	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			is_female = no
			liege = {
				OR = {
					primary_title = {
						has_law = female_council_law_3
					}
					primary_title = {
						has_law = female_council_law_4
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
		}
		NOT = { trait = incapable } 
		learning = 7
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		religion = taoist
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

## Court Physician
title_court_physician = {
	is_high_prio = yes
	attribute = learning
    dignity = 5
    realm_in_name = yes
	grant_limit = 1
	opinion_effect = 10
	monthly_salary = 0.2
	monthly_prestige = 0.5
	
	allowed_to_grant = {
		OR = {
			higher_tier_than = BARON
			is_patrician = yes
		}
		has_dlc = "Reapers"
	}
	
	allowed_to_hold = {
		custom_tooltip = {
			text = court_physician_tooltip_1
			NOT = {
				primary_title = { temporary = yes } 
			}
		}
		custom_tooltip = {
			text = court_physician_tooltip_2
			OR = {
				is_female = no
				AND = {
					is_feminist_trigger = yes
					liege = { religion = ROOT }
				}
				liege = {
					OR = {
						primary_title = {
							has_law = female_council_law_4
						}
						has_game_rule = {
							name = gender
							value = all
						}
						has_game_rule = {
							name = gender
							value = plus
						}
					}
				}
			}
		}
		OR = {
			learning = 15
			AND = {
				learning = 10
				OR = {
					trait = physician
					trait = scholar
					trait = mystic
					trait = mutazilite
				}
			}
			custom_tooltip = { 
				text = educated_court_physician
				hidden_tooltip = {
					has_character_flag = is_court_physician
				}
			}
		}
		OR = {
			NOT = { religion = hindu }
			trait = brahmin
		}
		is_adult = yes

		prisoner = no
		NOT = { is_inaccessible_trigger = yes }
		NOT = { trait = incapable }
	}

	revoke_trigger = {
		custom_tooltip = {
			text = revoke_court_physician_being_treated_tt
			NOT = { FROM = { has_character_flag = being_treated } }
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}
	retire_effect = {
	}

	message = yes
}


#MNM hermetics apprentice
title_hermetics_apprentice = {
	is_high_prio = yes
	attribute = learning
    dignity = 1
    realm_in_name = no
	grant_limit = 1
	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.1
	revoke_allowed = no
	
	allowed_to_grant = {
		has_dlc = "Mystics"
		society_member_of = hermetics
		ai = no
	}
	
	allowed_to_hold = {
		custom_tooltip = {
			text = court_physician_tooltip_1
			NOT = {
				primary_title = { temporary = yes } 
			}
		}
		is_adult = yes
		OR = {
			society_member_of = hermetics
			is_in_society = no
		}

		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
		prisoner = no
		
		hidden_trigger = {
			liege = { society_member_of = hermetics }
			ai = yes
			NOT = { has_character_flag = completed_apprenticeship }
			OR = {
				FROM = { ai = no }
				learning = 10
				is_smart_trigger = yes
				trait = gardener
				trait = scholar
				trait = mystic
			}
		}
	}
	
	gain_effect = {
		if = {
			limit = { NOT = { society_member_of = hermetics } }
			join_society = hermetics
		}
		character_event = { id = MNM.1413 days = 4500 random = 1000 }  #Some years later, the apprenticeship ends

		
		opinion = { 
			modifier = opinion_hermetic_apprentice
			who = FROM
			years = 100
		}
		FROM = {
			if = {
				limit = { has_quest = quest_hermetics_find_apprentice }
				character_event = { id = MNM.1409 }
			}
		}
	}
	lose_effect = {
		remove_opinion = { 
			modifier = opinion_hermetic_apprentice
			who = FROM
		}
	}
	retire_effect = {
	}

	message = yes
}


###JADE DRAGON MINOR TITLES###

title_china_emperor = {			# this title is not granted by a character to another, it is automatically obtained
								# when one character becomes emperor of china. It is used solely to identify them as such
	is_offmap_holder = yes
	offmap_power = offmap_china
	show_as_title = yes
	dignity = 1000 				# this should always be higher than 0, or it won't be applied in all cases
}

title_administrator = {
	is_high_prio = no
    dignity = 0.9
    realm_in_name = no
	grant_limit = 1
	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.1
	
	allowed_to_grant = {
		has_dlc = "Jade Dragon"
		any_courtier = { has_character_modifier = jd_administrator }
	}
	
	allowed_to_hold = {
		custom_tooltip = {
			text = title_administrator_modifier_tt
			has_character_modifier = jd_administrator
		}
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
		prisoner = no
	}

	revoke_trigger = {
		always = yes
	}
	
	gain_effect = {
		if = {
			limit = {
				has_character_flag = jd_administrator_golden_age #courtier is from golden age
			}
			liege = {
				add_character_modifier = {
					name = employing_jd_administrator_golden_age
					duration = -1
				}
			}
		}
		else = {
			liege = {
				add_character_modifier = {
					name = employing_jd_administrator
					duration = -1
				}
			}
		}
	}
	lose_effect = {
		liege = {
			if = {
				limit = { has_character_modifier = employing_jd_administrator }
				remove_character_modifier = employing_jd_administrator
			}
			if = {
				limit = { has_character_modifier = employing_jd_administrator_golden_age }
				remove_character_modifier = employing_jd_administrator_golden_age
			}
		}
	}
	retire_effect = {
		liege = {
			if = {
				limit = { has_character_modifier = employing_jd_administrator }
				remove_character_modifier = employing_jd_administrator
			}
			if = {
				limit = { has_character_modifier = employing_jd_administrator_golden_age }
				remove_character_modifier = employing_jd_administrator_golden_age
			}
		}
	}
	death_effect = {
		liege = {
			if = {
				limit = { has_character_modifier = employing_jd_administrator }
				remove_character_modifier = employing_jd_administrator
			}
			if = {
				limit = { has_character_modifier = employing_jd_administrator_golden_age }
				remove_character_modifier = employing_jd_administrator_golden_age
			}
		}
	}

	message = yes
}

title_master_engineer = {
	is_high_prio = no
    dignity = 0.9
    realm_in_name = no
	grant_limit = 1
	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.1
	
	allowed_to_grant = {
		has_dlc = "Jade Dragon"
		any_courtier = { has_character_modifier = jd_master_engineer }
	}
	
	allowed_to_hold = {
		custom_tooltip = {
			text = title_master_engineer_modifier_tt
			has_character_modifier = jd_master_engineer
		}
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
		prisoner = no
	}

	revoke_trigger = {
		always = yes
	}
	
	gain_effect = {
		if = {
			limit = { has_character_flag = master_engineer_just_spawned }
            character_event = { id = JD.20033 days = 10 } 
            clr_character_flag = master_engineer_just_spawned
            break = yes
		}
        if = {
            limit = {
                has_character_flag = china_master_engineer_golden_age
            }
            character_event = { id = JD.20033 days = 1460 random = 542 } 
        }
		else = {
            character_event = { id = JD.20033 days = 2920 random = 1095 } 
        }
	}
	lose_effect = {
		clear_delayed_event = { id = JD.20033 }
	}
	retire_effect = {
		clear_delayed_event = { id = JD.20033 }	
	}
	death_effect = {
		clear_delayed_event = { id = JD.20033 }
	}

	message = yes
}

# Special Title. Do not Delete or alter the name of the tag!
# The Teacher serves as the default Educator for all children at court who are not close relatives of the ruler
title_teacher = {
	is_high_prio = yes
    dignity = 5
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 5
	monthly_prestige = 0.3
	monthly_salary = 0.1

	is_unique = yes
	
	allowed_to_grant = {
		has_dlc = "Zeus"
		is_theocracy = no
		OR = {			
			higher_tier_than = BARON
			is_patrician = yes
		}
		is_landed = yes
		is_playable = yes
	}
	
	allowed_to_hold = {
		is_adult = yes
		is_ruler = no
		prisoner = no
		NOT = { is_inaccessible_trigger = yes }			
		NOR = {
			trait = incapable
			trait = infirm
			trait = imbecile
		} 
		custom_tooltip = {
			text = court_physician_tooltip_1
			NOT = {
				primary_title = { temporary = yes } 
			}
		}
		custom_tooltip = {
			text = court_physician_tooltip_2
			OR = {
				is_female = no
				AND = {
					is_feminist_trigger = yes
					liege = { religion = ROOT }
				}
				liege = {
					OR = {
						primary_title = {
							has_law = female_council_law_4
						}
						has_game_rule = {
							name = gender
							value = all
						}
						has_game_rule = {
							name = gender
							value = plus
						}
					}
				}
			}
		}
		custom_tooltip = {
			text = court_educator_tooltip
			hidden_tooltip = {
				OR = {
					AND = {
						has_education_diplomacy_trigger = yes
						diplomacy = 10
					}
					AND = {
						has_lifestyle_diplomacy_trigger = yes
						diplomacy = 15
					}			
					AND = {
						has_education_martial_trigger = yes
						martial = 10
					}
					AND = {
						has_lifestyle_martial_trigger = yes
						martial = 15
					}
					AND = {
						has_education_stewardship_trigger = yes
						stewardship = 10
					}
					AND = {
						has_lifestyle_stewardship_trigger = yes
						stewardship = 15
					}
					AND = {
						has_education_intrigue_trigger = yes
						intrigue = 10
					}
					AND = {
						has_lifestyle_intrigue_trigger = yes
						intrigue = 15
					}
					AND = {
						has_education_learning_trigger = yes
						learning = 10
					}
					AND = {
						has_lifestyle_learning_trigger = yes
						learning = 15
					}
					has_top_tier_education_trait_trigger = yes
				}				
			}						
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

