########################################################
# 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 = 1.50
	
	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.75

	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.5
	
	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.75
	
	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 = 1.00
	
	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.25
	
	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.10
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = no
}

title_male_consort = {
	dignity = 0.05
	#realm_in_name = yes
	revoke_allowed = no
	
	monthly_salary = 0.02
	monthly_prestige = 0.10
	
	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.50
	#combat_rating = 10 # Reactivate if we get this working
	
	revoke_allowed = no # Handled by diplomatic interaction
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		liege = { character = FROM }
		OR = {
			AND = {
				OR = {
					male_can_hold_minor_title_trigger = yes
					female_can_hold_minor_commander_title_trigger = yes
				}
				OR = {
					NOT = { religion = hindu }
					trait = kshatriya
				}
				is_adult = yes
			}
			has_character_flag = special_marshal
		}
		
		prisoner = no
		NOT = { trait = incapable }
		NOT = { is_inaccessible_trigger = yes }
		NOT = { has_character_flag = guru }
		NOT = { has_character_modifier = refusing_to_lead }
		OR = { 
			NOT = { liege = { has_law = succ_byzantine_elective } }  #Either not Imperial...
			higher_real_tier_than = BARON #...Or potential commander is vassal...
			NOT = { #...Or there are no valid vassal candidates that can be commanders.
				custom_tooltip = { 
					text = tooltip_byzantine_empire_can_appoint_commanders
					liege = { 
						any_vassal = { 
							higher_real_tier_than = BARON
							NOT = { 
								primary_title = { temporary = yes } 
							}
							OR = {
								AND = {
									OR = {
										male_can_hold_minor_title_trigger = yes
										female_can_hold_minor_commander_title_trigger = yes
									}
									OR = {
										NOT = { religion = hindu }
										trait = kshatriya
									}
									is_adult = yes
								}
								has_character_flag = special_marshal
							}
							
							prisoner = no
							NOT = { trait = incapable }
							NOT = { is_inaccessible_trigger = yes }
							NOT = { has_character_flag = guru }
							NOT = { has_character_modifier = refusing_to_lead }
							NOR = {
								has_job_title = job_chancellor
								has_job_title = job_marshal
								has_job_title = job_treasurer
								has_job_title = job_spymaster
								has_job_title = job_spiritual
								has_minor_title = title_commander
							}
						} 
					} 
				} 
			}
		}
	}
	
	gain_effect = {
		if = {
			limit = {
				liege = { 
					has_law = succ_byzantine_elective 
				}
			}
			character_event = { id = HFP.20805 days = 1 } 
		}
		hidden_effect = { # Because this cannot be added in the passive effects, for some code reason
			add_character_modifier = {
	        	name = hidden_commander_bonus
	        	duration = -1
	        	hidden = yes
	        }
		}
	}
	lose_effect = {
		if = {
			limit = {
				liege = { has_law = succ_byzantine_elective }
			}
			character_event = { id = HFP.20803 days = 1 } #Make sure the commander is not being made a sub-vassal.
			
		}
		hidden_effect = {
			remove_character_modifier = hidden_commander_bonus
		}
	}
	
	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.25
	
	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 }
	}
	
	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.25
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		trait = dwarf
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}	
	}
	
	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.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		NOT = { has_character_flag = guru }
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_group = pagan_group
			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.50
	
	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
		}
		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.40
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		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_master_of_the_hunt = {
	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 = {
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		NOT = { has_character_flag = guru }
		NOT = { trait = incapable }
		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
			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.40
	
	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
		}
		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.60
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		OR = {
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		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 }
	}
	
	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.60
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		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 }
		OR = {
			religion_group = christian
			religion_group = jewish_group
			has_dharmic_religion_trigger = yes
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

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

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

	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

# Byzantine Titles
title_despot = {
	dignity = 6.0
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 30
	
	monthly_salary = 0.1
	monthly_prestige = 0.5
	
	counts_as_purple_born = yes
	
	show_as_title = yes
	
	is_unique = yes
	
	allowed_to_hold = {
		OR = {
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
			has_law = true_cognatic_succession
			has_law = enatic_cognatic_succession
			has_law = enatic_succession
		}
		is_close_relative = FROM
		NOT = { trait = monk }
		NOT = { trait = nun }
		NOT = { trait = eunuch }
		is_theocracy = no
	}
	
	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 = pagan_group
		}
	}
	
	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.25
	
	show_as_title = yes
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_close_relative = FROM
	}
	
	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 = pagan_group
		}
	}
	
	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.25
	
	show_as_title = yes
	
	is_unique = yes
	
	allowed_to_hold = {
		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_group = pagan_group
		}
	}
	
	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.75
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = 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_group = pagan_group
		}
	}
		
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_anthypatos = {
	dignity = 3.0
	grant_limit = 5
	opinion_effect = 10
	
	monthly_salary = 0.005
	monthly_prestige = 0.25
	
	show_as_title = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		NOT = { has_minor_title = title_hypatos }
		is_adult = yes	
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = 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_group = pagan_group
		}
	}
	
	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.35
	
	show_as_title = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		is_female = no
		trait = eunuch
	}
	
	allowed_to_grant = {
		real_tier = emperor	
		is_feudal = yes
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
	}	
	
	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 = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
	}
	
	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.20
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}

	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.40
	
	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_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.40
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}

	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.40
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}

	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.60
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		religion_group = muslim
		liege = { religion = PREV }
		OR = {
			trait = detached_priest
			trait = martial_cleric
			trait = scholarly_theologian
			trait = mastermind_theologian
		}
		NOT = { trait = incapable } 
	}

	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
}


