#########################################################
#                                                       #
#           THE NEW CYCLIC CRUSADES EVENTS              #
#                                                       #
#           By Chris Stone                              #
#                                                       #
#########################################################


#########################################
#########################################
#########################################
### MAIN CYCLIC CRUSADE TARGET EVENTS ###
#########################################
#########################################
#########################################

#
# RESERVED ID RANGE 1500-1699
#

###############################
###############################
## CRUSADES TO THE HOLY LAND ##
###############################
###############################

##############
# Jerusalem! #
##############

character_event = { #Crusade to free Jerusalem
	id = 1500
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 774 #Jerusalem
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 1800
		modifier = {
			condition = { type = not value = { type = year value = 1075 } }
			factor = 30
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1075 }
				condition = { type = not value = { type = year value = 1085 } }
			}
			factor = 0.3
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.01 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}

		modifier = {
			condition = { 	type = province 
				province = 772 #Acre
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}

			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 775 #Jaffe
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 776 #Hebron
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antiocheia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 483 #Rhodes
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 756 #Limisol
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 757 #Fammagusta
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 771 #Tyrus
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 780 #Ascallon
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 779 #Beersheb
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 777 #Kerak
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 724 #Amman
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 725 #Irbio
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 773 #Tiberias
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 778 #Monreal
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}

		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # petition the pope to call a new crusade to free the holy city!
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = gold value = 2000 } }
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 2500 }
				factor = 0.25
			}
			modifier = {
				condition = { type = not value = { type = piety value = 20 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 20 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = papacy }
				factor = 100
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.100
			}
		effect = { type = crusade value = 774 } #Jerusalem
		effect = { type = piety value = 50 }
		effect = { type = prestige value = 50 }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # help finance a crusade to free the holy city!
		ai_chance = 25
			modifier = {
				condition = { type = gold value = 2500 }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = gold value = 2000 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = not value = { type = piety value = 50 } }
				factor = 2
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 50 } }
				factor = 2
			}
		effect = { type = crusade value = 774 } #Jerusalem
		effect = { type = gold value = -2000 }
		effect = { type = piety value = 100 }
		effect = { type = prestige value = 300 }
		effect = { type = add_trait value = crusader }
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = generous }
		}
	}
	action_c = { #let it stay in heathen hands
		ai_chance = 15
			modifier = {
				condition = { type = gold value = 2000 }
				factor = 0.3
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 0.1
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 0.2
			}
			modifier = {
				condition = { type = piety value = 50 }
				factor = 0.5
			}
			modifier = {
				condition = { type = prestige value = 100 }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -100 }
		effect = { type = prestige value = -200 }
		effect = { type = remove_trait value = zealous }
		effect = { type = remove_trait value = crusader }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = coward }
		}
	}
}

character_event = { #end the Jerusalem crusade - Jerusalem not in Christian hands
	id = 1501
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 774 } #Jerusalem
		condition = { type = papacy }
		condition = {
       			type = province 
			province = 774 #Jerusalem
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 20

		modifier = {
			condition = { 	type = province 
				province = 772 #Acre
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 775 #Jaffa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 776 #Hebron
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antiocheia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 483 #Rhodes
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 756 #Limisol
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 757 #Fammagusta
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 771 #Tyrus
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 780 #Ascallon
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 779 #Beersheb
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 777 #Kerak
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 724 #Amman
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 725 #Irbio
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 773 #Tiberias
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 778 #Monreal
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
	}

	action_a = { # let us continue this holy crusade to free Jerusalem!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 100 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 100 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.1
			}
		effect = { type = piety value = 50 }
		effect = { type = prestige value = 50 }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # Our cause is lost! We must abandon poor Jerusalem!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 100} }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 100 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 } #end crusade
		effect = { type = piety value = -100 }
		effect = { type = prestige value = -100 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = sceptical }
		}
	}
}
character_event = { #end the Jerusalem crusade - Jerusalem in Christian hands
	id = 1502
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 774 } 
		condition = { type = papacy } 
		condition = { 	type = province 
			province = 774 #Jerusalem
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = {
				type = province
				province = 774 #ends 4x faster if Jerusalem has been converted to Catholic
				condition = { type = religion value = catholic }
			}
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 772 #Acre
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}

		modifier = {
			condition = { 	type = province 
				province = 775 #Jaffa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 776 #Hebron
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antiocheia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 483 #Rhodes
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 756 #Limisol
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 757 #Fammagusta
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 771 #Tyrus
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 780 #Ascalon
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 779 #Beersheb
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 777 #Kerak
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 724 #Amman
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 725 #Irbio
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 773 #Tiberias
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 778 #Monreal
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
	}
	immidiate = { #Jerusalem is saved!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1503
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 774 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 774 } #Jerusalem
			condition = { type = province value = 772 } #Acre
			condition = { type = province value = 775 } #Jaffe
			condition = { type = province value = 776 } #Hebron
			condition = { type = province value = 764 } #Antiocheia
			condition = { type = province value = 483 } #Rhodes
			condition = { type = province value = 756 } #Limsol
			condition = { type = province value = 757 } #Fammagusta
		}
	}

	mean_time_to_happen = {
		months = 3000
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province value = 774 }
			factor = 0.3
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 2
		}
		#Other modifiers?
		modifier = { # could be higher but this is a chance for reparation
			condition = { type = trait value = excommunicated }
			factor = 4
		}
		modifier = { # pope shouldn't ask heretic for this
			condition = { type = trait value = heretic } 
			factor = 100
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = {
			condition = { type = trait value = war_invalid } #Has shown his personal engagement
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 9 } #A charismatic leader is trusted more often
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 12 }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 15 }
			factor = 0.9
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_piety
					value = 0
				}
			}
			factor = 1.5
		}		
		modifier = {
			condition = { type = ruler_piety value = 200 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 500 }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_gold value = 0 } }
			factor = 1.2
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
			modifier = { # crusade still needs money, maybe better safe some
				condition = { type = not value = { type = ruler_gold value = 50 } }
				factor = 0.8
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = has_province_effect value = { poor = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = has_province_effect value = { looted = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = has_province_effect value = { rich = yes } } }
				factor = 0.6
			}
			modifier = {
				condition = { type = has_province_effect value = { revolt = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = sceptical }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.5
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = cruel }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = arbitrary }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = reckless }
				factor = 1.1
			}
			modifier = { 
				condition = { type = province value = 774 }
				factor = 5
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.166 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = { type = burgher_loyalty value = -0.25 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 50 }
		effect = { type = ruler_prestige value = 25 } #converting the heathen in the name of the pope during a crusade is something good
		effect = {
			type = random
			chance = 50
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
		effect = { #It may all go wrong 
			type = random
			chance = 15
			effect = { type = add_province_effect value = heretic } 
			effect = { type = ruler_piety value = -25 }
			effect = { type = ruler_prestige value = -50 }
			effect = { type = clergy_power value = -0.2 }
			effect = { type = noble_loyalty value = -0.1 }
		}
	}
	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = ruler_prestige value = 10 } }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = just }
				factor = 1.1
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.1
			}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		effect = { type = ruler_gold scale = -0.083 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.2 }
		effect = { type = burgher_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 33
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
			effect = { type = ruler_prestige value = 20 } #it's the result that counts
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 10 #this should be chosen in few special cases
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 10 } }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 0 } }
				factor = 5
			}
			modifier = {
				condition = { type = not value = { type = ruler_piety value = 50 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = trait value = heretic }
				factor = 2.5
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = {
			type = random
			chance = 33
			effect = { type = ruler_piety value = -25 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = heretic }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1504
#


##############
# Antioch! #
##############

character_event = { #Crusade to free Antioch
	id = 1510
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 764 #Antioch
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 4500

		modifier = {
			condition = { type = not value = { type = year value = 1075 }}
			factor = 20
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1075 }
				condition = { type = not value = { type = year value = 1085 } }
			}
			factor = 0.45
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.01 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}

		modifier = {
			condition = { 	type = province 
				province = 763 #Alexandretta
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 762 #Adana
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 733 #Aleppo
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 765 #Archa
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 766 #Tortosa
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 767 #Tripoli
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 483 #Rhodes
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 756 #Limisol
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 757 #Fammagusta
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 735 #Teluch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 734 #Aintab
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 699 #Edessa
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 708 #Tell Bashir
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 732 #Hama
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 731 #Homs
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 730 #Palmyra
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 728 #Damascus
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}

		modifier = {
			condition = { 	type = province 
				province = 772 #Acre
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 776 #Hebron
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}

		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # petition the pope to call a new crusade to free the city!
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = gold value = 1000 } }
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 1500 }
				factor = 0.25
			}
			modifier = {
				condition = { type = not value = { type = piety value = 10 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 10 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = papacy }
				factor = 10
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = crusade value = 764 } #Antioch
		effect = { type = piety value = 50 }
		effect = { type = prestige value = 50 }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # help finance a crusade to free the city!
		ai_chance = 25
			modifier = {
				condition = { type = not value = { type = gold value = 1000 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = gold value = 1500 }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = piety value = 20 } }
				factor = 2
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 20 } }
				factor = 2
			}
		effect = { type = crusade value = 764 } #Antioch
		effect = { type = gold value = -1000 }
		effect = { type = piety value = 100 }
		effect = { type = prestige value = 200 }
		effect = { type = add_trait value = crusader }
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = generous }
		}
	}
	action_c = { #let it stay in heathen hands
		ai_chance = 15
			modifier = {
				condition = { type = trait value = crusader }
				factor = 0.1
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 0.2
			}
			modifier = {
				condition = { type = gold value = 1000 }
				factor = 0.3
			}
			modifier = {
				condition = { type = piety value = 50 }


				factor = 0.5
			}
			modifier = {
				condition = { type = prestige value = 100 }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = remove_trait value = zealous }
		effect = { type = remove_trait value = crusader }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = coward }
		}
	}
}

character_event = { #end the Antioch crusade - Antioch not in Christian hands
	id = 1511
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 764 } #Antioch
		condition = { type = papacy }
		condition = { 	type = province 
			province = 764 #Antioch
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 20

		modifier = {
			condition = { 	type = province 
				province = 763 #Alexandretta
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 762 #Adana
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 733 #Aleppo
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 765 #Archa
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 766 #Tortosa
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 767 #Tripoli
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 483 #Rhodes
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 756 #Limisol
				condition = {
					type = or
 

					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 757 #Fammagusta
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 735 #Teluch
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 734 #Aintab
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 699 #Edessa
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 708 #Tell Bashir
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 732 #Hama
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 731 #Homs
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 730 #Palmyra
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 728 #Damascus
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 772 #Acre
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 776 #Hebron
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
	}

	action_a = { # let us continue this holy crusade to free Antioch!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.1
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # Our cause is lost! We must abandom poor Antioch!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -75 }
		effect = { type = prestige value = -75 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = sceptical }
		}
	}
}
character_event = { #end the Antioch crusade - Antioch in Christian hands
	id = 1512
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 764 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 764 #Antioch
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = {
				type = province
				province = 764 #ends 4x faster if Antioch has converted
				condition = { type = religion value = catholic }
			}
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 763 #Alexandretta
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 762 #Adana
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 733 #Aleppo
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 765 #Archa
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 766 #Tortosa
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 767 #Tripoli
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 483 #Rhodes
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 756 #Limisol
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 757 #Fammagusta
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 735 #Teluch
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 734 #Aintab
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 699 #Edessa
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 708 #Tell Bashir
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 732 #Hama
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 731 #Homs
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 730 #Palmyra
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 

				province = 728 #Damascus
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 772 #Acre
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 776 #Hebron
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
	}
	immidiate = { #Antioch is saved!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1513
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 764 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 774 } #Jerusalem
			condition = { type = province value = 772 } #Acre
			condition = { type = province value = 776 } #Hebron
			condition = { type = province value = 728 } #Damascus
			condition = { type = province value = 730 } #Palmyra
			condition = { type = province value = 731 } #Homs
			condition = { type = province value = 732 } #Hama
			condition = { type = province value = 708 } #Tel Bashir
			condition = { type = province value = 699 } #Edessa
			condition = { type = province value = 734 } #Aintab
			condition = { type = province value = 735 } #Teluch
			condition = { type = province value = 767 } #Tripoli
			condition = { type = province value = 766 } #Tortosa
			condition = { type = province value = 765 } #Archa
			condition = { type = province value = 733 } #Aleppo
			condition = { type = province value = 762 } #Adana
			condition = { type = province value = 763 } #Alexandretta
			condition = { type = province value = 764 } #Antiocheia
			condition = { type = province value = 483 } #Rhodes
			condition = { type = province value = 756 } #Limsol
			condition = { type = province value = 757 } #Fammagusta
		}
	}

	mean_time_to_happen = {
		months = 4000
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province value = 764 }
			factor = 0.4
		}
		modifier = {
			condition = { type = province value = 774 }
			factor = 0.4
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 2
		}
		#Other modifiers?
		modifier = { # could be higher but this is a chance for reparation
			condition = { type = trait value = excommunicated }
			factor = 4
		}
		modifier = { # pope shouldn't ask heretic for this
			condition = { type = trait value = heretic } 
			factor = 100
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = {
			condition = { type = trait value = war_invalid } #Has shown his personal engagement
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 9 } #A charismatic leader is trusted more often with a delicate task
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 12 }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 15 }
			factor = 0.9
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_piety
					value = 0
				}
			}
			factor = 1.5
		}		
		modifier = {
			condition = { type = ruler_piety value = 200 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 500 }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_gold value = 0 } }
			factor = 1.2
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
			modifier = { # crusade still needs money, maybe better safe some
				condition = { type = not value = { type = ruler_gold value = 50 } }
				factor = 0.8
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = has_province_effect value = { poor = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = has_province_effect value = { looted = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = has_province_effect value = { rich = yes } } }
				factor = 0.6
			}
			modifier = {
				condition = { type = has_province_effect value = { revolt = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = sceptical }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.5
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = cruel }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = arbitrary }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = reckless }
				factor = 1.1
			}
			modifier = { 
				condition = { type = province value = 764 }
				factor = 5
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.166 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = { type = burgher_loyalty value = -0.25 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 50 }
		effect = { type = ruler_prestige value = 25 } #converting the heathen in the name of the pope during a crusage is something good
		effect = {
			type = random
			chance = 50
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
		effect = { #It may all go wrong 
			type = random
			chance = 15
			effect = { type = add_province_effect value = heretic } 
			effect = { type = ruler_piety value = -25 }
			effect = { type = ruler_prestige value = -50 }
			effect = { type = clergy_power value = -0.2 }
			effect = { type = noble_loyalty value = -0.1 }
		}
	}
	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = ruler_prestige value = 10 } }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = just }
				factor = 1.1
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = wise }
				factor = 1.25
			}
		effect = { type = ruler_gold scale = -0.083 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.2 }
		effect = { type = burgher_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 33
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
			effect = { type = ruler_prestige value = 20 } #it's the result that counts
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 10 #this should be chosen in few special cases
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 10 } }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 0 } }
				factor = 5
			}
			modifier = {
				condition = { type = not value = { type = ruler_piety value = 50 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = trait value = heretic }
				factor = 2.5
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = {
			type = random
			chance = 33
			effect = { type = ruler_piety value = -25 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = heretic }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1514
#

#################
# Alexandria    #
#################

character_event = { #Crusade to free Alexandria
	id = 1520
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 802 #Alexandria
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 4500

		modifier = {
			condition = { type = not value = { type = year value = 1075 }}
			factor = 20
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1075 }
				condition = { type = not value = { type = year value = 1085 } }
			}
			factor = 0.5
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.01 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}

		modifier = {
			condition = { type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.2
		}
		modifier = {
			condition = { type = province 
				province = 764 #Antioch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.1
		}
		modifier = {
			condition = { type = province 
				province = 796 #Cairo
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { type = province 
				province = 801 # Bahairya
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}

			factor = 0.9
		}
		modifier = {
			condition = { type = province 
				province = 800 #Gizeh
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province 
				province = 799 #Gabiyaha
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province 
				province = 798 #Delta
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { type = province 
				province = 797 # Mandura
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province 
				province = 790 #Sarqihya
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province 
				province = 791 #Quena
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province 
				province = 795 #Asyut
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 789 #Pelusia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 794 #Aswan
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 792 #Nubia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 793 #Sudan
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}


		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # petition the pope to call a new crusade to free the city!
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = gold value = 1000 } }
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 1500 }
				factor = 0.25
			}
			modifier = {
				condition = { type = not value = { type = piety value = 10 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 10 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = papacy }
				factor = 10
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}

		effect = { type = crusade value = 802 } #Alexandria
		effect = { type = piety value = 50 }
		effect = { type = prestige value = 50 }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # help finance a crusade to free the city!
		ai_chance = 25
			modifier = {
				condition = { type = gold value = 1500 }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = gold value = 1000 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = not value = { type = piety value = 20 } }
				factor = 2
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 20 } }
				factor = 2
			}
		effect = { type = crusade value = 802 } #Alexandria
		effect = { type = gold value = -1000 }
		effect = { type = piety value = 100 }
		effect = { type = prestige value = 200 }
		effect = { type = add_trait value = crusader }
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = generous }
		}
	}
	action_c = { #let it stay in heathen hands
		ai_chance = 15
			modifier = {
				condition = { type = trait value = crusader }
				factor = 0.1
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 0.2
			}
			modifier = {
				condition = { type = gold value = 1000 }
				factor = 0.3
			}
			modifier = {
				condition = { type = piety value = 50 }
				factor = 0.5
			}
			modifier = {
				condition = { type = prestige value = 100 }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = remove_trait value = zealous }
		effect = { type = remove_trait value = crusader }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = coward }
		}
	}
}

character_event = { #end the Alexandria crusade - Alexandria not in Christian hands
	id = 1521
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 802 } #Alexandria
		condition = { type = papacy }
		condition = { 	type = province 
			province = 802 #Alexandria
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 20

		modifier = {
			condition = { 	type = province 
				province = 796 #Cairo
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 801 # Bahairya
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 800 #Gizeh
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 799 #Gabiyaha
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 798 #Delta
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 797 # Mandura
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 790 #Sarqihya
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 791 #Quena
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 795 #Asyut
				condition = {
					type = or

					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 789 #Pelusia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 794 #Aswan
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 792 #Nubia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 793 #Sudan
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
	}

	action_a = { # let us continue this holy crusade to free Alexandria!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 2
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # Our cause is lost! We must abandom poor Alexandria!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -75 }
		effect = { type = prestige value = -75 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = sceptical }
		}
	}
}
character_event = { #end the Alexandria crusade - Alexandria in Christian hands
	id = 1522
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 802 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 802 #Alexandria
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = {
				type = province
				province = 802 #ends 4x faster if Alexandria has converted
				condition = { type = religion value = catholic }
			}
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 796 #Cairo
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 801 # Bahairya
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 800 #Gizeh
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 799 #Gabiyaha
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 798 #Delta
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 797 # Mandura
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 790 #Sarqihya
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 791 #Quena
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 795 #Asyut
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 789 #Pelusia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 794 #Aswan
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 792 #Nubia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 793 #Sudan
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
	}
	immidiate = { #Alexandria is ours!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1523
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 802 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 802 } #Alexandria
			condition = { type = province value = 801 } #Balairya
			condition = { type = province value = 800 } #Gizeh
			condition = { type = province value = 799 } #Gabiyacha
			condition = { type = province value = 798 } #Delta
			condition = { type = province value = 797 } #Mandura
			condition = { type = province value = 796 } #Cairo
			condition = { type = province value = 790 } #Quena
			condition = { type = province value = 795 } #Asyut
			condition = { type = province value = 789 } #Aswan
			condition = { type = province value = 792 } #Nubia
			condition = { type = province value = 793 } #Sudan
		}
	}

	mean_time_to_happen = {
		months = 4000
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province value = 802 }
			factor = 0.4
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 2
		}
		#Other modifiers?
		modifier = { # could be higher but this is a chance for reparation
			condition = { type = trait value = excommunicated }
			factor = 4
		}
		modifier = { # pope shouldn't ask heretic for this
			condition = { type = trait value = heretic } 
			factor = 100
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = {
			condition = { type = trait value = war_invalid } #Has shown his personal engagement
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 9 } #A charismatic leader is trusted more often with a delicate task
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 12 }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 15 }
			factor = 0.9
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_piety
					value = 0
				}
			}
			factor = 1.5
		}		
		modifier = {
			condition = { type = ruler_piety value = 200 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 500 }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_gold value = 0 } }
			factor = 1.2
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
			modifier = { # crusade still needs money, maybe better safe some
				condition = { type = not value = { type = ruler_gold value = 50 } }
				factor = 0.8
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = has_province_effect value = { poor = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = has_province_effect value = { looted = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = has_province_effect value = { rich = yes } } }
				factor = 0.6
			}
			modifier = {
				condition = { type = has_province_effect value = { revolt = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = sceptical }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.5
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = cruel }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = arbitrary }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = reckless }
				factor = 1.1
			}
			modifier = { 
				condition = { type = province value = 802 }
				factor = 5
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.166 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = { type = burgher_loyalty value = -0.25 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 50 }
		effect = { type = ruler_prestige value = 25 } #converting the heathen in the name of the pope during a crusage is something good
		effect = {
			type = random
			chance = 50
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
		effect = { #It may all go wrong 
			type = random
			chance = 15
			effect = { type = add_province_effect value = heretic } 
			effect = { type = ruler_piety value = -25 }
			effect = { type = ruler_prestige value = -50 }
			effect = { type = clergy_power value = -0.2 }
			effect = { type = noble_loyalty value = -0.1 }
		}
	}
	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = ruler_prestige value = 10 } }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = just }
				factor = 1.1
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.1
			}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		effect = { type = ruler_gold scale = -0.083 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.2 }
		effect = { type = burgher_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 33
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
			effect = { type = ruler_prestige value = 20 } #it's the result that counts
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 10 #this should be chosen in few special cases
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 10 } }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 0 } }
				factor = 5
			}
			modifier = {
				condition = { type = not value = { type = ruler_piety value = 50 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = trait value = heretic }
				factor = 2.5
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = {
			type = random
			chance = 33
			effect = { type = ruler_piety value = -25 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = heretic }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1524
#


#################
# Tunis #
#################

character_event = { #Crusade to free Tunis
	id = 1530
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 817 #Tunis
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 4000

		modifier = {
			condition = { type = not value = { type = year value = 1075 } }
			factor = 20
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1075 }
				condition = { type = not value = { type = year value = 1085 } }
			}
			factor = 1.1
		}

		modifier = {
			condition = { type = papacy }
			factor = 0.01 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}
		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 4
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antioch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 3
		}
		modifier = {
			condition = { 	type = province 
				province = 802 #Alexandria
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 816 #Mahdia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 815 #Kairwan
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 818 #Medjerda
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 819 #Bizerte
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}

			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 814 #Gabes
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 821 #Constantine
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 820 #Annaba
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}


		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # petition the pope to call a new crusade to free the city!
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = gold value = 1000 } }
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 1500 }
				factor = 0.25
			}
			modifier = {
				condition = { type = not value = { type = piety value = 10 } }

				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 10 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = papacy }
				factor = 10
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = crusade value = 817 } #Tunis
		effect = { type = piety value = 50 }
		effect = { type = prestige value = 50 }
		effect = {
			type = random
			chance = 20
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 20
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # help finance a crusade to free the city!
		ai_chance = 25
			modifier = {
				condition = { type = gold value = 1500 }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = gold value = 1000 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = not value = { type = piety value = 20 } }
				factor = 2
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 20 } }
				factor = 2
			}
		effect = { type = crusade value = 817 } #Tunis
		effect = { type = gold value = -1000 }
		effect = { type = piety value = 100 }
		effect = { type = prestige value = 200 }
		effect = { type = add_trait value = crusader }
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = generous }
		}
	}
	action_c = { #let it stay in heathen hands
		ai_chance = 15
			modifier = {
				condition = { type = trait value = crusader }
				factor = 0.1
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 0.2
			}
			modifier = {
				condition = { type = gold value = 1000 }
				factor = 0.3
			}
			modifier = {
				condition = { type = piety value = 50 }
				factor = 0.5
			}
			modifier = {
				condition = { type = prestige value = 100 }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = remove_trait value = zealous }
		effect = { type = remove_trait value = crusader }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = coward }
		}
	}
}

