namespace = Investiture
######################################
####### Vatican				   #######
######################################
character_event = {
	id = Investiture.1 # 67001
	desc = EVTDESC67001
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	option = { # accepter
		name = EVTOPTA67001		
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0
				trait = cynical
			}
			modifier = {
				factor = 8
				trait = zealous
			}
		}
		any_demesne_title = {
			limit = { 
				has_law = investiture_law_1
			}
			revoke_law = investiture_law_1
			add_law_w_cooldown = investiture_law_0
		}
		religion_authority = {
			modifier = ruler_bowed_to_pope
			years = 10
		}
		piety = 50
		prestige = 50
		FROMFROM = {
			if = {
				limit = {
					NOT = {
						has_opinion_modifier = {
							modifier = pope_invest_approve
							who = ROOT
						}
					}
				}
				opinion = {
					modifier = pope_invest_approve
					who = ROOT
					years = 4
				}
			}			
		}
		FROMFROM = {
			character_event = {
			id = Investiture.4 # 67002
			days = 1
			}
		}
		clr_character_flag = demande_loi_flag
	}
	option = { # Refuse
		name = EVTOPTB67001
		ai_chance = {
			factor = 1
			modifier = {
				factor = 1.5
				trait = arbitrary
			}
			modifier = {
				factor = 1.5
				trait = cynical
			}
			modifier = {
				factor = 1.5
				trait = hedonist
			}
		}
		piety = -50
		prestige = -50
	#	religion_authority = {
	#		modifier = ruler_defied_pope
	#		years = 10
	#	}
		FROMFROM = {
			if = {
				limit = {
					NOT = {
						has_opinion_modifier = {
							modifier = pope_invest_dislike
							who = ROOT
						}
					}
				}
				opinion = {
					modifier = pope_invest_dislike
					who = ROOT
					years = 5
				}
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = {
				id = Investiture.2 # 67003
				days = 1
				}
			}
		}
		clr_character_flag = demande_loi_flag
	}	
	option = { # Give gold to Pope
		name = EVTOPTC67001
		trigger = {
			OR = {
				AND = {
					primary_title = {
						higher_tier_than = DUKE
					}
					treasury >= 200
				}
				AND = {
					primary_title = {
						higher_tier_than = KING
					}
					treasury >= 400
				}
			}
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 3
				trait = cynical
			}
			modifier = {
				factor = 0
				trait = zealous
			}
		}
		if = {
			limit = {
				tier = KING
			}
			wealth = -200
		}
		else_if  = {
			limit = {
				tier = EMPEROR
			}
			wealth = -400
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = {
					id = Investiture.3 # 67004
					days = 1
				}
			}
		}
		clr_character_flag = demande_loi_flag
	}
	option = { # Impress with Learning
		name = EVTOPTD67001 
		tooltip_info = learning
		trigger = {
			learning = 16
		}
		ai_chance = {
			factor = 5
		}
		piety = 1
		hidden_tooltip = {
			FROMFROM = {
				character_event = {
					id = Investiture.5 # 67005
				}
			}
		}
		clr_character_flag = demande_loi_flag	
	}
}

