# -*- ck2.landed_titles -*-

d_army_light = {
	color = { 120 160 30 }
	color2 = { 255 255 255 }
	graphical_culture = holygfx
	capital = 693 # Baghdad
	title = GRANDMASTER
	foa = GRANDMASTER_FOA
	# Always exists
	landless = yes
	holy_order = yes
	# Parent Religion
	religion = manichean
	culture = persian
	# Cannot be held as a secondary title
	primary = yes
	# Extra income due to donations, etc
	monthly_income = 3 # (Must be an integer between 1 and 512)
	mercenary_type = saint_addai_composition
	coat_of_arms = {
		data = { 2 0 3 4 7 11 11 }
		religion = manichean
	}
}
d_ismaili = {
	color = { 60 190 60 }
	color2 = { 220 220 0 }
	capital = 719 # Mecca
	creation_requires_capital = no
	dignity = 100 # Counted as having this many more counties than it does
	religion = ismaili
	# Controls a religion
	controls_religion = ismaili
	assimilate = no
	caliphate = yes
	coat_of_arms = {
		data = { 0 0 0 9 1 7 7 }
		religion = ismaili
	}
	title = CALIPH
	title_female = CALIPHA
	foa = CALIPH_FOA
	short_name = yes
	gain_effect = {
		if = {
			limit = { d_ismaili = { NOT = { has_title_flag = ismaili_followers } } }
			hidden_effect = {
				character_event = {
					id = emf_heresy.1973
					days = 30
				}
			}
		}
	}
	allow = {
		trigger_if = {
			limit = { NOT = { religion = ismaili } }
			religion = ismaili
		}
		OR = {
			trait = mirza
			trait = sayyid
			piety = 1000
			custom_tooltip = {
				text = ismaili_bloodline_TT
				any_owned_bloodline = {
					has_bloodline_flag = bloodline_ismaili_leader
					bloodline_is_active_for = PREV
				}
			}
		}
		trigger_if = {
			limit = {
				NOT = {
					has_alternate_start_parameter = {
						key = religion_names
						value = random
					}
				}
			}
			custom_tooltip = {
				text = ismaili_creation_independent
				in_revolt = no
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							OR = {
								in_revolt = yes
								NOT = { religion = ismaili }
							}
						}
					}
				}
			}
			custom_tooltip = {
				text = not_shia_caliphate_revolt_ongoing
				NOT = { has_global_flag = ismaili_caliphate_revolt_ongoing }
			}
			OR = {
				AND = {
					trait = sayyid
					piety = 1000
				}
				AND = {
					custom_tooltip = {
						text = ismaili_bloodline_TT
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_ismaili_leader
							bloodline_is_active_for = PREV
						}
					}
					piety = 500
				}
				trigger_if = {
					limit = { NOT = { has_global_flag = destroyed_caliphates } }
					custom_tooltip = {
						text = controls_mecca_medina
						c_mecca = { owner_under_ROOT = yes }
						c_medina = { owner_under_ROOT = yes }
					}
				}
				custom_tooltip = {
					text = controls_jerusalem_damascus_baghdad
					c_jerusalem = { owner_under_ROOT = yes }
					c_damascus = { owner_under_ROOT = yes }
					c_baghdad = { owner_under_ROOT = yes }
				}
			}
		}
		trigger_else = {
			custom_tooltip = {
				text = THREE_HOLY_SITES_TT
				any_realm_title = {
					count = 3
					is_holy_site = ROOT
				}
			}
		}
		trigger_if = {
			limit = { has_global_flag = destroyed_caliphates }
			OR = {
				piety = 500
				custom_tooltip = {
					text = controls_mecca_medina
					c_mecca = { owner_under_ROOT = yes }
					c_medina = { owner_under_ROOT = yes }
				}
				custom_tooltip = {
					text = ismaili_bloodline_TT
					any_owned_bloodline = {
						has_bloodline_flag = bloodline_ismaili_leader
						bloodline_is_active_for = PREV
					}
				}
			}
		}
	}
} # end d_ismaili
d_mahdiyya = {
	color = { 180 0 0 }
	color2 = { 220 220 0 }
	capital = 719 # Mecca
	creation_requires_capital = no
	dignity = 100 # Counted as having this many more counties than it does
	title = CALIPH
	title_female = CALIPHA
	foa = CALIPH_FOA
	short_name = yes
	religion = mahdiyya
	# Controls a religion
	controls_religion = mahdiyya
	assimilate = no
	caliphate = yes
	coat_of_arms = {
		data = { 0 0 0 9 1 7 7 }
		religion = mahdiyya
	}
	allow = {
		trigger_if = {
			limit = { NOT = { religion = mahdiyya } }
			religion = mahdiyya
		}
		OR = {
			trait = mirza
			trait = sayyid
			piety = 1000
		}
		trigger_if = {
			limit = {
				NOT = {
					has_alternate_start_parameter = {
						key = religion_names
						value = random
					}
				}
			}
			custom_tooltip = {
				text = mahdiyya_creation_independent
				in_revolt = no
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							OR = {
								in_revolt = yes
								NOT = { religion = mahdiyya }
							}
						}
					}
				}
			}
			OR = {
				AND = {
					trait = sayyid
					piety = 1000
				}
				trigger_if = {
					limit = { NOT = { has_global_flag = destroyed_caliphates } }
					custom_tooltip = {
						text = controls_mecca_medina
						c_mecca = { owner_under_ROOT = yes }
						c_medina = { owner_under_ROOT = yes }
					}
				}
				custom_tooltip = {
					text = controls_jerusalem_damascus_baghdad
					c_jerusalem = { owner_under_ROOT = yes }
					c_damascus = { owner_under_ROOT = yes }
					c_baghdad = { owner_under_ROOT = yes }
				}
			}
		}
		trigger_else = {
			custom_tooltip = {
				text = THREE_HOLY_SITES_TT
				any_realm_title = {
					count = 3
					is_holy_site = ROOT
				}
			}
		}
		trigger_if = {
			limit = { has_global_flag = destroyed_caliphates }
			custom_tooltip = {
				text = controls_mecca_medina
				c_mecca = { owner_under_ROOT = yes }
				c_medina = { owner_under_ROOT = yes }
			}
		}
	}
}
d_manichean = { # Manichaean Church
	color = { 180 120 40 }
	color2 = { 220 220 0 }
	capital = 693 # Baghdad
	title = MANI_LEADER
	foa = POPE_FOA
	short_name = yes
	dignity = 80 # Counted as having this many more counties than it does
	# Always exists
	landless = yes
	# Controls a religion
	controls_religion = manichean
	religion = manichean
	# Cannot be held as a secondary title
	primary = yes
	dynasty_title_names = no # Will not be named "Seljuk", etc.
	allow = {
		is_title_active = FROM
		religion = manichean
		is_adult = yes
		has_regent = no
		war = no
		num_of_holy_sites = 1
		piety = 500
	}
}
d_maronite = { # Maronite Church
	color = { 51 25 0 }
	color2 = { 170 172 88 }
	capital = 770 # Beirut
	title = MARONITE_PATRIARCH
	foa = ECUMENICAL_PATRIARCH_FOA
	# Always exists
	landless = yes
	short_name = yes
	dignity = 80 # Counted as having this many more counties than it does
	# Controls a religion
	controls_religion = maronite
	religion = maronite
	# Cannot be held as a secondary title
	primary = yes
	dynasty_title_names = no # Will not be named "Seljuk", etc.
	allow = { always = no }
}
d_syriac = { # Syriac Orthodox Church
	color = { 151 125 20 }
	color2 = { 170 172 88 }
	capital = 683 # Amida
	title = SYRIAC_PATRIARCH
	foa = ECUMENICAL_PATRIARCH_FOA
	# Always exists
	landless = yes
	short_name = yes
	dignity = 80 # Counted as having this many more counties than it does
	# Controls a religion
	controls_religion = syriac
	religion = syriac
	# Cannot be held as a secondary title
	primary = yes
	dynasty_title_names = no # Will not be named "Seljuk", etc.
	allow = { always = no }
}
d_nabawiyya = {
	color = { 225 220 80 }
	color2 = { 220 220 0 }
	capital = 719 # Mecca
	creation_requires_capital = no
	dignity = 100 # Counted as having this many more counties than it does
	title = MALIK
	title_female = MALIKA
	foa = MALIK_FOA
	short_name = yes
	religion = nabawiyya
	# Controls a religion
	controls_religion = nabawiyya
	assimilate = no
	caliphate = yes
	coat_of_arms = {
		data = { 0 0 0 9 1 7 7 }
		religion = nabawiyya
	}
	allow = {
		trigger_if = {
			limit = { NOT = { religion = nabawiyya } }
			religion = nabawiyya
		}
		OR = {
			trait = mirza
			trait = sayyid
			piety = 1000
		}
		trigger_if = {
			limit = {
				NOT = {
					has_alternate_start_parameter = {
						key = religion_names
						value = random
					}
				}
			}
			custom_tooltip = {
				text = nabawiyya_creation_independent
				in_revolt = no
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							OR = {
								in_revolt = yes
								NOT = { religion = nabawiyya }
							}
						}
					}
				}
			}
			OR = {
				AND = {
					trait = sayyid
					piety = 1000
				}
				trigger_if = {
					limit = { NOT = { has_global_flag = destroyed_caliphates } }
					custom_tooltip = {
						text = controls_mecca_medina
						c_mecca = { owner_under_ROOT = yes }
						c_medina = { owner_under_ROOT = yes }
					}
				}
				custom_tooltip = {
					text = controls_jerusalem_damascus_baghdad
					c_jerusalem = { owner_under_ROOT = yes }
					c_damascus = { owner_under_ROOT = yes }
					c_baghdad = { owner_under_ROOT = yes }
				}
			}
		}
		trigger_else = {
			custom_tooltip = {
				text = THREE_HOLY_SITES_TT
				any_realm_title = {
					count = 3
					is_holy_site = ROOT
				}
			}
		}
		trigger_if = {
			limit = { has_global_flag = destroyed_caliphates }
			custom_tooltip = {
				text = controls_mecca_medina
				c_mecca = { owner_under_ROOT = yes }
				c_medina = { owner_under_ROOT = yes }
			}
		}
	}
}
d_shiite = {
	color = { 200 250 200 }
	color2 = { 220 220 0 }
	capital = 719 # Mecca
	creation_requires_capital = no
	dignity = 100 # Counted as having this many more counties than it does
	religion = shiite
	landless = yes
	dynasty_title_names = no
	# Controls a religion
	controls_religion = shiite
	assimilate = no
	caliphate = yes
	coat_of_arms = {
		data = { 0 0 0 9 1 7 7 }
		religion = shiite
	}
	title = IMAM
	title_female = IMAMA
	foa = IMAM_FOA
	short_name = yes
	allow = {
		trigger_if = {
			limit = { NOT = { religion = shiite } }
			religion = shiite
		}
		OR = {
			trait = mirza
			trait = sayyid
			piety = 1000
		}
		trigger_if = {
			limit = {
				NOT = {
					has_alternate_start_parameter = {
						key = religion_names
						value = random
					}
				}
			}
			custom_tooltip = {
				text = shia_creation_independent
				in_revolt = no
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							OR = {
								in_revolt = yes
								NOT = { religion = shiite }
							}
						}
					}
				}
			}
			OR = {
				AND = {
					trait = sayyid
					piety = 1000
				}
				trigger_if = {
					limit = { NOT = { has_global_flag = destroyed_caliphates } }
					custom_tooltip = {
						text = controls_mecca_medina
						c_mecca = { owner_under_ROOT = yes }
						c_medina = { owner_under_ROOT = yes }
					}
				}
				custom_tooltip = {
					text = controls_jerusalem_damascus_baghdad
					c_jerusalem = { owner_under_ROOT = yes }
					c_damascus = { owner_under_ROOT = yes }
					c_baghdad = { owner_under_ROOT = yes }
				}
			}
		}
		trigger_else = {
			custom_tooltip = {
				text = THREE_HOLY_SITES_TT
				any_realm_title = {
					count = 3
					is_holy_site = ROOT
				}
			}
		}
		trigger_if = {
			limit = { has_global_flag = destroyed_caliphates }
			custom_tooltip = {
				text = controls_mecca_medina
				c_mecca = { owner_under_ROOT = yes }
				c_medina = { owner_under_ROOT = yes }
			}
		}
	}
} # end d_shiite
d_zaydi = {
	color = { 40 160 40 }
	color2 = { 220 220 0 }
	capital = 719 # Makkah # Mecca
	creation_requires_capital = no
	dignity = 80 # Counted as having this many more counties than it does
	religion = zaydi
	# Controls a religion
	controls_religion = zaydi
	caliphate = yes
	title = IMAM
	title_female = IMAMA
	foa = IMAM_FOA
	short_name = yes
	allow = {
		trigger_if = {
			limit = { NOT = { religion = zaydi } }
			religion = zaydi
		}
		OR = {
			trait = mirza
			trait = sayyid
			piety = 1000
		}
		trigger_if = {
			limit = {
				NOT = {
					has_alternate_start_parameter = {
						key = religion_names
						value = random
					}
				}
			}
			custom_tooltip = {
				text = zaydi_creation_independent
				in_revolt = no
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							OR = {
								in_revolt = yes
								NOT = { religion = zaydi }
							}
						}
					}
				}
			}
			OR = {
				AND = {
					trait = sayyid
					piety = 1000
				}
				trigger_if = {
					limit = { NOT = { has_global_flag = destroyed_caliphates } }
					custom_tooltip = {
						text = controls_mecca_medina
						c_mecca = { owner_under_ROOT = yes }
						c_medina = { owner_under_ROOT = yes }
					}
				}
				custom_tooltip = {
					text = controls_jerusalem_damascus_baghdad
					c_jerusalem = { owner_under_ROOT = yes }
					c_damascus = { owner_under_ROOT = yes }
					c_baghdad = { owner_under_ROOT = yes }
				}
			}
		}
		trigger_else = {
			custom_tooltip = {
				text = THREE_HOLY_SITES_TT
				any_realm_title = {
					count = 3
					is_holy_site = ROOT
				}
			}
		}
		trigger_if = {
			limit = { has_global_flag = destroyed_caliphates }
			custom_tooltip = {
				text = controls_mecca_medina
				c_mecca = { owner_under_ROOT = yes }
				c_medina = { owner_under_ROOT = yes }
			}
		}
	}
} # end d_zaydi