character_event = { #end the Tunis crusade - Tunis not in Christian hands
	id = 1531
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 817 } #Tunis
		condition = { type = papacy }
		condition = { 	type = province 
			province = 817 #Tunis
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 15

		modifier = {
			condition = { 	type = province 
				province = 816 #Mahdia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 815 #Kairwan
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 818 #Medjerda
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 819 #Bizerte
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 814 #Gabes
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 821 #Constantine
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 820 #Annaba
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
	}

	action_a = { # let us continue this holy crusade to free Tunis!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 50 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 50 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.1
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # Our cause is lost! We must abandom poor Tunis!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 50 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 50 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -50 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = sceptical }
		}
	}
}
character_event = { #end the Tunis crusade - Tunis in Christian hands
	id = 1532
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 817 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 817 #Tunis
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 36

		modifier = {
			condition = {
				type = province
				province = 817 #ends 4x faster if converted
				condition = { type = religion value = catholic }
			}
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 816 #Mahdia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 815 #Kairwan
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 818 #Medjerda
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 819 #Bizerte
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 814 #Gabes
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 821 #Constantine
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 820 #Annaba
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
	}
	immidiate = { #Cairo is ours!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}


province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1533
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 817 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 817 } #tunis
			condition = { type = province value = 816 } #Mahdia
			condition = { type = province value = 815 } #Kairwan
			condition = { type = province value = 818 } #Medjerda
			condition = { type = province value = 818 } #Bizerte
			condition = { type = province value = 814 } #Gabes
			condition = { type = province value = 821 } #Constantine
			condition = { type = province value = 820 } #Annaba
		}
	}

	mean_time_to_happen = {
		months = 3500
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province value = 817 }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 2
		}
		#Other modifiers?
		modifier = { # could be higher but this is a chance for reparation
			condition = { type = trait value = excommunicated }
			factor = 4
		}
		modifier = { # pope shouldn't ask heretic for this
			condition = { type = trait value = heretic } 
			factor = 100
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = {
			condition = { type = trait value = war_invalid } #Has shown his personal engagement
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 9 } #A charismatic leader is trusted more often with a delicate task
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 12 }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 15 }
			factor = 0.9
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_piety
					value = 0
				}
			}
			factor = 1.5
		}		
		modifier = {
			condition = { type = ruler_piety value = 200 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 500 }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_gold value = 0 } }
			factor = 1.2
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
			modifier = { # crusade still needs money, maybe better safe some
				condition = { type = not value = { type = ruler_gold value = 50 } }
				factor = 0.8
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = has_province_effect value = { poor = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = has_province_effect value = { looted = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = has_province_effect value = { rich = yes } } }
				factor = 0.6
			}
			modifier = {
				condition = { type = has_province_effect value = { revolt = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = sceptical }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.5
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = cruel }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = arbitrary }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = reckless }
				factor = 1.1
			}
			modifier = { 
				condition = { type = province value = 817 }
				factor = 2
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.166 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = { type = burgher_loyalty value = -0.25 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 50 }
		effect = { type = ruler_prestige value = 25 } #converting the heathen in the name of the pope during a crusage is something good
		effect = {
			type = random
			chance = 50
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
		effect = { #It may all go wrong 
			type = random
			chance = 15
			effect = { type = add_province_effect value = heretic } 
			effect = { type = ruler_piety value = -25 }
			effect = { type = ruler_prestige value = -50 }
			effect = { type = clergy_power value = -0.2 }
			effect = { type = noble_loyalty value = -0.1 }
		}
	}
	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = ruler_prestige value = 10 } }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = just }
				factor = 1.1
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.1
			}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		effect = { type = ruler_gold scale = -0.083 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.2 }
		effect = { type = burgher_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 33
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
			effect = { type = ruler_prestige value = 20 } #it's the result that counts
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 10 #this should be chosen in few special cases
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 10 } }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 0 } }
				factor = 5
			}
			modifier = {
				condition = { type = not value = { type = ruler_piety value = 50 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = trait value = heretic }
				factor = 2.5
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = {
			type = random
			chance = 33
			effect = { type = ruler_piety value = -25 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = heretic }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1534
#


#################
# Byzantium #
#################

# In case Byzantion falls into Moslem hands

character_event = { #Crusade to free Byzantium
	id = 1540
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 496 #Byzantion
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 2700

		modifier = {
			condition = { type = not value = { type = year value = 1075 } }
			factor = 20
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1075 }
				condition = { type = not value = { type = year value = 1085 } }
			}
			factor = 0.5
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.01 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}
		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antioch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 802 #Alexandria
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 497 #Trake
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 495 #Kaliopolis
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 494 #Andrionopolis
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 741 #Nikomedia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 742 #Prusa
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 743 #Kyzileos
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 744 #Abydos
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 750 #Nikaea
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 749 #Dorylaion
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 748 #Laodikeia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 745 #Smyrna
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 493 #Philippopolis
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 499 #Tyrnovo
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 508 #Dorostotum
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 498 #Messembria
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 487 #Lesbos
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 482 #Atheniai
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 490 #Thessalonike
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 483 #Rhodos
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 740 #Herakleia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}

		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # petition the pope to call a new crusade to free the city!
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = gold value = 1000 } }
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 1500 }
				factor = 0.25
			}
			modifier = {
				condition = { type = not value = { type = piety value = 10 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 10 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = papacy }
				factor = 10
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = crusade value = 496 } #Byzantion
		effect = { type = piety value = 50 }
		effect = { type = prestige value = 50 }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # help finance a crusade to free the city!
		ai_chance = 25
			modifier = {
				condition = { type = gold value = 1500 }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = gold value = 1000 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = not value = { type = piety value = 20 } }
				factor = 2
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 20 } }
				factor = 2
			}
		effect = { type = crusade value = 496 } #Byzantion
		effect = { type = gold value = -1000 }
		effect = { type = piety value = 100 }
		effect = { type = prestige value = 200 }
		effect = { type = add_trait value = crusader }
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = generous }
		}
	}
	action_c = { #let it stay in heathen hands
		ai_chance = 15
			modifier = {
				condition = { type = trait value = crusader }
				factor = 0.1
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 0.2
			}
			modifier = {
				condition = { type = gold value = 1000 }
				factor = 0.3
			}
			modifier = {
				condition = { type = piety value = 50 }
				factor = 0.5
			}
			modifier = {
				condition = { type = prestige value = 100 }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = remove_trait value = zealous }
		effect = { type = remove_trait value = crusader }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = coward }
		}
	}
}

character_event = { #end the Byzantion crusade - Byzantion not in Christian hands
	id = 1541
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 496 } #Byzantion
		condition = { type = papacy }
		condition = { 	type = province 
			province = 496 #Byzantion
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 20

		modifier = {
			condition = { 	type = province 
				province = 497 #Trake
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 495 #Kaliopolis
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 494 #Andrionopolis
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 741 #Nikomedia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 742 #Prusa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 743 #Kyzileos
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 744 #Abydos
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 750 #Nikaea
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 749 #Dorylaion
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 748 #Laodikeia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 745 #Smyrna
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 493 #Philippopolis
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 499 #Tyrnovo
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 508 #Dorostotum
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 498 #Messembria
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 487 #Lesbos
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 482 #Atheniai

				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 490 #Thessalonike
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 483 #Rhodos
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 740 #Herakleia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
	}

	action_a = { # let us continue this holy crusade to free Byzantion!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.1
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # Our cause is lost! We must abandom poor Byzantion!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -75 }
		effect = { type = prestige value = -75 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = sceptical }
		}
	}
}
character_event = { #end the Byzantion crusade - Byzantion in Christian hands
	id = 1542
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 496 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 496 #Byzantion
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = { 	type = province 
				province = 496 #Byzantion has converted to Catholic
				condition = { type = religion value = catholic }
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 496 #Byzantion is still Orthodox or has been converted back
				condition = { type = religion value = orthodox }
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 497 #Trake
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 495 #Kaliopolis
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 494 #Andrionopolis
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 741 #Nikomedia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 742 #Prusa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 743 #Kyzileos
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 744 #Abydos
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 750 #Nikaea
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 749 #Dorylaion
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 748 #Laodikeia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 745 #Smyrna
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 493 #Philippopolis
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 499 #Tyrnovo
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 508 #Dorostotum
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 498 #Messembria
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 487 #Lesbos
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 482 #Atheniai
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 490 #Thessalonike
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 483 #Rhodos
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 740 #Herakleia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
	}
	immidiate = { #Byzantion is ours!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1543
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 496 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 496 } #Byzantion
			condition = { type = province value = 497 } #Trake
			condition = { type = province value = 495 } #Kaliopolis
			condition = { type = province value = 494 } #Adrianopolis
			condition = { type = province value = 741 } #Nikomedia
			condition = { type = province value = 742 } #Prusa
			condition = { type = province value = 743 } #Kyzileos
			condition = { type = province value = 744 } #Abydos
			condition = { type = province value = 750 } #Nikaea
			condition = { type = province value = 749 } #Dorylaion
			condition = { type = province value = 748 } #Laodikeia
			condition = { type = province value = 745 } #Smyrna
			condition = { type = province value = 493 } #Philippolis
			condition = { type = province value = 499 } #Tyrnovo
			condition = { type = province value = 508 } #Dorosbutum
			condition = { type = province value = 498 } #Meembria
			condition = { type = province value = 487 } #Lesbos
			condition = { type = province value = 482 } #Athenai
			condition = { type = province value = 490 } #Thessalonike
			condition = { type = province value = 483 } #Rhodes
			condition = { type = province value = 740 } #Herakleia
		}
	}

	mean_time_to_happen = {
		months = 3000
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province value = 496 }
			factor = 0.4
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 2
		}
		#Other modifiers?
		modifier = { # could be higher but this is a chance for reparation
			condition = { type = trait value = excommunicated }
			factor = 4
		}
		modifier = { # pope shouldn't ask heretic for this
			condition = { type = trait value = heretic } 
			factor = 100
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = {
			condition = { type = trait value = war_invalid } #Has shown his personal engagement
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 9 } #A charismatic leader is trusted more often with a delicate task
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 12 }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 15 }
			factor = 0.9
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_piety
					value = 0
				}
			}
			factor = 1.5
		}		
		modifier = {
			condition = { type = ruler_piety value = 200 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 500 }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_gold value = 0 } }
			factor = 1.2
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 60
			modifier = { # crusade still needs money, maybe better safe some
				condition = { type = not value = { type = ruler_gold value = 50 } }
				factor = 0.8
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = has_province_effect value = { poor = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = has_province_effect value = { looted = yes } }
				factor = 1.4
			}
			modifier = {
				condition = { type = not value = { type = has_province_effect value = { rich = yes } } }
				factor = 0.6
			}
			modifier = {
				condition = { type = has_province_effect value = { revolt = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = sceptical }
				factor = 0.8
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.5
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = cruel }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = arbitrary }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = reckless }
				factor = 1.1
			}
			modifier = { 
				condition = { type = province value = 496 }
				factor = 4
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.2 } #slightly more expensive but better effects
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.3 }
		effect = { type = burgher_loyalty value = -0.15 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 50 }
		effect = { type = ruler_prestige value = 40 } #converting the heathen in the name of the pope during a crusage is something good
		effect = {
			type = random
			chance = 35
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_province_effect value = revolt }
		}
		effect = { #It may all go wrong 
			type = random
			chance = 25
			effect = { type = add_province_effect value = heretic } 
			effect = { type = ruler_piety value = -25 }
			effect = { type = ruler_prestige value = -50 }
			effect = { type = clergy_power value = -0.2 }
			effect = { type = noble_loyalty value = -0.1 }
		}
	}
	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 30
			modifier = {
				condition = { type = not value = { type = ruler_prestige value = 10 } }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = just }
				factor = 1.1
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.1
			}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		effect = { type = ruler_gold scale = -0.133 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.15 }
		effect = { type = burgher_loyalty value = -0.08 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
			effect = { type = ruler_prestige value = 30 } #it's the result that counts
		}
		effect = {
			type = random
			chance = 20
			effect = { type = add_province_effect value = looted }
		}
	}
	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 10 #this should be chosen in few special cases
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 10 } }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 0 } }
				factor = 5
			}
			modifier = {
				condition = { type = not value = { type = ruler_piety value = 50 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = trait value = heretic }
				factor = 2.5
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -30 }
		effect = {
			type = random
			chance = 33
			effect = { type = ruler_piety value = -30 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = heretic }
		}
		effect = { #people take matter in their own hands
		       type = random
		       chance = 25
		       effect = { type = religion value = orthodox }
		       }
	}
}

#
# NEXT EVENT IN THIS SERIES 1544
#


###############################
###############################
## CRUSADES IN ITALY ##
###############################
###############################


###############
# Roma! #
###############

# In case Roma falls into non-Catholic hands

character_event = { #Crusade to free Roma
	id = 1550
	picture = "event_crusades"

	trigger = {
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 333 #Roma
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			} #Orthodox occupation of Rome handled by a different set of events
		}
	}

	mean_time_to_happen = {
		years = 20 #this should happen just about as soon as it can

		modifier = {
			condition = { type = papacy }
			factor = 0.1 #papal controller is most likely to call it
		}
		modifier = {
			condition = {
				type = not
				value = { type = exists value = PAPA }
			}
			factor = 0.001
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 1.25 #a duke might call it
		}

		modifier = {
			condition = { 	type = province 
				province = 332 #Orbetello
				condition = {
					type = not 
					value = { type = ruler_religion value = catholic }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 330 #Siena
				condition = {
					type = not 
					value = { type = ruler_religion value = catholic }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 898 #Orvieto
				condition = {
					type = not 
					value = { type = ruler_religion value = catholic }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 997 #Cabua
				condition = {
					type = not 
					value = { type = ruler_religion value = catholic }
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { 	type = province 
				province = 334 #Napoli
				condition = {
					type = not 
					value = { type = ruler_religion value = catholic }
				}
			}
			factor = 0.75
		}


		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.25
		}
		modifier = {
			condition = { type = trait value = zealous }

			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 100
		}
		modifier = {
			condition = { type = piety value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # call upon Christendom to free the holy city!
		ai_chance = 95
		effect = { type = crusade value = 333 } #Roma
		effect = { type = piety value = 100 }
		effect = { type = prestige value = 250 }
		effect = { type = add_trait value = crusader }
		effect = { type = add_trait value = zealous }
	}
	action_b = { #let it stay in heathen hands
		ai_chance = 5
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -250 }
		effect = { type = prestige value = -250 }
		effect = { type = add_trait value = sceptical }
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = excommunicated }
		}
	}
}

character_event = { #end the Roma crusade - Roma not in Christian hands
	id = 1551
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 333 } #Roma
		condition = { type = papacy }
		condition = { 	type = province 
			province = 333 #Roma
			condition = { type = not value = { type = ruler_religion value = catholic } }
		}
	}

	mean_time_to_happen = {
		years = 10

	}

	action_a = { # let us continue this holy crusade to free Roma!
		ai_chance = 75
		modifier = {
			condition = { 	type = province 
				province = 332 #Orbetello
				condition = {
					type = not 
					value = { type = ruler_religion value = catholic }
				}
			}
			factor = 1.15
		}
		modifier = {
			condition = { 	type = province 
				province = 330 #Siena
				condition = {
					type = not 
					value = { type = ruler_religion value = catholic }
				}
			}
			factor = 1.15
		}
		modifier = {
			condition = { 	type = province 
				province = 898 #Orvieto
				condition = {
					type = not 
					value = { type = ruler_religion value = catholic }
				}
			}
			factor = 1.15
		}
		modifier = {
			condition = { 	type = province 
				province = 997 #Cabua
				condition = {
					type = not 
					value = { type = ruler_religion value = catholic }
				}
			}
			factor = 1.15
		}
		modifier = {
			condition = { 	type = province 
				province = 334 #Napoli
				condition = {
					type = not 
					value = { type = ruler_religion value = catholic }
				}
			}
			factor = 1.15
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}

		effect = { type = piety value = 50 }
		effect = { type = prestige value = 50 }
	}
	action_b = { # Our cause is lost! We must abandom Roma!
		ai_chance = 25
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = energetic }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.5
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -200 }
		effect = { type = prestige value = -500 }
		effect = { type = remove_trait value = zealous }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = sceptical }
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = excommunicated }
		}
	}
}
character_event = { #end the Roma crusade - Roma in Christian hands
	id = 1552
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 333 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 333 #Roma
			condition = { type = ruler_religion value = catholic }
		}
	}

	mean_time_to_happen = {
		months = 60

		modifier = {
			condition = { 	type = province 
				province = 332 #Orbetello
				condition = { type = ruler_religion value = catholic }
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 330 #Siena
				condition = { type = ruler_religion value = catholic }
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 898 #Orvieto
				condition = { type = ruler_religion value = catholic }
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 997 #Cabua
				condition = { type = ruler_religion value = catholic }
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 334 #Napoli
				condition = { type = ruler_religion value = catholic }
			}
			factor = 0.5
		}
	}
	immidiate = { #Roma is ours!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1553
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 333 }
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 333 } #Roma
			condition = { type = province value = 332 } #Ornetello
			condition = { type = province value = 330 } #Siena
			condition = { type = province value = 898 } #Orvieto
			condition = { type = province value = 997 } #Cabua
			condition = { type = province value = 334 } #Napoli
		}
	}

	mean_time_to_happen = {
		months = 800
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province value = 333 }
			factor = 0.1
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 2
		}
		#Other modifiers?
		modifier = { # could be higher but this is a chance for reparation
			condition = { type = trait value = excommunicated }
			factor = 4
		}
		modifier = { # pope shouldn't ask heretic for this
			condition = { type = trait value = heretic } 
			factor = 100
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = {
			condition = { type = trait value = war_invalid } #Has shown his personal engagement
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 9 } #A charismatic leader is trusted more often with a delicate task
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 12 }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 15 }
			factor = 0.9
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_piety
					value = 0
				}
			}
			factor = 1.5
		}		
		modifier = {
			condition = { type = ruler_piety value = 200 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 500 }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_gold value = 0 } }
			factor = 1.2
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 60
			modifier = { # crusade still needs money, maybe better safe some
				condition = { type = not value = { type = ruler_gold value = 50 } }
				factor = 0.8
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = has_province_effect value = { looted = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = has_province_effect value = { rich = yes } } }
				factor = 0.8
			}
			modifier = {
				condition = { type = has_province_effect value = { revolt = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = sceptical }
				factor = 0.8
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.5
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 0.8
			}
			modifier = {
				condition = { type = trait value = cruel }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = arbitrary }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = reckless }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = vengeful }
				factor = 1.2
			}
			modifier = { 
				condition = { type = province value = 333 }
				factor = 10
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.25 } #This is no place to be stingy
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.25 }
		effect = { type = burgher_loyalty value = -0.15 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.3 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 100 }
		effect = { type = ruler_prestige value = 50 } #converting the heathen in the name of the pope during a crusage is something good
		effect = { #chance for prosperity -2 is 1/2
		       type = random
		       chance = 50
		       effect = { type = prosperity value = -2 }
		       }
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
		effect = { #It may all go wrong 
			type = random
			chance = 20
			effect = { type = add_province_effect value = heretic } 
			effect = { type = ruler_piety value = -40 }
			effect = { type = ruler_prestige value = -75 }
			effect = { type = clergy_power value = -0.2 }
			effect = { type = noble_loyalty value = -0.1 }
		}
	}
	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 30
			modifier = {
				condition = { type = trait value = merciful }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = just }
				factor = 1.1
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.1
			}
		effect = { type = ruler_gold scale = -0.15 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.1 }
		effect = { type = burgher_loyalty value = -0.05 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.15 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 60
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
			effect = { type = ruler_prestige value = 40 } #it's the result that counts
		}
		effect = {
			type = random
			chance = 20
			effect = { type = add_province_effect value = looted }
		}
	}
	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 10 #this should be chosen in few special cases
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 10 } }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 0 } }
				factor = 5
			}
			modifier = {
				condition = { type = not value = { type = ruler_piety value = 50 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = trait value = heretic }
				factor = 2.5
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -50 }
		effect = {
			type = random
			chance = 40
			effect = { type = ruler_piety value = -25 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = heretic }
		}
		effect = {
		       type = random
		       chance = 25
		       effect = { type = religion value = catholic }
		       }
	}
}

#
# NEXT EVENT IN THIS SERIES 1554
#

###################################################################
# End other crusades in the event that the Papacy ceases to exist #
###################################################################

character_event = { #Disaster! The Papacy has fallen to a hostile force and the Pope has fled into exile!
	id = 1554
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade } 
		condition = { type = not value = { type = target value = 333 } }
		condition = { type = not value = { type = exists value = PAPA } }
		condition = { type = not value = { type = ai } } #this way the player will know what's happening
		condition = { type = ruler }
	}

	mean_time_to_happen = {
		days = 5
	}

	action_a = { #Surely, he will soon find a court that is sympathetic to his cause.
		effect = { type = crusade value = 0 }
	}
}

############
# SICILY! #
############

character_event = { #Crusade to free Sicily
	id = 1560
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 340 #Palermo
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 5000

		modifier = {
			condition = { type = not value = { type = year value = 1100 } }
			factor = 100
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1100 }
				condition = { type = not value = { type = year value = 1150 } }
			}
			factor = 2
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.01 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}
		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antioch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 802 #Alexandria
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}

		modifier = {
			condition = { 	type = province 
				province = 339 #Messina
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 343 #Siracusa
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 342 #Agrigento
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 

				province = 341 #Trapani
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 812 #Malta
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 338 #Reggio
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}


		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}
	}
	action_a = { # petition the pope to call a new crusade to free Sicily!
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = gold value = 1000 } }
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 1500 }
				factor = 0.25
			}
			modifier = {
				condition = { type = not value = { type = piety value = 10 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 10 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = papacy }
				factor = 10
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = crusade value = 340 } #Palermo
		effect = { type = piety value = 50 }
		effect = { type = prestige value = 50 }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 20
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # help finance a crusade to free Sicily!
		ai_chance = 25
			modifier = {
				condition = { type = gold value = 1500 }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = gold value = 1000 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = not value = { type = piety value = 20 } }
				factor = 2
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 20 } }
				factor = 2
			}
		effect = { type = crusade value = 340 } #Palermo
		effect = { type = gold value = -1000 }
		effect = { type = piety value = 100 }
		effect = { type = prestige value = 200 }
		effect = { type = add_trait value = crusader }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = generous }
		}
	}
	action_c = { #let it stay in heathen hands
		ai_chance = 15
			modifier = {
				condition = { type = trait value = crusader }
				factor = 0.1
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 0.2
			}
			modifier = {
				condition = { type = gold value = 1000 }
				factor = 0.3
			}
			modifier = {
				condition = { type = piety value = 50 }
				factor = 0.5
			}
			modifier = {
				condition = { type = prestige value = 100 }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = remove_trait value = zealous }
		effect = { type = remove_trait value = crusader }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = coward }
		}
	}
}

