########################################################
# MINOR TITLES
# Characters can have any number of these
########################################################
#	grant_limit			Max number of holders
#	realm_in_name		Append the name of the realm 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
#	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

#	Scopes (except allowed_to_hold)
#	ROOT is potential holder of minor title
#	FROM is liege

#	ai_will_do is supported

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

title_regent = {
	is_voter = yes
	message = yes
	realm_in_name = yes

	dignity = 0.9

	monthly_salary = 0.1
	monthly_prestige = 0.50

	revoke_trigger = {
		always = no
	}

	lose_effect = {
		if = {
			limit = { has_character_flag = declared_ruler_insane }

			persistent_event_target:ruler_declared_insane = {
				character_event = {
					id = 61152
					days = 1
				}
			}
		}
	}

	retire_effect = {
		if = {
			limit = { has_character_flag = declared_ruler_insane }

			persistent_event_target:ruler_declared_insane = {
				character_event = {
					id = 61152
					days = 1
				}
			}
		}
	}

	death_effect = {
		if = {
			limit = { has_character_flag = declared_ruler_insane }

			persistent_event_target:ruler_declared_insane = {
				character_event = {
					id = 61152
					days = 1
				}
			}
		}
	}
}

title_appointed_regent = {
	is_high_prio = yes
	realm_in_name = yes
	message = yes

	dignity = 0.9
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.05
	monthly_prestige = 0.25

	allowed_to_grant = {
		NOT = {
			has_game_rule = {
				name = regencies
				value = off
			}
		}

		has_regent = no
	}

	allowed_to_hold = {
		is_adult = yes
		has_regent = no
		prisoner = no
		is_incapable = no
	}

	revoke_trigger = {
		FROM = { has_regent = no }
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_ruler_consort = {
	message = no
	show_as_title = yes
	realm_in_name = yes
	spouse_context = yes # Title name is the opposite gender version of the spouse's ruler title

	dignity = 0.88

	monthly_salary = 0.1
	monthly_prestige = 0.25

	revoke_trigger = {
		always = no
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_tanist = {
	message = no
	realm_in_name = yes
	show_as_title = yes

	dignity = 0.86

	monthly_salary = 0.07
	monthly_prestige = 0.25

	revoke_trigger = {
		always = no
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_queen_mother = {
	message = no
	realm_in_name = yes
	show_as_title = yes

	dignity = 0.85

	monthly_salary = 0.05
	monthly_prestige = 0.25

	revoke_trigger = {
		always = no
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_prince = {
	message = no
	realm_in_name = yes
	show_as_title = yes

	dignity = 0.8

	monthly_salary = 0.05
	monthly_prestige = 0.125

	revoke_trigger = {
		always = no
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# Pagan consort
title_courtesan = {
	message = no

	dignity = 0.05

	monthly_salary = 0.02
	monthly_prestige = 0.10

	revoke_trigger = {
		always = no
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_male_consort = {
	message = no

	dignity = 0.05

	monthly_salary = 0.02
	monthly_prestige = 0.025

	revoke_trigger = {
		always = no
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# Commander, granted via its own interaction, so very special
title_commander = {
	is_high_prio = yes
	message = yes
	realm_in_name = yes

	attribute = martial
	dignity = 0.05

	opinion_effect = 5
	monthly_salary = 0.05
	monthly_prestige = 0.05
	# combat_rating = 10 # Reactivate if we get this working

	allowed_to_grant = {
	}

	allowed_to_hold = {
		trigger_if = {
			limit = {
				NOT = {	has_character_flag = special_marshal }
			}

			is_adult = yes

			custom_tooltip = {
				text = court_physician_tooltip_2

				OR = {
					male_can_hold_minor_title_trigger = yes
					female_can_hold_minor_commander_title_trigger = yes
				}
			}

			trigger_if = {
				limit = { religion = hindu }
				NOT = { trait = kshatriya }
			}
		}

		prisoner = no
		is_incapable = no
		is_inaccessible_trigger = no
		NOT = { has_character_modifier = guru }
		NOT = { has_character_modifier = refusing_to_lead }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { FROM = { has_law = succ_byzantine_elective } }

			OR = {
				higher_real_tier_than = BARON

				FROM = {
					show_scope_change = no
					byzantines_can_grant_commander_trigger = yes
				}
			}
		}
	}

	revoke_trigger = {
		always = no
	}

	gain_effect = {
		if = {
			limit = {
				FROM = { 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 = {
				FROM = { 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
		}
	}

	retire_effect = {
	}

	death_effect = {
	}
}

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

title_court_eunuch = {
	message = yes
	realm_in_name = yes

	dignity = 0.01
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.02
	monthly_prestige = 0.05

	allowed_to_grant = {
		higher_real_tier_than = DUKE

		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		any_courtier_or_vassal = {
			trait = eunuch
		}

		NOR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
	}

	allowed_to_hold = {
		is_adult = yes
		trait = eunuch

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_court_dwarf = {
	message = yes
	realm_in_name = yes

	dignity = 0.01
	grant_limit = 1
	opinion_effect = 10

	monthly_salary = 0.02
	monthly_prestige = 0.05

	allowed_to_grant = {
		higher_real_tier_than = DUKE

		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		OR = {
			religion_group = christian
			religion_group = muslim
			religion_group = jewish_group
			religion_openly_egyptian_or_reformed_trigger = yes
		}

		any_courtier_or_vassal = {
			trait = dwarf
		}
	}

	allowed_to_hold = {
		trait = dwarf
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_court_jester = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.01
	grant_limit = 1

	opinion_effect = -5
	monthly_salary = 0.02
	monthly_prestige = -0.125

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		is_feudal = yes

		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_group = pagan_group
			has_dharmic_religion_trigger = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		NOT = { has_character_modifier = guru }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# Keeper of the King's Swans
title_keeper_of_swans = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.05
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.01
	monthly_prestige = 0.10

	allowed_to_grant = {
		higher_real_tier_than = DUKE

		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		OR = {
			religion_group = christian
			religion_group = jewish_group
		}

		NOR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_master_of_the_horse = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.06
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		OR = {
			religion_group = christian
			religion_group = pagan_group
			religion_group = jewish_group
		}

		NOR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_master_of_the_hunt = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.05
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		OR = {
			religion_group = christian
			religion_group = pagan_group
			religion_group = jewish_group
			has_dharmic_religion_trigger = yes
		}

		NOR = {
			religion = jain
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		NOR = {
			religion = jain
			has_character_modifier = guru
		}

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_high_almoner = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.03
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		OR = {
			religion_group = christian
			religion_group = jewish_group
		}

		NOR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_cupbearer = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.1
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.05
	monthly_prestige = 0.15

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		OR = {
			religion_group = christian
			religion_group = jewish_group
		}

		NOR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
	}

	allowed_to_hold = {
		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no
		NOT = { has_character_modifier = guru }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_seneschal = {
	realm_in_name = yes
	is_unique = yes
	message = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.05
	monthly_prestige = 0.25

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		OR = {
			religion_group = christian
			religion_group = jewish_group
		}

		NOR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		NOT = { has_character_modifier = guru }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_paramount_knight = {
	message = yes

	dignity = 0.8
	grant_limit = 0
	opinion_effect = 0

	monthly_prestige = 0.50

	allowed_to_grant = {
	}

	allowed_to_hold = {
		is_incapable = no
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# Byzantine Titles
title_despot = {
	counts_as_purple_born = yes
	is_unique = yes
	message = yes
	realm_in_name = yes
	show_as_title = yes
	is_voter = yes

	dignity = 6.0
	grant_limit = 1

	opinion_effect = 30
	monthly_salary = 0.1
	monthly_prestige = 0.125

	allowed_to_grant = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_openly_hellenic_or_reformed_trigger = yes
		}

		is_feudal = yes
		has_dlc = "Conclave"

		any_close_relative = {
			dynasty = PREV
			is_adult = yes
			is_incapable = no
			is_theocracy = no

			trigger_if = {
				limit = { is_female = yes }
				female_can_hold_minor_commander_title_trigger = yes
			}

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}

			NOR = {
				trait = monk
				trait = nun
				trait = eunuch
			}
		}
	}

	allowed_to_hold = {
		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_close_relative = FROM
		dynasty = FROM
		is_incapable = no
		is_adult = yes
		is_theocracy = no

		NOR = {
			trait = monk
			trait = nun
			trait = eunuch
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_sebastokrator = {
	is_unique = yes
	message = yes
	show_as_title = yes
	realm_in_name = yes

	dignity = 0.2
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.05

	allowed_to_grant = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_openly_hellenic_or_reformed_trigger = yes
		}

		is_feudal = yes
	}

	allowed_to_hold = {
		is_close_relative = FROM

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_caesar = {
	is_unique = yes
	message = yes
	realm_in_name = yes
	show_as_title = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.05

	allowed_to_grant = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_openly_hellenic_or_reformed_trigger = yes
		}

		is_feudal = yes
	}

	allowed_to_hold = {
		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_kouropalates = {
	realm_in_name = yes
	is_unique = yes
	message = yes

	dignity = 0.10
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.25

	allowed_to_grant = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_openly_hellenic_or_reformed_trigger = yes
		}

		is_feudal = yes
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_anthypatos = {
	message = yes
	show_as_title = yes

	dignity = 3.0
	grant_limit = 4

	opinion_effect = 10
	monthly_salary = 0.005
	monthly_prestige = 0.05

	allowed_to_grant = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_openly_hellenic_or_reformed_trigger = yes
		}

		is_feudal = yes
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		NOT = { has_minor_title = title_hypatos }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_imperial_eunuch = {
	message = yes
	show_as_title = yes

	dignity = 0.050
	grant_limit = 1

	opinion_effect = 30
	monthly_salary = 0.02
	monthly_prestige = 0.125

	allowed_to_grant = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		is_feudal = yes

		any_courtier = {
			trait = eunuch
			is_adult = yes
			is_ruler = no
		}
	}

	allowed_to_hold = {
		trait = eunuch
		is_adult = yes
		is_ruler = no
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# Muslim World titles

title_food_taster = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.01
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = -0.25

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		religion_group = muslim

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_court_calligrapher = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.05
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.01
	monthly_prestige = 0.05

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		religion_group = muslim

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_court_musician = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.06
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		OR = {
			religion_group = muslim
			has_dharmic_religion_trigger = yes
		}

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_court_poet = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.05
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		religion_group = muslim

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_chief_architect = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.03
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		religion_group = muslim

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { prisoner = yes }

			host = {
				NOT = { is_liege_of = ROOT }
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_chief_qadi = {
	realm_in_name = yes
	is_unique = yes
	message = yes
	is_voter = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.05
	monthly_prestige = 0.15

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		religion_group = muslim
		has_dlc = "Conclave"

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes
		religion = FROM
		has_education_learning_trigger = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# MERCHANT REPUBLIC TITLES

title_state_inquisitor = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.06
	grant_limit = 3

	opinion_effect = 6
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		is_merchant_republic = yes
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}
}

title_high_admiral = {
	message = yes
	is_unique = yes
	realm_in_name = yes

	dignity = 0.1
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.05
	monthly_prestige = 0.15

	allowed_to_grant = {
		is_merchant_republic = yes
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_high_judge = {
	message = yes
	is_unique = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.05
	monthly_prestige = 0.15

	allowed_to_grant = {
		is_merchant_republic = yes
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# Special - This title determines the heir of a Patrician
title_patrician_heir = {
	is_high_prio = yes
	message = yes
	patrician_heir = yes
	realm_in_name = yes

	dignity = 0.05
	grant_limit = 1

	opinion_effect = 25
	monthly_salary = 0.01
	monthly_prestige = 0.15

	allowed_to_grant = {
		is_patrician = yes
	}

	allowed_to_hold = {
		dynasty = FROM

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_landed = no
		is_theocracy = no
		is_ascetic_trigger = no

		NOR = {
			trait = bastard
			trait = monk
			trait = nun
			trait = eunuch
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# NORSE PAGAN TITLES

title_volva = {
	is_unique = yes
	message = yes

	dignity = 0.050
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.1

	allowed_to_grant = {
		religion_openly_norse_or_reformed_trigger = yes

		any_courtier = {
			trait = mystic
			religion_openly_norse_or_reformed_trigger = yes
			is_female = yes
			is_adult = yes
		}
	}

	allowed_to_hold = {
		trait = mystic
		religion_openly_norse_or_reformed_trigger = yes
		is_adult = yes
		is_female = yes

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_lawspeaker = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.2
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.25

	allowed_to_grant = {
		religion_openly_germanic_or_reformed_trigger = yes
		NOT = { culture = icelandic }

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		religion_openly_germanic_or_reformed_trigger = yes
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_drottseti = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.125

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		religion_openly_norse_or_reformed_trigger = yes

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_court_skald = {
	message = yes
	is_unique = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.25

	allowed_to_grant = {
		religion_openly_germanic_or_reformed_trigger = yes

		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		any_courtier_or_vassal = {
			trait = poet
			is_adult = yes
		}
	}

	allowed_to_hold = {
		trait = poet
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		is_incapable = no
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_marksman = {
	message = yes
	is_unique = yes
	realm_in_name = yes

	dignity = 0.1
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.125

	allowed_to_grant = {
		religion_openly_germanic_or_reformed_trigger = yes

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_hirdman = {
	is_unique = yes
	message = yes

	dignity = 0.075
	grant_limit = 4

	opinion_effect = 5
	monthly_salary = 0.005
	monthly_prestige = 0.05

	allowed_to_grant = {
		religion_openly_germanic_or_reformed_trigger = yes

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# MONGOL PAGAN TITLES

title_baghatur = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.2
	grant_limit = 2

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.25

	allowed_to_grant = {
		trigger_if = {
			limit = { is_nomadic = yes }
			culture = mongol
		}
		trigger_else = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_ilkhanate
			}

			OR = {
				is_feudal = yes
				is_tribal = yes
			}
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_cherbi = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.125

	allowed_to_grant = {
		trigger_if = {
			limit = { is_nomadic = yes }
			culture = mongol
		}
		trigger_else = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_ilkhanate
			}

			OR = {
				is_feudal = yes
				is_tribal = yes
			}
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_darkhan = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 2

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.25

	allowed_to_grant = {
		trigger_if = {
			limit = { is_nomadic = yes }
			culture = mongol
		}
		trigger_else = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_ilkhanate
				has_landed_title = e_chagatai
			}

			OR = {
				is_feudal = yes
				is_tribal = yes
			}
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_noyan = {
	is_unique = yes
	message = yes

	dignity = 0.075
	grant_limit = 4

	opinion_effect = 5
	monthly_salary = 0.005
	monthly_prestige = 0.05

	allowed_to_grant = {
		trigger_if = {
			limit = { is_nomadic = yes }
			culture = mongol
		}
		trigger_else = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_ilkhanate
				has_landed_title = e_chagatai
			}

			OR = {
				is_feudal = yes
				is_tribal = yes
			}
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_behi = {
	is_unique = yes
	message = yes

	dignity = 0.1
	grant_limit = 2

	opinion_effect = 5
	monthly_salary = 0.05
	monthly_prestige = 0.05

	allowed_to_grant = {
		trigger_if = {
			limit = { is_nomadic = yes }
			culture = mongol
		}
		trigger_else = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_ilkhanate
				has_landed_title = e_chagatai
			}

			OR = {
				is_feudal = yes
				is_tribal = yes
			}
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_female = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_master_of_the_eagle = {
	is_unique = yes
	message = yes

	dignity = 0.10
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.125

	allowed_to_grant = {
		trigger_if = {
			limit = { is_nomadic = yes }
			culture = mongol
		}
		trigger_else = {
			OR = {
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_ilkhanate
				has_landed_title = e_chagatai
			}

			OR = {
				is_feudal = yes
				is_tribal = yes
			}
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# ZOROASTRIAN TITLES

title_shahrwaraz = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.2
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.25

	allowed_to_grant = {
		religion_group = zoroastrian_group

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		martial >= 15
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_kardarigan = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.125

	allowed_to_hold = {
		martial >= 15
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	allowed_to_grant = {
		religion_group = zoroastrian_group

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_shahin = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.125

	allowed_to_hold = {
		martial >= 15
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	allowed_to_grant = {
		religion_group = zoroastrian_group

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_pushtigban_salar = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.125

	allowed_to_grant = {
		religion_group = zoroastrian_group

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_spahbod = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 4

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.125

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		religion_group = zoroastrian_group

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_eran_ambaragbed = {
	is_unique = yes
	message = yes

	dignity = 0.075
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.005
	monthly_prestige = 0.05

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		religion_group = zoroastrian_group

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# GENERIC PAGAN TITLES

title_champion = {
	message = yes
	realm_in_name = yes

	dignity = 0.2
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.125

	allowed_to_grant = {
		trigger_if = {
			limit = { is_nomadic = no } # No additional requirements

			OR = {
				is_feudal = yes
				is_tribal = yes
			}

			religion_group = pagan_group

			# Already have a special minor title
			religion_openly_tengri_or_reformed_trigger = no
			religion_openly_germanic_or_reformed_trigger = no
		}

		NOR = {
			has_landed_title = e_mongol_empire
			has_landed_title = e_golden_horde
			has_landed_title = e_ilkhanate
			has_landed_title = e_chagatai
		}
	}

	allowed_to_hold = {
		is_adult = yes
		has_education_martial_trigger = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		health_traits == 0
		is_incapable = no
		prisoner = no
		NOT = { has_character_flag = retired_champion }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		trigger_if = {
			limit = { FROM = { ai = yes } }

			opinion = {
				who = FROM
				value >= 0
			}

			reverse_opinion = {
				who = FROM
				value >= 0
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_master_of_the_blade = {
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.125

	allowed_to_grant = {
		trigger_if = {
			limit = { is_nomadic = no } # No additional requirements

			OR = {
				is_feudal = yes
				is_tribal = yes
			}

			religion_group = pagan_group

			# Already have a special minor title
			religion_openly_germanic_or_reformed_trigger = no
		}

		# Already have a special minor title
		NOR = {
			religion_openly_tengri_or_reformed_trigger = yes
			has_landed_title = e_mongol_empire
			has_landed_title = e_golden_horde
			has_landed_title = e_ilkhanate
			has_landed_title = e_chagatai
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			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 }
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_master_of_the_bow = {
	realm_in_name = yes
	message = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.125

	allowed_to_grant = {
		trigger_if = {
			limit = { is_nomadic = no } # No additional requirements

			OR = {
				is_feudal = yes
				is_tribal = yes
			}

			religion_group = pagan_group

			# Already have a special minor title
			religion_openly_germanic_or_reformed_trigger = no
		}

		# Already have a special minor title
		NOR = {
			religion_openly_tengri_or_reformed_trigger = yes
			has_landed_title = e_mongol_empire
			has_landed_title = e_golden_horde
			has_landed_title = e_ilkhanate
			has_landed_title = e_chagatai
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no
		NOT = { has_minor_title = title_master_of_the_blade }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_venerable_elder = {
	dignity = 0.15
	realm_in_name = yes
	message = yes
	grant_limit = 4
	opinion_effect = 10

	monthly_salary = 0.075
	monthly_prestige = 0.125

	allowed_to_grant = {
		trigger_if = {
			limit = { is_nomadic = no } # No additional requirements

			OR = {
				is_feudal = yes
				is_tribal = yes
			}

			religion_group = pagan_group

			# Already have a special minor title
			religion_openly_germanic_or_reformed_trigger = no
		}

		# Already have a special minor title
		NOR = {
			religion_openly_tengri_or_reformed_trigger = yes
			has_landed_title = e_mongol_empire
			has_landed_title = e_golden_horde
			has_landed_title = e_ilkhanate
			has_landed_title = e_chagatai
		}
	}

	allowed_to_hold = {
		practical_age >= 50

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# TENGRI TITLES:

title_yabgu = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.25
	grant_limit = 1

	opinion_effect = 15
	monthly_salary = 0.1
	monthly_prestige = 0.50

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
			is_nomadic = yes
		}

		OR = {
			religion_openly_tengri_or_reformed_trigger = yes

			trigger_if = {
				limit = { culture_group = altaic }

				NOR = {
					religion_group = christian
					religion_group = muslim
					religion_group = zoroastrian_group
				}
			}
		}


		NOR = {
			culture = mongol
			has_landed_title = e_mongol_empire
			has_landed_title = e_golden_horde
			has_landed_title = e_ilkhanate
			has_landed_title = e_chagatai
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_close_relative = FROM

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_ishad = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 4

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.05

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
			is_nomadic = yes
		}

		OR = {
			religion_openly_tengri_or_reformed_trigger = yes

			trigger_if = {
				limit = { culture_group = altaic }

				NOR = {
					religion_group = christian
					religion_group = muslim
					religion_group = zoroastrian_group
				}
			}
		}


		NOR = {
			culture = mongol
			has_landed_title = e_mongol_empire
			has_landed_title = e_golden_horde
			has_landed_title = e_ilkhanate
			has_landed_title = e_chagatai
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_kundur = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.125

	allowed_to_grant = {
		OR = {
			is_feudal = yes
			is_tribal = yes
			is_nomadic = yes
		}

		OR = {
			religion_openly_tengri_or_reformed_trigger = yes

			trigger_if = {
				limit = { culture_group = altaic }

				NOR = {
					religion_group = christian
					religion_group = muslim
					religion_group = zoroastrian_group
				}
			}
		}


		NOR = {
			culture = mongol
			has_landed_title = e_mongol_empire
			has_landed_title = e_golden_horde
			has_landed_title = e_ilkhanate
			has_landed_title = e_chagatai
		}
	}

	allowed_to_hold = {
		is_adult = yes
		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# INDIAN TITLES

title_master_of_the_royal_elephants = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.06
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		has_dharmic_religion_trigger = yes

		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		NOR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		NOT = { has_character_modifier = guru }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_royal_builder = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.03
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.05

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		has_dharmic_religion_trigger = yes

		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		NOR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		NOT = { has_character_modifier = guru }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_court_poet_india = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.05
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		has_dharmic_religion_trigger = yes

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		NOT = { has_character_modifier = guru }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_guru = {
	message = yes

	dignity = 0.050
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.02
	monthly_prestige = 0.25

	allowed_to_grant = {
		OR = {
			has_dharmic_religion_trigger = yes
			religion_openly_bon_or_reformed_trigger = yes
		}

		any_courtier_or_vassal = {
			has_character_modifier = guru
		}
	}

	allowed_to_hold = {
		has_character_modifier = guru
		is_adult = yes

		OR = {
			has_dharmic_religion_trigger = yes
			religion_openly_bon_or_reformed_trigger = yes
		}

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
		always = no
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_genghis = {
	message = yes
	realm_in_name = no
	replace_order = yes
	show_as_title = yes

	dignity = 10
	monthly_prestige = 1.50

	revoke_trigger = {
		always = no
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_councilmember_king = {
	is_high_prio = yes
	is_voter = yes
	message = yes

	dignity = 0.050
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.00
	monthly_prestige = 0.5

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		has_law = law_voting_power_1
		has_dlc = "Conclave"
	}

	allowed_to_hold = {
		can_be_councilmember_king_trigger = yes

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
		show_only_failed_conditions = yes

		trigger_if = {
			limit = { FROM = { has_law = succession_voting_power_1 } }
			is_powerful_vassal = no
		}

		trigger_if = {
			limit = { FROM = { has_law = council_privileges_1 } }

			OR = {
				is_incapable = yes
				is_inaccessible_trigger = yes
			}
		}

		custom_tooltip = {
			text = not_changing_council_spot_tt
			NOT = { has_character_flag = is_moving_councillor }
		}
	}

	gain_effect = {
		remove_opinion = { who = FROM name = opinion_fired_from_council }
		remove_opinion = { who = FROM name = opinion_recently_fired }

		if = {
			limit = { FROM = { has_law = council_privileges_1  } }

			opinion = {
				name = grateful_council_term
				who = FROM
				years = 1
			}
		}
	}

	lose_effect = {
		if = {
			limit = {
				NOR = {
					has_character_flag = is_moving_councillor
					has_character_flag = given_title
				}

				is_incapable = no
			}

			opinion = { who = FROM name = opinion_fired_from_council }
			opinion = { who = FROM name = opinion_recently_fired }
		}

		clr_character_flag = is_moving_councillor
		clr_character_flag = given_title

		remove_opinion = {
			name = grateful_council_term
			who = FROM
		}
	}

	retire_effect = {
		if = {
			limit = {
				age < 65
				health >= 3
				is_sick_or_injured_trigger = no
				can_be_councilmember_king_trigger = yes
			}

			reverse_opinion = {
				name = opinion_resigned_from_council
				who = FROM
			}
		}
	}

	death_effect = {
	}
}

title_councilmember_emperor = {
	is_high_prio = yes
	message = yes
	is_voter = yes

	dignity = 0.060
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.00
	monthly_prestige = 0.5

	allowed_to_grant = {
		real_tier = EMPEROR
		has_law = law_voting_power_1
		has_dlc = "Conclave"
	}

	allowed_to_hold = {
		can_be_councilmember_emperor_trigger = yes

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
		show_only_failed_conditions = yes

		trigger_if = {
			limit = { FROM = { has_law = succession_voting_power_1 } }
			is_powerful_vassal = no
		}

		trigger_if = {
			limit = { FROM = { has_law = council_privileges_1 } }

			OR = {
				is_incapable = yes
				is_inaccessible_trigger = yes
			}
		}

		custom_tooltip = {
			text = not_changing_council_spot_tt
			NOT = { has_character_flag = is_moving_councillor }
		}
	}

	gain_effect = {
		remove_opinion = { who = FROM name = opinion_fired_from_council }
		remove_opinion = { who = FROM name = opinion_recently_fired }

		if = {
			limit = { FROM = { has_law = council_privileges_1  } }

			opinion = {
				name = grateful_council_term
				who = FROM
				years = 1
			}
		}
	}

	lose_effect = {
		if = {
			limit = {
				NOR = {
					has_character_flag = is_moving_councillor
					has_character_flag = given_title
				}

				is_incapable = no
			}

			opinion = { who = FROM name = opinion_fired_from_council }
			opinion = { who = FROM name = opinion_recently_fired }
		}

		clr_character_flag = is_moving_councillor
		clr_character_flag = given_title

		remove_opinion = {
			name = grateful_council_term
			who = FROM
		}
	}

	retire_effect = {
		if = {
			limit = {
				age < 65
				health >= 3
				is_sick_or_injured_trigger = no
				can_be_councilmember_emperor_trigger = yes
			}

			reverse_opinion = {
				name = opinion_resigned_from_council
				who = FROM
			}
		}
	}

	death_effect = {
	}
}

# TAOIST TITLES

title_court_architect = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.03
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		higher_real_tier_than = DUKE
		religion = taoist
		is_feudal = yes
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_zhangshi = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.05
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.10

	allowed_to_grant = {
		religion = taoist

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_canjun = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.25

	allowed_to_grant = {
		religion = taoist

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_yuhou = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.25

	allowed_to_grant = {
		religion = taoist

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_historiographer = {
	is_unique = yes
	message = yes
	realm_in_name = yes

	dignity = 0.15
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.075
	monthly_prestige = 0.25

	allowed_to_grant = {
		religion = taoist

		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}

	allowed_to_hold = {
		is_adult = yes
		learning >= 7

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		is_incapable = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_court_physician = {
	is_high_prio = yes
	message = yes
	realm_in_name = yes

	attribute = learning
	dignity = 5
	grant_limit = 1

	opinion_effect = 10
	monthly_salary = 0.2
	monthly_prestige = 0.5

	allowed_to_grant = {
		is_playable = yes
		has_dlc = "Reapers"
	}

	allowed_to_hold = {
		is_adult = yes
		prisoner = no

		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

				has_character_flag = is_court_physician
			}
		}

		trigger_if = {
			limit = { religion = hindu }
			NOT = { trait = brahmin }
		}

		is_incapable = no
		is_inaccessible_trigger = no

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
		custom_tooltip = {
			text = revoke_court_physician_being_treated_tt

			FROM = {
				NOT = { has_character_flag = being_treated }
			}
		}
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_hermetics_apprentice = {
	is_high_prio = yes
	message = yes
	realm_in_name = no

	attribute = learning
	dignity = 1
	grant_limit = 1
	opinion_effect = 10
	monthly_salary = 0.1
	monthly_prestige = 0.1

	allowed_to_grant = {
		ai = no
		society_member_of = hermetics
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		OR = {
			society_member_of = hermetics
			is_in_society = no
		}

		prisoner = no
		is_incapable = no
		NOT = { trait = in_hiding }

		hidden_trigger = {
			ai = yes
			NOT = { has_character_flag = completed_apprenticeship }

			trigger_if = {
				limit = {
					FROM = { ai = yes }
				}

				OR = {
					learning >= 10
					is_smart_trigger = yes
					trait = gardener
					trait = scholar
					trait = mystic
				}
			}
		}
	}

	revoke_trigger = {
		always = no
	}

	gain_effect = {
		if = {
			limit = { NOT = { society_member_of = hermetics } }
			join_society = hermetics
		}

		character_event = {
			id = MNM.1413 # Some years later, the apprenticeship ends
			days = 4500
			random = 1000
		}

		opinion = {
			name = 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 = {
			name = opinion_hermetic_apprentice
			who = FROM
		}
	}

	retire_effect = {
	}

	death_effect = {
	}
}

### JADE DRAGON MINOR TITLES###

# 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
title_china_emperor = {
	is_offmap_holder = yes
	show_as_title = yes

	offmap_power = offmap_china

	dignity = 1000 # This should always be higher than 0, or it won't be applied in all cases
}

title_administrator = {
	message = yes
	realm_in_name = no

	dignity = 0.9
	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
		}

		prisoner = no
		is_incapable = no
		NOT = { trait = in_hiding }
	}

	revoke_trigger = {
	}

	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
			}
		}
	}
}

title_master_engineer = {
	realm_in_name = no
	message = yes

	dignity = 0.9
	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
		}

		prisoner = no
		is_incapable = no
		NOT = { trait = in_hiding }
	}

	revoke_trigger = {
	}

	gain_effect = {
		trigger_switch = {
			on_trigger = has_character_flag

			master_engineer_just_spawned = {
				clr_character_flag = master_engineer_just_spawned

				character_event = {
					id = JD.20033
					days = 10
				}
			}

			china_master_engineer_golden_age = {
				character_event = {
					id = JD.20033
					years = 4
					random = 542 # 1.5 years
				}
			}

			fallback = {
				character_event = {
					id = JD.20033
					years = 8
					random = 1095 # 3 years
				}
			}
		}
	}

	lose_effect = {
		clear_delayed_event = { id = JD.20033 }
	}

	retire_effect = {
		clear_delayed_event = { id = JD.20033 }
	}

	death_effect = {
		clear_delayed_event = { id = JD.20033 }
	}
}

title_strategist = {
	realm_in_name = no
	message = yes

	dignity = 0.9
	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_strategist
		}
	}

	allowed_to_hold = {
		custom_tooltip = {
			text = title_strategist_modifier_tt
			has_character_modifier = jd_strategist
		}

		prisoner = no
		is_incapable = no
		NOT = { trait = in_hiding }
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

# 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_unique = yes
	message = yes
	is_high_prio = yes
	realm_in_name = yes

	dignity = 0.1
	grant_limit = 1

	opinion_effect = 5
	monthly_salary = 0.1
	monthly_prestige = 0.3

	allowed_to_grant = {
		is_playable = yes
		is_landed = yes
		has_dlc = "Conclave"
		is_theocracy = no
	}

	allowed_to_hold = {
		is_adult = yes

		custom_tooltip = {
			text = court_educator_tooltip

			OR = {
				has_top_tier_education_trait_trigger = yes

				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
				}
			}
		}

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}

		is_ruler = no
		prisoner = no
		is_incapable = no
		is_inaccessible_trigger = no

		NOR = {
			trait = infirm
			trait = imbecile
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

### New Byzantine Minor Titles ###
title_augusta = {
	is_unique = yes
	message = yes
	realm_in_name = yes
	show_as_title = yes

	dignity = 5.0
	grant_limit = 1

	opinion_effect = 30
	monthly_salary = 0.05
	monthly_prestige = 0.25

	allowed_to_grant = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		is_feudal = yes

		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_group = pagan_group
		}
	}

	allowed_to_hold = {
		is_close_relative = FROM
		is_female = yes
		is_adult = yes
		NOT = { has_minor_title = title_sebastos }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_patrikios = {
	show_as_title = yes
	message = yes

	dignity = 2.0
	grant_limit = 10

	opinion_effect = 5
	monthly_salary = 0.03
	monthly_prestige = 0.125

	allowed_to_grant = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		is_feudal = yes

		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_group = pagan_group
		}
	}

	allowed_to_hold = {
		is_adult = yes

		NOR = {
			dynasty = FROM
			is_close_relative = FROM
		}

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_hypatos = {
	message = yes

	dignity = 1.0
	grant_limit = 20

	opinion_effect = 5
	monthly_salary = 0.03
	monthly_prestige = 0.0625

	allowed_to_grant = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		is_feudal = yes

		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_group = pagan_group
		}
	}

	allowed_to_hold = {
		is_adult = yes

		NOR = {
			dynasty = FROM
			is_close_relative = FROM
			has_minor_title = title_anthypatos
		}

		custom_tooltip = {
			text = court_physician_tooltip_2

			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_title_trigger = yes
			}
		}

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}

title_sebastos = {
	message = yes
	show_as_title = yes

	dignity = 2.5
	grant_limit = 10

	opinion_effect = 5
	monthly_salary = 0.02
	monthly_prestige = 0.1875

	allowed_to_grant = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		is_feudal = yes

		OR = {
			religion_group = christian
			religion_group = jewish_group
			religion_group = pagan_group
		}
	}

	allowed_to_hold = {
		OR = {
			is_close_relative = FROM
			family = FROM
			is_cousin_of = FROM
			is_friend = FROM
		}

		NOT = { has_minor_title = title_augusta }

		custom_tooltip = {
			text = court_physician_tooltip_1

			trigger_if = {
				limit = { is_ruler = yes }

				primary_title = {
					temporary = no
				}
			}
		}
	}

	revoke_trigger = {
	}

	gain_effect = {
	}

	lose_effect = {
	}

	retire_effect = {
	}

	death_effect = {
	}
}