namespace = Couronnement
######################################
####### Vatican				   #######
######################################
character_event = {
	id = Couronnement.1
	desc = EVTDESC_Couronnement_1
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	option = { # Demandez un don en argent
		name = EVTOPTB_Couronnement_1
	    event_target:ask_coronation_target = {
			letter_event = {
				id = HF.20212
				days = 1
			}
		}
		ai_chance = {
			factor = 0.2
		    modifier = {
				factor = 0.5
				vassal_of = FROM
			} 
			modifier = {
				factor = 1.5
				has_opinion_modifier = { 
					who = FROM 
					modifier = opinion_supported_pope 
				}
			}
			modifier = {
				factor = 0
				NOT = { 
					opinion = { 
						who = FROM
						value = -100 
					} 
				}
			}
			modifier = {
				factor = 0.2
				NOT = { 
					opinion = { 
						who = FROM
						value = -80 
					} 
				}
			}
			modifier = {
				factor = 0.3
				NOT = { 
					opinion = { 
						who = FROM
						value = -60 
					} 
				}
			}
			modifier = {
				factor = 0.4
				NOT = { 
					opinion = { 
						who = FROM
						value = -40 
					} 
				}
			}
			modifier = {
				factor = 0.5
				NOT = { 
					opinion = { 
						who = FROM
						value = -20 
					} 
				}
			}
			modifier = {
				factor = 0.6
				NOT = { 
					opinion = { 
						who = FROM
						value = 0 
					} 
				}
			}
			modifier = {
				factor = 1.25
				opinion = { 
					who = FROM
					value = 20 
				}
			}
			modifier = {
				factor = 1.5
				opinion = { 
					who = FROM
					value = 40 
				}
			}
			modifier = {
				factor = 1.5
				opinion = { 
					who = FROM
					value = 60 
				}
			}
			modifier = {
				factor = 1.5
				opinion = { 
					who = FROM
					value = 80 
				}
			}
			modifier = {
				factor = 1.5
				opinion = { 
					who = FROM
					value = 100 
				}
			}
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 0.5
				trait = zealous
			}
		}
	}
	option = { # Je veux être indépendant
		name = EVTOPTA_Couronnement_1
		trigger = {
			vassal_of = event_target:ask_coronation_target
		}
	    event_target:ask_coronation_target = {
			letter_event = {
				id = HF.20211
				days = 1
			}
		}	
		ai_chance = {
			factor = 0.8
			 modifier = {
				factor = 0
				NOT = { vassal_of = FROM }
			}
			modifier = {
				factor = 2
				has_opinion_modifier = {
					who = FROM 
					modifier = opinion_requested_independence 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
			}
			modifier = {
				factor = 2
				NOT = { 
					opinion = { 
						who = FROM
						value = -100 
					} 
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -80 
					} 
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -60 
					} 
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -40 
					} 
				}
			}
			modifier = {
				factor = 1.5
				NOT = { 
					opinion = { 
						who = FROM
						value = -20 
					} 
				}
			}
			modifier = {
				factor = 0.9
				opinion = { 
					who = FROM
					value = 20 
				} 
			}
			modifier = {
				factor = 0.8
				opinion = { 
					who = FROM
					value = 40 
				} 
			}
			modifier = {
				factor = 0.7
				opinion = { 
					who = FROM
					value = 60 
				} 
			}
			modifier = {
				factor = 0.6
				opinion = { 
					who = FROM
					value = 80 
				} 
			}
			modifier = {
				factor = 0.5
				opinion = { 
					who = FROM
					value = 100 
				} 
			}
		}
	}
	option = { # Demandez que l'Investiture Papale soit mise en œuvre
		name = EVTOPTC_Couronnement_1		
		trigger = {
			event_target:ask_coronation_target = {
				primary_title = {
					has_law = investiture_law_1
				}
			}
		}		
	    event_target:ask_coronation_target = {
			letter_event = {
				id = HF.20213
				days = 1
			}
		}
		hidden_tooltip = {
			event_target:ask_coronation_target = {
				any_vassal = {
					remove_claim = k_papal_state
				}
			}
		}
		ai_chance = {
			factor = 0.3
			modifier = {
				factor = 0
				FROM = {
					NOT = {
						primary_title = {
							has_law = investiture_law_1
						}
					}
				}
			}
			modifier = {
				factor = 2
				has_opinion_modifier = {
					who = FROM 
					modifier = opinion_requested_papal_investiture 
				}
			}
			modifier = {
				factor = 1.5
				FROM = { tier = EMPEROR }
			}
			modifier = {
				factor = 1.75
				FROM = { has_landed_title = e_hre }
			}
			modifier = {
				factor = 1.5
				tier = KING
			}
			modifier = {
				factor = 1.5
				trait = envious
			}
			modifier = {
				factor = 1.75
				independent = yes
			}
		}
	}
	option = { # Suivant
		name = EVTOPTA_excommunication_suiv
		character_event = {
			id = Couronnement.2
		}
		ai_chance = {
			factor = 0  
		}
	}
}