character_event = { #end the Sicily crusade - Sicily not in Christian hands
	id = 1561
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 340 } #Sicily
		condition = { type = papacy }
		condition = { 	type = province 
			province = 340 #Palermo
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 15

		modifier = {
			condition = { 	type = province 
				province = 339 #Messina
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 343 #Siracusa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 342 #Agrigento
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 341 #Trapani
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 812 #Malta
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 338 #Reggio
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
	}

	action_a = { # let us continue this holy crusade to free Sicily!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 50 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 50 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 2
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = zealous }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # Our cause is lost! We must abandom Sicily!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 50 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 50 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -50 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = sceptical }
		}
	}
}
character_event = { #end the Sicily crusade - Sicily in Christian hands
	id = 1562
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 340 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 340 #Palermo
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 36

		modifier = {
			condition = { type = province
				province = 340 #Palermo has converted
				condition = { type = religion value = catholic }
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 339 #Messina
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 343 #Siracusa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 342 #Agrigento
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 341 #Trapani
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 812 #Malta
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 338 #Reggio
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
	}
	immidiate = { #Sicily is ours!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1563
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 340 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 340 } #Palermo
			condition = { type = province value = 339 } #Messina
			condition = { type = province value = 343 } #siracusa
			condition = { type = province value = 342 } #Agrigento
			condition = { type = province value = 341 } #Trapani
			condition = { type = province value = 812 } #Malta
			condition = { type = province value = 338 } #Reggio
		}
	}

	mean_time_to_happen = {
		months = 3000
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = province value = 340 }
			factor = 0.4
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 2
		}
		#Other modifiers?
		modifier = { # could be higher but this is a chance for reparation
			condition = { type = trait value = excommunicated }
			factor = 4
		}
		modifier = { # pope shouldn't ask heretic for this
			condition = { type = trait value = heretic } 
			factor = 100
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = {
			condition = { type = trait value = war_invalid } #Has shown his personal engagement
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 9 } #A charismatic leader is trusted more often with a delicate task
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 12 }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 15 }
			factor = 0.9
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_piety
					value = 0
				}
			}
			factor = 1.5
		}		
		modifier = {
			condition = { type = ruler_piety value = 200 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 500 }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_gold value = 0 } }
			factor = 1.2
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
			modifier = { # crusade still needs money, maybe better safe some
				condition = { type = not value = { type = ruler_gold value = 50 } }
				factor = 0.8
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = has_province_effect value = { poor = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = has_province_effect value = { looted = yes } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = has_province_effect value = { rich = yes } } }
				factor = 0.6
			}
			modifier = {
				condition = { type = has_province_effect value = { revolt = yes } }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = sceptical }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.5
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 0.6
			}
			modifier = {
				condition = { type = trait value = cruel }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = arbitrary }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = reckless }
				factor = 1.1
			}
			modifier = { 
				condition = { type = province value = 340 }
				factor = 4
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.2 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.3 }
		effect = { type = burgher_loyalty value = -0.15 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 50 }
		effect = { type = ruler_prestige value = 30 } #converting the heathen in the name of the pope during a crusage is something good
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_province_effect value = revolt }
		}
		effect = { #It may all go wrong 
			type = random
			chance = 25
			effect = { type = add_province_effect value = heretic } 
			effect = { type = ruler_piety value = -25 }
			effect = { type = ruler_prestige value = -50 }
			effect = { type = clergy_power value = -0.2 }
			effect = { type = noble_loyalty value = -0.1 }
		}
	}
	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
			modifier = {
				condition = { type = not value = { type = ruler_prestige value = 10 } }
				factor = 2
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = just }
				factor = 1.1
			}
			modifier = { # the risk is lower if the province is already in bad shape
				condition = { type = has_province_effect value = { struggling = yes } }
				factor = 1.1
			}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		effect = { type = ruler_gold scale = -0.133 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.1 }
		effect = { type = burgher_loyalty value = -0.08 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -20 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
			effect = { type = ruler_prestige value = 30 } #it's the result that counts
		}
		effect = {
			type = random
			chance = 20
			effect = { type = add_province_effect value = looted }
		}
	}
	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 10 #this should be chosen in few special cases
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 10 } }
				factor = 3
			}
			modifier = {
				condition = { type = not value = { type = ruler_gold value = 0 } }
				factor = 5
			}
			modifier = {
				condition = { type = not value = { type = ruler_piety value = 50 } }
				factor = 0.2
			}
			modifier = {
				condition = { type = trait value = heretic }
				factor = 2.5
			}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -40 }
		effect = {
			type = random
			chance = 33
			effect = { type = ruler_piety value = -25 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = heretic }
		}
		effect = { #people take matters into their own hands 
		       type = random
		       chance = 15
		       effect = { type = religion value = catholic }
		       }
	}
}

#
# NEXT EVENT IN THIS SERIES 1564
#



###############################
###############################
## THE (Iberian) RECONQUISTA ##
###############################
###############################


##############
# Cordoba! #
##############

character_event = { #Crusade to free Cordoba
	id = 1570
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 181 #Cordoba
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 1200

		modifier = {
			condition = { type = not value = { type = year value = 1075 } }
			factor = 50
		}
		modifier = {
			condition = { type = not value = { type = year value = 1150 } }
			factor = 5
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1150 }
				condition = { type = not value = { type = year value = 1250 } }
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.05 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 0.15
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 3
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antioch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 802 #Alexandria
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 197 #Toledo
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 171 #Valencia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 199 #Burgos
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 5
		}
		modifier = {
			condition = { 	type = province 
				province = 180 #Granada
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 179 #Almansa
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 178 #La Mancha
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 182 #Sevilla
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 183 #Axacena
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 184 #Badajoz
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 196 #Calatrava
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}

		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # Deus Vult!
		ai_chance = 75
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 1.1
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 1.05
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 1.1
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = crusade value = 181 } #Codoba
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 50 }
		effect = { type = add_trait value = zealous }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # They are harmless enough
		ai_chance = 25
		modifier = {
			condition = { type = not value = { type = piety value = 75 } }
			factor = 0.25
		}
		modifier = {
			condition = { type = not value = { type = prestige value = 150 } }
			factor = 0.25
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = add_trait value = sceptical }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = excommunicated }
		}
	}
}

character_event = { #end the Cordoba crusade - Cordoba not in Christian hands
	id = 1571
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 181 } #Cordoba
		condition = { type = papacy }
		condition = { 	type = province 
			province = 181 #Cordoba
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 20

		modifier = {
			condition = { 	type = province 
				province = 180 #Granada
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 179 #Almansa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 178 #La Mancha
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 182 #Sevilla
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 183 #Axacena
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 184 #Badajoz
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 196 #Calatrava
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 197 #Toledo
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
	}

	action_a = { # let us continue this holy crusade
		ai_chance = 50
			modifier = { 
				condition = { type = culture value = Castillan }
				factor = 1.1
			}
			modifier = { 
				condition = { type = culture value = Catalan }
				factor = 1.05
			}
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.1
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = { type = add_trait value = crusader }
	}
	action_b = { # Our cause is lost!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -75 }
		effect = { type = prestige value = -75 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = excommunicated }
		}
	}
}
character_event = { #end the Cordoba crusade - Cordoba in Christian hands
	id = 1572
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 181 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 181 #Cordoba
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 48


		modifier = {
			condition = { 	type = province 
				province = 181 #Cordoba
				condition = { type = religion value = catholic }
			}
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 180 #Granada
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 179 #Almansa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 178 #La Mancha
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 182 #Sevilla
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 183 #Axacena
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 184 #Badajoz
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 

				province = 196 #Calatrava
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 197 #Toledo
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
	}
	immidiate = { #Cordoba is saved!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1573
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 181 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 178 } # La Mancha
			condition = { type = province value = 179 } # Almansa
			condition = { type = province value = 180 } # Granada
			condition = { type = province value = 181 } # Cordoba
			condition = { type = province value = 182 } # Sevilla
			condition = { type = province value = 183 } # Aracena
			condition = { type = province value = 184 } # Badajoz
			condition = { type = province value = 196 } # Calatrava
			condition = { type = province value = 197 } # Toledo
			}
		}

	mean_time_to_happen = {
		months = 4000

		modifier = {
			condition = {
			type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = province value = 181 }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.8
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = cruel }
			factor = 0.99
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = reckless }
			factor = 0.95
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = merciful }
			factor = 1.15
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = { # Less bothered about religious differences
			condition = { type = trait value = sceptical }
			factor = 2
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = heretic }
			factor = 10
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = excommunicated }
			factor = 100
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 50 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 100 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 200 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 500 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 1000 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = martial_cleric }
					}
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = scholarly_theologian }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = mastermind_theologian }
					}
				}
			factor = 0.85
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
		modifier = {
			condition = { type = trait value = cruel }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = arbitrary }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 25 }
				}
			factor = 0.5
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.166 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = { type = burgher_loyalty value = -0.25 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 25 }
		effect = { type = ruler_prestige value = -25 }
		effect = {
			type = random
			chance = 50
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = scholarly_theologian }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 1.25
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 10 }
				}
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 8 }
			factor = 1.5
		}
		effect = { type = ruler_gold scale = -0.083 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.2 }
		effect = { type = burgher_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = { # Revolt is really nasty, so lowered the chance to balance it with A
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 20
		modifier = {
			condition = { type = trait value = heretic }
			factor = 2.5
		}
		modifier = {
			condition = { type = trait value = excommunicated }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_piety value = 25	}
				}
			factor = 0.5
		}
		modifier = { # Less likely to pick non-converting option for crusade target
			condition = { type = province value = 181 }
			factor = 0.1
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = {
			type = random
			chance = 50 #hard to guess how the pope will view your lack of zeal
			effect = { type = ruler_piety value = -50 }
		}
		effect = {
			type = random
			chance = 20 #pope may declare anathema
			effect = { type = add_province_effect value = heretic }
		}
		effect = {
			type = random
			chance = 5 #a province under weak guidance could revolt
			effect = { type = add_province_effect value = revolt }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1574
#


##############
# Toledo! #
##############

character_event = { #Crusade to free Toledo
	id = 1580
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 197 #Toledo
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 1200

		modifier = {
			condition = { type = not value = { type = year value = 1075 } }
			factor = 50
		}
		modifier = {
			condition = { type = not value = { type = year value = 1150 } }
			factor = 5
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1150 }
				condition = { type = not value = { type = year value = 1250 } }
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.05 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 0.1
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 0.2
		}

		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 3
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antioch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 802 #Alexandria
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 199 #Burgos
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 3
		}
		modifier = {
			condition = { 	type = province 
				province = 192 #Salamanca
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 194 #Plasencia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 195 #Caceres
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 184 #Badajoz
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 196 #Calstrava
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 178 #La Mancha
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 177 #Cuenca
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 176 #Molina
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 181 #Codoba
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}

		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # Deus Vult!
		ai_chance = 75
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 1.1
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 1.05
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 1.1
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = crusade value = 197 } #Toledo
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 50 }
		effect = { type = add_trait value = zealous }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # They are harmless enough
		ai_chance = 25
		modifier = {
			condition = { type = not value = { type = piety value = 75 } }
			factor = 0.25
		}
		modifier = {
			condition = { type = not value = { type = prestige value = 150 } }
			factor = 0.25
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = add_trait value = sceptical }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = excommunicated }
		}
	}
}

character_event = { #end the Toledo crusade - Toledo not in Christian hands
	id = 1581
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 197 } #Toledo
		condition = { type = papacy }
		condition = { 	type = province 
			province = 197 #Toledo
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 20

		modifier = {
			condition = { 	type = province 
				province = 192 #Salamanca
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 194 #Plasencia
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 195 #Caceres
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 

				province = 184 #Badajoz
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 196 #Calstrava
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 178 #La Mancha
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 177 #Cuenca
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 176 #Molina
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 181 #Codoba
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
	}

	action_a = { # let us continue this holy crusade
		ai_chance = 50
			modifier = { 
				condition = { type = culture value = Castillan }
				factor = 1.1
			}
			modifier = { 
				condition = { type = culture value = Catalan }
				factor = 1.05
			}
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.1
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = { type = add_trait value = crusader }
	}
	action_b = { # Our cause is lost!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -75 }
		effect = { type = prestige value = -75 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = excommunicated }
		}
	}

}
character_event = { #end the Toledo crusade - Toledo in Christian hands
	id = 1582
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 197 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 197 #Toledo
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = { 	type = province 
				province = 197 #Toledo
				condition = { type = religion value = catholic }
			}
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 192 #Salamanca
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 194 #Plasencia
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 195 #Caceres
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 184 #Badajoz
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 196 #Calstrava
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 178 #La Mancha
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 177 #Cuenca
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 176 #Molina
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 181 #Codoba
				condition = {
					type = or 
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
	}
	immidiate = { #Toledo is saved!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1583
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 197 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 197 } # Toledo
			condition = { type = province value = 192 } # Salamance
			condition = { type = province value = 194 } # Plasencia
			condition = { type = province value = 195 } # Caceres
			condition = { type = province value = 184 } # Badajoz
			condition = { type = province value = 196 } # Calatrava
			condition = { type = province value = 177 } # La Mancha
			condition = { type = province value = 178 } # Cuenca
			condition = { type = province value = 176 } # Molina
			condition = { type = province value = 181 } # Cordoba
			}
		}

	mean_time_to_happen = {
		months = 4000

		modifier = {
			condition = {
			type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = province value = 197 }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.8
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = cruel }
			factor = 0.99
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = reckless }
			factor = 0.95
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = merciful }
			factor = 1.15
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = { # Less bothered about religious differences
			condition = { type = trait value = sceptical }
			factor = 2
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = heretic }
			factor = 10
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = excommunicated }
			factor = 100
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 50 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 100 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 200 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 500 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 1000 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = martial_cleric }
					}
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = scholarly_theologian }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = mastermind_theologian }
					}
				}
			factor = 0.85
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
		modifier = {
			condition = { type = trait value = cruel }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = arbitrary }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 25 }
				}
			factor = 0.5
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.166 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = { type = burgher_loyalty value = -0.25 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 25 }
		effect = { type = ruler_prestige value = -25 }
		effect = {
			type = random
			chance = 50
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = scholarly_theologian }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 1.25
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 10 }
				}
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 8 }
			factor = 1.5
		}
		effect = { type = ruler_gold scale = -0.083 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.2 }
		effect = { type = burgher_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = { # Revolt is really nasty, so lowered the chance to balance it with A
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 20
		modifier = {
			condition = { type = trait value = heretic }
			factor = 2.5
		}
		modifier = {
			condition = { type = trait value = excommunicated }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_piety value = 25	}
				}
			factor = 0.5
		}
		modifier = { # Less likely to pick non-converting option for crusade target
			condition = { type = province value = 197 }
			factor = 0.1
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = {
			type = random
			chance = 50 #hard to guess how the pope will view your lack of zeal
			effect = { type = ruler_piety value = -50 }
		}
		effect = {
			type = random
			chance = 20 #pope may declare anathema
			effect = { type = add_province_effect value = heretic }
		}
		effect = {
			type = random
			chance = 5 #a province under weak guidance could revolt
			effect = { type = add_province_effect value = revolt }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1584
#



##############
# Lisboa! #
##############

character_event = { #Crusade to free Lisboa
	id = 1590
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 160 #Lisboa
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 1200

		modifier = {
			condition = { type = not value = { type = year value = 1075 } }
			factor = 50
		}
		modifier = {
			condition = { type = not value = { type = year value = 1150 } }
			factor = 5
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1150 }
				condition = { type = not value = { type = year value = 1250 } }
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.05 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 0.15
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 0.25
		}

		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 3
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antioch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 802 #Alexandria
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 199 #Burgos
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 5
		}
		modifier = {
			condition = { 	type = province 
				province = 197 #Toledo
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 171 #Valencia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 181 #Cordoba
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 159 #Coimbra
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 186 #Evora
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 161 #Alcacer du Sol
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 162 #Silves
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 185 #Tortola
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 193 #Alcanatara
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 187 #Castelo Branco
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 188 #Braganza
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 158 #Porto
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 157 #Santiago
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 156 #Compostella
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}

		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # Deus Vult!
		ai_chance = 75
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 1.1
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 1.05
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 1.1
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = crusade value = 160 } #Lisboa
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 50 }
		effect = { type = add_trait value = zealous }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # They are harmless enough
		ai_chance = 25
		modifier = {
			condition = { type = not value = { type = piety value = 75 } }
			factor = 0.25
		}
		modifier = {
			condition = { type = not value = { type = prestige value = 150 } }
			factor = 0.25
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = add_trait value = sceptical }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = excommunicated }
		}
	}
}

character_event = { #end the Lisboa crusade - Lisboa not in Christian hands
	id = 1591
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 160 } #Lisboa
		condition = { type = papacy }
		condition = { 	type = province 
			province = 160 #Lisboa
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 20

		modifier = {
			condition = { 	type = province 
				province = 159 #Coimbra
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 186 #Evora
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 161 #Alcacer du Sol
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 162 #Silves
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 185 #Tortola
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 193 #Alcanatara
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 187 #Castelo Branco
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 188 #Braganza
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 158 #Porto
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 157 #Santiago
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 156 #Compostella
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
	}

	action_a = { # let us continue this holy crusade
		ai_chance = 50
			modifier = { 
				condition = { type = culture value = Castillan }
				factor = 1.1
			}
			modifier = { 
				condition = { type = culture value = Catalan }
				factor = 1.05
			}
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.1
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = { type = add_trait value = crusader }
	}
	action_b = { # Our cause is lost!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -75 }
		effect = { type = prestige value = -75 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = excommunicated }
		}
	}
}
character_event = { #end the Lisboa crusade - Lisboa in Christian hands
	id = 1592
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 160 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 160 #Lisboa
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = { 	type = province 
				province = 160 #Lisboa
				condition = { type = religion value = catholic }
			}
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 159 #Coimbra
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }

				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 186 #Evora
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 161 #Alcacer du Sol
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 162 #Silves
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 185 #Tortola
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 193 #Alcanatara
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 187 #Castelo Branco
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 188 #Braganza
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 158 #Porto
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 157 #Santiago
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 156 #Compostella
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
	}
	immidiate = { #Lisboa is saved!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1593
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 160 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 160 } # Lisboa
			condition = { type = province value = 159 } # Coimbra
			condition = { type = province value = 186 } # Evora
			condition = { type = province value = 161 } # Alcacer do Sal
			condition = { type = province value = 162 } # Silves
			condition = { type = province value = 185 } # Tortola
			condition = { type = province value = 193 } # Alcantara
			condition = { type = province value = 187 } # Castelo Branco
			condition = { type = province value = 188 } # Braganza
			condition = { type = province value = 158 } # Porto
			condition = { type = province value = 157 } # Santiago
			condition = { type = province value = 156 } # Compostela
			}
		}

	mean_time_to_happen = {
		months = 4000

		modifier = {
			condition = {
			type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = province value = 160 }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.8
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = cruel }
			factor = 0.99
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = reckless }
			factor = 0.95
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = merciful }
			factor = 1.15
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = { # Less bothered about religious differences
			condition = { type = trait value = sceptical }
			factor = 2
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = heretic }
			factor = 10
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = excommunicated }
			factor = 100
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 50 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 100 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 200 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 500 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 1000 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = martial_cleric }
					}
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = scholarly_theologian }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = mastermind_theologian }
					}
				}
			factor = 0.85
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
		modifier = {
			condition = { type = trait value = cruel }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = arbitrary }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 25 }
				}
			factor = 0.5
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.166 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = { type = burgher_loyalty value = -0.25 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 25 }
		effect = { type = ruler_prestige value = -25 }
		effect = {
			type = random
			chance = 50
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = scholarly_theologian }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 1.25
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 10 }
				}
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 8 }
			factor = 1.5
		}
		effect = { type = ruler_gold scale = -0.083 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.2 }
		effect = { type = burgher_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = { # Revolt is really nasty, so lowered the chance to balance it with A
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 20
		modifier = {
			condition = { type = trait value = heretic }
			factor = 2.5
		}
		modifier = {
			condition = { type = trait value = excommunicated }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_piety value = 25	}
				}
			factor = 0.5
		}
		modifier = { # Less likely to pick non-converting option for crusade target
			condition = { type = province value = 160 }
			factor = 0.1
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = {
			type = random
			chance = 50 #hard to guess how the pope will view your lack of zeal
			effect = { type = ruler_piety value = -50 }
		}
		effect = {
			type = random
			chance = 20 #pope may declare anathema
			effect = { type = add_province_effect value = heretic }
		}
		effect = {
			type = random
			chance = 5 #a province under weak guidance could revolt
			effect = { type = add_province_effect value = revolt }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1594
#



##############
# Valencia! #
##############

character_event = { #Crusade to free Valencia
	id = 1600
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 171 #Valencia
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 1200

		modifier = {
			condition = { type = not value = { type = year value = 1075 } }
			factor = 50
		}
		modifier = {
			condition = { type = not value = { type = year value = 1150 } }
			factor = 5
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1150 }
				condition = { type = not value = { type = year value = 1250 } }
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.05 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 0.15
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 0.2
		}

		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 3
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antioch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 802 #Alexandria
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 199 #Burgos
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 197 #Toldedo
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 170 #Denia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 179 #Alamansa
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 178 #La Mancha
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 177 #Cuenca
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 172 #Castellon
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 202 #Zaragosa
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 204 #Barcellona
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 173 #Tarragona
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 174 #Albarracin
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 203 #Lleida
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 175 #Calatayud
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 176 #Molina
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}

		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # Deus Vult!
		ai_chance = 75
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 1.1
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 1.05
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 1.1
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = crusade value = 171 } #Valencia
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 50 }
		effect = { type = add_trait value = zealous }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # They are harmless enough
		ai_chance = 25
		modifier = {
			condition = { type = not value = { type = piety value = 75 } }
			factor = 0.25
		}
		modifier = {
			condition = { type = not value = { type = prestige value = 150 } }
			factor = 0.25
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = add_trait value = sceptical }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = excommunicated }
		}
	}
}

character_event = { #end the Valencia crusade - Valencia not in Christian hands
	id = 1601
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 171 } #Valencia
		condition = { type = papacy }
		condition = { 	type = province 
			province = 171 #Valencia
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 20

		modifier = {

			condition = { 	type = province 
				province = 170 #Denia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 179 #Alamansa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 178 #La Mancha
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 177 #Cuenca
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 172 #Castellon
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 202 #Zaragosa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}

			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 204 #Barcellona
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 173 #Tarragona
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 174 #Albarracin
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 203 #Lleida
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 175 #Calatayud
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 176 #Molina
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
	}

	action_a = { # let us continue this holy crusade
		ai_chance = 50
			modifier = { 
				condition = { type = culture value = Castillan }
				factor = 1.1
			}
			modifier = { 
				condition = { type = culture value = Catalan }
				factor = 1.05
			}
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.1
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = { type = add_trait value = crusader }
	}
	action_b = { # Our cause is lost!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -75 }
		effect = { type = prestige value = -75 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = excommunicated }
		}
	}
}
character_event = { #end the Valencia crusade - Valencia in Christian hands
	id = 1602
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 171 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 171 #Valencia
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = { 	type = province 
				province = 171 #Valencia
				condition = { type = religion value = catholic }
			}
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 170 #Denia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 179 #Alamansa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 178 #La Mancha
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 177 #Cuenca
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 172 #Castellon
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 202 #Zaragosa
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 204 #Barcellona
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 173 #Tarragona
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 174 #Albarracin

				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 203 #Lleida
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 175 #Calatayud
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 176 #Molina
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.85
		}
	}
	immidiate = { #Valencia is saved!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1603
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 171 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 171 } # Valencia
			condition = { type = province value = 170 } # Denia
			condition = { type = province value = 179 } # Almansa
			condition = { type = province value = 178 } # La Mancha
			condition = { type = province value = 177 } # Cuenca
			condition = { type = province value = 172 } # Castellon
			condition = { type = province value = 202 } # Zaragoza
			condition = { type = province value = 204 } # Barcelona
			condition = { type = province value = 173 } # Tarragona
			condition = { type = province value = 174 } # Albaraccin
			condition = { type = province value = 203 } # Lleida
			condition = { type = province value = 175 } # Calatayud
			condition = { type = province value = 176 } # Molina
			}
		}

	mean_time_to_happen = {
		months = 4000

		modifier = {
			condition = {
			type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = province value = 171 }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.8
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = cruel }
			factor = 0.99
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = reckless }
			factor = 0.95
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = merciful }
			factor = 1.15
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = { # Less bothered about religious differences
			condition = { type = trait value = sceptical }
			factor = 2
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = heretic }
			factor = 10
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = excommunicated }
			factor = 100
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 50 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 100 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 200 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 500 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 1000 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = martial_cleric }
					}
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = scholarly_theologian }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = mastermind_theologian }
					}
				}
			factor = 0.85
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
		modifier = {
			condition = { type = trait value = cruel }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = arbitrary }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 25 }
				}
			factor = 0.5
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.166 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = { type = burgher_loyalty value = -0.25 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 25 }
		effect = { type = ruler_prestige value = -25 }
		effect = {
			type = random
			chance = 50
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = scholarly_theologian }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 1.25
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 10 }
				}
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 8 }
			factor = 1.5
		}
		effect = { type = ruler_gold scale = -0.083 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.2 }
		effect = { type = burgher_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = { # Revolt is really nasty, so lowered the chance to balance it with A
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 20
		modifier = {
			condition = { type = trait value = heretic }
			factor = 2.5
		}
		modifier = {
			condition = { type = trait value = excommunicated }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_piety value = 25	}
				}
			factor = 0.5
		}
		modifier = { # Less likely to pick non-converting option for crusade target
			condition = { type = province value = 171 }
			factor = 0.1
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = {
			type = random
			chance = 50 #hard to guess how the pope will view your lack of zeal
			effect = { type = ruler_piety value = -50 }
		}
		effect = {
			type = random
			chance = 20 #pope may declare anathema
			effect = { type = add_province_effect value = heretic }
		}
		effect = {
			type = random
			chance = 5 #a province under weak guidance could revolt
			effect = { type = add_province_effect value = revolt }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1604
#



##############
# Cadiz! #
##############

character_event = { #Crusade to free Cadiz
	id = 1610
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 165 #Cadiz
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 2000

		modifier = {
			condition = { type = not value = { type = year value = 1075 } }
			factor = 50
		}
		modifier = {
			condition = { type = not value = { type = year value = 1150 } }
			factor = 5
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1150 }
				condition = { type = not value = { type = year value = 1250 } }
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.05 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 0.15
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 0.25
		}

		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 3
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antioch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 802 #Alexandria
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 199 #Burgos
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 5
		}
		modifier = {
			condition = { 	type = province 
				province = 197 #Toledo
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 3
		}
		modifier = {
			condition = { 	type = province 
				province = 181 #Cordoba
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2.5
		}
		modifier = {
			condition = { 	type = province 
				province = 171 #Valencia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 160 #Lisboa
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.75
		}
		modifier = {
			condition = { 	type = province 
				province = 164 #Niebla
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 183 #Aracena
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 182 #Sevilla
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 167 #Malaga
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 166 #Algeciras
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 180 #Granada
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.8
		}


		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}

	}
	action_a = { # Deus Vult!
		ai_chance = 75
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 1.1
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 1.05
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 1.1
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = crusade value = 165 } #Cadiz
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 50 }
		effect = { type = add_trait value = zealous }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # They are harmless enough
		ai_chance = 25
		modifier = {
			condition = { type = not value = { type = piety value = 75 } }
			factor = 0.25
		}
		modifier = {
			condition = { type = not value = { type = prestige value = 150 } }
			factor = 0.25
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = add_trait value = sceptical }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = excommunicated }
		}
	}
}