# 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.40
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}

	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.60
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}
	
	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.60
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}

	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.20
	
	allowed_to_hold = {
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		is_landed = no
		dynasty = FROM
		NOT = { trait = bastard }
		NOT = { trait = monk }
		NOT = { trait = nun }
		NOT = { trait = eunuch }
		is_theocracy = no
	}

	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
		custom_tooltip = {
			text = is_germanic_pagan_custom_tooltip
			hidden_tooltip = {
				OR = {
					religion = norse_pagan
					religion = norse_pagan_reformed
				}
			}
		}
	}
	
	allowed_to_grant = {
		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.75
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		custom_tooltip = {
			text = is_germanic_pagan_custom_tooltip
			hidden_tooltip = {
				OR = {
					religion = norse_pagan
					religion = norse_pagan_reformed
				}
			}
		}
		NOT = { trait = incapable } 
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = norse_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.5
	
	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.75
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		trait = poet
		NOT = { trait = incapable } 
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = norse_pagan_reformed
		}
	}
	
	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.75
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			religion = norse_pagan
			religion = 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
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}

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

	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.75
	
	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.5
	
	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.75
	
	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.5
	
	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 = {
			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.25
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		is_female = 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_master_of_the_eagle = {
	dignity = 0.10
	grant_limit = 1
	opinion_effect = 10
	
	monthly_salary = 0.1
	monthly_prestige = 0.35
	
	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.75
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		martial = 15
		NOT = { trait = incapable } 
	}
	
	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.75
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		martial = 15
		NOT = { trait = incapable } 
	}
	
	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.75
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		martial = 15
		NOT = { trait = incapable } 
	}

	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.5
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}

	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.75
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = 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
}

