###########################################
#
# Crusade Events
#
# ID 8300-8499 is reserved
#
###########################################

# Arriving for the crusade
character_event = {
	id = 8300
	desc = "EVTDESC8300"
	picture = "GFX_evt_crusaders"
	border = GFX_event_normal_frame_war
	
	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		NOT = { trait = crusader }
		in_command = yes
		OR = {
			AND = {
				any_war = {
					using_cb = crusade
				}
				religion_group = christian
				crusade_target = {
					is_located_in = ROOT
				}
			}
			any_liege = {
				religion_group = christian
				any_war = {
					using_cb = crusade
				}
				crusade_target = {
					is_located_in = ROOT
				}
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		trigger = {
			religion_group = christian
		}
		name = "EVTOPTA8300"
		add_trait = crusader
	}
	
	option = {
		trigger = {
			NOT = { religion_group = christian }
		}
		name = "GLORY"
		add_trait = crusader
	}
}

# Arriving for the crusade (Muslim)
character_event = {
	id = 8301
	desc = "EVTDESC8300"
	picture = "GFX_evt_moors"
	border = GFX_event_normal_frame_war
	
	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		NOT = { trait = mujahid }
		in_command = yes
		OR = {
			AND = {
				any_war = {
					using_cb = crusade
				}
				religion_group = muslim
				crusade_target = {
					is_located_in = ROOT
				}
			}
			any_liege = {
				religion_group = muslim
				any_war = {
					using_cb = crusade
				}
				crusade_target = {
					is_located_in = ROOT
				}
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		trigger = {
			religion_group = muslim
		}
		name = "EVTOPTA8301"
		add_trait = mujahid
	}
	
	option = {
		trigger = {
			NOT = { religion_group = muslim }
		}
		name = "GLORY"
		add_trait = mujahid
	}
}

# Arriving at the crusade target
character_event = {
	id = 8305
	desc = "EVTDESC8305"
	picture = "GFX_evt_siege"
	border = GFX_event_normal_frame_war

	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		has_called_crusade = yes
		in_command = yes
		OR = {
			any_war = {
				using_cb = crusade
			}
			any_liege = {
				any_war = {
					using_cb = crusade
				}
			}
		}
		religion = catholic
		crusade_target = {
			is_located_in = ROOT
		}
		NOT = { has_character_flag = arrived_at_crusade_target }
		location = {
			holder_scope = {
				NOT = { character = ROOT }
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		hidden_tooltip = {
			set_character_flag = arrived_at_crusade_target
		}
	}
	
	option = {
		name = "EXCELLENT"
		prestige = 25
		piety = 25
	}
}

# Pope lifts Excommunication (AI characters only)
character_event = {
	id = 8306
	desc = "EVTDESC8306"
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion

	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		controls_religion = yes
		has_called_crusade = yes
		religion = catholic
		
		OR = {
			any_independent_ruler = {
				ai = yes
				religion = catholic
				any_war = {
					using_cb = crusade
				}
				excommunicated_for = ROOT
			}
			any_independent_ruler = {
				religion = catholic
				any_realm_lord = {
					ai = yes
					religion = catholic
					any_war = {
						using_cb = crusade
					}
					excommunicated_for = ROOT
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 1
	}
	
	option = {
		name = "EVTOPTA8306"
		any_independent_ruler = {
			limit = {
				ai = no
				religion = catholic
				any_war = {
					using_cb = crusade
				}
				excommunicated_for = ROOT
			}
			set_character_flag = offered_revoked_excommunication
			letter_event = { id = 8467 days = 1 }
		}
		any_independent_ruler = {
			limit = {
				religion = catholic
			}
			any_realm_lord = {
				limit = {
					ai = no
					religion = catholic
					any_war = {
						using_cb = crusade
					}
					excommunicated_for = ROOT
				}
				set_character_flag = offered_revoked_excommunication
				letter_event = { id = 8467 days = 1 }
			}
		}
	}
}


### On actions events ###

# Character becomes zealous
# on_battle_won
# FROM = opposing army's owner
character_event = {
	id = 8310
	desc = "EVTDESC8310"
	picture = "GFX_evt_knight_kneeling"
	border = GFX_event_normal_frame_religion
	
	hide_from = yes
	
	is_triggered_only = yes
	
	trigger = {
		religion = catholic
		NOT = { trait = zealous }
		NOT = { trait = cynical }
		
		has_called_crusade = yes
		OR = {
			any_war = {
				using_cb = crusade
			}
			any_liege = {
				any_war = {
					using_cb = crusade
				}
			}
		}
		crusade_target = {
			is_located_in = ROOT
		}
	}

	option = {
		name = "EXCELLENT"
		add_trait = zealous
	}
}

# Character becomes cynical
# on_battle_lost
# FROM = opposing army's owner
character_event = {
	id = 8320
	desc = "EVTDESC8320"
	picture = "GFX_evt_pale_rider"
	border = GFX_event_normal_frame_war

	is_triggered_only = yes
	
	trigger = {
		religion = catholic
		NOT = { trait = cynical }
		NOT = { trait = zealous }
		
		has_called_crusade = yes
		OR = {
			any_war = {
				using_cb = crusade
			}
			any_liege = {
				any_war = {
					using_cb = crusade
				}
			}
		}
		crusade_target = {
			is_located_in = ROOT
		}
	}
	
	option = {
		name = "EVTOPTA8320"
		add_trait = cynical
	}
}

# Conquers the crusade target
# on_siege_won_leader
# FROM = barony won
character_event = {
	id = 8330
	desc = EVTDESC8330
	picture = GFX_evt_siege
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { is_capital = yes }
		religion = catholic
		
		has_called_crusade = yes
		OR = {
			any_war = {
				using_cb = crusade
			}
			any_liege = {
				any_war = {
					using_cb = crusade
				}
			}
		}
		crusade_target = {
			de_jure_vassal_or_below = FROM
		}
	}
	
	option = {
		name = EVTOPTA8330
		prestige = 100
		piety = 100
		hidden_tooltip = {
			set_character_flag = captures_crusade_target
			if = {
				limit = {
					independent = no
				}
				# Only liege
				if = {
					limit = {
						liege = {
							NOT = { character = ROOT }
							any_war = {
								using_cb = crusade
							}
						}
						top_liege = {
							NOT = {
								any_war = {
									using_cb = crusade
								}
							}
						}
					}
					liege = { letter_event = { id = 8331 days = 1 } }
				}
				# Only top liege
				if = {
					limit = {
						liege = {
							NOT = {
								any_war = {
									using_cb = crusade
								}
							}
						}
						top_liege = {
							any_war = {
								using_cb = crusade
							}
						}
					}
					top_liege = { letter_event = { id = 8331 days = 1 } }
				}
				# Both liege and top liege
				if = {
					limit = {
						liege = {
							NOT = { character = ROOT }
							any_war = {
								using_cb = crusade
							}
							ROOT = {
								top_liege = {
									NOT = { character = PREVPREV }
									any_war = {
										using_cb = crusade
									}
								}
							}
						}
					}
					liege = { letter_event = { id = 8331 days = 1 } }
					top_liege = { letter_event = { id = 8331 days = 1 } }
				}
			}
		}
	}
}

# Inform liege of capturing the crusade target
letter_event = {
	id = 8331
	desc = "EVTDESC8331"
	
	is_triggered_only = yes
	
	option = {
		name = "EXCELLENT"
		if = {
			limit = { NOT = { has_character_flag = captures_crusade_target } }
			prestige = 25
			piety = 25
		}
		set_character_flag = captures_crusade_target
	}
}


# Finds the Spear of Destiny / Holy Lance
# on_siege_won_leader
# FROM = barony won
character_event = {
	id = 8340
	desc = "EVTDESC8340"
	picture = "GFX_evt_siege"
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
		
	trigger = {
		religion = catholic
		FROM = { title = b_jerusalem }
		OR = {
			any_war = {
				using_cb = crusade
			}
			any_liege = {
				any_war = {
					using_cb = crusade
				}
			}
		}
		NOT = { has_global_flag = found_the_holy_lance }
	}
	
	immediate = {
		hidden_tooltip = {
			set_global_flag = found_the_holy_lance
		}
	}
	
	option = {
		name = "EVTOPTA8340"
		prestige = 100
	}
}


# Finds the Holy Grail
# on_siege_won_leader
# FROM = barony won
character_event = {
	id = 8342
	desc = "EVTDESC8342"
	picture = "GFX_evt_siege"
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		religion = catholic
		FROM = { title = b_syrcaesarea }
		OR = {
			any_war = {
				using_cb = crusade
			}
			any_liege = {
				any_war = {
					using_cb = crusade
				}
			}
		}
		NOT = { has_global_flag = found_the_holy_grail }
	}
	
	immediate = {
		hidden_tooltip = {
			set_global_flag = found_the_holy_grail
		}
	}
	
	option = {
		name = "EVTOPTA8342"
		prestige = 200
	}
}


# Sack of Jerusalem
# on_siege_won_leader
# FROM = barony won
character_event = {
	id = 8345
	desc = "EVTDESC8345"
	picture = "GFX_evt_siege"
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
		
	trigger = {
		religion = catholic
		FROM = { title = b_jerusalem }
		OR = {
			any_war = {
				using_cb = crusade
			}
			any_liege = {
				any_war = {
					using_cb = crusade
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTA8345"
		prestige = 50
	}
}


# Loses the crusade target's capital
# on_siege_lost_leader
# FROM = barony lost
character_event = {
	id = 8350
	desc = "EVTDESC8350"
	picture = "GFX_evt_siege"
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { is_capital = yes }
		religion = catholic
		OR = {
			any_war = {
				using_cb = crusade
			}
			any_liege = {
				any_war = {
					using_cb = crusade
				}
			}
		}
		crusade_target = {
			de_jure_vassal_or_below = FROM
		}
	}
	
	option = {
		name = "EVTOPTA8350"
		prestige = -50
		piety = -50
		hidden_tooltip = {
			if = {
				limit = {
					independent = no
				}
				# Only liege
				if = {
					limit = {
						liege = {
							NOT = { character = ROOT }
							any_war = {
								using_cb = crusade
							}
						}
						top_liege = {
							NOT = {
								any_war = {
									using_cb = crusade
								}
							}
						}
					}
					liege = { letter_event = { id = 8351 days = 1 } }
				}
				# Only top liege
				if = {
					limit = {
						liege = {
							NOT = {
								any_war = {
									using_cb = crusade
								}
							}
						}
						top_liege = {
							any_war = {
								using_cb = crusade
							}
						}
					}
					top_liege = { letter_event = { id = 8351 days = 1 } }
				}
				# Both liege and top liege
				if = {
					limit = {
						liege = {
							NOT = { character = ROOT }
							any_war = {
								using_cb = crusade
							}
							ROOT = {
								top_liege = {
									NOT = { character = PREVPREV }
									any_war = {
										using_cb = crusade
									}
								}
							}
						}
					}
					liege = { letter_event = { id = 8351 days = 1 } }
					top_liege = { letter_event = { id = 8351 days = 1 } }
				}
			}
		}
	}
}

# Inform liege of losing the crusade target
letter_event = {
	id = 8351
	desc = "EVTDESC8351"
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA8351"
		prestige = -25
		piety = -25
	}
}


########################################
# Disappointment of not participating
########################################

### Pope Disappointed ###

# Pope is concerned that an independent ruler is not participating in crusade
character_event = {
	id = 8400
	desc = "EVTDESC8400"
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion
	
	only_playable = yes
	
	trigger = {
		controls_religion = yes
		has_called_crusade = yes
		religion = catholic
		had_global_flag = { flag = crusade_called days = 180 }
		
		any_independent_ruler = {
			religion = catholic
			NOT = {
				any_war = {
					using_cb = crusade
				}
			}
			crusade_target = {
				holder_scope = {
					NOT = { reverse_has_truce = PREVPREV }
				}
			}
			rightful_religious_head_scope = {
				character = ROOT
			}
			NOT = { excommunicated_for = ROOT }
			NOT = {
				reverse_has_opinion_modifier = {
					who = ROOT
					modifier = opinion_not_participating_in_crusade_emperor
				}
				reverse_has_opinion_modifier = {
					who = ROOT
					modifier = opinion_not_participating_in_crusade_king
				}
				reverse_has_opinion_modifier = {
					who = ROOT
					modifier = opinion_not_participating_in_crusade_duke
				}
				reverse_has_opinion_modifier = {
					who = ROOT
					modifier = opinion_not_participating_in_crusade_count
				}
			}
			NOT = {
				any_realm_province = {
					any_neighbor_province = {
						has_owner = yes
						NOT = { religion_group = christian } 
					}
				}
			}
			NOT = { mercenary = yes }
		}
	}
	
	mean_time_to_happen = {
		months = 6
		
		modifier = {
			factor = 0.5
			trait = zealous
		}
	}
	
	option = {
		name = "EVTOPTA8400"
		random_independent_ruler = {
			limit = {
				religion = catholic
				NOT = {
					any_war = {
						using_cb = crusade
					}
				}
				crusade_target = {
					holder_scope = {
						NOT = { reverse_has_truce = PREVPREV }
					}
				}
				rightful_religious_head_scope = {
					character = ROOT
				}
				NOT = { excommunicated_for = ROOT }
				NOT = {
					reverse_has_opinion_modifier = {
						who = ROOT
						modifier = opinion_not_participating_in_crusade_emperor
					}
					reverse_has_opinion_modifier = {
						who = ROOT
						modifier = opinion_not_participating_in_crusade_king
					}
					reverse_has_opinion_modifier = {
						who = ROOT
						modifier = opinion_not_participating_in_crusade_duke
					}
					reverse_has_opinion_modifier = {
						who = ROOT
						modifier = opinion_not_participating_in_crusade_count
					}
				}
				NOT = {
					any_realm_province = {
						any_neighbor_province = {
							has_owner = yes
							NOT = { religion_group = christian } 
						}
					}
				}
				NOT = { mercenary = yes }
			}
			letter_event = { id = 8405 days = 1 }
		}		
	}
}

# Pope shares his concerns
letter_event = {
	id = 8405
	desc = "EVTDESC8405"
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA8405"
		trigger = { primary_title = { tier = EMPEROR } }
		religion_head = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_emperor
				who = ROOT
				years = 10
			}
		}
	}
	option = {
		name = "EVTOPTA8405"
		trigger = { primary_title = { tier = KING } }
		religion_head = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_king
				who = ROOT
				years = 10
			}
		}
	}
	option = {
		name = "EVTOPTA8405"
		trigger = { primary_title = { tier = DUKE } }
		religion_head = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_duke
				who = ROOT
				years = 10
			}
		}
	}
	option = {
		name = "EVTOPTA8405"
		trigger = { primary_title = { tier = COUNT } }
		religion_head = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_count
				who = ROOT
				years = 10
			}
		}
	}
	option = {
		name = "EVTOPTB8405"
		set_character_flag = reminded_about_crusade
	}
}

