﻿###################
# MILITARY ORDERS #
###################

# Defined - Catholic & Pre-Catholic #

#Knights Hospitaller
ho_christian_knights_hospitaller = {
	
	type = military
	government = holy_order_government
	title = d_neow_military_hospitallers
	name = "holy_order_knights_hospitaller"
	coat_of_arms = "ho_knights_hospitaller"

	trigger = {
		trigger_if = {
			limit = { scope:founder = { has_variable = military_order_game_start_founder } }
			scope:founder = { has_variable = military_order_game_start_founder_2 }
			scope:province.county ?= title:c_spoleto
		}
		trigger_else = {
			scope:founder = {
				faith = faith:roman_catholic_faith
				culture = { has_cultural_pillar = heritage_italian }
			}
		}
	}

	weight = {
		value = 10
		if = {
			limit = { scope:province.county ?= title:c_spoleto }
			add = 100
		}
		if = {
			limit = { scope:founder = { has_variable = military_order_game_start_founder_2 } }
			add = 100000
		}
	}

	men_at_arms = { order_knights order_serjeants }

	effect = {
		scope:leader = {
			add_trait = lifestyle_physician
			add_trait_xp = {
				trait = lifestyle_physician
				value = { 25 50 }
			}
		}
		scope:new_holy_order = { set_order_tenet = tenet:tenet_celestial_hierarchy }
	}
}

#Teutonic Knights
ho_christian_teutonic_order = {
	
	type = military
	government = holy_order_government
	title = d_neow_military_teutonic_order
	name = "holy_order_teutonic_order"
	coat_of_arms = "ho_teutonic_order"

	trigger = {
		trigger_if = {
			limit = { scope:founder = { has_variable = military_order_game_start_founder } }
			scope:founder = { has_variable = military_order_game_start_founder_1 }
			scope:province.county ?= title:c_vienna
		}
		trigger_else = {
			scope:founder = {
				faith = faith:roman_catholic_faith
				culture = { has_cultural_pillar = heritage_central_germanic }
			}
		}
	}

	weight = {
		value = 10
		if = {
			limit = { scope:province.county ?= title:c_vienna }
			add = 100
		}
		if = {
			limit = { scope:founder = { has_variable = military_order_game_start_founder_1 } }
			add = 100000
		}
	}

	men_at_arms = { order_serjeants crossbowmen }

	effect = {
		scope:leader = {
			if = {
				limit = {
					NOT = {
						has_realm_law = cultural_holy_order_succession_law
					}
				}
				add_realm_law = cultural_holy_order_succession_law
			}
		}
		scope:new_holy_order = { set_order_tenet = tenet:tenet_peace_of_god }
	}
}

#Knights of St Lazarus
#Who cared for lepers (as well as fighting in battles)
ho_knights_of_st_lazarus = {

	type = military
	government = holy_order_government
	title = d_neow_military_saint_lazarus
	name = "holy_order_knights_of_st_lazarus"
	coat_of_arms = "ho_knights_of_st_lazarus"

	trigger = {
		trigger_if = {
			limit = { scope:founder = { has_variable = military_order_game_start_founder } }
			scope:founder = { has_variable = military_order_game_start_founder_3 }
			scope:province.county ?= title:c_dublin
		}
		trigger_else = {
			scope:founder = {
				faith = faith:roman_catholic_faith
				culture = { has_cultural_pillar = heritage_goidelic }
			}
		}
	}

	weight = {
		value = 10
		if = {
			limit = { scope:province.county ?= title:c_dublin }
			add = 100
		}
		if = {
			limit = { scope:founder = { has_variable = military_order_game_start_founder_3 } }
			add = 100000
		}
	}

	men_at_arms = { order_knights order_serjeants }

	effect = {
		scope:leader = {
			add_trait = lifestyle_physician
			add_trait_xp = {
				trait = lifestyle_physician
				value = { 25 50 }
			}
		}
		scope:new_holy_order = { set_order_tenet = tenet:tenet_dulia }
	}
}

###################
# MONASTIC ORDERS #
###################

# Fixed