character_event = {
	id = Investiture.2 # 67003
	desc = EVTDESC67003
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	option = { # il y aura d autres moyens
		name = EVTOPTA67003
		ai_chance = {
			factor = 1
			modifier = {
				factor = 1.2
				trait = shy
			}
			modifier = {
				factor = 1.5
				trait = kind
			}
			modifier = {
				factor = 1.5
				trait = bad_priest_christian
			}
			modifier = {
				factor = 2
				opinion = {
					who = FROM
					value = 50
				}
			}
		}
	#	ROOT = {
	#		prestige = -50
	#	}
		if = {
			limit = {
				NOT = {
					has_opinion_modifier = {
						modifier = pope_invest_dislike
						who = FROM
					}
				}
			}
			opinion = {
				modifier = pope_invest_dislike
				who = FROM
				years = 5
			}
		}
	}
#	option = { # il va le payer (excommunié)
#		name = EVTOPTA67022
#		ai_chance = {
#			factor = 1
#			modifier = {
#				factor = 1.2
#				trait = proud
#			}
#			modifier = {
#				factor = 1.2
#				trait = envious
#			}
#			modifier = {
#				factor = 1.5
#				trait = crusader
#			}
#			modifier = {
#				factor = 1.5
#				trait = ambitious
#			}
#			modifier = {
#				factor = 3
#				trait = zealous
#			}
#			modifier = {
#				factor = 3
#				NOT = {
#					opinion = {
#						who = FROM
#						value = 0
#					}
#				}
#			}
#		}
#	#	ROOT = {
#	#		prestige = -5
#	#	}
#		if = {
#			limit = {
#				NOT = {
#					has_opinion_modifier = {
#						modifier = pope_invest_dislike
#						who = FROM
#					}
#				}
#			}
#			opinion = {
#				modifier = pope_invest_dislike
#				who = FROM
#				years = 5
#			}
#		}
#		tooltip = {
#			FROM = {
#				add_trait = excommunicated
#			}
#		}
#		trigger = {
#			FROM = {
#				NOT = {
#					trait = excommunicated
#				}
#			}
#		}
#		hidden_tooltip = {
#			FROM = {
#				character_event = {
#					id = Investiture.6 # 38022
#					days = 1
#				}
#			}
#		}
#	}
#	option = { # il va le payer (apostat)
#		name = EVTOPTA67022	
#		ai_chance = {
#			factor = 1
#			modifier = {
#				factor = 1.2
#				trait = proud
#			}
#			modifier = {
#				factor = 1.2
#				trait = envious
#			}
#			modifier = {
#				factor = 1.5
#				trait = crusader
#			}
#			modifier = {
#				factor = 1.5
#				trait = ambitious
#			}
#			modifier = {
#				factor = 3
#				trait = zealous
#			}
#			modifier = {
#				factor = 3
#				NOT = {
#					opinion = {
#						who = FROM
#						value = 0
#					}
#				}
#			}
#		}
#	#	ROOT = {
#	#		prestige = -5
#	#	}
#		if = {
#			limit = {
#				NOT = {
#					has_opinion_modifier = {
#						modifier = pope_invest_dislike
#						who = FROM
#					}
#				}
#			}
#			opinion = {
#				modifier = pope_invest_dislike
#				who = FROM
#				years = 5
#			}
#		}
#		tooltip = {
#			FROM = {
#				add_character_modifier = {
#					name = accused_apostate
#					duration = -1
#				}
#			}
#		}
#		trigger = {
#			FROM = {
#				NOT = {
#					has_character_modifier = accused_apostate 
#				}
#			}
#		}
#		hidden_tooltip = {
#			FROM = {
#				character_event = {
#					id = Investiture.7 # event apostat
#					days = 1
#				}
#			}
#		}
#	}
}	