# Pope is disappointed in the rulers decision to not participate in the crusade
character_event = {
	id = 8410
	desc = "EVTDESC8410"
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion
	
	only_playable = yes
	
	trigger = {
		controls_religion = yes
		has_called_crusade = yes
		religion = catholic
		had_global_flag = { flag = crusade_called days = 180 }
		
		any_independent_ruler = {
			had_character_flag = { flag = reminded_about_crusade days = 30 }
			religion = catholic
			NOT = {
				any_war = {
					using_cb = crusade
				}
			}
			crusade_target = {
				holder_scope = {
					NOT = { reverse_has_truce = PREVPREV }
				}
			}
			rightful_religious_head_scope = {
				character = ROOT
			}
			NOT = { excommunicated_for = ROOT }
		}
	}
	
	mean_time_to_happen = {
		months = 6
		
		modifier = {
			factor = 0.5
			trait = zealous
		}
	}
	
	option = {
		name = "EVTOPTA8410"
		random_independent_ruler = {
			limit = {
				had_character_flag = { flag = reminded_about_crusade days = 30 }
				religion = catholic
				NOT = {
					any_war = {
						using_cb = crusade
					}
				}
				crusade_target = {
					holder_scope = {
						NOT = { reverse_has_truce = PREVPREV }
					}
				}
				rightful_religious_head_scope = {
					character = ROOT
				}
				NOT = { excommunicated_for = ROOT }
			}
			clr_character_flag = reminded_about_crusade
			letter_event = { id = 8415 days = 1 }
		}		
	}
}