character_event = {
	id = Couronnement.2
	desc = EVTDESC_Couronnement_2
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	option = { # Demandez la déposition d'un dirigeant excommunié
		name = EVTOPTA_Couronnement_2
		trigger = {
			event_target:ask_coronation_target = { #Wartime coronation.
				war = no
			}
			any_independent_ruler = { 
				is_within_diplo_range = event_target:ask_coronation_target
				excommunicated_for = ROOT
				in_revolt = no
				NOT = {
					is_liege_of = event_target:ask_coronation_target
				}
				NOT = {
					is_allied_with = ROOT
				}
				NOT = { 
					any_current_enemy = {
						NOT = {
							religion_group = ROOT
						}
					}
				}
			}
		}
	    event_target:ask_coronation_target = {
			letter_event = {
				id = HF.20214
				days = 1
			}
		}
		ai_chance = {
			factor = 0.3
			modifier = {
				factor = 0
				NOT = {
					any_independent_ruler = { 
						is_within_diplo_range = FROM
						excommunicated_for = ROOT
						in_revolt = no
						NOT = {
							is_liege_of = FROM
						}
						NOT = {
							is_allied_with = ROOT
						}
						NOT = { 
							any_current_enemy = {
								NOT = {
									religion_group = ROOT
								}
							}
						}
					}
				}
			}
			modifier = {
				factor = 2.5
				has_opinion_modifier = {
					who = FROM 
					modifier = opinion_requested_excommunication_war 
				}
			}
			modifier = {
				factor = 0.35
				FROM = { lower_tier_than = EMPEROR }
			}
			modifier = {
				factor = 0.25
				FROM = { NOT = { realm_size = 40 } }
			}
			modifier = {
				factor = 0.5
				FROM = { NOT = { realm_size = 80 } }
			}
			modifier = {
				factor = 0.75
				FROM = { NOT = { realm_size = 150 } }
			}
		}
	}
	option = { # Demandez la déposition d'un antipape
		name = EVTOPTB_Couronnement_2
		trigger = {
			event_target:ask_coronation_target = { #Wartime coronation.
				war = no
			}
			any_independent_ruler = {
				religion = event_target:ask_coronation_target
				is_within_diplo_range = event_target:ask_coronation_target
				NOT = {
					is_allied_with = ROOT
				}
	#			OR = {
					religion = catholic
	#				religion = fraticelli
	#			}
				rightful_religious_head_scope = { # ne pas changer le "rightful_religious_head_scope"
					is_liege_or_above = PREV
	#				OR = {
						has_claim = k_papal_state
	#					has_claim = d_fraticelli
	#				}
				}
			}
		}
	    event_target:ask_coronation_target = {
			letter_event = {
				id = HF.20215
				days = 1
			}
		}
		ai_chance = {
			factor = 0.3
			modifier = { #Check if any antipopes are available in the first place
				factor = 0
				NOT = {
					any_independent_ruler = {
						religion = FROM
						is_within_diplo_range = FROM
						NOT = {
							is_allied_with = ROOT
						}
	#					OR = {
							religion = catholic
	#						religion = fraticelli
	#					}
						rightful_religious_head_scope = { # ne pas changer le "rightful_religious_head_scope"
							is_liege_or_above = PREV
	#						OR = {
								has_claim = k_papal_state
	#							has_claim = d_fraticelli
	#						}
						}
					}
				}
			}
			modifier = {
				factor = 2.5
				has_opinion_modifier = { #Opinion modifier keeps track of the Pope's previous decision, should the player deny his first request and then attempt to ask again immediately after for a different result.
					who = FROM 
					modifier = opinion_requested_antipope_war 
				}
			}
			modifier = {
				factor = 0.35
				FROM = {
					lower_tier_than = EMPEROR
				}
			}
			modifier = {
				factor = 0.25
				FROM = {
					NOT = {
						realm_size = 40
					}
				}
			}
			modifier = {
				factor = 0.5
				FROM = {
					NOT = {
						realm_size = 80
					}
				}
			}
			modifier = {
				factor = 0.75
				FROM = {
					NOT = {
						realm_size = 150
					}
				}
			}
		}
	}
	option = { # Demandez une guerre sainte en Italie
		name = EVTOPTA_Couronnement_4
		trigger = { #Check if a potential target exists (either an infidel, a heretic, or a hated Christian ruler).
			event_target:ask_coronation_target = { higher_tier_than = KING war = no }
			any_independent_ruler = {
				is_shattered_world = no
				is_alternate_start = no
				is_random_world = no
				is_within_diplo_range = event_target:ask_coronation_target
				NOT = {
					is_allied_with = ROOT
				}
				OR = { 
					excommunicated_for = ROOT
					NOT = {
						religion = ROOT
					}
					NOT = { 
						opinion = { 
							who = ROOT 
							value = -50
						} 
					}
				}
				OR = {
					any_demesne_title = {
						OR = {
							title = d_latium
							title = d_spoleto
							title = d_ancona
							title = d_ferrara
							title = d_benevento
							d_latium = {
								any_de_jure_vassal_title = {
									owner = {
										character = PREVPREVPREVPREV
									}
								}
							}
							d_spoleto = {
								any_de_jure_vassal_title = {
									owner = {
										character = PREVPREVPREVPREV
									}
								}
							}
							d_ancona = {
								any_de_jure_vassal_title = {
									owner = {
										character = PREVPREVPREVPREV
									}
								}
							}
							d_ferrara = {
								any_de_jure_vassal_title = {
									owner = {
										character = PREVPREVPREVPREV
									}
								}
							}
							d_benevento = {
								any_de_jure_vassal_title = {
									owner = {
										character = PREVPREVPREVPREV
									}
								}
							}
						}
					}
					any_vassal = {	
						any_demesne_title = {
							OR = {
								title = d_latium
								title = d_spoleto
								title = d_ancona
								title = d_ferrara
								title = d_benevento
								d_latium = {
									any_de_jure_vassal_title = {
										owner = {
											character = PREVPREVPREVPREV
										}
									}
								}
								d_spoleto = {
									any_de_jure_vassal_title = {
										owner = {
											character = PREVPREVPREVPREV
										}
									}
								}
								d_ancona = {
									any_de_jure_vassal_title = {
										owner = {
											character = PREVPREVPREVPREV
										}
									}
								}
								d_ferrara = {
									any_de_jure_vassal_title = {
										owner = {
											character = PREVPREVPREVPREV
										}
									}
								}
								d_benevento = {
									any_de_jure_vassal_title = {
										owner = {
											character = PREVPREVPREVPREV
										}
									}
								}
							}
						}		
					}
				}
			}
		}
	    event_target:ask_coronation_target = {
			letter_event = {
				id = HF.20221
				days = 1
			}
		}
		ai_chance = {
			factor = 0.3
			   modifier = {
				factor = 0.25
				FROM = {
					NOT = {
						realm_size = 40
					}
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -100 
					} 
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -80 
					} 
				}
			}
			modifier = {
			factor = 1.5
				NOT = { 
					opinion = { 
						who = FROM
						value = -60 
					} 
				}
			}
			modifier = {
				factor = 1.5
				NOT = { 
					opinion = { 
						who = FROM
						value = -40 
					} 
				}
			}
			modifier = {
				factor = 1.25
				NOT = { 
					opinion = { 
						who = FROM
						value = -20 
					} 
				}
			}
			modifier = {
				factor = 2
				has_landed_title = k_papal_state
				FROM = {
					has_landed_title = e_hre
				}
			}
			modifier = {
				factor = 2.5
				has_opinion_modifier = {
					who = FROM 
					modifier = opinion_requested_pepin_war 
				}
			}
			modifier = {
				factor = 10
				NOT = {
					completely_controls = d_latium
				}
				NOT = {
					completely_controls = d_spoleto
				}
				NOT = {
					completely_controls = d_ancona
				}
				NOT = {
					completely_controls = d_ferrara
				}
				NOT = {
					completely_controls = d_benevento
				}
			}
			modifier = {
				factor = 0
				completely_controls = d_latium
				completely_controls = d_spoleto
				completely_controls = d_ancona
				completely_controls = d_ferrara
				completely_controls = d_benevento
			}
		}		
	}
	option = { # Suivant
		name = EVTOPTA_excommunication_suiv
		character_event = {
			id = Couronnement.3
		}
		ai_chance = {
			factor = 0  
		}
	}
}