character_event = { #end the Cadiz crusade - Cadiz not in Christian hands
	id = 1611
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 165 } #Cadiz
		condition = { type = papacy }
		condition = { 	type = province 
			province = 165 #Cadiz
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 20

		modifier = {
			condition = { 	type = province 
				province = 164 #Niebla
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 183 #Aracena
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 182 #Sevilla
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 167 #Malaga
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9

		}
		modifier = {
			condition = { 	type = province 
				province = 166 #Algeciras
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 180 #Granada
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
	}

	action_a = { # let us continue this holy crusade
		ai_chance = 50
			modifier = { 
				condition = { type = culture value = Castillan }
				factor = 1.1
			}
			modifier = { 
				condition = { type = culture value = Catalan }
				factor = 1.05
			}
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.1
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = { type = add_trait value = crusader }
	}
	action_b = { # Our cause is lost!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -75 }
		effect = { type = prestige value = -75 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = excommunicated }
		}
	}
}
character_event = { #end the Cadiz crusade - Cadiz in Christian hands
	id = 1612
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 165 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 165 #Cadiz
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = { 	type = province 
				province = 165 #Cadiz
				condition = { type = religion value = catholic }
			}
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 164 #Niebla
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 183 #Aracena
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 182 #Sevilla
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 167 #Malaga
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 166 #Algeciras
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 180 #Granada
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.5
		}
	}
	immidiate = { #Cadiz is saved!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}

province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1613
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 165 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 165 } # Cadiz
			condition = { type = province value = 164 } # Niebla
			condition = { type = province value = 183 } # Aracena
			condition = { type = province value = 182 } # Sevilla
			condition = { type = province value = 167 } # Malaga
			condition = { type = province value = 166 } # Algeciras
			condition = { type = province value = 180 } # Granada
			}
		}

	mean_time_to_happen = {
		months = 4000

		modifier = {
			condition = {
			type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = province value = 165 }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.8
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = cruel }
			factor = 0.99
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = reckless }
			factor = 0.95
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = merciful }
			factor = 1.15
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = { # Less bothered about religious differences
			condition = { type = trait value = sceptical }
			factor = 2
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = heretic }
			factor = 10
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = excommunicated }
			factor = 100
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 50 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 100 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 200 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 500 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 1000 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = martial_cleric }
					}
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = scholarly_theologian }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = mastermind_theologian }
					}
				}
			factor = 0.85
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
		modifier = {
			condition = { type = trait value = cruel }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = arbitrary }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 25 }
				}
			factor = 0.5
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.166 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = { type = burgher_loyalty value = -0.25 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 25 }
		effect = { type = ruler_prestige value = -25 }
		effect = {
			type = random
			chance = 50
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = scholarly_theologian }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 1.25
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 10 }
				}
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 8 }
			factor = 1.5
		}
		effect = { type = ruler_gold scale = -0.083 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.2 }
		effect = { type = burgher_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = { # Revolt is really nasty, so lowered the chance to balance it with A
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 20
		modifier = {
			condition = { type = trait value = heretic }
			factor = 2.5
		}
		modifier = {
			condition = { type = trait value = excommunicated }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_piety value = 25	}
				}
			factor = 0.5
		}
		modifier = { # Less likely to pick non-converting option for crusade target
			condition = { type = province value = 165 }
			factor = 0.1
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = {
			type = random
			chance = 50 #hard to guess how the pope will view your lack of zeal
			effect = { type = ruler_piety value = -50 }
		}
		effect = {
			type = random
			chance = 20 #pope may declare anathema
			effect = { type = add_province_effect value = heretic }
		}
		effect = {
			type = random
			chance = 5 #a province under weak guidance could revolt
			effect = { type = add_province_effect value = revolt }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1614
#



##############
# Burgos! #
##############

character_event = { #Crusade to free Burgos
	id = 1620
	picture = "event_crusades"

	trigger = {
		condition = { type = exists value = PAPA }
		condition = { 
			type = not	
			value = { type = crusade } 
		}
		condition = {
			type = or
			condition = { type = papacy }
			condition = {
				type = and
				condition = { type = is_independent }
				condition = { type = not value = { type = county } }
				condition = { type = not value = { type = trait value = excommunicated } }
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = not value = { type = trait value = sceptical } }
			}
		}
		condition = { 	type = religion value = catholic }
		condition = { 	type = province 
			province = 199 #Burgos
			condition = {
				type = and
				condition = { type = not value = { type = ruler_religion value = catholic }}
				condition = { type = not value = { type = ruler_religion value = orthodox }}
			}
		}
	}

	mean_time_to_happen = {
		years = 1050

		modifier = {
			condition = { type = not value = { type = year value = 1075 } }
			factor = 50
		}
		modifier = {
			condition = { type = not value = { type = year value = 1150 } }
			factor = 5
		}
		modifier = {
			condition = {
				type = and
				condition = { type = year value = 1150 }
				condition = { type = not value = { type = year value = 1250 } }
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = papacy }
			factor = 0.05 #papal controller is most likely to call it
		}
		modifier = {
			condition = { type = not value = { type = papacy  } }
			condition = { type = duchy }
			factor = 10 #a duke unlikely to call one
		}
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 0.1
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 0.1
		}

		modifier = {
			condition = { 	type = province 
				province = 774 #Jerusalem
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 3
		}
		modifier = {
			condition = { 	type = province 
				province = 764 #Antioch
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 2
		}
		modifier = {
			condition = { 	type = province 
				province = 802 #Alexandria
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 1.5
		}
		modifier = {
			condition = { 	type = province 
				province = 190 #Leon
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 155 #Asturios de Ovieda
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 156 #Compostella
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 156 #Santiago
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 154 #Astias de Santillana
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 153 #Viscaya
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 201 #Rioja
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85

		}
		modifier = {
			condition = { 	type = province 
				province = 200 #Sorja
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 198 #Valladolid
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 176 #Molina
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 207 #Jaca
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 152 #Navarra
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 197 #Toledo
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 171 #Valencia
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 181 #Cordoba
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 182 #Sevilla
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 180 #Granada
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { 	type = province 
				province = 160 #Lisboa
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { 	type = province 
				province = 165 #Cadiz
				condition = {
					type = and
					condition = { type = not value = { type = ruler_religion value = catholic }}
					condition = { type = not value = { type = ruler_religion value = orthodox }}
				}
			}
			factor = 0.5
		}

		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = martial_cleric}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.95
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 25 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.9
		}
	}
	action_a = { # Deus Vult!
		ai_chance = 80
		modifier = { 
			condition = { type = culture value = Castillan }
			factor = 1.1
		}
		modifier = { 
			condition = { type = culture value = Catalan }
			factor = 1.05
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 1.1
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = crusade value = 199 } #Burgos
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 50 }
		effect = { type = add_trait value = zealous }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = crusader }
		}
	}
	action_b = { # They are harmless enough
		ai_chance = 25
		modifier = {
			condition = { type = not value = { type = piety value = 75 } }
			factor = 0.25
		}
		modifier = {
			condition = { type = not value = { type = prestige value = 150 } }
			factor = 0.25
		}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = piety value = -50 }
		effect = { type = prestige value = -100 }
		effect = { type = add_trait value = sceptical }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = excommunicated }
		}
	}
}

character_event = { #end the Burgos crusade - Burgos not in Christian hands
	id = 1621
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 199 } #Burgos
		condition = { type = papacy }
		condition = { 	type = province 
			province = 199 #Burgos
			condition = {
				type = and 
				condition = { type = not value = { type = ruler_religion value = catholic } }
				condition = { type = not value = { type = ruler_religion value = orthodox } }
			}
		}
	}

	mean_time_to_happen = {
		years = 20

		modifier = {
			condition = { 	type = province 
				province = 190 #Leon
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 155 #Asturios de Ovieda
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 156 #Compostella
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 156 #Santiago
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 154 #Astias de Santillana
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 153 #Viscaya
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 201 #Rioja
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 200 #Sorja
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 198 #Valladolid
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.95
		}
		modifier = {
			condition = { 	type = province 
				province = 176 #Molina
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 207 #Jaca
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 152 #Navarra
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 197 #Toledo
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 171 #Valencia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 181 #Cordoba
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 182 #Sevilla
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 180 #Granada
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
	}

	action_a = { # let us continue this holy crusade
		ai_chance = 50
			modifier = { 
				condition = { type = culture value = Castillan }
				factor = 1.1
			}
			modifier = { 
				condition = { type = culture value = Catalan }
				factor = 1.05
			}
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 1.1
			}
			modifier = {
				condition = { type = trait value = crusader }
				factor = 1.2
			}
			modifier = {
				condition = { type = trait value = zealous }
				factor = 1.1
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = { type = add_trait value = crusader }
	}
	action_b = { # Our cause is lost!
		ai_chance = 50
			modifier = {
				condition = { type = not value = { type = piety value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = not value = { type = prestige value = 75 } }
				factor = 0.5
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = crusade value = 0 }
		effect = { type = piety value = -75 }
		effect = { type = prestige value = -75 }
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = sceptical }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = excommunicated }
		}
	}
}
character_event = { #end the Burgos crusade - Burgos in Christian hands
	id = 1622
	picture = "event_crusades"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 199 }
		condition = { type = papacy } # once started, only the papal controller can call off a crusade
		condition = { 	type = province 
			province = 199 #Burgos
			condition = {
				type = or 
				condition = { type = ruler_religion value = catholic }
				condition = { type = ruler_religion value = orthodox }
			}
		}
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = { 	type = province 
				province = 199 #Burgos
				condition = { type = religion value = catholic }
			}
			factor = 0.25
		}
		modifier = {
			condition = { 	type = province 
				province = 190 #Leon
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 155 #Asturios de Ovieda
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 156 #Compostella
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 156 #Santiago
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 154 #Astias de Santillana
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 153 #Viscaya
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 201 #Rioja
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 200 #Sorja
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 198 #Valladolid
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { 	type = province 
				province = 176 #Molina
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 207 #Jaca
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 152 #Navarra
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 197 #Toledo
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 171 #Valencia
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 181 #Cordoba
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 
				province = 182 #Sevilla
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { 	type = province 

				province = 180 #Granada
				condition = {
					type = or
					condition = { type = ruler_religion value = catholic }
					condition = { type = ruler_religion value = orthodox }
				}
			}
			factor = 0.8
		}
	}
	immidiate = { #Burgos is saved!
		effect = { type = crusade value = 0 } #turn off crusades
	}
}


province_event = { #The Pope urges you to convert these captured lands to the one true faith
	id = 1623
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = { type = target value = 199 } 
		condition = { type = ruler_religion value = catholic }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = or
			condition = { type = province value = 199 } # Burgos
			condition = { type = province value = 190 } # Leon
			condition = { type = province value = 155 } # Asturias de Oviedo
			condition = { type = province value = 156 } # Compostela
			condition = { type = province value = 157 } # Santiago
			condition = { type = province value = 154 } # Asturias de Santillana
			condition = { type = province value = 153 } # Viscaya
			condition = { type = province value = 201 } # Rioja
			condition = { type = province value = 200 } # Soria
			condition = { type = province value = 198 } # Valldolid
			condition = { type = province value = 176 } # Molina
			condition = { type = province value = 152 } # Navarra
			condition = { type = province value = 207 } # Jaca
			condition = { type = province value = 197 } # Toledo
			condition = { type = province value = 171 } # Valencia
			condition = { type = province value = 181 } # Cordoba
			condition = { type = province value = 182 } # Sevilla
			condition = { type = province value = 180 } # Granada
			}
		}

	mean_time_to_happen = {
		months = 4000

		modifier = {
			condition = {
			type = or
				condition = { type = trait value = ecclesiastical_education }
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = martial_cleric }
				condition = { type = trait value = mastermind_theologian }
				condition = { type = trait value = scholarly_theologian }
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = province value = 199 }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.8
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = cruel }
			factor = 0.99
		}
		modifier = { # More willing to use force against his subjects
			condition = { type = trait value = reckless }
			factor = 0.95
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = merciful }
			factor = 1.15
		}
		modifier = { # Less willing to use force against his subjects
			condition = { type = trait value = just }
			factor = 1.1
		}
		modifier = { # Less bothered about religious differences
			condition = { type = trait value = sceptical }
			factor = 2
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = heretic }
			factor = 10
		}
		modifier = { # Finds harder to get clerics to support converting effort
			condition = { type = trait value = excommunicated }
			factor = 100
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 50 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 100 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 200 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 500 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = piety value = 1000 }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = martial_cleric }
					}
				}
			factor = 0.85
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = scholarly_theologian }
					}
				}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chaplain_csc
					condition = { type = trait value = mastermind_theologian }
					}
				}
			factor = 0.85
		}
	}

	action_a = { #I will see to it that they convert, or die!
		ai_chance = 40
		modifier = {
			condition = { type = trait value = cruel }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = arbitrary }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 25 }
				}
			factor = 0.5
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 100
			}
		effect = { type = ruler_gold scale = -0.166 }
		effect = { type = religion value = catholic }
		effect = { type = prosperity value = -2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = { type = burgher_loyalty value = -0.25 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = { type = clergy_power value = 0.25 }
		effect = { type = noble_power value = 0.25 }
		effect = { type = ruler_piety value = 25 }
		effect = { type = ruler_prestige value = -25 }
		effect = {
			type = random
			chance = 50
			effect = { type = add_province_effect value = looted }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_b = { #I will try to do my best to encourage them to convert
		ai_chance = 40
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = wise }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = scholarly_theologian }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 1.25
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_prestige value = 10 }
				}
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 8 }
			factor = 1.5
		}
		effect = { type = ruler_gold scale = -0.083 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_loyalty value = -0.2 }
		effect = { type = burgher_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = 0.1 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = ruler_prestige value = -10 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 10 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
		}
		effect = { # Revolt is really nasty, so lowered the chance to balance it with A
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_c = { #I am a little too busy crusading to do that at the moment
		ai_chance = 20
		modifier = {
			condition = { type = trait value = heretic }
			factor = 2.5
		}
		modifier = {
			condition = { type = trait value = excommunicated }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.5
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_piety value = 25	}
				}
			factor = 0.5
		}
		modifier = { # Less likely to pick non-converting option for crusade target
			condition = { type = province value = 199 }
			factor = 0.1
		}
			modifier = {
				condition = { type = or
					condition = { type = demesne value = PAPA }
					condition = { type = demesne value = TEMP }
					condition = { type = demesne value = HOSP }
					condition = { type = demesne value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = noble_power value = -0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = {
			type = random
			chance = 50 #hard to guess how the pope will view your lack of zeal
			effect = { type = ruler_piety value = -50 }
		}
		effect = {
			type = random
			chance = 20 #pope may declare anathema
			effect = { type = add_province_effect value = heretic }
		}
		effect = {
			type = random
			chance = 5 #a province under weak guidance could revolt
			effect = { type = add_province_effect value = revolt }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1624
#


##############################################################
##############################################################
## GENERAL FLAVOUR EVENTS FOR THE CRUSADES TO THE HOLY LAND ##
##############################################################
##############################################################

#
# RESERVED ID RANGE 1700-1799
#

###################################################
# The peasants flock to support your Holy Crusade #
###################################################

character_event = {
	id = 1700

	picture = "event_crusades"

	trigger = {
		condition = { type = ruler }
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 774 } #Jerusalem
			condition = { type = target value = 764 } #Antioch
			condition = { type = target value = 802 } #Alexandria
			condition = { type = target value = 817 } #Tunis
			condition = { type = target value = 496 } #Byzantion
			condition = { type = target value = 340 } #Sicily
		}
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = prestige value = 50 }
		condition = { type = capital
			condition = {
				type = and
				condition = { type = peasant_loyalty value = 0.75 }
				condition = { type = peasant_power value = 0.25 }
				condition = { type = religion value = catholic }
			}
		}
	}

	mean_time_to_happen = {
		months = 4800

		#check whether actively crusading and target is still in enemy hands
		modifier = {
			condition = { type = on_crusade }
			factor = 0.05
		}

		# power and loyalty check
		modifier = {
			condition = { type = capital
				condition = { type = peasant_loyalty value = 0.85 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = peasant_loyalty value = 0.95 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = peasant_power value = 0.35 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = peasant_power value = 0.45 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = peasant_power value = 0.6 }
			}
			factor = 0.9
		}

		#capital province conditions check
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { heretic = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { bubonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { pneumonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { malaria = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { dysentery = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { small_pox = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { typhoid_fever = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 10
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 5
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 0.75
		}

		#ruler check
		modifier = {
			condition = { type = prestige value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 10
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = has_law value = { royal_preorgatory_law = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_law value = { feudal_contract_law = yes } }
			factor = 2
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_law value = { regal_supremacy = yes } }
			factor = 1.25
		}

		#specific crusades modifiers
		modifier = {
			condition = { type = target value = 774 } #Jerusalem
			factor = 0.5
		}
		modifier = {
			condition = { type = target value = 764 } #Antioch
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 802 } #Alexandria
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 817 } #Tunis
			factor = 0.9
		}
		modifier = {
			condition = { type = target value = 496 } #Byzantion
			factor = 0.9
		}
		modifier = {
			condition = { type = target value = 340 } #Sicily
			factor = 0.95
		}


		#difficulty setting modifiers
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
	}

	action_a = {#Deus Vult!
		effect = { 	type = add_regiment #this to default to the character's culture and capital province tech level
				strength = {
					militia = 1000
					archers = 500
				}
		}
		effect = { 	type = add_regiment 
				strength = {
					militia = 800
				}
		}
#cost of this rem-ed out for now until the new effect is coded
#		effect = { type = prosperity for = capital value = -1 } #some of the troops come from your capital
		effect = {
			type = random
			chance = 50
			effect = { 	type = add_regiment 
					strength = {
							militia = 400
					}
			}
			effect = { 	type = add_regiment 
					strength = {
						militia = 400
					}
			}
	#		effect = { type = prosperity for = random value = -1 } #some come from the surrounding countryside
		}
	}

	action_b = {#I thank you, but you are more needed in the fields!
		effect = { type = prestige value = 10 }
		effect = { type = piety value = -20 }
#		effect = {
#			type = random
#			chance = 33
#			effect = { type = prosperity for = random value = 1 }
#		}
	}
}


##################################################
# The burgers unite to support your Holy Crusade #
##################################################

character_event = {
	id = 1701

	picture = "event_crusades"

	trigger = {
		condition = { type = ruler }
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 774 } #Jerusalem
			condition = { type = target value = 764 } #Antioch
			condition = { type = target value = 802 } #Alexandria
			condition = { type = target value = 817 } #Tunis
			condition = { type = target value = 496 } #Byzantion
			condition = { type = target value = 340 } #Sicily
		}
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = prestige value = 50 }
		condition = { type = capital
			condition = {
				type = and
				condition = { type = burgher_loyalty value = 0.75 }
				condition = { type = burgher_power value = 0.25 }
				condition = { type = religion value = catholic }
			}
		}
	}

	mean_time_to_happen = {
		months = 7200

		#check whether actively crusading and target is still in enemy hands
		modifier = {
			condition = { type = on_crusade }
			factor = 0.05
		}
		# power and loyalty check
		modifier = {
			condition = { type = capital
				condition = { type = burgher_loyalty value = 0.85 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = burgher_loyalty value = 0.95 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = burgher_power value = 0.35 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = burgher_power value = 0.45 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = burgher_power value = 0.6 }
			}
			factor = 0.9
		}

		#capital province conditions check
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { heretic = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { bubonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { pneumonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { malaria = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { dysentery = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { small_pox = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { typhoid_fever = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 10
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 5
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 0.75
		}

		#ruler check
		modifier = {
			condition = { type = prestige value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 10
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = amateurish_pettifogger }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = proven_dealbreaker }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = charismatic_negotiator }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = grey_eminence }
			factor = 0.75
		}
		modifier = {
			condition = { type = has_law value = { royal_preorgatory_law = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_law value = { feudal_contract_law = yes } }
			factor = 1.25
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 0.75
		}

		#specific crusades modifiers
		modifier = {
			condition = { type = target value = 774 } #Jerusalem
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 764 } #Antioch
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 802 } #Alexandria
			factor = 0.9
		}
		modifier = {
			condition = { type = target value = 817 } #Tunis
			factor = 0.9
		}
		modifier = {
			condition = { type = target value = 496 } #Byzantion
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 340 } #Sicily
			factor = 0.8
		}

		#difficulty setting modifiers
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
	}

	action_a = {#Deus Vult!
		effect = { 	type = add_regiment #this to default to the character's culture and capital province tech level
				strength = {
					archers = 400 
					heavy_inf = 400 
					pikemen = 1000 
				}
		}
		effect = { 	type = add_regiment 
				strength = {
					archers = 200 
					heavy_inf = 200 
					pikemen = 500 
				}
		}
#cost of this rem-ed out for now until the new effect is coded
#		effect = { type = prosperity for = capital value = -1 } #some of the troops come from your capital
		effect = {
			type = random
			chance = 50
			effect = { 	type = add_regiment 
					strength = {
						heavy_inf = 200 
						pikemen = 500 
					}
			}
			effect = { 	type = add_regiment 
					strength = {
					pikemen = 500 
					}
			}
#			effect = { type = prosperity for = random value = -1 } #some come from the surrounding countryside
		}
	}

	action_b = {#I thank you, but I would prefer a financial contribution!
		effect = { type = prestige value = -20 }
		effect = { type = piety value = -20 }
		effect = { type = gold value = 300 }
		effect = {
			type = random
			chance = 33
			effect = { type = gold scale = 1.5 }
		}
	}
}

#################################################
# The clergy strongly endorse your Holy Crusade #
#################################################

character_event = {
	id = 1702

	picture = "event_religion"

	trigger = {
		condition = { type = ruler }
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 774 } #Jerusalem
			condition = { type = target value = 764 } #Antioch
			condition = { type = target value = 802 } #Alexandria
			condition = { type = target value = 817 } #Tunis
			condition = { type = target value = 496 } #Byzantion
			condition = { type = target value = 340 } #Sicily
		}
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = not value = { type = trait value = sceptical }}
		condition = { type = not value = { type = trait value = kinslayer }}
		condition = { type = prestige value = 50 }
		condition = { type = piety value = 50 }
		condition = { type = capital
			condition = {
				type = and
				condition = { type = clergy_loyalty value = 0.75 }
				condition = { type = clergy_power value = 0.25 }
				condition = { type = religion value = catholic }
			}
		}
	}

	mean_time_to_happen = {
		months = 7200

		#check whether actively crusading and target is still in enemy hands
		modifier = {
			condition = { type = on_crusade }
			factor = 0.05
		}

		# power and loyalty check
		modifier = {
			condition = { type = capital
				condition = { type = clergy_loyalty value = 0.85 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = clergy_loyalty value = 0.95 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = clergy_power value = 0.35 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = clergy_power value = 0.45 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = clergy_power value = 0.6 }
			}
			factor = 0.9
		}

		#capital province conditions check
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { heretic = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { bubonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { pneumonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { malaria = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { dysentery = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { small_pox = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { typhoid_fever = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 10
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 5
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 0.75
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { templar_house = yes } }
			}
			factor = 0.85
		}

		#ruler check
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 10
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = detached_priest }
			factor = 0.95
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = scholarly_theologian }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_law value = { regal_supremacy = yes } }
			factor = 3
		}
		modifier = {
			condition = { type = has_law value = { monastic_supremacy = yes } }
			factor = 1.15
		}
		modifier = {
			condition = { type = has_law value = { ecclesical_balance = yes } }
			factor = 1.15
		}
		modifier = {
			condition = { type = has_law value = { church_supremacy = yes } }
			factor = 0.6
		}

		#specific crusades modifiers
		modifier = {
			condition = { type = target value = 774 } #Jerusalem
			factor = 0.4
		}
		modifier = {
			condition = { type = target value = 764 } #Antioch
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 802 } #Alexandria
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 817 } #Tunis
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 496 } #Byzantion
			factor = 0.9
		}
		modifier = {
			condition = { type = target value = 340 } #Sicily
			factor = 0.8
		}


		#difficulty setting modifiers
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
	}

	action_a = {#Deus Vult!
		effect = { 	type = add_regiment #this to default to the character's culture and capital province tech level
				strength = {
					heavy_cav = 400 
					light_cav = 400 
					archers = 300 
					heavy_inf = 300 
					pikemen = 300 
				}
		}
		effect = { 	type = add_regiment 
				strength = {
					heavy_cav = 200 
					light_cav = 300 
					heavy_inf = 500 
				}
		}
		effect = { type = add_trait value = crusader }
		effect = { type = add_trait value = zealous }
#cost of this rem-ed out for now until the new effect is coded
#		effect = { type = prosperity for = capital value = -1 } #some of the troops come from your capital
		effect = {
			type = random
			chance = 50
			effect = { 	type = add_regiment 
					strength = {
						heavy_cav = 300 
						light_cav = 400 
					}
			}
			effect = { 	type = add_regiment 
					strength = {
						heavy_inf = 300 
						pikemen = 400
					}
			}
#			effect = { type = prosperity for = random value = -1 } #some come from the surrounding countryside
		}
	}

	action_b = {#I thank you, but I'd prefer that you open the churchs coffers
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = { type = piety value = -40 }
		effect = { type = gold value = 150 }
		effect = {
			type = random
			chance = 33
			effect = { type = gold scale = 1.5 }
		}
	}
}