character_event = {
	id = Investiture.3 # 67004
	desc = EVTDESC67004
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	option = { # accepter le pot de vin
		name = EVTOPTA67004
		if = {
			limit = {
				FROM = {
					tier = EMPEROR
				}
			}
			wealth = 400
		}
		else_if = {
			limit = {
				FROM = {
					tier = KING
				}	
			}
			wealth = 200
		}
	}
	option = { # il y aura d autres moyens
		name = EVTOPTA67003
		if = {
			limit = {
				NOT = {
					has_opinion_modifier = {
						modifier = pope_invest_dislike
						who = FROM
					}
				}
			}
			opinion = {
				modifier = pope_invest_dislike
				who = FROM
				years = 5
			}
		}
	#	ROOT = {
	#		prestige = -50
	#	}
		FROM = {
			if = {
				limit = {
					tier = EMPEROR
				}
				wealth = 400
			}
			else_if = {
				limit = {
					tier = KING
				}
				wealth = 200
			}
		}
	}
#	option = { # il va le payer (excommunié)
#		name = EVTOPTA67022
#		trigger = {
#			FROM = {
#				NOT = {
#					trait = excommunicated
#				}
#			}
#		}
#		if = {
#			limit = {
#				NOT = {
#					has_opinion_modifier = {
#						modifier = pope_invest_dislike
#						who = FROM
#					}
#				}
#			}
#			opinion = {
#				modifier = pope_invest_dislike
#				who = FROM
#				years = 5
#			}
#		}
#		tooltip = {
#			FROM = {
#				add_trait = excommunicated
#			}
#		}			
#	#	ROOT = {
#	#		prestige = -5
#	#	}
#		hidden_tooltip = {
#			FROM = {
#				character_event = {
#					id = Investiture.6 # 38022
#					days = 1
#				}
#			}
#		}
#		FROM = {	
#			if = {
#				limit = {
#					tier = EMPEROR
#				}
#				wealth = 400
#			}
#			else_if  = {
#				limit = {
#					tier = KING
#				}
#				wealth = 200
#			}	
#		}
#	}
#	option = { # il va le payer (apostat)
#		name = EVTOPTA67022		
#		trigger = {
#			FROM = {
#				NOT = {
#					has_character_modifier = accused_apostate 
#				}
#			}
#		}
#		if = {
#			limit = {
#				NOT = {
#					has_opinion_modifier = {
#						modifier = pope_invest_dislike
#						who = FROM
#					}
#				}
#			}
#			opinion = {
#				modifier = pope_invest_dislike
#				who = FROM
#				years = 5
#			}
#		}
#		tooltip = {
#			FROM = {
#				add_character_modifier = {
#					name = accused_apostate
#					duration = -1
#				}
#			}
#		}			
#	#	ROOT = {
#	#		prestige = -5
#	#	}
#		hidden_tooltip = {
#			FROM = {
#				character_event = {
#					id = Investiture.7 # event apostat
#					days = 1
#				}
#			}
#		}
#		FROM = {	
#			if = {
#				limit = {
#					tier = EMPEROR
#				}
#				wealth = 400
#			}
#			else_if  = {
#				limit = {
#					tier = KING
#				}
#				wealth = 200
#			}	
#		}
#	}
}

character_event = {
	id = Investiture.4 # 67002
	desc = EVTDESC67002
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = GLORY_TO_HIGHGOD
		prestige = 5
	}
}

character_event = {
	id = Investiture.5 # 67005
	desc = EVTDESC67005
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA67005
	#	piety = -5
	}
}

#character_event = {
#	id = Investiture.6 # 38022
#	desc = EVTDESC_Investiture_6
#	picture = GFX_evt_bad_news
#	border = GFX_event_normal_frame_religion
#	is_triggered_only = yes
#	option = { # je suis excommunié...
#		name = EVTOPTA38022 
#		add_trait = excommunicated
#		piety = -50
#		prestige = -50
#		k_papal_state = {
#			holder_scope = {
#				save_event_target_as = pope_opinion_Excommunier
#			}
#		}
#		if = {
#			limit = {
#				NOT = {
#					has_opinion_modifier = {
#						modifier = opinion_excommunier
#						who = event_target:pope_opinion_Excommunier
#					}
#				}
#			}
#			opinion = {
#				modifier = opinion_excommunier
#				who = event_target:pope_opinion_Excommunier
#				years = 500
#			}
#		}
#	}
#}

#character_event = {
#	id = Investiture.7 # event apostat
#	desc = EVTDESC_Investiture_7
#	picture = GFX_evt_bad_news
#	border = GFX_event_normal_frame_religion
#	is_triggered_only = yes
#	option = { # je suis un apostat...
#		name = EVTOPTA38022 
#		add_character_modifier = {
#			name = accused_apostate
#			duration = -1
#		}
#		piety = -50
#		prestige = -50
#		k_papal_state = {
#			holder_scope = {
#				save_event_target_as = pope_opinion_Apostat
#			}
#		}
#		if = {
#			limit = {
#				NOT = {
#					has_opinion_modifier = {
#						modifier = opinion_apostat
#						who = event_target:pope_opinion_Apostat
#					}
#				}
#			}
#			opinion = {
#				modifier = opinion_apostat
#				who = event_target:pope_opinion_Apostat
#				years = 500
#			}
#		}
#	}
#}