character_event = {
	id = Couronnement.3
	desc = EVTDESC_Couronnement_3
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	option = { # Demandez une terre pour un ordre sacré
		name = EVTOPTB_Couronnement_3		
		trigger = { #Check if holy orders exist.
			OR = { 
				is_title_active = d_knights_templar 
				is_title_active = d_teutonic_order 
				is_title_active = d_knights_hospitaler 
				is_title_active = d_knights_santiago 
				is_title_active = d_knights_calatrava 
			}
			event_target:ask_coronation_target = { 
				higher_real_tier_than = KING 
				any_demesne_title = { #Check if you have enough land to give.
					can_be_given_away = yes
					tier = duke
				}
			}
		}
	    event_target:ask_coronation_target = {
			letter_event = {
				id = HF.20217
				days = 1
			}
		}
		ai_chance = {
			factor = 0.05
			   modifier = {
				factor = 0
				NOT = {
					FROM = {
						any_artifact = { 
							has_artifact_flag = christian 
							OR = { 
								has_artifact_flag = rare
								has_artifact_flag = very_rare
							}
						}
					}
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -100 
					} 
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -80 
					} 
				}
			}
			modifier = {
				factor = 1.5
				NOT = { 
					opinion = { 
						who = FROM
						value = -60 
					} 
				}
			}
			modifier = {
				factor = 1.5
				NOT = { 
					opinion = { 
						who = FROM
						value = -40 
					} 
				}
			}
			modifier = {
				factor = 1.25
				NOT = { 
					opinion = { 
						who = FROM
						value = -20 
					} 
				}
			}
			modifier = {
				factor = 10
				has_opinion_modifier = {
					who = FROM 
					modifier = opinion_requested_artifact 
				}
			}
		}
	}
	option = { # Demandez un artefact
		name = EVTOPTC_Couronnement_3		
		trigger = {
			event_target:ask_coronation_target = {
				any_artifact = { 
					has_artifact_flag = christian 
					OR = { 
						has_artifact_flag = rare
						has_artifact_flag = very_rare
					}
				}
			}		
		}
	    event_target:ask_coronation_target = {
			letter_event = {
				id = HF.20241
				days = 1
			}
		}
		ai_chance = {
			factor = 0.15
			modifier = {
				factor = 0
				NOT = {
					FROM = {
						any_artifact = { 
							has_artifact_flag = christian 
							OR = { 
								has_artifact_flag = rare
								has_artifact_flag = very_rare
							}
						}
					}
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -100 
					} 
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -80 
					} 
				}
			}
			modifier = {
				factor = 1.5
				NOT = { 
					opinion = { 
						who = FROM
						value = -60 
					} 
				}
			}
			modifier = {
				factor = 1.5
				NOT = { 
					opinion = { 
						who = FROM
						value = -40 
					} 
				}
			}
			modifier = {
				factor = 1.25
				NOT = { 
					opinion = { 
						who = FROM
						value = -20 
					} 
				}
			}
			modifier = {
				factor = 10
				has_opinion_modifier = {
					who = FROM 
					modifier = opinion_requested_artifact 
				}
			}
		}	
	}
	option = { # Demander une orgie...
		name = EVTOPTA_Couronnement_3
		trigger = {
			event_target:ask_coronation_target = { #Wartime coronation.
				war = no
			} 
			OR = {
				trait = bad_priest_christian
				trait = hedonist
			}
			NOR = {
				trait = celibate
				trait = temperate
			}
			NOT = {
	#			has_landed_title = d_fraticelli
			}
		}
	    event_target:ask_coronation_target = {
			letter_event = {
				id = HF.20235
				days = 1
			}
		}
		ai_chance = {
			factor = 0.1
			modifier = {
				factor = 0
				NOR = {
					 trait = bad_priest_christian
					 trait = hedonist
				}
			}
			modifier = {
				factor = 0
				OR = {
					 trait = celibate
					 trait = temperate
				}
			}
			modifier = {
				factor = 0
				has_landed_title = d_fraticelli
			}
			modifier = {
				factor = 1.5
				trait = gluttonous
			}
			modifier = {
				factor = 1.5
				trait = drunkard
			}
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = cynical
			}
			modifier = {
				factor = 0.5
				trait = zealous
			}
		}
	}
	option = { # Suivant
		name = EVTOPTA_excommunication_suiv
		character_event = {
			id = Couronnement.4
		}
		ai_chance = {
			factor = 0  
		}
	}
}