# Pope shares his disappointment
letter_event = {
	id = 8415
	desc = "EVTDESC8415"
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA8415"
		trigger = { primary_title = { tier = EMPEROR } }
		religion_head = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_emperor
				who = ROOT
				years = 10
			}
		}
	}
	option = {
		name = "EVTOPTA8415"
		trigger = { primary_title = { tier = KING } }
		religion_head = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_king
				who = ROOT
				years = 10
			}
		}
	}
	option = {
		name = "EVTOPTA8415"
		trigger = { primary_title = { tier = DUKE } }
		religion_head = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_duke
				who = ROOT
				years = 10
			}
		}
	}
	option = {
		name = "EVTOPTA8415"
		trigger = { primary_title = { tier = COUNT } }
		religion_head = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_count
				who = ROOT
				years = 10
			}
		}
	}
}


### Bishop Disappointed ###

# Bishop is concerned that an independent ruler is not participating in crusade
character_event = {
	id = 8420
	desc = "EVTDESC8420"
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	min_age = 16
	capable_only = yes
	only_rulers = yes
	prisoner = no
	
	trigger = {
		has_called_crusade = yes
		had_global_flag = { flag = crusade_called days = 180 }
		NOT = { has_character_flag = no_complains_about_not_crusading }
		is_priest = yes
		independent = no
		religion = catholic
		controls_religion = no
		
		liege = {
			independent = yes
			religion = catholic
			prisoner = no
			NOT = { primary_title = { tier = COUNT } } # Exclude small rulers
			NOT = {
				any_war = {
					using_cb = crusade
				}
			}
			crusade_target = {
				holder_scope = {
					NOT = { reverse_has_truce = PREVPREV }
				}
			}
			religion_head = {
				PREV = {
					rightful_religious_head_scope = {
						character = PREVPREV
					}
					NOT = { excommunicated_for = PREV }
				}
			}
			NOT = {
				reverse_has_opinion_modifier = {
					who = ROOT
					modifier = opinion_not_participating_in_crusade_bishop
				}
			}
			NOT = {
				any_realm_province = {
					any_neighbor_province = {
						has_owner = yes
						NOT = { religion_group = christian } 
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 120
		
		modifier = {
			factor = 0.90
			trait = detached_priest
		}
		modifier = {
			factor = 0.85
			trait = martial_cleric
		}
		modifier = {
			factor = 0.80
			trait = scholarly_theologian
		}
		modifier = {
			factor = 0.75
			trait = mastermind_theologian
		}
		modifier = {
			factor = 0.5
			trait = crusader
		}
		modifier = {
			factor = 0.75
			trait = strong
		}
		modifier = {
			factor = 0.75
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = zealous
		}
		modifier = {
			factor = 1.25
			trait = content
		}
		modifier = {
			factor = 1.25
			trait = weak
		}
		modifier = {
			factor = 1.25
			trait = craven
		}
		modifier = {
			factor = 1.25
			trait = cynical
		}
	}
	
	option = {
		name = "EVTOPTA8420"
		ai_chance = { factor = 100 }
		set_character_flag = bishop_complains_about_not_crusading
		liege = { letter_event = { id = 8425 days = 1 } }		
	}
	option = {
		name = "EVTOPTB8420"
		set_character_flag = no_complains_about_not_crusading
	}
}

# Bishop shares his concerns
letter_event = {
	id = 8425
	desc = "EVTDESC8425"
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA8425"
		FROM = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_bishop
				who = ROOT
				years = 10
			}
		}
		FROM = { clr_character_flag = bishop_complains_about_not_crusading }
	}
	option = {
		name = "EVTOPTB8425"
		FROM = { set_character_flag = reminded_about_crusade }
	}
}

# Bishop is disappointed in the rulers decision to not participate in the crusade
character_event = {
	id = 8430
	desc = "EVTDESC8430"
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion
	
	only_rulers = yes
	
	trigger = {
		has_character_flag = bishop_complains_about_not_crusading
		had_character_flag = { flag = reminded_about_crusade days = 30 }
		liege = {
			NOT = {
				any_war = {
					using_cb = crusade
				}
			}
			crusade_target = {
				holder_scope = {
					NOT = { reverse_has_truce = PREVPREV }
				}
			}
			religion_head = {
				PREV = {
					rightful_religious_head_scope = {
						character = PREVPREV
					}
					NOT = { excommunicated_for = PREV }
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 3
	}
	
	option = {
		name = "EVTOPTA8430"
		clr_character_flag = bishop_complains_about_not_crusading
		clr_character_flag = reminded_about_crusade
		liege = { letter_event = { id = 8435 days = 1 } }		
	}
}

# Bishop shares his disappointment
letter_event = {
	id = 8435
	desc = "EVTDESC8435"
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA8435"
		FROM = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_emperor
				who = ROOT
				years = 10
			}
		}
	}
}


### Vassal Disappointed ###

# Vassal is concerned that an independent ruler is not participating in crusade
character_event = {
	id = 8440
	desc = "EVTDESC8440"
	picture = GFX_evt_emissary

	only_rulers = yes
	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		has_called_crusade = yes
		had_global_flag = { flag = crusade_called days = 180 }
		NOT = { has_character_flag = no_complains_about_not_crusading }
		independent = no
		religion = catholic
		controls_religion = no
		
		liege = {
			independent = yes
			religion = catholic
			prisoner = no
			NOT = { primary_title = { tier = COUNT } } # Exclude small rulers
			NOT = {
				any_war = {
					using_cb = crusade
				}
			}
			crusade_target = {
				holder_scope = {
					NOT = { reverse_has_truce = PREVPREV }
				}
			}
			religion_head = {
				PREV = {
					rightful_religious_head_scope = {
						character = PREVPREV
					}
					NOT = { excommunicated_for = PREV }
				}
			}
			NOT = {
				reverse_has_opinion_modifier = {
					who = ROOT
					modifier = opinion_not_participating_in_crusade_vassal
				}
			}
			NOT = {
				any_realm_province = {
					any_neighbor_province = {
						has_owner = yes
						NOT = { religion_group = christian } 
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 120
		
		modifier = {
			factor = 0.90
			trait = misguided_warrior
		}
		modifier = {
			factor = 0.85
			trait = tough_soldier
		}
		modifier = {
			factor = 0.80
			trait = skilled_tactician
		}
		modifier = {
			factor = 0.75
			trait = brilliant_strategist
		}
		modifier = {
			factor = 0.5
			trait = crusader
		}
		modifier = {
			factor = 0.75
			trait = strong
		}
		modifier = {
			factor = 0.75
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = zealous
		}
		modifier = {
			factor = 1.25
			trait = content
		}
		modifier = {
			factor = 1.25
			trait = weak
		}
		modifier = {
			factor = 1.25
			trait = craven
		}
		modifier = {
			factor = 1.25 
			trait = cynical
		}
	}
	
	option = {
		name = "EVTOPTA8440"
		ai_chance = { factor = 100 }
		set_character_flag = vassal_complains_about_not_crusading
		liege = { letter_event = { id = 8445 days = 1 } }		
	}
	option = {
		name = "EVTOPTB8440"
		set_character_flag = no_complains_about_not_crusading
	}
}

# Vassal shares his concerns
letter_event = {
	id = 8445
	desc = "EVTDESC8445"
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA8445"
		FROM = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_vassal
				who = ROOT
				years = 10
			}
		}
		FROM = { clr_character_flag = vassal_complains_about_not_crusading }
	}
	option = {
		name = "EVTOPTB8445"
		FROM = { set_character_flag = reminded_about_crusade }
	}
}

# Vassal is disappointed in the rulers decision to not participate in the crusade
character_event = {
	id = 8450
	desc = "EVTDESC8450"
	picture = GFX_evt_emissary
	
	only_ruler = yes
	
	trigger = {
		has_character_flag = vassal_complains_about_not_crusading
		had_character_flag = { flag = reminded_about_crusade days = 30 }
		liege = {
			NOT = {
				any_war = {
					using_cb = crusade
				}
			}
			crusade_target = {
				holder_scope = {
					NOT = { reverse_has_truce = PREVPREV }
				}
			}
			religion_head = {
				PREV = {
					rightful_religious_head_scope = {
						character = PREVPREV
					}
					NOT = { excommunicated_for = PREV }
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 3
	}
	
	option = {
		name = "EVTOPTA8450"
		clr_character_flag = vassal_complains_about_not_crusading
		clr_character_flag = reminded_about_crusade
		liege = { letter_event = { id = 8455 days = 1 } }		
	}
}

# Vassal shares his disappointment
letter_event = {
	id = 8455
	desc = "EVTDESC8455"
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA8455"
		FROM = {
			opinion = {
				modifier = opinion_not_participating_in_crusade_vassal
				who = ROOT
				years = 10
			}
		}
	}
}


########################################
# Excommunicated (Player only)
########################################


### Pope Offer to Forgive Excommunicated ###

# Pope finds an excommunicated catholic
character_event = {
	id = 8460
	desc = "EVTDESC8460"
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion
	
	only_playable = yes
	
	trigger = {
		controls_religion = yes
		has_called_crusade = yes
		religion = catholic
		
		OR = {
			any_independent_ruler = {
				ai = no	# Only for players
				religion = catholic
				prisoner = no
				NOT = {
					any_war = {
						using_cb = crusade
					}
				}
				crusade_target = {
					holder_scope = {
						NOT = { reverse_has_truce = PREVPREV }
					}
				}
				excommunicated_for = ROOT
				NOT = { has_character_flag = offered_revoked_excommunication }
				NOT = {
					any_realm_province = {
						any_neighbor_province = {
							has_owner = yes
							NOT = { religion = catholic } 
						}
					}
				}
			}
			any_independent_ruler = {
				religion = catholic
				any_realm_lord = {
					ai = no
					religion = catholic
					prisoner = no
					NOT = {
						any_war = {
							using_cb = crusade
						}
					}
					crusade_target = {
						holder_scope = {
							NOT = { reverse_has_truce = PREVPREV }
						}
					}
					excommunicated_for = ROOT
					NOT = { has_character_flag = offered_revoked_excommunication }
					NOT = {
						any_realm_province = {
							any_neighbor_province = {
								has_owner = yes
								NOT = { religion_group = christian } 
							}
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 3
	}
	
	option = {
		name = "EVTOPTA8460"
		any_independent_ruler = {
			limit = {
				ai = no	# Only for players
				religion = catholic
				prisoner = no
				NOT = {
					any_war = {
						using_cb = crusade
					}
				}
				crusade_target = {
					holder_scope = {
						NOT = { reverse_has_truce = PREVPREV }
					}
				}
				excommunicated_for = ROOT
				NOT = { has_character_flag = offered_revoked_excommunication }
				NOT = {
					any_realm_province = {
						any_neighbor_province = {
							has_owner = yes
							NOT = { religion_group = christian } 
						}
					}
				}
			}
			set_character_flag = offered_revoked_excommunication
			letter_event = { id = 8465 days = 1 }
		}
		any_independent_ruler = {
			limit = {
				religion = catholic
			}
			any_realm_lord = {
				limit = {
					ai = no
					religion = catholic
					prisoner = no
					NOT = {
						any_war = {
							using_cb = crusade
						}
					}
					crusade_target = {
						holder_scope = {
							NOT = { reverse_has_truce = PREVPREV }
						}
					}
					excommunicated_for = ROOT
					NOT = { has_character_flag = offered_revoked_excommunication }
					NOT = {
						any_realm_province = {
							any_neighbor_province = {
								has_owner = yes
								NOT = { religion_group = christian } 
							}
						}
					}
				}
				set_character_flag = offered_revoked_excommunication
				letter_event = { id = 8465 days = 1 }
			}
		}
	}
}

# Pope sends his offer
letter_event = {
	id = 8465
	desc = "EVTDESC8465"
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA8465"
		ai_chance = { factor = 100 }
	}
	option = {
		name = "EVTOPTB8465"
		ai_chance = { factor = 0 }
	}
}

# Pope lifts Excommunication
character_event = {
	id = 8466
	desc = "EVTDESC8466"
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion
	
	only_playable = yes
	
	trigger = {
		controls_religion = yes
		has_called_crusade = yes
		religion = catholic
		
		OR = {
			any_independent_ruler = {
				ai = no
				religion = catholic
				prisoner = no
				any_war = {
					using_cb = crusade
				}
				crusade_target = {
					holder_scope = {
						NOT = { reverse_has_truce = PREVPREV }
					}
				}
				excommunicated_for = ROOT
				has_character_flag = offered_revoked_excommunication
			}
			any_independent_ruler = {
				religion = catholic
				any_realm_lord = {
					ai = no
					religion = catholic
					prisoner = no
					any_war = {
						using_cb = crusade
					}
					crusade_target = {
						holder_scope = {
							NOT = { reverse_has_truce = PREVPREV }
						}
					}
					excommunicated_for = ROOT
					has_character_flag = offered_revoked_excommunication
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 1
	}
	
	option = {
		name = "EVTOPTA8466"
		any_independent_ruler = {
			limit = {
				ai = no
				religion = catholic
				prisoner = no
				any_war = {
					using_cb = crusade
				}
				crusade_target = {
					holder_scope = {
						NOT = { reverse_has_truce = PREVPREV }
					}
				}
				excommunicated_for = ROOT
				has_character_flag = offered_revoked_excommunication
			}
			letter_event = { id = 8467 days = 1 }
		}
		any_independent_ruler = {
			limit = {
				religion = catholic
			}
			any_realm_lord = {
				limit = {
					ai = no
					religion = catholic
					prisoner = no
					any_war = {
						using_cb = crusade
					}
					crusade_target = {
						holder_scope = {
							NOT = { reverse_has_truce = PREVPREV }
						}
					}
					excommunicated_for = ROOT
					has_character_flag = offered_revoked_excommunication
				}
				letter_event = { id = 8467 days = 1 }
			}
		}
	}
}

# Pope sends his offer
letter_event = {
	id = 8467
	desc = "EVTDESC8467"
	
	is_triggered_only = yes
	
	option = {
		name = "EXCELLENT"
		excommunicate = no
		clr_character_flag = offered_revoked_excommunication
	}
}