#################################################
# The nobility wishes to join your Holy Crusade #
#################################################

character_event = {
	id = 1703

	picture = "event_crusades"

	trigger = {
		condition = { type = ruler }
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 774 } #Jerusalem
			condition = { type = target value = 764 } #Antioch
			condition = { type = target value = 802 } #Alexandria
			condition = { type = target value = 817 } #Tunis
			condition = { type = target value = 496 } #Byzantion
			condition = { type = target value = 340 } #Sicily
		}
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = not value = { type = trait value = kinslayer }}
		condition = { type = prestige value = 100 }
		condition = { type = piety value = 25 }
		condition = { type = capital
			condition = {
				type = and
				condition = { type = noble_loyalty value = 0.75 }
				condition = { type = noble_power value = 0.25 }
				condition = { type = religion value = catholic }
			}
		}
	}

	mean_time_to_happen = {
		months = 9600

		#check whether actively crusading and target is still in enemy hands
		modifier = {
			condition = { type = on_crusade }
			factor = 0.05
		}

		# power and loyalty check
		modifier = {
			condition = { type = capital
				condition = { type = noble_loyalty value = 0.85 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = noble_loyalty value = 0.95 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = noble_power value = 0.35 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = noble_power value = 0.45 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = noble_power value = 0.6 }
			}
			factor = 0.9
		}

		#capital province conditions check
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { heretic = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { bubonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { pneumonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { malaria = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { dysentery = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { small_pox = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { typhoid_fever = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 10
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 5
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 0.75
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { traininggrounds = yes } }
			}
			factor = 0.95
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { medium_castle = yes } }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { large_castle = yes } }
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { huge_castle = yes } }
			}
			factor = 0.8
		}

		#ruler check
		modifier = {
			condition = { type = prestige value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 10
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = misguided_warrior }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = tough_soldier }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = knowledged_tactician }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = brilliant_strategist }
			factor = 0.75
		}
		modifier = {
			condition = { type = has_law value = { feudal_contract_law = yes } }
			factor = 0.75
		}
		modifier = {
			condition = { type = has_law value = { traditional_custom_law = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 1.5
		}

		#specific crusades modifiers
		modifier = {
			condition = { type = target value = 774 } #Jerusalem
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 764 } #Antioch
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 802 } #Alexandria
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 817 } #Tunis
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 496 } #Byzantion
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 340 } #Sicily
			factor = 0.9
		}

		#difficulty setting modifiers
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
	}

	action_a = {#Deus Vult!
		effect = { 	type = add_regiment #this to default to the character's culture and capital province tech level
				strength = {
					heavy_cav = 750
					light_cav = 750
				}
		}
		effect = { 	type = add_regiment 
				strength = {
					heavy_cav = 400 
					light_cav = 400 
					heavy_inf = 250 
				}
		}
#cost of this rem-ed out for now until the new effect is coded
#		effect = { type = prosperity for = capital value = -1 } #some of the troops come from your capital
		effect = {
			type = random
			chance = 50
			effect = { 	type = add_regiment 
					strength = {
						heavy_cav = 500 
						light_cav = 500 
					}
			}
			effect = { 	type = add_regiment 
					strength = {
						heavy_cav = 250 
						light_cav = 250 
				}
			}
#			effect = { type = prosperity for = random value = -1 } #some come from the surrounding countryside
		}
	}

	action_b = {#I thank you, but I'd prefer some gold instead
		effect = { type = prestige value = 50 }
		effect = { type = piety value = -20 }
		effect = { type = gold value = 300 }
		effect = {
			type = random
			chance = 33
			effect = { type = gold scale = 1.5 }
		}
	}
}

#
# NEXT EVENT IN THIS SERIES 1704
#


#######################################################
#######################################################
## COURT PURGES DURING THE CRUSADES TO THE HOLY LAND ##
#######################################################
#######################################################


###############################################
# Ruler must decide how to deal with heathens #
###############################################

character_event = { #My Lord, there is a Crusade to the Holy Land and yet you harbour a heathen in your court. The Pope has fobiddem this!

	id = 1751
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 774 } #Jerusalem
			condition = { type = target value = 764 } #Antioch
			condition = { type = target value = 802 } #Alexandria
			condition = { type = target value = 817 } #Tunis
			condition = { type = target value = 496 } #Byzantion
		}
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = ruler_child } }
		condition = { type = not value = { type = religion value = catholic } }
		condition = { type = not value = { type = religion value = orthodox } }
		condition = { type = not value = { type = trait value = ecclesiastical_education } }
		condition = { type = age value = 10 }
		condition = { 
			type = ruler_csc
			condition = { type = religion value = catholic }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = excommunicated } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = sceptical } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = zealous } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = merciful } }
		}
		#temporary spam fix - definitely needs to be reworked for 1.06
		condition = { type = or
			condition = { type = marshal }
			condition = { type = steward }
			condition = { type = chancellor }
			condition = { type = spymaster }
			condition = { type = chaplain }
		}
	}

	mean_time_to_happen = {

	months = 12

	}

	action_a = { #You shall convert, or die!
		ai_chance = 60
			modifier = {
				condition = { type = ruler_csc
					condition = { type = or
						condition = { type = title value = PAPA }
						condition = { type = title value = TEMP }
						condition = { type = title value = HOSP }
						condition = { type = title value = TEUT }
					}
				}
				factor = 100
			}
		effect = { #courtier refuses to convert and doesn't survive the inquisition
			type = random
			chance = 50
			effect = { type = death }
		}
		effect = { type = set_to_realm_religion } #if he survives, he converts
		effect = { #...but it might take a lot of persuasion
			type = random
			chance = 50
			effect = { type = add_trait value = war_invalid }
			effect = { type = add_trait value = illness }
			effect = { type = health value = -3 }
		}
		effect = { #...and he also find it an emotionally grueling experience
			type = random
			chance = 50
			effect = { type = add_trait value = stress_symptom }
		}
		effect = { #...and he probably won't appreciate the experience
			type = random
			chance = 75
			effect = { type = loyalty value = -0.5 }
		}
		effect = { type = trigger for = ruler value = 1754 }
	}
	action_b = { #You shall be bannished from my realm!
		ai_chance = 35
		effect = { type = courtier_defect value = none }
		effect = { type = trigger for = ruler value = 1755 }
	}
	action_c = { #I reject the pope's authority to influence my court!
		ai_chance = 5
			modifier = {
				condition = { type = ruler_csc
					condition = { type = or
						condition = { type = title value = PAPA }
						condition = { type = title value = TEMP }
						condition = { type = title value = HOSP }
						condition = { type = title value = TEUT }
					}
				}
				factor = 0.001
			}
		effect = { type = trigger for = ruler value = 1756 }
	}
}

#####################################
# Zealous Ruler Deals With Heathens #
#####################################

character_event = { #My Lord, there is a heathen living among us!

	id = 1752
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 774 } #Jerusalem
			condition = { type = target value = 764 } #Antioch
			condition = { type = target value = 802 } #Alexandria
			condition = { type = target value = 817 } #Tunis
			condition = { type = target value = 496 } #Byzantion
		}
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = ruler_child } }
		condition = { type = not value = { type = religion value = catholic } }
		condition = { type = not value = { type = religion value = orthodox } }
		condition = { type = not value = { type = trait value = ecclesiastical_education } }
		condition = { type = age value = 10 }
		condition = { 
			type = ruler_csc
			condition = { type = religion value = catholic }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = excommunicated } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = sceptical } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = trait value = zealous }
		}
		#temporary spam fix - definitely needs to be reworked for 1.06
		condition = { type = or
			condition = { type = marshal }
			condition = { type = steward }
			condition = { type = chancellor }
			condition = { type = spymaster }
			condition = { type = chaplain }
		}
	}

	mean_time_to_happen = {

	days = 30

	}

	action_a = { #Not for long!
		ai_chance = 60
			modifier = {
				condition = { type = ruler_csc
					condition = { type = or
						condition = { type = title value = PAPA }
						condition = { type = title value = TEMP }
						condition = { type = title value = HOSP }
						condition = { type = title value = TEUT }
					}
				}
				factor = 100
			}
		effect = { type = death }
		effect = { type = trigger for = ruler value = 1757 }
	}
	action_b = { #Summon the Papal Inquisador!
		ai_chance = 35
		effect = {
			type = random
			chance = 75
			effect = { type = death }
		}
		effect = { type = set_to_realm_religion } #if he survives, he converts
		effect = {
			type = loyalty
			value = -0.5
		}
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = war_invalid }
			effect = { type = add_trait value = illness }
			effect = { type = health value = -5 }
		}
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = stress_symptom }
		}
		effect = { type = trigger for = ruler value = 1758 }
	}
	action_c = { #I tire of all the bloodshed. Banish the heathen instead!
		ai_chance = 5
			modifier = {
				condition = { type = ruler_csc
					condition = { type = or
						condition = { type = title value = PAPA }
						condition = { type = title value = TEMP }
						condition = { type = title value = HOSP }
						condition = { type = title value = TEUT }
					}
				}
				factor = 0.0001
			}
		effect = { type = courtier_defect value = none }
		effect = { type = trigger for = ruler value = 1759 } 
	}
}

######################################
# Merciful Ruler deals with heathens #
######################################

character_event = { #My Lord, there is a Crusade to the Holy Land and yet there is a heathen in your court. The Pope has fobiddem this!

	id = 1753
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 774 } #Jerusalem
			condition = { type = target value = 764 } #Antioch
			condition = { type = target value = 802 } #Alexandria
			condition = { type = target value = 817 } #Tunis
			condition = { type = target value = 496 } #Byzantion
		}
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = ruler_child } }
		condition = { type = not value = { type = religion value = catholic } }
		condition = { type = not value = { type = religion value = orthodox } }
		condition = { type = not value = { type = trait value = ecclesiastical_education } }
		condition = { type = age value = 10 }
		condition = { 
			type = ruler_csc
			condition = { type = religion value = catholic }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = excommunicated } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = sceptical } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = zealous } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = trait value = merciful }
		}
		#temporary spam fix - definitely needs to be reworked for 1.06
		condition = { type = or
			condition = { type = marshal }
			condition = { type = steward }
			condition = { type = chancellor }
			condition = { type = spymaster }
			condition = { type = chaplain }
		}
	}

	mean_time_to_happen = {

	months = 24 

	}

	action_a = { #Escort the heathen from my realm!
		ai_chance = 60
		effect = { type = courtier_defect value = none }
		effect = { type = trigger for = ruler value = 1760 }
	}
	action_b = { #I tire of all these papal decrees!
		ai_chance = 5
		effect = { type = trigger for = ruler value = 1761 }
	}
	action_c = { #My court shall show no mercy towards heathens! Summon the Inquisador!
		ai_chance = 35
			modifier = {
				condition = { type = ruler_csc
					condition = { type = or
						condition = { type = title value = PAPA }
						condition = { type = title value = TEMP }
						condition = { type = title value = HOSP }
						condition = { type = title value = TEUT }
					}
				}
				factor = 1000
			}
		effect = { #courtier refuses to convert and doesn't survive the inquisition
			type = random
			chance = 50
			effect = { type = death }
		}
		effect = { type = set_to_realm_religion } #if he survives, he converts
		effect = { #...but it might take a lot of persuasion
			type = random
			chance = 50
			effect = { type = add_trait value = war_invalid }
			effect = { type = add_trait value = illness }
			effect = { type = health value = -3 }
		}
		effect = { #...and he also find it an emotionally grueling experience
			type = random
			chance = 50
			effect = { type = add_trait value = stress_symptom }
		}
		effect = { #...and he probably won't appreciate the experience
			type = random
			chance = 75
			effect = { type = loyalty value = -0.5 }
		}
		effect = { type = trigger for = ruler value = 1762 }
	}
}

##################################################
# Ruler has chosen to deal harshly with heathens #
##################################################

character_event = { #The Pope is impressed with your zealous treatment of the heathen!

	id = 1754
	picture = "event_heretic"

	#triggered by 1751 action_a

	immidiate = {#Deus Vult!
		effect = { type = prestige value = -5 }
		effect = { type = piety value = 25 }
		effect = { type = add_trait value = zealous } 
	}
}

#################################################################
# Ruler has chosen to be merciful towards heathens in his court #
#################################################################

character_event = { #My Lord, you showed great mercy to let the heathen depart alive!

	id = 1755
	picture = "event_techspread" #just using it because it's the best picture for this choice

	#triggered by 1751 action_b

	immidiate = {#Yes. I'm a nice guy, aren't I?
		effect = { type = prestige value = 25 }
		effect = { type = piety value = -5 }
		effect = { type = add_trait value = merciful } 
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = sceptical } #but could be view unfavourably by some
		}

	}
}

##############################################################
# Ruler has chosen to defy the papal decree against heathens #
##############################################################

character_event = { #My Lord, it would seem that your faith is waivering. I hope the Pope doesn't hear of it!

	id = 1756
	picture = "event_heretic"

	#triggered by 1751 action_c

	immidiate = {#Let's not tell him then!
		effect = { type = prestige value = -5 }
		effect = { type = piety value = -25 }
		effect = { type = add_trait value = sceptical } 
	}
}

##############################################
# Zealous ruler executes a heathen courtier #
##############################################

character_event = { # The Heathen has been put to death as you ordered, my Lord!

	id = 1757
	picture = "event_heretic"

	#triggered by 1752 action_a

	immidiate = {#Deus Vult!
		effect = { type = piety value = 25 }
		effect = {
			type = random
			chance = 25
			effect = { type = gold value = 100 } #confiscated procedes from the heathen's estate, if there was one
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = cruel } #summary execution isn't exactly merciful
		}
	}
}

############################################
# A Zealous ruler converts another heathen #
############################################

character_event = { # My Lord, the Papal Inquisador sends his compliments!

	id = 1758
	picture = "event_heretic"

	#triggered by 1752 action_b

	immidiate = {#Deus Vult!
		effect = { type = piety value = 10 }
		effect = {
			type = random
			chance = 25
			effect = { type = gold value = 25 } # possible kick-back from the former heathen's estate
		}
		effect = {
			type = random
			chance = 5
			effect = { type = add_trait value = cruel } #your actions might be misinterpreted as a little excessive
		}
	}
}

#######################################
# A zealous ruler's zeal is waivering #
#######################################

character_event = { # My Lord, that was a surprisingly kind act!

	id = 1759
	picture = "event_heretic"

	#triggered by 1752 action_c

	immidiate = {#I suppose my zeal is waining!
		effect = { type = piety value = -25 }
		effect = { type = remove_trait value = zealous }
		effect = { type = remove_trait value = cruel }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = merciful }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = arbitrary } #your actions seem suspiciously arbirary
		}
		effect = {
			type = random
			chance = 20
			effect = { type = add_trait value = sceptical } #and possibly even show a waivering of your faith
		}
	}
}

################################################
# A merciful ruler banishes a heathen courtier #
################################################

character_event = { # My Lord, the heathen has been escorted from the realm!

	id = 1760
	picture = "event_agriculture2" #seems like a nice and mercifully peaceful graphic to use

	#triggered by 1753 action_a

	immidiate = {#That is good!
		effect = { type = piety value = -5 }
		effect = { type = prestige value = 5 }
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = just }
		}
		effect = {
			type = random
			chance = 5
			effect = { type = add_trait value = sceptical } #but could be view unfavourably by some
		}
	}
}

###########################################
# A merciful ruler tires of papal decrees #
###########################################

character_event = { # My Lord, you dare defy the Pope?!

	id = 1761
	picture = "event_heretic"

	#triggered by 1753 action_b

	immidiate = {#I suppose my faith in him is waining!
		effect = { type = piety value = -25 }
		effect = { type = add_trait value = sceptical }
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = stress_symptom } #this may have been a stressful decision
		}
	}
}

#################################################################
# A merciful ruler tires of showing mercy to wandering heathens #
#################################################################

character_event = { # My Lord, the Pope is pleased with your surprising change of heart!

	id = 1762
	picture = "event_heretic"

	#triggered by 1753 action_c

	immidiate = {#I suddenly feel so much more zealous!
		effect = { type = remove_trait value = merciful }
		effect = { type = add_trait value = zealous }
		effect = { type = piety value = 25 }
		effect = {
			type = random
			chance = 25
			effect = { type = gold value = 25 } # possible kick-back from the former heathen's estate
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = cruel } #this may be viewed as a cruel and arbitrary act, considering you used to be so merciful
			effect = { type = add_trait value = arbitrary }
		}
	}
}

#####################################################################################
# It can be dangerous to be a sceptic during the time of a crusade to the Holy Land #
#####################################################################################

character_event = { #My lord, the Pope has heard of your scepticism! He demands that you atone for your sins!

	id = 1763
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 774 } #Jerusalem
			condition = { type = target value = 764 } #Antioch
			condition = { type = target value = 802 } #Alexandria
			condition = { type = target value = 817 } #Tunis
			condition = { type = target value = 496 } #Byzantion
		}
		condition = { type = ruler }
		condition = { type = religion value = catholic }
		condition = { type = trait value = sceptical }
		condition = { type = not value = { type = trait value = merciful } }
	}

	mean_time_to_happen = {
		months = 24

		modifier = {
			condition = { type = trait value = crusader }
			factor = 5
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 1.2
		}
		modifier = {
			condition = { type = piety value = 500 }
			factor = 1.2
		}
		modifier = {
			condition = { type = piety value = 1000 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 18 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 15 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 12 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 8 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 2 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = piety value = 25 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = piety value = 5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = piety value = 0 } }
			factor = 0.85
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 10 }
			}
			factor = 1.1
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 14 }
			}
			factor = 1.2
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 18 }
			}
			factor = 1.2
		}
		modifier = {
			condition = {
				type = liege
				condition = { type = trait value = zealous }
			}
			factor = 0.75
		}
	}

	action_a = { #I beg the Pope's indulgence and will atone for my sins!
		ai_chance = 34
			modifier = {
				condition = { type = gold value = 50 }
				factor = 1.5
			}
			modifier = {
				condition = { type = gold value = 100 }
				factor = 1.5
			}
			modifier = {
				condition = { type = gold value = 500 }
				factor = 2
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 1000
			}
		effect = { type = gold scale = -1 }
		effect = { type = piety value = 25 }
		effect = { type = prestige value = -50 }
		effect = { type = remove_trait value = sceptical }
	}

	action_b = { #I appeal the Pope's claim. I am no sceptic!
		ai_chance = 33
			modifier = {
				condition = { type = gold value = 50 }
				factor = 1.5
			}
			modifier = {
				condition = { type = gold value = 100 }
				factor = 1.5
			}
		effect = { type = gold scale = -0.33 } #court and bribery costs
		effect = { type = piety value = -10 }
		effect = { type = prestige value = 50 }
		effect = { type = remove_trait value = sceptical }
		effect = {
			type = random
			chance = 33
			effect = { type = add_trait value = heretic }
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = excommunicated }
		}
	}
	action_c = { #I defy the Pope to prove it!
		ai_chance = 33
			modifier = {
				condition = { type = not value = { type = gold value = 25 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = gold value = 0 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = gold value = 500 }
				factor = 0.1
			}
		effect = { type = piety value = -25 }
		effect = { type = prestige value = -50 }
		effect = { type = remove_trait value = sceptical }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = excommunicated }
		}
	}
}

###############################################################################################
# It is less dangerous to be a merciful sceptic during the time of a crusade to the Holy Land #
###############################################################################################

character_event = { #My lord, the Pope has heard of your scepticism! He demands that you atone for your sins!

	id = 1764
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 774 } #Jerusalem
			condition = { type = target value = 764 } #Antioch
			condition = { type = target value = 802 } #Alexandria
			condition = { type = target value = 817 } #Tunis
			condition = { type = target value = 496 } #Byzantion
		}
		condition = { type = ruler }
		condition = { type = religion value = catholic }
		condition = { type = trait value = sceptical }
		condition = { type = trait value = merciful }
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = { type = trait value = crusader }
			factor = 5
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 1.2
		}
		modifier = {
			condition = { type = piety value = 500 }
			factor = 1.2
		}
		modifier = {
			condition = { type = piety value = 1000 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 18 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 15 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 12 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 8 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 2 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = piety value = 25 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = piety value = 5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = piety value = 0 } }
			factor = 0.85
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 10 }
			}
			factor = 1.1
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 14 }
			}
			factor = 1.2
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 18 }
			}
			factor = 1.2
		}
		modifier = {
			condition = {
				type = liege
				condition = { type = trait value = zealous }
			}
			factor = 0.75
		}
	}

	action_a = { #I beg the Pope's indulgence and will atone for my sins!
		ai_chance = 40
			modifier = {
				condition = { type = gold value = 100}
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 500 }
				factor = 2
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 1000
			}
		effect = { type = gold scale = -0.33 }
		effect = { type = piety value = 15 }
		effect = { type = prestige value = -25 }
		effect = { type = remove_trait value = sceptical }
	}

	action_b = { #I appeal the Pope's claim. I am no sceptic!
		ai_chance = 35
			modifier = {
				condition = { type = gold value = 25 }
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 100 }
				factor = 1.5
			}
		effect = { type = gold scale = -0.1 }
		effect = { type = piety value = -15 }
		effect = { type = prestige value = 20 }
		effect = { type = remove_trait value = sceptical }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = heretic }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = excommunicated }
		}
	}
	action_c = { #I defy the Pope to prove it!
		ai_chance = 25
			modifier = {
				condition = { type = not value = { type = gold value = 0 } }
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 100 }
				factor = 0.1
			}
		effect = { type = piety value = -25 }
		effect = { type = prestige value = -50 }
		effect = { type = remove_trait value = sceptical }
		effect = {
			type = random
			chance = 33
			effect = { type = add_trait value = excommunicated }
		}
	}
}


###################################################################
# Ruler's children not sharing their father's faith are converted #
###################################################################

character_event = { #My child shall follow the same religion as I!

	id = 1765
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 774 } #Jerusalem
			condition = { type = target value = 764 } #Antioch
			condition = { type = target value = 802 } #Alexandria
			condition = { type = target value = 817 } #Tunis
			condition = { type = target value = 496 } #Byzantion
		}
		condition = { type = not value = { type = ruler } }
		condition = { type = ruler_child }
		condition = { type = not value = { type = religion value = catholic } }
		condition = { type = not value = { type = religion value = orthodox } }
		condition = { 
			type = ruler_csc
			condition = { type = religion value = catholic }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = excommunicated } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
	}

	mean_time_to_happen = {

	days = 15 #should at least reduce the spam load from this event a little bit...

	}

	action_a = { #Christ is Great!
		effect = { type = set_to_realm_religion }
	}
}