character_event = {
	id = Couronnement.4
	desc = EVTDESC_Couronnement_4
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	option = { # Demander des terres italiennes.
		name = EVTOPTC_Couronnement_2		
		trigger = {
			is_shattered_world = no
			is_alternate_start = no
			is_random_world = no
			event_target:ask_coronation_target = { #Check if you or your vassals hold lands within Italy
				higher_real_tier_than = DUKE
				independent = yes
				OR = {
					any_demesne_title = {
						can_be_given_away = yes
						OR = {
							title = d_latium
							title = d_spoleto
							title = d_ancona
							title = d_ferrara
						#	title = d_benevento
							title = c_roma
							title = c_orvieto
							title = c_orbetello
							title = c_spoleto
							title = c_perugia
							title = c_ancona
							title = c_urbino
							title = c_rimini
							title = c_ravenna
							title = c_bologna
							title = c_ferrara
						}
					}
					any_vassal = {
						any_demesne_title = {
							OR = {
								title = d_latium
								title = d_spoleto
								title = d_ancona
								title = d_ferrara
							#	title = d_benevento
								title = c_roma
								title = c_orvieto
								title = c_orbetello
								title = c_spoleto
								title = c_perugia
								title = c_ancona
								title = c_urbino
								title = c_rimini
								title = c_ravenna
								title = c_bologna
								title = c_ferrara
							}
						}
					}
				}
			}
		}
	    event_target:ask_coronation_target = {
			letter_event = {
				id = HF.20216
				days = 1
			}
		}
		ai_chance = {
			factor = 0.2
			modifier = {
				factor = 0
				FROM = {
					lower_tier_than = EMPEROR
				}
			} 
			modifier = {
				factor = 0
				FROM = {
					NOT = {
						any_demesne_title = {
							can_be_given_away = yes
							OR = {
								title = d_latium
								title = d_spoleto
								title = d_ancona
								title = d_ferrara
							#	title = d_benevento
								title = c_roma
								title = c_orvieto
								title = c_orbetello
								title = c_spoleto
								title = c_perugia
								title = c_ancona
								title = c_urbino
								title = c_rimini
								title = c_ravenna
								title = c_bologna
								title = c_ferrara
							}
						}
					}
					NOT = { 
						any_vassal = {
							any_demesne_title = {
								OR = {
									title = d_latium
									title = d_spoleto
									title = d_ancona
									title = d_ferrara
								#	title = d_benevento
									title = c_roma
									title = c_orvieto
									title = c_orbetello
									title = c_spoleto
									title = c_perugia
									title = c_ancona
									title = c_urbino
									title = c_rimini
									title = c_ravenna
									title = c_bologna
									title = c_ferrara
								}
							}
						}
					}
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -100 
					} 
				}
			}
			modifier = {
				factor = 1.75
				NOT = { 
					opinion = { 
						who = FROM
						value = -80 
					} 
				}
			}
			modifier = {
				factor = 1.5
				NOT = { 
					opinion = { 
						who = FROM
						value = -60 
					} 
				}
			}
			modifier = {
				factor = 1.5
				NOT = { 
					opinion = { 
						who = FROM
						value = -40 
					} 
				}
			}
			modifier = {
				factor = 1.25
				NOT = { 
					opinion = { 
						who = FROM
						value = -20 
					} 
				}
			}
			modifier = {
				factor = 1.25
				opinion = { 
					who = FROM
					value = -20 
				} 
			}
			modifier = {
				factor = 0.85
				opinion = { 
					who = FROM
					value = 20 
				} 
			}
			modifier = {
				factor = 0.85
				opinion = { 
					who = FROM
					value = 40 
				} 
			}
			modifier = {
				factor = 0.75
				opinion = { 
					who = FROM
					value = 60 
				} 
			}
			modifier = {
				factor = 0.5
				opinion = { 
					who = FROM
					value = 80 
				} 
			}
			modifier = {
				factor = 0.9
				FROM = {
					trait = zealous 
				} 
			}
			modifier = {
				factor = 0.9
				FROM = {
					trait = baptized_by_pope 
				} 
			}
			modifier = {
				factor = 0.9
				FROM = {
					piety = 100
				} 
			}
			modifier = {
				factor = 0.9
				FROM = {
					piety = 150
				} 
			}
			modifier = {
				factor = 0.8
				FROM = {
					piety = 250
				} 
			}
			modifier = {
				factor = 0.7
				FROM = {
					primary_title = {
						has_law = investiture_law_0
					}
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = d_latium 
						any_vassal = {
							has_landed_title = d_latium
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = d_spoleto
						any_vassal = {
							has_landed_title = d_spoleto
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = d_ancona
						any_vassal = {
							has_landed_title = d_ancona
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = d_ferrara
						any_vassal = {
							has_landed_title = d_ferrara
						}
					} 
				}
			}
		#	modifier = {
		#		factor = 1.5
		#		has_landed_title = k_papal_state
		#		FROM = { 
		#			OR = { 
		#				has_landed_title = d_benevento
		#				any_vassal = {
		#					has_landed_title = d_benevento
		#				}
		#			} 
		#		}
		#	}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = {
		#			OR = { 
						has_landed_title = c_roma
		#				any_vassal = {
		#					has_landed_title = c_roma
		#				}
		#			}
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = c_orvieto
						any_vassal = {
							has_landed_title = c_orvieto
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = c_orbetello
						any_vassal = {
							has_landed_title = c_orbetello
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = c_spoleto
						any_vassal = {
							has_landed_title = c_spoleto
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = c_perugia
						any_vassal = {
							has_landed_title = c_perugia
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = c_ancona
						any_vassal = {
							has_landed_title = c_ancona
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = c_urbino
						any_vassal = {
							has_landed_title = c_urbino
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = c_rimini
						any_vassal = {
							has_landed_title = c_rimini
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = c_ravenna
						any_vassal = {
							has_landed_title = c_ravenna
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = c_bologna
						any_vassal = {
							has_landed_title = c_bologna
						}
					} 
				}
			}
			modifier = {
				factor = 1.5
				has_landed_title = k_papal_state
				FROM = { 
					OR = { 
						has_landed_title = c_ferrara
						any_vassal = {
							has_landed_title = c_ferrara
						}
					} 
				}
			}
			modifier = {
				factor = 2.5
				has_opinion_modifier = {
					who = FROM 
					modifier = opinion_requested_papal_land 
				}
			}
			modifier = {
				factor = 0
				OR = { 
					any_vassal = { has_landed_title = d_latium }
					has_landed_title = d_latium 
				}
				OR = { 
					any_vassal = { has_landed_title = d_spoleto }
					has_landed_title = d_spoleto 
				}
				OR = { 
					any_vassal = { has_landed_title = d_ancona }
					has_landed_title = d_ancona 
				}
				OR = { 
					any_vassal = { has_landed_title = d_ferrara }
					has_landed_title = d_ferrara 
				}
			#	OR = { 
			#		any_vassal = { has_landed_title = d_benevento }
			#		has_landed_title = d_benevento 
			#	}
				OR = { 
					any_vassal = { has_landed_title = c_roma }
					has_landed_title = c_roma 
				}
				OR = { 
					any_vassal = { has_landed_title = c_orvieto }
					has_landed_title = c_orvieto 
				}
				OR = { 
					any_vassal = { has_landed_title = c_orbetello }
					has_landed_title = c_orbetello 
				}
				OR = { 
					any_vassal = { has_landed_title = c_spoleto }
					has_landed_title = c_spoleto 
				}
				OR = { 
					any_vassal = { has_landed_title = c_perugia }
					has_landed_title = c_perugia 
				}
				OR = { 
					any_vassal = { has_landed_title = c_ancona }
					has_landed_title = c_ancona 
				}
				OR = { 
					any_vassal = { has_landed_title = c_urbino }
					has_landed_title = c_urbino 
				}
				OR = { 
					any_vassal = { has_landed_title = c_rimini }
					has_landed_title = c_rimini 
				}
				OR = { 
					any_vassal = { has_landed_title = c_ravenna }
					has_landed_title = c_ravenna 
				}
				OR = { 
					any_vassal = { has_landed_title = c_bologna }
					has_landed_title = c_bologna 
				}
				OR = { 
					any_vassal = { has_landed_title = c_ferrara }
					has_landed_title = c_ferrara 
				}
			}
		}
	}
	option = { # Refuser
		name = EVTOPTB_Couronnement_4
		event_target:ask_coronation_target = {
			letter_event = {
				id = Couronnement.5
				days = 1
			}
		}
		ai_chance = {
			factor = 0
		}
		event_target:ask_coronation_target = {
			clr_character_flag = couronnement_flag
		}
	}
	option = { # accepter
		name = EVTOPTC_Couronnement_4
		event_target:ask_coronation_target = {
			letter_event = {
				id = Couronnement.6
				days = 1
			}
		}
		ai_chance = { 
			factor = 0
		}
		event_target:ask_coronation_target = {
			clr_character_flag = couronnement_flag
		}
	}
	option = { # Retour Page 1
		name = EVTOPTA_excommunication_page
		character_event = {
			id = Couronnement.1
		}
		ai_chance = { 
			factor = 0
		}
	}
}

letter_event = {
	id = Couronnement.5
	desc = EVTDESC_Couronnement_5
	is_triggered_only = yes
	option = {
		name = CURSES
	}
}

letter_event = {
	id = Couronnement.6
	desc = EVTDESC_Couronnement_6
	is_triggered_only = yes
	option = {
		name = EXCELLENT
		hidden_tooltip = {
			FROM = {
				opinion = {
					modifier = opinion_coronation_money_refund
					who = ROOT
					years = 100
				}
			}
		}
		set_character_flag = flag_crowned_by_pope
		FROM = {
			save_event_target_as = coronation_priest 
			show_scope_change = no	
			opinion = {
				modifier = opinion_supposed_to_crown
				months = 1
				who = ROOT
			}
			reverse_opinion = {
				modifier = opinion_supposed_to_crown
				months = 1
				who = ROOT
			}
		}
		if = { 
			limit = {
				real_tier = KING
			}
			if = { 
				limit = {  
					NOT = { 
						piety = 350
					} 
					FROM = { 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = -75
							} 
						}
					} 
				} 
			}
			if = { 
				limit = {
					piety = 350
					FROM = { 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = -75
							} 
						}
					} 
				} 
			}
			if = { 
				limit = {  
					NOT = { 
						piety = 350
					} 
					FROM = { 
						opinion = { 
							who = ROOT 
							value = -75
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = -25
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = {  
					piety = 350
					FROM = { 
						opinion = { 
							who = ROOT 
							value = -75
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = -25
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = {  
					NOT = { 
						piety = 350
					} 
					FROM = { 
						opinion = { 
							who = ROOT 
							value = -25
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = 0
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = { 
					piety = 350
					FROM = { 
						opinion = { 
							who = ROOT 
							value = -25
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = 0
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = { 
					NOT = { 
						piety = 350
					}  
					FROM = { 
						opinion = { 
							who = ROOT 
							value = 0
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = 50
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = { 
					piety = 350
					FROM = { 
						opinion = { 
							who = ROOT 
							value = 0
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = 50
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = { 
					NOT = { 
						piety = 350
					}   
					FROM = { 
						opinion = { 
							who = ROOT 
							value = 50
						} 
					} 
				} 
			}
			if = { 
				limit = { 
					piety = 350
					FROM = { 
						opinion = { 
							who = ROOT 
							value = 50
						} 
					} 
				} 
			}
		}
		if = { 
			limit = {
				real_tier = EMPEROR
			}
			if = { 
				limit = {  
					NOT = { 
						piety = 350
					} 
					FROM = { 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = -75
							} 
						}
					} 
				} 
			}
			if = { 
				limit = {
					piety = 350
					FROM = { 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = -75
							} 
						}
					} 
				} 
			}
			if = { 
				limit = {  
					NOT = { 
						piety = 350
					} 
					FROM = { 
						opinion = { 
							who = ROOT 
							value = -75
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = -25
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = {  
					piety = 350
					FROM = { 
						opinion = { 
							who = ROOT 
							value = -75
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = -25
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = {  
					NOT = { 
						piety = 350
					} 
					FROM = { 
						opinion = { 
							who = ROOT 
							value = -25
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = 0
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = { 
					piety = 350
					FROM = { 
						opinion = { 
							who = ROOT 
							value = -25
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = 0
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = { 
					NOT = { 
						piety = 350
					}  
					FROM = { 
						opinion = { 
							who = ROOT 
							value = 0
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = 50
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = { 
					piety = 350
					FROM = { 
						opinion = { 
							who = ROOT 
							value = 0
						} 
						NOT = { 
							opinion = { 
								who = ROOT 
								value = 50
							} 
						} 
					} 
				} 
			}
			if = { 
				limit = { 
					NOT = { 
						piety = 350
					}   
					FROM = { 
						opinion = { 
							who = ROOT 
							value = 50
						} 
					} 
				} 
			}
			if = { 
				limit = { 
					piety = 350
					FROM = { 
						opinion = { 
							who = ROOT 
							value = 50
						} 
					} 
				} 
			}
		}
		hidden_tooltip = {
			character_event = {
				id = HF.20300
			}
		}
		ai_chance = {
			factor = 100
		}
	}
}