#Benedictines - extant by earliest game start
ho_contemplative_hospitaller_johannics = {
	
	type = monastic
	government = monastic_holy_order_government
	title = d_contemplative_hospitaller_johannics
	name = "contemplative_hospitaller_johannics"
	coat_of_arms = "ho_contemplative_hospitaller_johannics"

	trigger = {
		trigger_if = {
			limit = {
				scope:founder = { has_variable = monastic_game_start_founder_2 }
			}
			scope:province.county ?= title:c_capua
		}
		trigger_else = {
		}
	}

	weight = {
		value = 10
		#Should be founded in Italy
		if = {
			limit = {
				scope:province.county ?= title:c_capua
			}
			add = 10
		}
		#Trying to put benedictines here on game start
		if = {
			limit = {
				years_from_game_start < 1
				current_year >= 2555
				
				scope:province.county ?= title:c_capua
			}
			add = 10000
		}
	}


	effect = {
		scope:leader = {
			add_trait = lifestyle_physician
			add_trait_xp = {
				trait = lifestyle_physician
				value = { 25 50 }
			}
		}
		scope:new_holy_order = { set_order_tenet = tenet:tenet_celestial_hierarchy }
	}
}

ho_contemplative_teutonic_order = {
	
	type = monastic
	government = monastic_holy_order_government
	title = d_contemplative_teutonic_order
	name = "contemplative_teutonic_order"
	coat_of_arms = "ho_contemplative_teutonic_order"

	trigger = {
		trigger_if = {
			limit = {
				scope:founder = { has_variable = monastic_game_start_founder_1 }
			}
			scope:province.county ?= title:c_wiener_neustadt
		}
		trigger_else = {
		}
	}

	weight = {
		value = 10
		#Should be founded in Italy
		if = {
			limit = {
				scope:province.county ?= title:c_wiener_neustadt
			}
			add = 10
		}
		#Trying to put benedictines here on game start
		if = {
			limit = {
				years_from_game_start < 1
				current_year >= 2555
				
				scope:province.county ?= title:c_wiener_neustadt
			}
			add = 10000
		}
	}


	effect = {
		scope:leader = {
			add_trait = lifestyle_physician
			add_trait_xp = {
				trait = lifestyle_physician
				value = { 25 50 }
			}
		}
		scope:new_holy_order = { set_order_tenet = tenet:tenet_peace_of_god }
	}
}

ho_contemplative_hospitaller_lazareans = {
	
	type = monastic
	government = monastic_holy_order_government
	title = d_contemplative_hospitaller_lazareans
	name = "contemplative_hospitaller_lazareans"
	coat_of_arms = "ho_contemplative_hospitaller_lazareans"

	trigger = {
		trigger_if = {
			limit = {
				scope:founder = { has_variable = monastic_game_start_founder_3 }
			}
			scope:province.county ?= title:c_offaly
		}
		trigger_else = {
		}
	}

	weight = {
		value = 10
		#Should be founded in Italy
		if = {
			limit = {
				scope:province.county ?= title:c_offaly
			}
			add = 10
		}
		#Trying to put benedictines here on game start
		if = {
			limit = {
				years_from_game_start < 1
				current_year >= 2555
				
				scope:province.county ?= title:c_offaly
			}
			add = 10000
		}
	}


	effect = {
		scope:leader = {
			add_trait = lifestyle_physician
			add_trait_xp = {
				trait = lifestyle_physician
				value = { 25 50 }
			}
		}
		scope:new_holy_order = { set_order_tenet = tenet:tenet_dulia }
	}
}

# Greek Catholic military orders (the faith is shared with Latin Catholics,
# so these names are selected by rite, not by a faith-wide name pool).
ho_neow_greek_catholic_sepulchre = {
	type = military
	government = holy_order_government
	name = "holy_order_brotherhood_of_the_holy_sepulchre"
	coat_of_arms = "ho_brotherhood_of_the_holy_sepulchre"
	trigger = {
		scope:founder = {
			rite = rite:greek_catholic_rite
			NOT = { has_variable = military_order_game_start_founder }
		}
	}
	weight = { value = 50 }
}
ho_neow_greek_catholic_first_patriarchate = {
	type = military
	government = holy_order_government
	name = "holy_order_knights_of_the_first_patriarchate"
	coat_of_arms = "ho_knights_of_the_first_patriarchate"
	trigger = {
		scope:founder = {
			rite = rite:greek_catholic_rite
			NOT = { has_variable = military_order_game_start_founder }
		}
	}
	weight = { value = 50 }
}
ho_neow_greek_catholic_theotokos = {
	type = military
	government = holy_order_government
	name = "holy_order_order_of_the_holy_virgin"
	coat_of_arms = "ho_order_of_the_holy_virgin"
	trigger = {
		scope:founder = {
			rite = rite:greek_catholic_rite
			NOT = { has_variable = military_order_game_start_founder }
		}
	}
	weight = { value = 50 }
}