#
# NEXT EVENT IN THIS SERIES 1766
#



################################################
################################################
## GENERAL FLAVOUR EVENTS FOR THE RECONQUISTA ##
################################################
################################################

#
# RESERVED ID RANGE 1800-1899
#


##################################################################
# A small regiment of Occitan Knights wants to join your cause  #
##################################################################

character_event = {
	id = 1800

	picture = "event_mercenaries"

	trigger = {
		condition = { type = ruler }
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 181 }
			condition = { type = target value = 197 }
			condition = { type = target value = 160 }
			condition = { type = target value = 171 }
			condition = { type = target value = 165 }
			condition = { type = target value = 199 }
		}
		condition = { type = region value = spain }
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
	}

	mean_time_to_happen = {
		months = 1200

		#check whether actively crusading and target is still in enemy hands
		modifier = {
			condition = { type = on_crusade }
			factor = 0.05
		}

		modifier = {
			condition = { type = prestige value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
	}

	action_a = {#Deus Vult!
		effect = { 	type = add_regiment 
				tech_prov = 214
				culture = occitan
				strength = {
					heavy_cav = 200
					light_cav = 200
				}
		}
		effect = { type = prestige value = -5 }
	}

	action_b = {#The glory is ours!
		effect = { type = prestige value = 10 }
		effect = { type = piety value = -10 }
	}
}

##################################################################################
# A Frankish Bishop sends you part of his personal guard to aid in the struggle  #
##################################################################################

character_event = {
	id = 1801

	picture = "event_templars"

	trigger = {
		condition = { type = crusade }
		condition = { type = is_independent }
		condition = {
			type = or
			condition = { type = target value = 181 }
			condition = { type = target value = 197 }
			condition = { type = target value = 160 }
			condition = { type = target value = 171 }
			condition = { type = target value = 165 }
			condition = { type = target value = 199 }
		}
		condition = { type = region value = spain }
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = piety value = 50 }
	}

	mean_time_to_happen = {
		months = 2000

		#check whether actively crusading and target is still in enemy hands
		modifier = {
			condition = { type = on_crusade }
			factor = 0.05
		}

		modifier = {
			condition = { type = prestige value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
	}

	action_a = {#Deus Vult!
		effect = { 	type = add_regiment 
				tech_prov = 107
				culture = frankish
				strength = {
					heavy_cav = 250
					light_cav = 250
					pikemen = 150
				}
		}
		effect = { type = prestige value = -5 }
	}

	action_b = {#The glory is ours!
		effect = { type = prestige value = 20 }
		effect = { type = piety value = -20 }
	}
}
##########################################################
# A French Noble Offers to assist you in your Holy Cause #
##########################################################

character_event = {
	id = 1802

	picture = "event_mercenaries"

	trigger = {
		condition = { type = crusade }
		condition = { type = is_independent }
		condition = {
			type = or
			condition = { type = target value = 181 }
			condition = { type = target value = 197 }
			condition = { type = target value = 160 }
			condition = { type = target value = 171 }
			condition = { type = target value = 165 }
			condition = { type = target value = 199 }
		}
		condition = { type = region value = spain }
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = prestige value = 100 }
	}

	mean_time_to_happen = {
		months = 2000

		#check whether actively crusading and target is still in enemy hands
		modifier = {
			condition = { type = on_crusade }
			factor = 0.05
		}

		modifier = {
			condition = { type = prestige value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
	}

	action_a = {#Deus Vult!
		effect = { type = gold value = -200 }
		effect = { 	type = add_regiment 
				tech_prov = 111
				culture = frankish
				strength = {
					heavy_cav = 200
					light_cav = 200
					heavy_inf = 200
					pikemen = 200
					archers = 200
				}
		}
		effect = { type = prestige value = -20 }
	}

	action_b = {#The glory is ours!
		effect = { type = prestige value = 50 }
		effect = { type = piety value = -20 }
	}
}

#
# NEXT EVENT IN THIS SERIES 1803
#


#########################################
#########################################
## COURT PURGES DURING THE RECONQUISTA ##
#########################################
#########################################


###############################################
# Ruler must decide how to deal with heathens #
###############################################

character_event = { #My Lord, there is a Reconquista and yet you harbour a heathen in your court. The Pope has fobiddem this!

	id = 1851
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 181 } #Cordoba
			condition = { type = target value = 197 } #Toledo
			condition = { type = target value = 160 } #Lisboa
			condition = { type = target value = 171 } #Valencia
			condition = { type = target value = 165 } #Cadiz
			condition = { type = target value = 199 } #Burgos
		}
		condition = { type = region value = spain }
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = ruler_child } }
		condition = { type = not value = { type = religion value = catholic } }
		condition = { type = not value = { type = religion value = orthodox } }
		condition = { type = not value = { type = trait value = ecclesiastical_education } }
		condition = { type = age value = 10 }
		condition = { 
			type = ruler_csc
			condition = { type = religion value = catholic }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = excommunicated } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = sceptical } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = zealous } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = merciful } }
		}
		#temporary spam fix - definitely needs to be reworked for 1.06
		condition = { type = or
			condition = { type = marshal }
			condition = { type = steward }
			condition = { type = chancellor }
			condition = { type = spymaster }
			condition = { type = chaplain }
		}
	}

	mean_time_to_happen = {

	months = 12 #should at least reduce the spam load from this event a little bit...

	}

	action_a = { #You shall convert, or die!
		ai_chance = 70
			modifier = {
				condition = { type = ruler_csc
					condition = { type = or
						condition = { type = title value = PAPA }
						condition = { type = title value = TEMP }
						condition = { type = title value = HOSP }
						condition = { type = title value = TEUT }
					}
				}
				factor = 100
			}
		effect = { #courtier refuses to convert and doesn't survive the inquisition
			type = random
			chance = 50
			effect = { type = death }
		}
		effect = { type = set_to_realm_religion } #if he survives, he converts
		effect = { #...but it might take a lot of persuasion
			type = random
			chance = 60
			effect = { type = add_trait value = war_invalid }
			effect = { type = add_trait value = illness }
			effect = { type = health value = -3 }
		}
		effect = { #...and he also find it an emotionally grueling experience
			type = random
			chance = 60
			effect = { type = add_trait value = stress_symptom }
		}
		effect = { #...and he probably won't appreciate the experience
			type = random
			chance = 50
			effect = { type = loyalty value = -0.5 }
		}
		effect = { type = trigger for = ruler value = 1854 }
	}
	action_b = { #You shall be bannished from my realm!
		ai_chance = 25
		effect = { type = courtier_defect value = none }
		effect = { type = trigger for = ruler value = 1855 }
	}
	action_c = { #I reject the Inquisition's authority to influence my court!
		ai_chance = 5
		effect = { type = trigger for = ruler value = 1856 }
	}
}

#####################################
# Zealous Ruler Deals With Heathens #
#####################################

character_event = { #My Lord, there is a heathen living among us!

	id = 1852
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 181 } #Cordoba
			condition = { type = target value = 197 } #Toledo
			condition = { type = target value = 160 } #Lisboa
			condition = { type = target value = 171 } #Valencia
			condition = { type = target value = 165 } #Cadiz
			condition = { type = target value = 199 } #Burgos
		}
		condition = { type = region value = spain }
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = ruler_child } }
		condition = { type = not value = { type = religion value = catholic } }
		condition = { type = not value = { type = religion value = orthodox } }
		condition = { type = not value = { type = trait value = ecclesiastical_education } }
		condition = { type = age value = 10 }
		condition = { 
			type = ruler_csc
			condition = { type = religion value = catholic }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = excommunicated } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = sceptical } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = trait value = zealous }
		}
		#temporary spam fix - definitely needs to be reworked for 1.06
		condition = { type = or
			condition = { type = marshal }
			condition = { type = steward }
			condition = { type = chancellor }
			condition = { type = spymaster }
			condition = { type = chaplain }
		}
	}

	mean_time_to_happen = {

	days = 15

	}

	action_a = { #Not for long!
		ai_chance = 50
		effect = { type = death }
		effect = { type = trigger for = ruler value = 1857 }
	}
	action_b = { #Summon my Inquisador!
		ai_chance = 45
			modifier = {
				condition = { type = ruler_csc
					condition = { type = or
						condition = { type = title value = PAPA }
						condition = { type = title value = TEMP }
						condition = { type = title value = HOSP }
						condition = { type = title value = TEUT }
					}
				}
				factor = 100
			}
		effect = {
			type = random
			chance = 75
			effect = { type = death }
		}
		effect = { type = set_to_realm_religion } #if he survives, he converts
		effect = {
			type = loyalty
			value = -0.5
		}
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = war_invalid }
			effect = { type = add_trait value = illness }
			effect = { type = health value = -5 }
		}
		effect = {
			type = random
			chance = 75
			effect = { type = add_trait value = stress_symptom }
		}
		effect = { type = trigger for = ruler value = 1858 }
	}
	action_c = { #I tire of all the bloodshed. Banish the heathen instead!
		ai_chance = 5
		effect = { type = courtier_defect value = none }
		effect = { type = trigger for = ruler value = 1859 } 
	}
}

######################################
# Merciful Ruler deals with heathens #
######################################

character_event = { #My Lord, there is a Reconquista and yet there is a heathen in your court. The Pope has fobiddem this!

	id = 1853
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 181 } #Cordoba
			condition = { type = target value = 197 } #Toledo
			condition = { type = target value = 160 } #Lisboa
			condition = { type = target value = 171 } #Valencia
			condition = { type = target value = 165 } #Cadiz
			condition = { type = target value = 199 } #Burgos
		}
		condition = { type = region value = spain }
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = ruler_child } }
		condition = { type = not value = { type = religion value = catholic } }
		condition = { type = not value = { type = religion value = orthodox } }
		condition = { type = not value = { type = trait value = ecclesiastical_education } }
		condition = { type = age value = 10 }
		condition = { 
			type = ruler_csc
			condition = { type = religion value = catholic }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = excommunicated } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = sceptical } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = zealous } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = trait value = merciful }
		}
		#temporary spam fix - definitely needs to be reworked for 1.06
		condition = { type = or
			condition = { type = marshal }
			condition = { type = steward }
			condition = { type = chancellor }
			condition = { type = spymaster }
			condition = { type = chaplain }
		}
	}

	mean_time_to_happen = {

	months = 24 

	}

	action_a = { #Escort the heathen from my realm!
		ai_chance = 50
		effect = { type = courtier_defect value = none }
		effect = { type = trigger for = ruler value = 1860 }
	}
	action_b = { #I tire of all these Papal decrees!
		ai_chance = 5
		effect = { type = trigger for = ruler value = 1861 }
	}
	action_c = { #My court shall show no mercy towards heathens! Summon my Inquisador!
		ai_chance = 45
			modifier = {
				condition = { type = ruler_csc
					condition = { type = or
						condition = { type = title value = PAPA }
						condition = { type = title value = TEMP }
						condition = { type = title value = HOSP }
						condition = { type = title value = TEUT }
					}
				}
				factor = 100
			}
		effect = { #courtier refuses to convert and doesn't survive the inquisition
			type = random
			chance = 60
			effect = { type = death }
		}
		effect = { type = set_to_realm_religion } #if he survives, he converts
		effect = { #...but it might take a lot of persuasion
			type = random
			chance = 60
			effect = { type = add_trait value = war_invalid }
			effect = { type = add_trait value = illness }
			effect = { type = health value = -3 }
		}
		effect = { #...and he also find it an emotionally grueling experience
			type = random
			chance = 60
			effect = { type = add_trait value = stress_symptom }
		}
		effect = { #...and he probably won't appreciate the experience
			type = random
			chance = 50
			effect = { type = loyalty value = -0.5 }
		}
		effect = { type = trigger for = ruler value = 1862 }
	}
}

##################################################
# Ruler has chosen to deal harshly with heathens #
##################################################

character_event = { #The Inquisition is impressed with your zealous treatment of the heathen!

	id = 1854
	picture = "event_heretic"

	#triggered by 1851 action_a

	immidiate = {#Deus Vult!
		effect = { type = prestige value = -5 }
		effect = { type = piety value = 35 }
		effect = { type = add_trait value = zealous } 
	}
}

#################################################################
# Ruler has chosen to be merciful towards heathens in his court #
#################################################################

character_event = { #My Lord, you showed great mercy to let the heathen depart alive!

	id = 1855
	picture = "event_techspread" #just using it because it's the best picture for this choice

	#triggered by 1851 action_b

	immidiate = {#Yes. I'm a nice guy, aren't I?
		effect = { type = prestige value = 35 }
		effect = { type = piety value = -5 }
		effect = { type = add_trait value = merciful } 
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = sceptical } #but could be view unfavourably by some
		}

	}
}

##############################################################
# Ruler has chosen to defy the papal decree against heathens #
##############################################################

character_event = { #My Lord, it would seem that your faith is waivering. I hope the Pope doesn't hear of it!

	id = 1856
	picture = "event_heretic"

	#triggered by 1751 action_c

	immidiate = {#Let's not mention it to the Inquisador!
		effect = { type = prestige value = -5 }
		effect = { type = piety value = -20 }
		effect = { type = add_trait value = sceptical } 
	}
}

##############################################
# Zealous ruler execultes a heathen courtier #
##############################################

character_event = { # The Heathen has been put to death as you ordered, my Lord!

	id = 1857
	picture = "event_heretic"

	#triggered by 1852 action_a

	immidiate = {#Deus Vult!
		effect = { type = piety value = 35 }
		effect = {
			type = random
			chance = 35
			effect = { type = gold value = 100 } #confiscated procedes from the heathen's estate, if there was one
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = cruel } #summary execution isn't exactly merciful
		}
	}
}

############################################
# A Zealous ruler converts another heathen #
############################################

character_event = { # My Lord, the Inquisador sends his compliments!

	id = 1858
	picture = "event_heretic"

	#triggered by 1852 action_b

	immidiate = {#Deus Vult!
		effect = { type = piety value = 10 }
		effect = {
			type = random
			chance = 35
			effect = { type = gold value = 25 } # possible kick-back from the former heathen's estate
		}
		effect = {
			type = random
			chance = 5
			effect = { type = add_trait value = cruel } #your actions might be misinterpreted as a little excessive
		}
	}
}

#######################################
# A zealous ruler's zeal is waivering #
#######################################

character_event = { # My Lord, that was a kind act!

	id = 1859
	picture = "event_heretic"

	#triggered by 1852 action_c

	immidiate = {#I suppose my zeal is waining!
		effect = { type = piety value = -20 }
		effect = { type = remove_trait value = zealous }
		effect = { type = remove_trait value = cruel }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = merciful }
		}
		effect = {
			type = random
			chance = 20
			effect = { type = add_trait value = arbitrary } #your actions seem suspiciously arbirary
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = sceptical } #and possibly even show a waivering of your faith
		}
	}
}

################################################
# A merciful ruler banishes a heathen courtier #
################################################

character_event = { # My Lord, the heathen has been escorted from the realm!

	id = 1860
	picture = "event_agriculture2" #seems like a nice and mercifully peaceful graphic to use

	#triggered by 1853 action_a

	immidiate = {#That is good!
		effect = { type = piety value = -5 }
		effect = { type = prestige value = 5 }
		effect = {
			type = random
			chance = 20
			effect = { type = add_trait value = just }
		}
		effect = {
			type = random
			chance = 5
			effect = { type = add_trait value = sceptical } #but could be view unfavourably by some
		}
	}
}

###########################################
# A merciful ruler tires of papal decrees #
###########################################

character_event = { # My Lord, you dare defy the Pope?!

	id = 1861
	picture = "event_heretic"

	#triggered by 1853 action_b

	immidiate = {#I suppose my faith is waining!
		effect = { type = piety value = -20 }
		effect = { type = add_trait value = sceptical }
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = stress_symptom } #this may have been a stressful decision
		}
	}
}

#################################################################
# A merciful ruler tires of showing mercy to wandering heathens #
#################################################################

character_event = { # My Lord, the Inquisador is pleased with your surprising change of heart!

	id = 1862
	picture = "event_heretic"

	#triggered by 1853 action_c

	immidiate = {#I suddenly feel so much more zealous!
		effect = { type = remove_trait value = merciful }
		effect = { type = add_trait value = zealous }
		effect = { type = piety value = 25 }
		effect = {
			type = random
			chance = 35
			effect = { type = gold value = 25 } # possible kick-back from the former heathen's estate
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = cruel } #this may be viewed as a cruel and arbitrary act, considering you used to be so merciful
			effect = { type = add_trait value = arbitrary }
		}
	}
}

##########################################################################
# It can be dangerous to be a sceptic during the time of the Reconquista #
##########################################################################

character_event = { #My lord, the Inquisador has heard of your scepticism! He demands that you atone for your sins!

	id = 1863
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 181 } #Cordoba
			condition = { type = target value = 197 } #Toledo
			condition = { type = target value = 160 } #Lisboa
			condition = { type = target value = 171 } #Valencia
			condition = { type = target value = 165 } #Cadiz
			condition = { type = target value = 199 } #Burgos
		}
		condition = { type = ruler }
		condition = { type = region value = spain }
		condition = { type = religion value = catholic }
		condition = { type = trait value = sceptical }
		condition = { type = not value = { type = trait value = merciful } }
	}

	mean_time_to_happen = {
		months = 48

		modifier = {
			condition = { type = trait value = crusader }
			factor = 5
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 1.2
		}
		modifier = {
			condition = { type = piety value = 500 }
			factor = 1.2
		}
		modifier = {
			condition = { type = piety value = 1000 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 18 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 15 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 12 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 8 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 2 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = piety value = 25 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = piety value = 5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = piety value = 0 } }
			factor = 0.85
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 10 }
			}
			factor = 1.1
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 14 }
			}
			factor = 1.2
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 18 }
			}
			factor = 1.2
		}
		modifier = {
			condition = {
				type = liege
				condition = { type = trait value = zealous }
			}
			factor = 0.75
		}
	}

	action_a = { #I will beg the Pope's indulgence and atone for my sins!
		ai_chance = 50
			modifier = {
				condition = { type = gold value = 50 }
				factor = 1.5
			}
			modifier = {
				condition = { type = gold value = 100 }
				factor = 1.5
			}
			modifier = {
				condition = { type = gold value = 500 }
				factor = 2
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = gold scale = -0.75 }
		effect = { type = piety value = 25 }
		effect = { type = prestige value = -50 }
		effect = { type = remove_trait value = sceptical }
	}

	action_b = { #I appeal the Inquisador's claim. I am no sceptic!
		ai_chance = 30
			modifier = {
				condition = { type = gold value = 50 }
				factor = 1.5
			}
			modifier = {
				condition = { type = gold value = 100 }
				factor = 1.5
			}
		effect = { type = gold scale = -0.25 } #court and bribery costs
		effect = { type = piety value = -10 }
		effect = { type = prestige value = 50 }
		effect = { type = remove_trait value = sceptical }
		effect = {
			type = random
			chance = 45
			effect = { type = add_trait value = heretic }
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_trait value = excommunicated }
		}
	}
	action_c = { #I defy the Inquisador to prove it!
		ai_chance = 20
			modifier = {
				condition = { type = not value = { type = gold value = 25 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = gold value = 0 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = gold value = 500 }
				factor = 0.1
			}
		effect = { type = piety value = -25 }
		effect = { type = prestige value = -50 }
		effect = { type = remove_trait value = sceptical }
		effect = {
			type = random
			chance = 50
			effect = { type = add_trait value = excommunicated }
		}
	}
}

##################################################################################
# It is less dangerous to be a merciful sceptic during the time of a Reconquista #
##################################################################################

character_event = { #My lord, the Inquisador has heard of your scepticism! He demands that you atone for your sins!

	id = 1864
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 181 } #Cordoba
			condition = { type = target value = 197 } #Toledo
			condition = { type = target value = 160 } #Lisboa
			condition = { type = target value = 171 } #Valencia
			condition = { type = target value = 165 } #Cadiz
			condition = { type = target value = 199 } #Burgos
		}
		condition = { type = ruler }
		condition = { type = region value = spain }
		condition = { type = religion value = catholic }
		condition = { type = trait value = sceptical }
		condition = { type = trait value = merciful }
	}

	mean_time_to_happen = {
		months = 72

		modifier = {
			condition = { type = trait value = crusader }
			factor = 5
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 1.2
		}
		modifier = {
			condition = { type = piety value = 500 }
			factor = 1.2
		}
		modifier = {
			condition = { type = piety value = 1000 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 18 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 15 }
			factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 12 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 8 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = intrigue value = 2 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = piety value = 25 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = piety value = 5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = piety value = 0 } }
			factor = 0.85
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 10 }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 50 }
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 10 }
			}
			factor = 1.1
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 14 }
			}
			factor = 1.2
		}
		modifier = {
			condition = {
				type = spymaster_csc
				condition = { type = intrigue value = 18 }
			}
			factor = 1.2
		}
		modifier = {
			condition = {
				type = liege
				condition = { type = trait value = zealous }
			}
			factor = 0.75
		}
	}

	action_a = { #I will beg the Pope's indulgence and atone for my sins!
		ai_chance = 50
			modifier = {
				condition = { type = gold value = 100}
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 500 }
				factor = 2
			}
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 0.00001
			}
		effect = { type = gold scale = -0.25 }
		effect = { type = piety value = 15 }
		effect = { type = prestige value = -25 }
		effect = { type = remove_trait value = sceptical }
	}

	action_b = { #I appeal the Inquisador's claim. I am no sceptic!
		ai_chance = 30
			modifier = {
				condition = { type = gold value = 25 }
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 100 }
				factor = 1.5
			}
		effect = { type = gold scale = -0.075 }
		effect = { type = piety value = -15 }
		effect = { type = prestige value = 20 }
		effect = { type = remove_trait value = sceptical }
		effect = {
			type = random
			chance = 35
			effect = { type = add_trait value = heretic }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_trait value = excommunicated }
		}
	}
	action_c = { #I defy the Inquisador to prove it!
		ai_chance = 20
			modifier = {
				condition = { type = not value = { type = gold value = 0 } }
				factor = 2
			}
			modifier = {
				condition = { type = gold value = 100 }
				factor = 0.1
			}
		effect = { type = piety value = -25 }
		effect = { type = prestige value = -50 }
		effect = { type = remove_trait value = sceptical }
		effect = {
			type = random
			chance = 25
			effect = { type = add_trait value = excommunicated }
		}
	}
}

###############################
# Ruler's children converted #
###############################

character_event = { #My child shall follow the same religion as I!

	id = 1865
	picture = "event_religion"

	trigger = {
		condition = { type = crusade }
		condition = {
			type = or
			condition = { type = target value = 181 } #Cordoba
			condition = { type = target value = 197 } #Toledo
			condition = { type = target value = 160 } #Lisboa
			condition = { type = target value = 171 } #Valencia
			condition = { type = target value = 165 } #Cadiz
			condition = { type = target value = 199 } #Burgos
		}
		condition = { type = region value = spain }
		condition = { type = not value = { type = ruler } }
		condition = { type = ruler_child }
		condition = { type = not value = { type = religion value = catholic } }
		condition = { type = not value = { type = religion value = orthodox } }
		condition = { 
			type = ruler_csc
			condition = { type = religion value = catholic }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = excommunicated } }
		}
		condition = { 
			type = ruler_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
	}

	mean_time_to_happen = {

	days = 15 #should at least reduce the spam load from this event a little bit...

	}

	action_a = { #Christ is Great!
		effect = { type = set_to_realm_religion }
	}
}

#
# NEXT EVENT IN THIS SERIES 1866
#



###########################################
###########################################
###########################################
### GENERAL FLAVOUR EVENTS FOR CRUSADES ###
###########################################
###########################################
###########################################

#
# RESERVED ID RANGE 1900-1999
#

#############################
#############################
## EXTRA CRUSADING TROOPS! ##
#############################
#############################

###################################################
# The peasants flock to support your Holy Crusade #
###################################################