title_eran_ambaragbed = {
	dignity = 0.075
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.005
	monthly_prestige = 0.5
	
	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
		}
		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.75
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		OR = {
			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_reformed
			religion = aztec
			religion = zun_pagan_reformed
			religion = zun_pagan
			religion = bon
			religion = bon_reformed
		}
	}
	
	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.75
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		NOT = { has_minor_title = title_master_of_the_bow }
		NOT = { trait = incapable } 
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		NOT = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_il-khanate
			}
		}
		OR = {
			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_reformed
			religion = aztec
			religion = tengri_pagan
			religion = tengri_pagan_reformed
			religion = zun_pagan_reformed
			religion = zun_pagan
			religion = bon
			religion = bon_reformed
		}
	}
	
	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.75
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		NOT = { has_minor_title = title_master_of_the_blade }
		NOT = { trait = incapable } 
	}
	
	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		NOT = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_il-khanate
			}
		}
		OR = {
			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_reformed
			religion = aztec
			religion = tengri_pagan
			religion = tengri_pagan_reformed
			religion = zun_pagan_reformed
			religion = zun_pagan
			religion = bon
			religion = bon_reformed
		}
	}
	
	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.75
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		age = 50
	}

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
		NOT = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_il-khanate
			}
		}
		OR = {
			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_reformed
			religion = aztec
			religion = tengri_pagan
			religion = tengri_pagan_reformed
			religion = zun_pagan_reformed
			religion = zun_pagan
			religion = bon
			religion = bon_reformed
		}
	}
	
	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.50
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}		
		is_close_relative = FROM
		NOT = { trait = incapable } 
	}

	allowed_to_grant = {
		#OR = {
		#	AND = {
				is_nomadic = yes
				NOT = { culture = mongol }
		#	}
		#	AND = {
		#		OR = {
		#			is_feudal = yes
		#			is_tribal = yes
		#		}
		#		NOT = {
		#			OR = {
		#				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
		#		}
		#	}
		#}
	}
	
	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.40
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		NOT = { trait = incapable } 
	}

	allowed_to_grant = {
		#OR = {
		#	AND = {
				is_nomadic = yes
				NOT = { culture = mongol }
		#	}
		#	AND = {
		#		OR = {
		#			is_feudal = yes
		#			is_tribal = yes
		#		}
		#		NOT = {
		#			OR = {
		#				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
		#		}
		#	}
		#}
	}
	
	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.5
	
	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
				NOT = { culture = mongol }
		#	}
		#	AND = {
		#		OR = {
		#			is_feudal = yes
		#			is_tribal = yes
		#		}
		#		NOT = {
		#			OR = {
		#				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
		#		}
		#	}
		#}
	}
	
	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.40
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		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.40
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		NOT = { has_character_flag = guru }
		NOT = { trait = incapable } 
	}

	allowed_to_grant = {
		is_feudal = yes
		primary_title = {
			OR = {
				tier = king
				tier = emperor
			}
		}
		has_dharmic_religion_trigger = yes
	}
	
	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.40
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		is_adult = yes
		OR = {
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		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.75

	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
			religion = bon_reformed
		}
	}
	
	allowed_to_grant = { 
		OR = {
			has_dharmic_religion_trigger = yes
			religion = bon
			religion = bon_reformed
		}
	}
	
	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.75
	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_councilmember_king_trigger = yes
	}
	revoke_trigger = {
		FROM = {
			primary_title = {
				NOT = { 
					AND = {
						has_law = succession_voting_power_1
						ROOT = { is_powerful_vassal = yes }
					}
				}
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
		if = {
			limit = {
				FROM = {
					NOT = {
						has_character_flag = swapping_councillors
					}
				}
			}
			opinion = { who = FROM modifier = opinion_fired_from_council }
			opinion = { who = FROM modifier = opinion_recently_fired }
		}
	}

	retire_effect = {
		if = {
			limit = {
				NOT = {
					age = 65
				}
				health = 3
				NOT = {
					is_sick_or_injured_trigger = yes
				}
				can_be_councilmember_king_trigger = yes
			}
			
			FROM = { 
				opinion = { who = ROOT modifier = opinion_resigned_from_council }
			}
		}
	}

	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_councilmember_emperor_trigger = yes
	}

	revoke_trigger = {
		FROM = {
			primary_title = {
				NOT = { 
					AND = {
						has_law = succession_voting_power_1
						ROOT = { is_powerful_vassal = yes }
					}
				}
			}
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
		if = {
			limit = {
				FROM = {
					NOT = {
						has_character_flag = swapping_councillors
					}
				}
			}
			opinion = { who = FROM modifier = opinion_fired_from_council }
			opinion = { who = FROM modifier = opinion_recently_fired }
		}
	}

	retire_effect = {
		if = {
			limit = {
				NOT = {
					age = 65
				}
				health = 3
				NOT = {
					is_sick_or_injured_trigger = yes
				}
				can_be_councilmember_king_trigger = yes
			}
			
			FROM = { 
				opinion = { who = ROOT modifier = opinion_resigned_from_council }
			}
		}
	}

	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 = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		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 = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		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 = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_commander_title_trigger = yes
		}
		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 = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		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 = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = yes
		}
		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 = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}
		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 = { trait = in_hiding }
		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 = {
	dignity = 0.1
	grant_limit = 1
	opinion_effect = 5
	
	monthly_salary = 0.02

	is_unique = yes
	
	allowed_to_grant = {
		has_dlc = "Zeus"
		is_theocracy = no
		OR = {
			is_republic = no
			is_patrician = yes
		}
		is_landed = yes
		is_playable = yes
	}
	
	allowed_to_hold = {
		is_adult = yes
		is_ruler = no
		prisoner = no
		NOR = {
			trait = incapable
			trait = infirm
			trait = imbecile
		} 
		learning = 5
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

### New Byzantine Minor Titles ###
title_augusta = {
	dignity = 5.0
	realm_in_name = yes
	grant_limit = 1
	opinion_effect = 30
	
	show_as_title = yes
	
	monthly_salary = 0.05
	monthly_prestige = 0.75
	
	is_unique = yes
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		NOT = { has_minor_title = title_sebastos }
		is_female = yes
		is_close_relative = FROM 
		is_adult = yes
	}
	
	allowed_to_grant = {
		is_feudal = yes
		OR = {
			has_landed_title = e_byzantium
		}
		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_group = pagan_group
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_patrikios = {
	dignity = 2.0
	grant_limit = 10
	opinion_effect = 5
	
	show_as_title = yes
	
	monthly_salary = 0.03
	monthly_prestige = 0.125
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		NOT = { family = FROM }
		NOT = { is_close_relative = FROM }
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = 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_group = pagan_group
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_hypatos = {
	dignity = 1.0
	grant_limit = 20
	opinion_effect = 5
	
	monthly_salary = 0.03
	monthly_prestige = 0.0625
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		NOT = { family = FROM }
		NOT = { is_close_relative = FROM }
		NOT = { has_minor_title = title_anthypatos }
		is_adult = yes
		OR = { 
			male_can_hold_minor_title_trigger = yes
			female_can_hold_minor_title_trigger = 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_group = pagan_group
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}

title_sebastos = {
	dignity = 2.5
	grant_limit = 10
	opinion_effect = 5
	
	show_as_title = yes
	
	monthly_salary = 0.02
	monthly_prestige = 0.1875
	
	allowed_to_hold = {
		NOT = { 
			primary_title = { temporary = yes } 
		}
		NOT = { has_minor_title = title_augusta }
		OR = {
			is_close_relative = FROM
			family = FROM
			is_cousin_of = FROM
			is_friend = FROM
		}
	}
	
	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 = pagan_group
		}
	}
	
	gain_effect = {
	}
	lose_effect = {
	}

	message = yes
}