character_event = {
	id = 1900

	picture = "event_mercenaries"

	trigger = {
		condition = { type = ruler }
		condition = { type = crusade }
		condition = { type = on_crusade } #this can only happen if the target hasn't been captured yet and you're at war with the owner
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = prestige value = 50 }
		condition = { type = capital
			condition = {
				type = and
				condition = { type = peasant_loyalty value = 0.75 }
				condition = { type = peasant_power value = 0.25 }
				condition = { type = religion value = catholic }
			}
		}
	}

	mean_time_to_happen = {
		months = 240

		# power and loyalty check
		modifier = {
			condition = { type = capital
				condition = { type = peasant_loyalty value = 0.85 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = peasant_loyalty value = 0.95 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = peasant_power value = 0.35 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = peasant_power value = 0.45 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = peasant_power value = 0.6 }
			}
			factor = 0.9
		}

		#capital province conditions check
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { heretic = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { bubonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { pneumonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { malaria = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { dysentery = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { small_pox = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { typhoid_fever = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 10
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 5
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 0.75
		}

		#ruler check
		modifier = {
			condition = { type = prestige value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 10
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = has_law value = { royal_preorgatory_law = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_law value = { feudal_contract_law = yes } }
			factor = 2
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_law value = { regal_supremacy = yes } }
			factor = 1.25
		}

		#specific crusades modifiers
		modifier = {
			condition = { type = target value = 774 } #Jerusalem
			factor = 0.5
		}
		modifier = {
			condition = { type = target value = 764 } #Antioch
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 802 } #Alexandria
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 817 } #Tunis
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 496 } #Byzantion
			factor = 0.9
		}
		modifier = {
			condition = { type = target value = 333 } #Roma
			factor = 0.5
		}
		modifier = {
			condition = { type = target value = 340 } #Sicily
			factor = 0.95
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Cordoba
			factor = 0.75
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 197 } #Toledo
			factor = 0.75
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 160 } #Lisboa
			factor = 0.85
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 171 } #Valencia
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 165 } #Cadiz
			factor = 0.9
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Burgos
			factor = 0.6
		}


		#difficulty setting modifiers
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
		#special
		modifier = {
			condition = { type = or
				condition = { type = title value = PAPA }
				condition = { type = title value = TEMP }
				condition = { type = title value = HOSP }
				condition = { type = title value = TEUT }
			}
			condition = { type = capital
				condition = { type = not value = { type = realm_regiments value = 3 } }
			}
			factor = 0.05
		}
	}

	action_a = {#Deus Vult!
		effect = { 	type = add_regiment #this to default to the character's culture and capital province tech level
				strength = {
					militia = 500
					archers = 250
				}
		}
		effect = { 	type = add_regiment 
				strength = {
					militia = 400
				}
		}
#cost of this rem-ed out for now until the new effect is coded
#		effect = { type = prosperity for = capital value = -1 } #some of the troops come from your capital
		effect = {
			type = random
			chance = 50
			effect = { 	type = add_regiment 
					strength = {
							militia = 200
					}
			}
			effect = { 	type = add_regiment 
					strength = {
						militia = 200
					}
			}
	#		effect = { type = prosperity for = random value = -1 } #some come from the surrounding countryside
		}
	}

	action_b = {#I thank you, but you are more needed in the fields!
		effect = { type = prestige value = 5 }
		effect = { type = piety value = -10 }
#		effect = {
#			type = random
#			chance = 33
#			effect = { type = prosperity for = random value = 1 }
#		}
	}
}


##################################################
# The burgers unite to support your Holy Crusade #
##################################################

character_event = {
	id = 1901

	picture = "event_crusades"

	trigger = {
		condition = { type = ruler }
		condition = { type = crusade }
		condition = { type = on_crusade } #this can only happen if the target hasn't been captured yet and you're at war with the owner
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = prestige value = 50 }
		condition = { type = capital
			condition = {
				type = and
				condition = { type = burgher_loyalty value = 0.75 }
				condition = { type = burgher_power value = 0.25 }
				condition = { type = religion value = catholic }
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# power and loyalty check
		modifier = {
			condition = { type = capital
				condition = { type = burgher_loyalty value = 0.85 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = burgher_loyalty value = 0.95 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = burgher_power value = 0.35 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = burgher_power value = 0.45 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = burgher_power value = 0.6 }
			}
			factor = 0.9
		}

		#capital province conditions check
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { heretic = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { bubonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { pneumonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { malaria = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { dysentery = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { small_pox = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { typhoid_fever = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 10
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 5
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 0.75
		}

		#ruler check
		modifier = {
			condition = { type = prestige value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 10
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = amateurish_pettifogger }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = proven_dealbreaker }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = charismatic_negotiator }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = grey_eminence }
			factor = 0.75
		}
		modifier = {
			condition = { type = has_law value = { royal_preorgatory_law = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_law value = { feudal_contract_law = yes } }
			factor = 1.25
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 0.75
		}

		#specific crusades modifiers
		modifier = {
			condition = { type = target value = 774 } #Jerusalem
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 764 } #Antioch
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 802 } #Alexandria
			factor = 0.9
		}
		modifier = {
			condition = { type = target value = 817 } #Tunis
			factor = 0.9
		}
		modifier = {
			condition = { type = target value = 496 } #Byzantion
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 333 } #Roma
			factor = 0.5
		}
		modifier = {
			condition = { type = target value = 340 } #Sicily
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Cordoba
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 197 } #Toledo
			factor = 0.6
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 160 } #Lisboa
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 171 } #Valencia
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 165 } #Cadiz
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Burgos
			factor = 0.6
		}


		#difficulty setting modifiers
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
		#special
		modifier = {
			condition = { type = or
				condition = { type = title value = PAPA }
				condition = { type = title value = TEMP }
				condition = { type = title value = HOSP }
				condition = { type = title value = TEUT }
			}
			condition = { type = capital
				condition = { type = not value = { type = realm_regiments value = 3 } }
			}
			factor = 0.05
		}
	}

	action_a = {#Deus Vult!
		effect = { 	type = add_regiment #this to default to the character's culture and capital province tech level
				strength = {
					archers = 200 
					heavy_inf = 200 
					pikemen = 500 
				}
		}
		effect = { 	type = add_regiment 
				strength = {
					archers = 100 
					heavy_inf = 100 
					pikemen = 250 
				}
		}
#cost of this rem-ed out for now until the new effect is coded
#		effect = { type = prosperity for = capital value = -1 } #some of the troops come from your capital
		effect = {
			type = random
			chance = 50
			effect = { 	type = add_regiment 
					strength = {
						heavy_inf = 100 
						pikemen = 250 
					}
			}
			effect = { 	type = add_regiment 
					strength = {
					pikemen = 250 
					}
			}
#			effect = { type = prosperity for = random value = -1 } #some come from the surrounding countryside
		}
	}

	action_b = {#I thank you, but I would prefer a financial contribution!
		effect = { type = prestige value = -10 }
		effect = { type = piety value = -10 }
		effect = { type = gold value = 200 }
		effect = {
			type = random
			chance = 33
			effect = { type = gold scale = 1 }
		}
	}
}

#################################################
# The clergy strongly endorse your Holy Crusade #
#################################################

character_event = {
	id = 1902

	picture = "event_religion"

	trigger = {
		condition = { type = ruler }
		condition = { type = crusade }
		condition = { type = on_crusade } #this can only happen if the target hasn't been captured yet and you're at war with the owner
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = not value = { type = trait value = sceptical }}
		condition = { type = not value = { type = trait value = kinslayer }}
		condition = { type = prestige value = 50 }
		condition = { type = piety value = 50 }
		condition = { type = capital
			condition = {
				type = and
				condition = { type = clergy_loyalty value = 0.75 }
				condition = { type = clergy_power value = 0.25 }
				condition = { type = religion value = catholic }
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# power and loyalty check
		modifier = {
			condition = { type = capital
				condition = { type = clergy_loyalty value = 0.85 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = clergy_loyalty value = 0.95 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = clergy_power value = 0.35 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = clergy_power value = 0.45 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = clergy_power value = 0.6 }
			}
			factor = 0.9
		}

		#capital province conditions check
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { heretic = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { bubonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { pneumonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { malaria = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { dysentery = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { small_pox = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { typhoid_fever = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 10
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 5
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 0.75
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { templar_house = yes } }
			}
			factor = 0.85
		}

		#ruler check
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 10
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = detached_priest }
			factor = 0.95
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = scholarly_theologian }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_law value = { regal_supremacy = yes } }
			factor = 3
		}
		modifier = {
			condition = { type = has_law value = { monastic_supremacy = yes } }
			factor = 1.15
		}
		modifier = {
			condition = { type = has_law value = { ecclesical_balance = yes } }
			factor = 1.15
		}
		modifier = {
			condition = { type = has_law value = { church_supremacy = yes } }
			factor = 0.6
		}

		#specific crusades modifiers
		modifier = {
			condition = { type = target value = 774 } #Jerusalem
			factor = 0.4
		}
		modifier = {
			condition = { type = target value = 764 } #Antioch
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 802 } #Alexandria
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 817 } #Tunis
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 496 } #Byzantion
			factor = 0.9
		}
		modifier = {
			condition = { type = target value = 333 } #Roma
			factor = 0.25
		}
		modifier = {
			condition = { type = target value = 340 } #Sicily
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Cordoba
			factor = 0.75
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 197 } #Toledo
			factor = 0.75
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 160 } #Lisboa
			factor = 0.75
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 171 } #Valencia
			factor = 0.75
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 165 } #Cadiz
			factor = 0.75
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Burgos
			factor = 0.75
		}


		#difficulty setting modifiers
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
		#special
		modifier = {
			condition = { type = or
				condition = { type = title value = PAPA }
				condition = { type = title value = TEMP }
				condition = { type = title value = HOSP }
				condition = { type = title value = TEUT }
			}
			condition = { type = capital
				condition = { type = not value = { type = realm_regiments value = 3 } }
			}
			factor = 0.05
		}
	}

	action_a = {#Deus Vult!
		effect = { 	type = add_regiment #this to default to the character's culture and capital province tech level
				strength = {
					heavy_cav = 50 
					light_cav = 100 
					archers = 50 
					heavy_inf = 250 
					pikemen = 150 
				}
		}
		effect = { 	type = add_regiment 
				strength = {
					heavy_cav = 150 
					light_cav = 250 
					heavy_inf = 100 
				}
		}
		effect = { type = add_trait value = crusader }
		effect = { type = add_trait value = zealous }
#cost of this rem-ed out for now until the new effect is coded
#		effect = { type = prosperity for = capital value = -1 } #some of the troops come from your capital
		effect = {
			type = random
			chance = 50
			effect = { 	type = add_regiment 
					strength = {
						heavy_cav = 100 
						light_cav = 200 
					}
			}
			effect = { 	type = add_regiment 
					strength = {
						heavy_inf = 250 
						pikemen = 150 
					}
			}
#			effect = { type = prosperity for = random value = -1 } #some come from the surrounding countryside
		}
	}

	action_b = {#I thank you, but I'd prefer that you open the churchs coffers
		effect = { type = remove_trait value = crusader }
		effect = { type = remove_trait value = zealous }
		effect = { type = piety value = -25 }
		effect = { type = gold value = 100 }
		effect = {
			type = random
			chance = 33
			effect = { type = gold scale = 1 }
		}
	}
}

#################################################
# The nobility wishes to join your Holy Crusade #
#################################################

character_event = {
	id = 1903

	picture = "event_crusades"

	trigger = {
		condition = { type = ruler }
		condition = { type = crusade }
		condition = { type = on_crusade } #this can only happen if the target hasn't been captured yet and you're at war with the owner
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = not value = { type = trait value = kinslayer }}
		condition = { type = prestige value = 100 }
		condition = { type = piety value = 25 }
		condition = { type = capital
			condition = {
				type = and
				condition = { type = noble_loyalty value = 0.75 }
				condition = { type = noble_power value = 0.25 }
				condition = { type = religion value = catholic }
			}
		}
	}

	mean_time_to_happen = {
		months = 480

		# power and loyalty check
		modifier = {
			condition = { type = capital
				condition = { type = noble_loyalty value = 0.85 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = noble_loyalty value = 0.95 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = noble_power value = 0.35 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = noble_power value = 0.45 }
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = capital
				condition = { type = noble_power value = 0.6 }
			}
			factor = 0.9
		}

		#capital province conditions check
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { heretic = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { bubonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { pneumonic_plague = yes } }
			factor = 100
		}
		modifier = {
			condition = { type = has_province_effect value = { malaria = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { dysentery = yes } }
			factor = 20
		}
		modifier = {
			condition = { type = has_province_effect value = { small_pox = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { typhoid_fever = yes } }
			factor = 50
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 10
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 5
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 0.75
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { traininggrounds = yes } }
			}
			factor = 0.95
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { medium_castle = yes } }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { large_castle = yes } }
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { huge_castle = yes } }
			}
			factor = 0.8
		}

		#ruler check
		modifier = {
			condition = { type = prestige value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 10
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = misguided_warrior }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = tough_soldier }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = knowledged_tactician }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = brilliant_strategist }
			factor = 0.75
		}
		modifier = {
			condition = { type = has_law value = { feudal_contract_law = yes } }
			factor = 0.75
		}
		modifier = {
			condition = { type = has_law value = { traditional_custom_law = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 1.5
		}

		#specific crusades modifiers
		modifier = {
			condition = { type = target value = 774 } #Jerusalem
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 764 } #Antioch
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 802 } #Alexandria
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 817 } #Tunis
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 496 } #Byzantion
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 333 } #Roma
			factor = 0.5
		}
		modifier = {
			condition = { type = target value = 340 } #Sicily
			factor = 0.9
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Cordoba
			factor = 0.7
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 197 } #Toledo
			factor = 0.7
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 160 } #Lisboa
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 171 } #Valencia
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 165 } #Cadiz
			factor = 0.9
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Burgos
			factor = 0.6
		}


		#difficulty setting modifiers
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
		#special
		modifier = {
			condition = { type = or
				condition = { type = title value = PAPA }
				condition = { type = title value = TEMP }
				condition = { type = title value = HOSP }
				condition = { type = title value = TEUT }
			}
			condition = { type = capital
				condition = { type = not value = { type = realm_regiments value = 3 } }
			}
			factor = 0.05
		}
	}

	action_a = {#Deus Vult!
		effect = { 	type = add_regiment #this to default to the character's culture and capital province tech level
				strength = {
					heavy_cav = 250
					light_cav = 500
				}
		}
		effect = { 	type = add_regiment 
				strength = {
					heavy_cav = 150 
					light_cav = 250 
					heavy_inf = 150 
				}
		}
#cost of this rem-ed out for now until the new effect is coded
#		effect = { type = prosperity for = capital value = -1 } #some of the troops come from your capital
		effect = {
			type = random
			chance = 50
			effect = { 	type = add_regiment 
					strength = {
						heavy_cav = 200 
						light_cav = 250 
					}
			}
			effect = { 	type = add_regiment 
					strength = {
						heavy_cav = 150 
						light_cav = 200 
				}
			}
#			effect = { type = prosperity for = random value = -1 } #some come from the surrounding countryside
		}
	}

	action_b = {#I thank you, but I'd prefer some gold instead
		effect = { type = prestige value = 25 }
		effect = { type = piety value = -10 }
		effect = { type = gold value = 200 }
		effect = {
			type = random
			chance = 33
			effect = { type = gold scale = 1 }
		}
	}
}

#############################################################
# A War Veteran Wishes to Pledge Himself to your Holy Cause #
#############################################################

character_event = {
	id = 1904

	picture = "event_appearance"

	trigger = {
		condition = { type = crusade }
		condition = { type = ruler }
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = not value = { type = trait value = kinslayer }}
		condition = { type = prestige value = 100 }
		condition = { type = piety value = 25 }
	}

	mean_time_to_happen = {
		months = 6000

		#check whether actively crusading and target is still in enemy hands
		modifier = {
			condition = { type = on_crusade }
			factor = 0.05
		}

		#ruler check
		modifier = {
			condition = { type = prestige value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 10
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = misguided_warrior }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = tough_soldier }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = knowledged_tactician }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = brilliant_strategist }
			factor = 0.75
		}

		#specific crusades modifiers
		modifier = {
			condition = { type = target value = 774 } #Jerusalem
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 764 } #Antioch
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 802 } #Alexandria
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 817 } #Tunis
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 496 } #Byzantion
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 333 } #Roma
			factor = 0.5
		}
		modifier = {
			condition = { type = target value = 340 } #Sicily
			factor = 0.9
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Cordoba
			factor = 0.7
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 197 } #Toledo
			factor = 0.7
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 160 } #Lisboa
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 171 } #Valencia
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 165 } #Cadiz
			factor = 0.9
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Burgos
			factor = 0.6
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = marshal_csc
					condition = { type = martial value = 0 }
				}
			}
			factor = 0.01
		}
		#difficulty setting modifiers
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
	}

	action_a = {#Welcome! I will find an army for you to command!
		effect = { 	type = create_courtier value = marshal }
	}

	action_b = {#Thanks, but I have all the generals I need!
		effect = { type = prestige value = 5 }
		effect = { type = piety value = -5 }
	}
}

#####################################
# A War Veteran Offers His Services #
#####################################

character_event = {
	id = 1905

	picture = "event_appearance"

	trigger = {
		condition = { type = crusade }
		condition = { type = ruler }
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated }}
		condition = { type = not value = { type = trait value = heretic }}
		condition = { type = not value = { type = trait value = kinslayer }}
		condition = { type = prestige value = 100 }
		condition = { type = piety value = 25 }
	}

	mean_time_to_happen = {
		months = 4800

		#check whether actively crusading and target is still in enemy hands
		modifier = {
			condition = { type = on_crusade }
			factor = 0.05
		}

		#ruler check
		modifier = {
			condition = { type = prestige value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = prestige value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = just }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 10
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = misguided_warrior }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = tough_soldier }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = knowledged_tactician }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = brilliant_strategist }
			factor = 0.75
		}

		#specific crusades modifiers
		modifier = {
			condition = { type = target value = 774 } #Jerusalem
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 764 } #Antioch
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 802 } #Alexandria
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 817 } #Tunis
			factor = 0.85
		}
		modifier = {
			condition = { type = target value = 496 } #Byzantion
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 333 } #Roma
			factor = 0.5
		}
		modifier = {
			condition = { type = target value = 340 } #Sicily
			factor = 0.9
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Cordoba
			factor = 0.7
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 197 } #Toledo
			factor = 0.7
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 160 } #Lisboa
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 171 } #Valencia
			factor = 0.8
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 165 } #Cadiz
			factor = 0.9
		}
		modifier = {
			condition = { type = region value = spain }
			condition = { type = target value = 181 } #Burgos
			factor = 0.6
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = marshal_csc
					condition = { type = martial value = 0 }
				}
			}
			factor = 0.01
		}


		#difficulty setting modifiers
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 1.15
		}
	}

	action_a = {#Welcome! I will assign an army for you to command soon!
		effect = { type = gold scale = -0.2}
		effect = { type = create_courtier value = marshal }
	}

	action_b = {#Thanks, but I have all the generals I need!
		effect = { type = prestige value = 20 }
	}
}

###############################
###############################
## CRUSADE CONVERSION EVENTS ##
###############################
###############################

####################################################
# Christian-owned Moslem province during a crusade #
####################################################

province_event = { # The clergy wish to take it upon themselves to try converting the heathens in one of your provinces.

	id = 1906
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = owner
			condition = { type = religion value = catholic }
		}
		condition = { type = not value = { type = trait value = excommunicated } }
		condition = { type = not value = { type = trait value = heretic } }
	}

	mean_time_to_happen = {
		months = 12000
		modifier = {
			condition = {
				type = owner
				condition = { type = on_crusade }
			}
			factor = 0.85
		}
		modifier = {
			condition = { type = region value = Spain }
			factor = 0.5
		}
		modifier = {
			condition = { type = region value = Middle_East }
			factor = 0.85
		}
		modifier = {
			condition = { type = region value = Asia_Minor }
			factor = 0.95
		}
		modifier = {
			condition = { type = region value = North_Africa }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = clergy_power value = 0.15 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = clergy_power value = 0.2 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = clergy_power value = 0.25 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = clergy_power value = 0.3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = clergy_power value = 0.35 }
			factor = 0.9
		}
		modifier = {
			condition = { type = clergy_power value = 0.4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = clergy_power value = 0.45 }
			factor = 0.9
		}
		modifier = {
			condition = { type = clergy_power value = 0.5 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = clergy_loyalty value = 0.25 } }
			factor = 5
		}
		modifier = {
			condition = { type = not value = { type = clergy_loyalty value = 0.5 } }
			factor = 2
		}
		modifier = {
			condition = { type = not value = { type = clergy_loyalty value = 0.75 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = clergy_loyalty value = 1.0 }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_advance value = { inquisition = yes } }
			factor = 0.5
		}
		modifier = {
			condition = { type = has_advance value = { letters_of_indulgence = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_advance value = { formalized_lithurgy = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_advance value = { jubilee = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_advance value = { ascetism = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_advance value = { apostolic_poverty = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_advance value = { critical_bible_interpretations = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_advance value = { bible_translations = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_advance value = { critical_thinking = yes } }
			factor = 1.5
		}
		modifier = {
			condition = { type = has_improvement value = { church  = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_improvement value = { large_church = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_improvement value = { domed_church = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_improvement value = { cathedral = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_piety value = 0 } }
			factor = 2
		}
		modifier = {
			condition = { type = not value = { type = ruler_piety value = 25 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = ruler_piety value = 50 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = ruler_piety value = 100 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_piety value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 2500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = capital value = yes }
			factor = 0.1
		}
		modifier = {
			condition = {
				type = owner
				condition = { type = papacy }
			}
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = detached_priest }
			factor = 0.95
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = scholarly_theologian }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = temperate }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = indulgent }
			factor = 1.1
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.8
		}
	}
	action_a = { #I will support your efforts
		effect = { type = ruler_gold value = -100 }
		effect = { type = ruler_piety value = 50 }
		effect = { type = clergy_power value = 0.05 }
		effect = { type = clergy_loyalty value = 0.25 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = catholic }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_b = { #I grant you leave to try
		effect = { type = ruler_piety value = 5 }
		effect = { type = clergy_power value = 0.1 }
		effect = { type = clergy_loyalty value = 0.05 }
		effect = {
			type = random
			chance = 15
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 20 }
		}
		effect = {
			type = random
			chance = 50
			effect = { type = prosperity value = -1 }
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_c = { #This is really not a good time to try that
		effect = { type = ruler_piety value = -10 }
		effect = { type = clergy_power value = -0.1 }
		effect = { type = clergy_loyalty value = -0.2 }
	}
}

province_event = { # The nobility wish to take it upon themselves to try converting the heathens in one of your provinces.

	id = 1907
	picture = "event_heretic"

	trigger = {
		condition = { type = crusade }
		condition = { type = not value = { type = religion value = catholic } }
		condition = {
			type = owner
			condition = { type = religion value = catholic }
		}
		condition = { type = not value = { type = trait value = excommunicated } }
		condition = { type = not value = { type = trait value = heretic } }
	}

	mean_time_to_happen = {
		months = 12000
		modifier = {
			condition = {
				type = owner
				condition = { type = on_crusade }
			}
			factor = 0.85
		}
		modifier = {
			condition = { type = region value = Spain }
			factor = 0.85
		}
		modifier = {
			condition = { type = region value = Middle_East }
			factor = 0.75
		}
		modifier = {
			condition = { type = region value = Asia_Minor }
			factor = 0.9
		}
		modifier = {
			condition = { type = region value = North_Africa }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = noble_power value = 0.15 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = noble_power value = 0.2 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = noble_power value = 0.25 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = noble_power value = 0.3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = noble_power value = 0.35 }
			factor = 0.9
		}
		modifier = {
			condition = { type = noble_power value = 0.4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = noble_power value = 0.45 }
			factor = 0.9
		}
		modifier = {
			condition = { type = noble_power value = 0.5 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = noble_loyalty value = 0.25 } }
			factor = 5
		}
		modifier = {
			condition = { type = not value = { type = noble_loyalty value = 0.5 } }
			factor = 2
		}
		modifier = {
			condition = { type = not value = { type = noble_loyalty value = 0.75 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = noble_loyalty value = 1.0 }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_advance value = { inquisition = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_advance value = { letters_of_indulgence = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { formalized_lithurgy = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { jubilee = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_advance value = { ascetism = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { apostolic_poverty = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { critical_bible_interpretations = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { bible_translations = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { critical_thinking = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_improvement value = { templar_house = yes } }
			factor = 0.75
		}
		modifier = {
			condition = { type = not value = { type = ruler_piety value = 0 } }
			factor = 2
		}
		modifier = {
			condition = { type = not value = { type = ruler_piety value = 25 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = ruler_piety value = 50 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = ruler_piety value = 100 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_piety value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_piety value = 2500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = capital value = yes }
			factor = 0.1
		}
		modifier = {
			condition = {
				type = owner
				condition = { type = papacy }
			}
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 0.95
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 5
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.85
		}
	}
	action_a = { #I will support your efforts
		effect = { type = ruler_gold value = -250 }
		effect = { type = ruler_piety value = 50 }
		effect = { type = noble_power value = 0.05 }
		effect = { type = noble_loyalty value = 0.25 }
		effect = {
			type = random
			chance = 75
			effect = { type = religion value = catholic }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_b = { #I grant you leave to try
		effect = { type = ruler_piety value = 5 }
		effect = { type = noble_power value = 0.1 }
		effect = { type = noble_loyalty value = 0.05 }
		effect = {
			type = random
			chance = 15
			effect = { type = religion value = catholic }
			effect = { type = ruler_piety value = 20 }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = religion value = catholic }
			effect = { type = add_province_effect value = looted }
			effect = { type = ruler_piety value = -5 }
		}
		effect = {
			type = random
			chance = 45
			effect = { type = prosperity value = -2 }
			effect = { type = add_province_effect value = looted }
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_c = { #This is really not a good time to try that
		effect = { type = ruler_piety value = -10 }
		effect = { type = noble_power value = -0.1 }
		effect = { type = noble_loyalty value = -0.2 }
	}
}

#################################################
# Moslem counter-conversion during the crusades #
#################################################

province_event = { #Moslems have attempted to convert one of their conquered catholic provinces

	id = 1908

	trigger = {
		condition = { type = crusade }
		condition = { type = not value = { type = religion value = moslem} }
		condition = {
			type = owner
			condition = { type = religion value = moslem}
		}
	}

	mean_time_to_happen = {
		months = 12000

		modifier = {
			condition = { type = region value = Spain }
			factor = 0.75
		}
		modifier = {
			condition = { type = region value = Middle_East }
			factor = 0.5
		}
		modifier = {
			condition = { type = region value = Asia_Minor }
			factor = 0.25
		}
		modifier = {
			condition = { type = region value = North_Africa }
			factor = 0.5
		}
		modifier = {
			condition = { type = has_advance value = { inquisition = yes } }
			factor = 0.75
		}
		modifier = {
			condition = { type = has_advance value = { letters_of_indulgence = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_advance value = { formalized_lithurgy = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_advance value = { jubilee = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_advance value = { ascetism = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_advance value = { apostolic_poverty = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_advance value = { critical_bible_interpretations = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_advance value = { bible_translations = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_advance value = { critical_thinking = yes } }
			factor = 1.2
		}
		modifier = {
			condition = { type = capital value = yes }
			factor = 0.1
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 0.95
		}
		modifier = {
			condition =  { type = has_improvement value = { church = yes } }
			factor = 0.9
		}
		modifier = {
			condition =  { type = has_improvement value = { large_church = yes } }
			factor = 0.9
		}
		modifier = {
			condition =  { type = has_improvement value = { domed_church = yes } }
			factor = 0.9
		}
		modifier = {
			condition =  { type = has_improvement value = { cathedral = yes } }
			factor = 0.9
		}

	}
	action_a = { #It was a gentle attempt
		ai_chance = 50
		effect = { type = ruler_gold value = -100 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = moslem }
		}
		effect = {
			type = random
			chance = 15
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_b = { #It was a bloody affair
		ai_chance = 50
		modifier = {
			condition = { type = region value = Spain }
			factor = 0.5
		}
		modifier = {
			condition = { type = region value = Middle_East }
			factor = 3
		}
		modifier = {
			condition = { type = region value = Asia_Minor }
			factor = 5
		}
		modifier = {
			condition = { type = region value = North_Africa }
			factor = 2
		}
		effect = { type = prosperity value = -1 }
		effect = {
			type = random
			chance = 50
			effect = { type = religion value = moslem }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = add_province_effect value = looted }
			effect = { type = add_province_effect value = revolt }
		}
	}
}


#
# NEXT EVENT IN THIS SERIES 1909
#

#####################################################
#####################################################
## EVENTS TO IMPROVE AI RESPONSIVENESS TO CRUSADES ##
#####################################################
#####################################################

#####################################
# Catholic rulers take up the cross #
#####################################

character_event = { #The Pope urges you to take up the cross and join God's Holy crusade!
	id = 1920
	picture = "event_crusades"

	trigger = {
		condition = { type = ai }
		condition = { type = is_independent }
		condition = { type = crusade }
		condition = { type = not value = { type = atwar } }
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = trait value = excommunicated } }
		condition = { type = not value = { type = trait value = heretic } }
		condition = { type = not value = { type = trait value = stutter } }
		condition = {
			type = or
			condition = {
				type = and
				condition = { type = target value = 774 }
				condition = { type = province 
					province = 774
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 764 }
				condition = { type = province 
					province = 764
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 802 }
				condition = { type = province 
					province = 802 
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 817 }
				condition = { type = province 
					province = 817
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 496 }
				condition = { type = province 
					province = 496
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 333 }
				condition = { type = province 
					province = 333
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 340 }
				condition = { type = province 
					province = 340 
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 181 }
				condition = { type = province 
					province = 181
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 197 }
				condition = { type = province 
					province = 197
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 160 }
				condition = { type = province 
					province = 160
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 171 }
				condition = { type = province 
					province = 171
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 165 }
				condition = { type = province 
					province = 165
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 199 }
				condition = { type = province 
					province = 199
					condition = {
						type = and
						condition = { type = not value = { type = ruler_religion value = catholic }}
						condition = { type = not value = { type = ruler_religion value = orthodox }}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 2000

		modifier = {
			condition = { type = kingdom }
			factor = 0.1
		}
		modifier = {
			condition = { type = kingdom }
			condition = { type = any_vassal
				condition = { type = trait value = intestinal_worm }
			}
			factor = 2
		}
		modifier = {
			condition = { type = county }
			factor = 10
		}
		modifier = {
			condition = {
				type = or
				condition = { type = target value = 774 }
				condition = { type = target value = 764 }
				condition = { type = target value = 802 }
				condition = { type = target value = 817 }
			}
			condition = {
				type = or
				condition = { type = title value = ENGL }
				condition = { type = title value = FRAN }
				condition = { type = title value = GERM }
			}
			factor = 0.35
		}
		modifier = {
			condition = {
				type = or
				condition = { type = target value = 774 }
				condition = { type = target value = 764 }
				condition = { type = target value = 802 }
				condition = { type = target value = 817 }
			}
			condition = {
				type = or
				condition = { type = title value = JERU }
				condition = { type = title value = HOSP }
				condition = { type = title value = TEMP }
			}
			factor = 0.6
		}
		modifier = {
			condition = {
				type = or
				condition = { type = target value = 774 }
				condition = { type = target value = 764 }
				condition = { type = target value = 802 }
				condition = { type = target value = 817 }
			}
			condition = {
				type = or
				condition = { type = title value = TEUT }
				condition = { type = title value = VENE }
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = or
				condition = { type = target value = 181 }
				condition = { type = target value = 197 }
				condition = { type = target value = 160 }
				condition = { type = target value = 171 }
				condition = { type = target value = 165 }
				condition = { type = target value = 199 }
			}
			condition = { 
				type = or
				condition = { type = culture value = Castillan }
				condition = { type = culture value = Catalan }
				condition = { type = culture value = Basque }
				condition = { type = culture value = Portuguese }
			}
			factor = 0.35
		}
		modifier = {
			condition = {
				type = or
				condition = { type = target value = 181 }
				condition = { type = target value = 197 }
				condition = { type = target value = 160 }
				condition = { type = target value = 171 }
				condition = { type = target value = 165 }
				condition = { type = target value = 199 }
			}
			condition = { type = title value = FRAN }
			factor = 0.6
		}
		modifier = {
			condition = { type = target value = 333 }
			factor = 0.2
		}
		modifier = {
			condition = { type = target value = 340 }
			condition = { type = region value = Italy }
			factor = 0.6
		}
		modifier = {
			condition = { type = target value = 340 }
			condition = { type = title value = APUL }
			factor = 0.1
		}
		modifier = {
			condition = { type = target value = 340 }
			condition = { type = title value = NAPL }
			factor = 0.35
		}
		modifier = {
			condition = { type = target value = 496 }
			condition = {
				type = or
				condition = { type = culture value = german }
				condition = { type = culture value = hungarian }
				condition = { type = culture value = southslavic }
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = target value = 496 }
			condition = { type = culture value = italian }
			factor = 0.6
		}
		modifier = {
			condition = { type = not value = { type = age value = 16 } }
			factor = 3
		}
		modifier = {
			condition = { type = not value = { type = age value = 26 } }
			condition = { type = age value = 16 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 1.1
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 1.1
		}
		modifier = {
			condition = { type = age value = 60 }
			factor = 1.5
		}
		modifier = {
			condition = { type = not value = { type = martial value = 4 } }
			factor = 1.15
		}
		modifier = {
			condition = { type = martial value = 9 }
			factor = 0.8
		}
		modifier = {
			condition = { type = martial value = 12 }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = clubfooted }
			factor = 1.1
		}
		modifier = {
			condition = { type = trait value = coward }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = clubfooted }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = energetic }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = hunchback }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = illness }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = lazy }
			factor = 1.15
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = valorous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = war_invalid }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = brilliant_strategist }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = knowledged_tactician }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = misguided_warrior }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = tough_soldier }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 0.8
		}
		modifier = {
			condition = { type = title value = PAPA }
			factor = 50 #to reduce risk of having pope DOW and then be obliterated
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 1.00 }}
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.8 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.25 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.01 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = gold value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = gold value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = gold value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = gold value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 1000 }
			factor = 0.9
		}
	}

	action_a = { #I will summon my levies and follow the cross!
		ai_chance = 75
		modifier = {
			condition = { type = gold value = 250 }
			factor = 1.1
		}
		modifier = {
			condition = { type = gold value = 500 }
			factor = 1.1
		}
		modifier = {
			condition = { type = gold value = 1000 }
			factor = 1.2
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 1.00 } }
			factor = 1.05
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.8 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.5 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.25 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.01 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = county }
			factor = 0.33
		}
		modifier = {
			condition = { type = duchy }
			factor = 0.66
		}
		effect = { type = piety value = 25 }
		effect = { type = gold value = 250 } #extra contribution from feudal levies
		effect = { type = add_regiment #extra feudal levy
				strength = {
					heavy_cav = 150 
					light_cav = 300 
					archers = 200 
					heavy_inf = 200 
					pikemen = 200 
					militia = 400
				}
		}
		effect = { type = declare_war value = crusade_target_owner }
	}
	action_b = { #I dare not risk it.
		ai_chance = 25
		effect = {
			type = random
			chance = 25
			effect = { type = piety value = -10 }
		}
	}
}

#######################################################
# Generate extra support for a liege who is crusading #
#######################################################

character_event = { #Your liege demands that you join the holy crusade.

	id = 1921
	picture = "event_crusades"

	trigger = {
		condition = { type = is_vassal }
		condition = { type = religion value = catholic }
		condition = { type = not value = { type = atwar } }
		condition = { type = not value = { type = trait value = excommunicated } }
		condition = { type = not value = { type = trait value = heretic } }
		condition = {
			type = realm_ruler
			condition = { type = and
				condition = { type = on_crusade }
				condition = { type = not value = { type = enemy_same_religion } }
			}
		}
		condition = { type = liege #to prevent vassals of player from DOWing...that's the player's decision
			condition = { type = ai }
		}
	}

	mean_time_to_happen = {
		days = 180
		modifier = {
			condition = { type = duchy }
			factor = 0.3
		}
	}

	action_a = { #I will summon my levies and follow the cross!
		ai_chance = 80
		modifier = {
			condition = { type = trait value = intestinal_worm }
			factor = 0.1
		}
		effect = { type = declare_war value = crusade_target_owner }
		effect = { type = piety value = 15 }
		effect = { # possible enthusiastic response from your people
			type = random
			chance = 25
			effect = { type = add_regiment
				strength = {
					heavy_cav = 50 
					light_cav = 75 
					archers = 100 
					heavy_inf = 75 
					pikemen = 100 
					militia = 200
				}
			}
		}
	}
	action_b = { #No. I do not believe in this cause!
		ai_chance = 13
		modifier = {
			condition = { type = trait value = intestinal_worm }
			factor = 0.5
		}
		effect = { type = piety value = -15 }
		effect = { type = add_trait value = heretic }
		effect = { type = loyalty value = -0.5 }
		effect = { #The pope will likely be pretty angry if he hears this
			type = random
			chance = 50
			effect = { type = add_trait value = excommunicated }
		}
	}
	action_c = { #No. I renounce my liege!
		ai_chance = 7
		modifier = {
			condition = { type = trait value = intestinal_worm }
			factor = 100
		}
		effect = { type = piety value = -5 }
		effect = { type = independence }
		effect = { type = add_trait value = reckless }
		effect = { type = random chance = 75
			effect = { type = add_trait value = deceitful }
		}
		effect = { type = random chance = 50
			effect = { type = add_trait value = sceptical }
		}
		effect = { #the pope may not be impressed with your actions at this time
			type = random
			chance = 15
			effect = { type = add_trait value = excommunicated }
		}
	}
}

################################################################
# Vassals of Moslem rulers need support from their vassals too #
################################################################

character_event = { #The infidel has invaded my liege's realm!

	id = 1922
	picture = "event_crusades"

	trigger = {
		condition = { type = is_vassal }
		condition = { type = religion value = moslem }
		condition = { type = not value = { type = atwar } }
		condition = {
			type = realm_ruler
			condition = { type = on_crusade }
		}
	}

	mean_time_to_happen = {
		months = 12
		modifier = {
			condition = { type = duchy }
			factor = 0.3
		}
	}

	action_a = { #I will summon my levies!
		ai_chance = 80
		effect = { type = declare_war value = crusade_target_owner }
		effect = { # possible enthusiastic response from your people
			type = random
			chance = 10
			effect = { type = add_regiment
				strength = {
					heavy_cav = 50 
					light_cav = 75 
					archers = 100 
					heavy_inf = 75 
					pikemen = 100 
					militia = 200
				}
			}
		}
	}
	action_b = { #Not my problem!
		ai_chance = 10
		effect = { type = loyalty value = -0.5 }
	}
	action_c = { #wOOt! Free at last!
		ai_chance = 10
		effect = { type = add_trait value = reckless }
		effect = { type = add_trait value = bastard } #simulates being cast out of family so can't inherit realm if liege's child
		effect = { type = independence }
	}
}

##########################################
# Moslem rulers leap to defend territory #
##########################################

character_event = { #The infidels are attacking Moslem lands!
	id = 1923
	picture = "event_crusades"

	trigger = {
		condition = { type = ai }
		condition = { type = is_independent }
		condition = { type = crusade }
		condition = { type = not value = { type = atwar } }
		condition = { type = not value = { type = religion value = catholic } }
		condition = { type = not value = { type = religion value = orthodox } }
		condition = { type = not value = { type = religion value = pagan } }
		condition = { type = not value = { type = trait value = excommunicated } }
		condition = { type = not value = { type = trait value = heretic } }
		condition = {
			type = or
			condition = {
				type = and
				condition = { type = target value = 774 }
				condition = { type = province 
					province = 774
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 764 }
				condition = { type = province 
					province = 764
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 802 }
				condition = { type = province 
					province = 802 
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 817 }
				condition = { type = province 
					province = 817
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 496 }
				condition = { type = province 
					province = 496
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 340 }
				condition = { type = province 
					province = 340 
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 181 }
				condition = { type = province 
					province = 181
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 197 }
				condition = { type = province 
					province = 197
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 160 }
				condition = { type = province 
					province = 160
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 171 }
				condition = { type = province 
					province = 171
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 165 }
				condition = { type = province 
					province = 165
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
			condition = {
				type = and
				condition = { type = target value = 199 }
				condition = { type = province 
					province = 199
					condition = {
						type = or
						condition = { type = ruler_religion value = catholic }
						condition = { type = ruler_religion value = orthodox }
					}
				}
			}
		}
	}

	mean_time_to_happen = {

		months = 2000

		modifier = {
			condition = { type = kingdom }
			factor = 0.1
		}
		modifier = {
			condition = { type = county }
			factor = 10
		}
		modifier = {
			condition = {
				type = or
				condition = { type = target value = 774 }
				condition = { type = target value = 764 }
			}
			condition = { type = capital
				condition = { type = or
					condition = { type = region value = Middle_East }
					condition = { type = region value = Asia_Minor }
					condition = { type = area value = 780 }
					condition = { type = area value = 789 }
					condition = { type = area value = 790 }
					condition = { type = area value = 803 }
				}
			}
			factor = 0.2
		}
		modifier = {
			condition = { type = target value = 802 }
			condition = { type = capital
				condition = { type = or
					condition = { type = region value = Middle_East }
					condition = { type = area value = 780 }
					condition = { type = area value = 789 }
					condition = { type = area value = 790 }
					condition = { type = area value = 803 }
					condition = { type = area value = 805 }
					condition = { type = area value = 810 }
					condition = { type = area value = 815 }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { type = target value = 817 }
			condition = { type = capital
				condition = { type = region value = North_Africa }
			}
			factor = 0.75
		}
		modifier = {
			condition = {
				type = or
				condition = { type = target value = 181 }
				condition = { type = target value = 197 }
				condition = { type = target value = 160 }
				condition = { type = target value = 171 }
				condition = { type = target value = 165 }
				condition = { type = target value = 199 }
			}
			condition = { type = capital
				condition = { type = region value = Spain }
			}
			factor = 0.35
		}
		modifier = {
			condition = {
				type = or
				condition = { type = target value = 181 }
				condition = { type = target value = 197 }
				condition = { type = target value = 160 }
				condition = { type = target value = 171 }
				condition = { type = target value = 165 }
				condition = { type = target value = 199 }
			}
			condition = { type = capital
				condition = { type = or
					condition = { type = area value = 821 }
					condition = { type = area value = 828 }
					condition = { type = area value = 831 }
					condition = { type = area value = 837 }
					condition = { type = area value = 839 }
					condition = { type = area value = 847 }
					condition = { type = area value = 848 }
				}
			}
			factor = 0.5
		}
		modifier = {
			condition = { type = target value = 496 }
			condition = { type = capital
				condition = { type = region value = Middle_East }
			}
			factor = 0.25
		}
		modifier = {
			condition = { type = not value = { type = age value = 16 } }
			factor = 3
		}
		modifier = {
			condition = { type = not value = { type = age value = 26 } }
			condition = { type = age value = 16 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 1.1
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 1.1
		}
		modifier = {
			condition = { type = age value = 60 }
			factor = 1.5
		}
		modifier = {
			condition = { type = not value = { type = martial value = 4 } }
			factor = 1.15
		}
		modifier = {
			condition = { type = martial value = 9 }
			factor = 0.8
		}
		modifier = {
			condition = { type = martial value = 12 }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = clubfooted }
			factor = 1.1
		}
		modifier = {
			condition = { type = trait value = coward }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = clubfooted }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = crusader }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = energetic }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = hunchback }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = illness }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = lazy }
			factor = 1.15
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = valorous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = war_invalid }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = brilliant_strategist }
			factor = 0.75
		}
		modifier = {
			condition = { type = trait value = knowledged_tactician }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = misguided_warrior }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = tough_soldier }
			factor = 0.85
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 1.00 }}
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.8 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.25 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.01 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = gold value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = gold value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = gold value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = gold value = 1000 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 250 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 500 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 1000 }
			factor = 0.9
		}
	}

	action_a = { #I will help repell the scum!
		ai_chance = 75
		modifier = {
			condition = { type = gold value = 250 }
			factor = 1.1
		}
		modifier = {
			condition = { type = gold value = 500 }
			factor = 1.1
		}
		modifier = {
			condition = { type = gold value = 1000 }
			factor = 1.2
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 1.00 } }
			factor = 1.05
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.8 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.5 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.25 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = efficiency value = 0.01 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = county }
			factor = 0.33
		}
		modifier = {
			condition = { type = duchy }
			factor = 0.66
		}
		effect = { type = gold value = 250 } #extra contribution from feudal levies
		effect = { type = add_regiment #extra feudal levy
				strength = {
					heavy_cav = 150 
					light_cav = 200 
					archer_cav = 300 
					heavy_inf = 200 
					pikemen = 200 
					militia = 400
				}
		}
		effect = { type = declare_war value = crusade_target_owner }
	}
	action_b = { #I dare not risk it.
		ai_chance = 25
		effect = {
			type = random
			chance = 50
			effect = { type = prestige scale = -10 }
		}
	}
}

###############################################
###############################################
## ORIGINAL CRUSADE EVENTS THAT I'VE LEFT IN ##
###############################################
###############################################

#######################################################
# God will forgive your sins if you join the Crusade #
#######################################################

character_event = {
	id = 1185
	
	picture = "event_crusades"
	
	trigger = { 
		condition = { type = ruler }
		condition = { type = crusade }		
		condition = { type = religion value = catholic }
		condition = { 
			type = or 
			condition = {
				type = trait
				value = sceptical
			}
			condition = {
				type = trait
				value = heretic
			}
		}
		condition = { 
			type = not 
			value = {
				type = trait
				value = crusader
			}
		}	
		condition = { 
			type = not 
			value = {
				type = trait
				value = excommunicated
			}
		}	
	}

	mean_time_to_happen = {
		months = 60

		modifier = { 

		}
	}

	action_a = {#Deus Vult!
		ai_chance = 75
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = add_trait value = crusader }
		effect = { type = remove_trait value = sceptical }
		effect = { type = remove_trait value = heretic }
	}

	action_b = {#Pff!
		ai_chance = 25
		effect = { type = add_trait value = excommunicated }
		effect = { type = piety value = -100 }
	}
}
########################################################
# God will heal your ailments if you join the Crusade #
########################################################

character_event = {
	id = 1186
	
	picture = "event_crusades"
	
	trigger = { 
		condition = { type = ruler }
		condition = { type = crusade }		
		condition = { type = religion value = catholic }
		condition = { 
			type = or 
			condition = {
				type = trait
				value = hunchback
			}
			condition= {
				type = trait
				value = clubfooted
			}
			condition = {
				type = trait
				value = lisp
			}
			condition = {
				type = trait
				value = inbred
			}
			condition = {
				type = trait
				value = harelip
			}
		}
		condition = { 
			type = not 
			value = {
				type = trait
				value = crusader
			}
		}	
		condition = { 
			type = not 
			value = {
				type = trait
				value = excommunicated
			}
		}	
	}

	mean_time_to_happen = {
		months = 360

		modifier = { 

		}
	}

	action_a = {#Deus Vult!
		ai_chance = 85
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = add_trait value = crusader }
		effect = { type = remove_trait value = hunchback }
		effect = { type = remove_trait value = clubfooted }
		effect = { type = remove_trait value = lisp }
		effect = { type = remove_trait value = inbred }
		effect = { type = remove_trait value = harelip }
	}

	action_b = {#Pff!
		ai_chance = 15
		effect = { type = piety value = -100 }
		effect = { type = add_trait value = excommunicated }
	}
}
#######################################################
# God urges you to take the Cross!	              #
#######################################################

character_event = {
	id = 1187
	
	picture = "event_crusades"
	
	trigger = { 
		condition = { type = ruler }
		condition = { type = crusade }		
		condition = { type = religion value = catholic }
		condition = { type = trait value = zealous }
		condition = { type = not value = { type = trait value = heretic } }
		condition = { 
			type = not 
			value = {
				type = trait
				value = crusader
			}
		}	

		condition = { 
			type = not 
			value = {
				type = trait
				value = excommunicated
			}
		}		}

	mean_time_to_happen = {
		months = 60

		modifier = { 

		}
	}

	action_a = {#Deus Vult!
		ai_chance = 65
			modifier = {
				condition = { type = or
					condition = { type = title value = PAPA }
					condition = { type = title value = TEMP }
					condition = { type = title value = HOSP }
					condition = { type = title value = TEUT }
				}
				factor = 100
			}
		effect = { type = add_trait value = crusader }
		effect = { type = piety value = 100 }
	}


	action_b = {#Pff!
		ai_chance = 35
		effect = { type = piety value = -100 }
		effect = { type = add_trait value = sceptical }
	}
}

#
# NEXT EVENT IN THIS SERIES NONE (PE RESERVED RANGE)
#
