##############################
# Chaplain events: 7800-7899 #
#                            #
#      Thomas Corriol        #
##############################
# Triggers revised by Byakhiam 6.4.05
########
# For the following "trial events", 
# the ruler would always be considered the same side of the Chaplain,
# i.e. choosing a non-heretic chaplain for a heretic ruler
# or an heretic chaplain for a non-heretic ruler does not make sense.
# Also, the ruler will always be considered the same religion as the Chaplain

# Heretic Courtier and Non-Heretic Chaplain: Fair trial

character_event = {
	id = 7800
	
	picture = "event_heretic"
	
	trigger = {
#		condition = { type = not value = { type = ai } }
		condition = { type = or 
			condition = { type = not value = { type = is_married } }
			condition = { type = gender value = male }
			}
		condition = { type = age value = 16 }
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = chaplain } }
		condition = { type = trait value = heretic }
		condition = {
			type = chaplain_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
		condition = {
			type = ruler_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
		condition = {
			type = or 
			condition = {
				type = and
				condition = { type = religion value = catholic } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = catholic } 
				}
			}
			condition = {
				type = and
				condition = { type = religion value = orthodox } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = orthodox } 
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# Courtier traits:

		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 = scholarly_theologian }
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = excommunicated }
			factor = 0.2
		}

		# Chaplain traits:

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = energetic }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = lazy }
			}
			factor = 1.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = vengeful }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = forgiving }
			}
			factor = 3
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = cruel }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = merciful }
			}
			factor = 2
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = zealous }
			}
			factor = 0.6
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = sceptical }
			}
			factor = 4
		}
		
		# Realm:

		modifier = {
			condition = {
				type = ruler_csc
				condition = { type = has_advance value = inquisition }
			}
			factor = 0.7
		}
	}

	action_a = {#Exile the heretic
		effect = { type = loyalty value = 1.0 }
		effect = { type = courtier_defect value = random_neighbor }
		effect = { type = random
				chance = 10
				effect = { type = add_trait for = ruler value = just }
		}
		effect = { type = random
				chance = 25
				effect = { type = remove_trait for = ruler value = zealous }
		}
		effect = { type = random
				chance = 25
				effect = { type = remove_trait for = ruler value = sceptical }
		}
	}

	action_b = {#Tolerate the heretic
		effect = { type = loyalty value = 0.1 }
		effect = { type = trigger for = ruler value = 7817 }
		effect = { type = trigger for = chaplain value = 7804 }
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = forgiving }
		}
		effect = { type = remove_trait for = ruler value = zealous }
		effect = { type = random
				chance = 33
				effect = { type = add_trait for = ruler value = sceptical }
		}
	}

	action_c = {#Put the heretic at the stake !
		effect = { type = death }
		effect = { type = random
				chance = 20
				effect = { type = add_trait for = ruler value = cruel }
		}
		effect = { type = random
				chance = 10
				effect = { type = add_trait for = chaplain value = cruel }
		}
		effect = { type = remove_trait for = ruler value = sceptical }
		effect = { type = random
				chance = 50
				effect = { type = add_trait for = ruler value = zealous }
		}
	}

	action_d = {#Sack Chaplain
		effect = { type = loyalty value = 0.25 }
		effect = { type = trigger for = ruler value = 7818 }
		effect = { type = remove_trait for = ruler value = zealous }
		effect = { type = random
				chance = 50
				effect = { type = add_trait for = ruler value = sceptical }
		}
		effect = { type = random
				chance = 10
				effect = { type = add_trait for = ruler value = arbitrary }
		}
		effect = { type = trigger for = chaplain value = 7805 }
	}
}

# "Heretic" Courtier and Zealous Non-Heretic Chaplain: Unfair trial

character_event = {
	id = 7801
	
	picture = "event_heretic"
	
	trigger = {
#		condition = { type = not value = { type = ai } }
		condition = { type = or 
			condition = { type = not value = { type = is_married } }
			condition = { type = gender value = male }
			}
		condition = { type = age value = 16 }
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = chaplain } }
		condition = { type = trait value = sceptical }
		condition = { type = not value = { type = trait value = heretic } }
		condition = {
			type = chaplain_csc
			condition = { type = and
				condition = { type = not value = { type = trait value = heretic } }
				condition = { type = trait value = zealous }
			}
		}
		condition = {
			type = ruler_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
		condition = {
			type = or 
			condition = {
				type = and
				condition = { type = religion value = catholic } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = catholic } 
				}
			}
			condition = {
				type = and
				condition = { type = religion value = orthodox } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = orthodox } 
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# Courtier traits:

		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 = scholarly_theologian }
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.7
		}
		modifier = {
			condition = { type = trait value = excommunicated }
			factor = 0.2
		}

		# Chaplain traits:

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = energetic }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = lazy }
			}
			factor = 2.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = vengeful }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = forgiving }
			}
			factor = 1.2
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = cruel }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = merciful }
			}
			factor = 2
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = suspicious }
			}
			factor = 0.6
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = trusting }
			}
			factor = 1.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = just }
			}
			factor = 3
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = arbitrary }
			}
			factor = 0.5
		}

		# Realm:

		modifier = {
			condition = {
				type = ruler_csc
				condition = { type = has_advance value = inquisition }
			}
			factor = 0.5
		}

		# Ruler traits:

		modifier = {
			condition = {
				type = ruler_csc
				condition = { type = trait value = just }
			}
			factor = 4
		}
	}

	action_a = {#Exile the "heretic"
		effect = { type = random
				chance = 20
				effect = { type = add_trait for = ruler value = arbitrary }
		}
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = zealous }
		}
		effect = { type = random
				chance = 50
				effect = { type = remove_trait for = ruler value = sceptical }
		}
		effect = { type = courtier_defect value = random_neighbor }
		effect = { type = loyalty value = 1.0 }
	}

	action_b = {#Tolerate the "heretic"
		effect = { type = loyalty value = 0.1 }
		effect = { type = trigger for = chaplain value = 7804 }
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = just }
		}
		effect = { type = random
				chance = 25
				effect = { type = remove_trait for = ruler value = zealous }
		}
		effect = { type = random
				chance = 33
				effect = { type = add_trait for = ruler value = sceptical }
		}
	}

	action_c = {#Put the "heretic" at the stake !
		effect = { type = death }
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = arbitrary }
		}
		effect = { type = random
				chance = 33
				effect = { type = add_trait for = ruler value = cruel }
		}
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = chaplain value = cruel }
		}
		effect = { type = remove_trait for = ruler value = sceptical }
		effect = { type = random
				chance = 75
				effect = { type = add_trait for = ruler value = zealous }
		}
	}

	action_d = {#Sack Chaplain
		effect = { type = loyalty value = 0.25 }
		effect = { type = trigger for = ruler value = 7817 }
		effect = { type = remove_trait for = ruler value = zealous }
		effect = { type = random
				chance = 50
				effect = { type = add_trait for = ruler value = sceptical }
		}
		effect = { type = random
				chance = 10
				effect = { type = add_trait for = ruler value = just }
		}
		effect = { type = trigger for = chaplain value = 7805 }
	}
}

# Non-Heretic Courtier and Heretic Chaplain: Fair trial

character_event = {
	id = 7802
	
	picture = "event_heretic"
	
	trigger = {
#		condition = { type = not value = { type = ai } }
		condition = { type = or 
			condition = { type = not value = { type = is_married } }
			condition = { type = gender value = male }
			}
		condition = { type = age value = 16 }
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = chaplain } }
		condition = { type = not value = { type = trait value = heretic } }
		condition = {
			type = chaplain_csc
			condition = { type = trait value = heretic }
		}
		condition = {
			type = ruler_csc
			condition = { type = trait value = heretic }
		}
		condition = {
			type = or 
			condition = {
				type = and
				condition = { type = religion value = catholic } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = catholic } 
				}
			}
			condition = {
				type = and
				condition = { type = religion value = orthodox } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = orthodox } 
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# Courtier traits:

		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 = scholarly_theologian }
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 1.2
		}

		# Chaplain traits:

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = energetic }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = lazy }
			}
			factor = 1.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = vengeful }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = forgiving }
			}
			factor = 3
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = cruel }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = merciful }
			}
			factor = 2
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = zealous }
			}
			factor = 0.6
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = sceptical }
			}
			factor = 4
		}
	}

	action_a = {#Exile the non-heretic
		effect = { type = trigger for = ruler value = 7817 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait for = ruler value = arbitrary }
		}
		effect = { type = random
				chance = 25
				effect = { type = remove_trait for = ruler value = zealous }
		}
		effect = { type = random
				chance = 25
				effect = { type = remove_trait for = ruler value = sceptical }
		}
		effect = { type = courtier_defect value = random_neighbor }
		effect = { type = loyalty value = 1.0 }
	}

	action_b = {#Tolerate the non-heretic
		effect = { type = loyalty value = 0.1 }
		effect = { type = trigger for = chaplain value = 7804 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait for = ruler value = just }
		}
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = forgiving }
		}
		effect = { type = remove_trait for = ruler value = zealous }
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = sceptical }
		}
	}

	action_c = {#Put the non-heretic at the stake !
		effect = { type = death }
		effect = { type = trigger for = ruler value = 7818 }
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = cruel }
		}
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = chaplain value = cruel }
		}
		effect = { type = remove_trait for = ruler value = sceptical }
		effect = { type = random
				chance = 50
				effect = { type = add_trait for = ruler value = zealous }
		}
	}

	action_d = {#Sack Chaplain
		effect = { type = loyalty value = 0.25 }
		effect = { type = remove_trait for = ruler value = zealous }
		effect = { type = random
				chance = 50
				effect = { type = add_trait for = ruler value = sceptical }
		}
		effect = { type = trigger for = chaplain value = 7805 }
	}
}

# "Heretic" Courtier and Zealous Heretic Chaplain: Unfair trial

character_event = {
	id = 7803
	
	picture = "event_heretic"
	
	trigger = {
#		condition = { type = not value = { type = ai } }
		condition = { type = or 
			condition = { type = not value = { type = is_married } }
			condition = { type = gender value = male }
			}
		condition = { type = age value = 16 }
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = chaplain } }
		condition = { type = trait value = heretic }
		condition = { type = trait value = sceptical }
		condition = {
			type = chaplain_csc
			condition = { type = and
				condition = { type = trait value = zealous }
				condition = { type = trait value = heretic }
			}
		}
		condition = {
			type = ruler_csc
			condition = { type = trait value = heretic }
		}
		condition = {
			type = or 
			condition = {
				type = and
				condition = { type = religion value = catholic } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = catholic } 
				}
			}
			condition = {
				type = and
				condition = { type = religion value = orthodox } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = orthodox } 
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# Courtier traits:

		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 = scholarly_theologian }
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.7
		}

		# Chaplain traits:

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = energetic }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = lazy }
			}
			factor = 2.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = vengeful }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = forgiving }
			}
			factor = 1.2
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = cruel }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = merciful }
			}
			factor = 2
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = suspicious }
			}
			factor = 0.6
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = trusting }
			}
			factor = 1.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = just }
			}
			factor = 3
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = arbitrary }
			}
			factor = 0.5
		}

		# Ruler traits:

		modifier = {
			condition = {
				type = ruler_csc
				condition = { type = trait value = just }
			}
			factor = 4
		}
	}

	action_a = {#Exile the "heretic"
		effect = { type = random
				chance = 20
				effect = { type = add_trait for = ruler value = arbitrary }
		}
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = zealous }
		}
		effect = { type = random
				chance = 50
				effect = { type = remove_trait for = ruler value = sceptical }
		}
		effect = { type = courtier_defect value = random_neighbor }
		effect = { type = loyalty value = 1.0 }
	}

	action_b = {#Tolerate the "heretic"
		effect = { type = loyalty value = 0.1 }
		effect = { type = trigger for = chaplain value = 7804 }
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = just }
		}
		effect = { type = random
				chance = 25
				effect = { type = remove_trait for = ruler value = zealous }
		}
		effect = { type = random
				chance = 33
				effect = { type = add_trait for = ruler value = sceptical }
		}
	}

	action_c = {#Put the "heretic" at the stake !
		effect = { type = death }
		effect = { type = random
				chance = 33
				effect = { type = add_trait for = ruler value = arbitrary }
		}
		effect = { type = random
				chance = 50
				effect = { type = add_trait for = ruler value = cruel }
		}
		effect = { type = random
				chance = 50
				effect = { type = add_trait for = chaplain value = cruel }
		}
		effect = { type = remove_trait for = ruler value = sceptical }
		effect = { type = add_trait for = ruler value = zealous }
	}

	action_d = {#Sack Chaplain
		effect = { type = loyalty value = 0.25 }
		effect = { type = remove_trait for = ruler value = zealous }
		effect = { type = random
				chance = 33
				effect = { type = add_trait for = ruler value = sceptical }
		}
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = just }
		}
		effect = { type = trigger for = chaplain value = 7806 }
	}
}

# Chaplain event counter-parts:

# Tolerant ruler:

character_event = {
	id = 7804
	
	picture = "event_intrigue"
	
	immidiate = {
		effect = { type = prestige value = -15 }
		effect = { type = loyalty value = -0.25 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait value = lazy }
		}
		effect = { type = random
				chance = 10
				effect = { type = add_trait value = modest }
		}
	}
}

# Chaplain sacked !

character_event = {
	id = 7805
	
	picture = "event_intrigue"
	
	immidiate = {
		effect = { type = prestige value = -25 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait value = vengeful }
		}
		effect = { type = random
				chance = 15
				effect = { type = add_trait value = zealous }
		}
		effect = { type = add_title_claim value = ruler }
		effect = { type = courtier_defect value = random_neighbor }
		effect = { type = loyalty value = 1.0 }
	}
}

# Heretic Chaplain sacked !

character_event = {
	id = 7806
	
	picture = "event_intrigue"
	
	immidiate = {
		effect = { type = prestige value = -25 }
		effect = { type = random
				chance = 25
				effect = { type = add_trait value = vengeful }
		}
		effect = { type = random
				chance = 15
				effect = { type = add_trait value = zealous }
		}
		effect = { type = courtier_defect value = random_neighbor }
		effect = { type = loyalty value = 1.0 }
	}
}

# Ruler event counter-parts:

character_event = {
	id = 7817
	
	picture = "event_religion"
	
	immidiate = {
		effect = { type = piety value = -15 }
	}
}

character_event = {
	id = 7818
	
	picture = "event_religion"
	
	immidiate = {
		effect = { type = piety value = -25 }
	}
}

################################################
# Ruler and Chaplain of different orientations #
################################################

character_event = {
	id = 7807
	
	picture = "event_religion"
	
	trigger = {
#		condition = { type = not value = { type = ai } }
		condition = { type = chaplain }
		condition = {
			type = or 
			condition = {
				type = and
				condition = {
					type = ruler_csc
					condition = { type = trait value = heretic }
				}
				condition = {
					type = chaplain_csc
					condition = { type = not value = { type = trait value = heretic } }
				}
			}
			condition = {
				type = and
				condition = {
					type = chaplain_csc
					condition = { type = trait value = heretic }
				}
				condition = {
					type = ruler_csc
					condition = { type = not value = { type = trait value = heretic } }
				}
			}
		}
		condition = {
			type = or 
			condition = {
				type = and
				condition = { type = religion value = catholic } 
				condition = {
					type = ruler_csc
					condition = { type = religion value = catholic } 
				}
			}
			condition = {
				type = and
				condition = { type = religion value = orthodox } 
				condition = {
					type = ruler_csc
					condition = { type = religion value = orthodox } 
				}
			}
		}
	}
	mean_time_to_happen = {
		months = 240

		# Chaplain traits:

		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = deceitful }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = honest }
			factor = 1.1
		}

		# Realm:

		modifier = {
			condition = {
				type = ruler_csc
				condition = { type = has_advance value = inquisition }
			}
			factor = 0.5
		}
	}

	immidiate = {#Chaplain leave ruler
		effect = { type = courtier_defect value = random_neighbor }
		effect = { type = loyalty value = 1.0 }
	}

}

############################################################
# Excommunication of an heretic character (if inquisition) #
############################################################

character_event = {
	id = 7808
	
	picture = "event_heretic"

	trigger = {
#		condition = { type = not value = { type = ai } }
		condition = { type = not value = { type = chaplain } }
		condition = { type = trait value = heretic }
		condition = { type = religion value = catholic }
		condition = {
			type = chaplain_csc
			condition = { type = not value = { type = trait value = heretic } }
			condition = { type = religion value = catholic }
		}
		condition = {
			type = capital
			condition = { type = has_advance value = { inquisition = yes } }
		}
	}

	mean_time_to_happen = {
		months = 900

		# Social importance of the character:

		modifier = { # Is Ruler
			condition = { type = ruler }
			factor = 2
		}
		modifier = { # Is Heir
			condition = { type = ruler_child }
			factor = 1.5
		}
		modifier = {
			condition = { type = not value = { type = age value = 16 } }
			factor = 3
		}
		modifier = { # Is an influent advisor
			condition = { 
				type = or
				condition = { type = steward }
				condition = { type = chancellor }
				condition = { type = spymaster }
				condition = { type = marshal }
			}
			factor = 0.9
		}

		# Traits

		modifier = { # Is an heretic preacher
			condition = { type = trait value = detached_priest }
			factor = 0.8
		}
		modifier = { # Is an heretic zealot fighter
			condition = { type = trait value = martial_cleric }
			factor = 0.7
		}
		modifier = { # Is an heretic scholar
			condition = { type = trait value = scholarly_theologian }
			factor = 0.6
		}
		modifier = { # Is an heretic master
			condition = { type = trait value = mastermind_theologian }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.8
		}

		# Laws

		modifier = {
			condition = { type = has_law value = { church_supremacy = yes } }
			factor = 0.5
		}
		
		# Chaplain traits

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = detached_priest }
			}
			factor = 1.3
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = energetic }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = lazy }
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = vengeful }
			}
			factor = 0.66
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = forgiving }
			}
			factor = 3
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = cruel }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = merciful }
			}
			factor = 2
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = zealous }
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = sceptical }
			}
			factor = 4
		}
	}

	immidiate = {
		effect = { type = add_trait value = excommunicated }
	}

}

##############################
# Conversion - same religion #
##############################

# Chance of converting back an heretic character

character_event = {
	id = 7809
	
	picture = "event_heretic"

	trigger = {
#		condition = { type = not value = { type = ai } }
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = chaplain } }
		condition = { type = trait value = heretic }
		condition = {
			type = chaplain_csc
			condition = { type = not value = { type = trait value = heretic } }
		}
		condition = {
			type = or 
			condition = {
				type = and
				condition = { type = religion value = catholic } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = catholic } 
				}
			}
			condition = {
				type = and
				condition = { type = religion value = orthodox } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = orthodox } 
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 900

		# Traits

		modifier = { # Is an heretic preacher
			condition = { type = trait value = detached_priest }
			factor = 1.25
		}
		modifier = { # Is an heretic zealot fighter
			condition = { type = trait value = martial_cleric }
			factor = 1.5
		}
		modifier = { # Is an heretic scholar
			condition = { type = trait value = scholarly_theologian }
			factor = 1.75
		}
		modifier = { # Is an heretic master
			condition = { type = trait value = mastermind_theologian }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = excommunicated }
			factor = 0.9
		}

		# Chaplain traits

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = detached_priest }
			}
			factor = 1.3
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = energetic }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = lazy }
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = zealous }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = sceptical }
			}
			factor = 5
		}
	}

	immidiate = {
		effect = { type = remove_trait value = excommunicated }
		effect = { type = remove_trait value = heretic }
		effect = { type = trigger for = chaplain value = 7819 }
	}
}

# Chance of converting character to heresy if heretic

character_event = {
	id = 7810
	
	picture = "event_heretic"

	trigger = {
#		condition = { type = not value = { type = ai } }
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = chaplain } }
		condition = { type = not value = { type = trait value = heretic } } 
		condition = {
			type = chaplain_csc
			condition = { type = trait value = heretic }
		}
		condition = {
			type = or 
			condition = {
				type = and
				condition = { type = religion value = catholic } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = catholic } 
				}
			}
			condition = {
				type = and
				condition = { type = religion value = orthodox } 
				condition = {
					type = chaplain_csc
					condition = { type = religion value = orthodox } 
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 900

		# Traits

		modifier = {
			condition = { type = trait value = detached_priest }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = martial_cleric }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = scholarly_theologian }
			factor = 1.75
		}
		modifier = {
			condition = { type = trait value = mastermind_theologian }
			factor = 2
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 1.25
		}
		modifier = {
			condition = { type = trait value = sceptical }
			factor = 0.7
		}
		modifier = {
			condition = { type = trait value = excommunicated }
			factor = 0.5
		}

		# Chaplain traits

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = detached_priest }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = energetic }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = lazy }
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = zealous }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = sceptical }
			}
			factor = 2
		}
	}

	immidiate = {
		effect = { type = add_trait value = heretic }
		effect = { type = piety value = -25 }
		effect = { type = trigger for = chaplain value = 7820 }
	}
}

# Chaplain event counter-parts:

character_event = {
	id = 7819
	
	picture = "event_religion"
	
	immidiate = {
		effect = { type = piety value = 15 }
		effect = { type = prestige value = 20 }
	}
}

character_event = {
	id = 7820
	
	picture = "event_religion"
	
	immidiate = {
		effect = { type = prestige value = 20 }
	}
}

##############################################
# Chaplain is an example of Christian virtue #
##############################################

# Trait events for character in ecclesiastical education
# depending of the traits of the appointed chaplain

# Chaste

character_event = {
	id = 7811
	
	picture = "event_education"
	
	trigger = {
		condition = { type = trait value = ecclesiastical_education }
		condition = { type = not value = { type = trait value = chaste } }
		condition = { type = not value = { type = trait value = lustful } }
		condition = {
			type = chaplain_csc
			condition = { type = and
				condition = { type = trait value = chaste }
				condition = { type = piety value = 50 }
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# Chaplain traits

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = detached_priest }
			}
			factor = 1.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 1.1
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.9
		}	
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.5
		}	
	}

	immidiate = {
		effect = { type = add_trait value = chaste }
		effect = { type = piety value = 10 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait value = zealous }
				effect = { type = piety value = 15 }
		}
	}
}

# Forgiving

character_event = {
	id = 7812
	
	picture = "event_education"
	
	trigger = {
		condition = { type = trait value = ecclesiastical_education }
		condition = { type = not value = { type = trait value = forgiving } }
		condition = { type = not value = { type = trait value = vengeful } }
		condition = {
			type = chaplain_csc
			condition = { type = and
				condition = { type = trait value = forgiving }
				condition = { type = piety value = 50 }
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# Chaplain traits

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = detached_priest }
			}
			factor = 1.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.8
		}	
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.5
		}	
	}

	immidiate = {
		effect = { type = add_trait value = forgiving }
		effect = { type = piety value = 10 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait value = zealous }
				effect = { type = piety value = 15 }
		}
	}
}

# Honest

character_event = {
	id = 7813
	
	picture = "event_education"
	
	trigger = {
		condition = { type = trait value = ecclesiastical_education }
		condition = { type = not value = { type = trait value = honest } }
		condition = { type = not value = { type = trait value = deceitful } }
		condition = {
			type = chaplain_csc
			condition = { type = and
				condition = { type = trait value = honest }
				condition = { type = piety value = 50 }
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# Chaplain traits

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = detached_priest }
			}
			factor = 1.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.7
		}	
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.5
		}	
	}

	immidiate = {
		effect = { type = add_trait value = honest }
		effect = { type = piety value = 10 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait value = zealous }
				effect = { type = piety value = 15 }
		}
	}
}

# Merciful

character_event = {
	id = 7814
	
	picture = "event_education"
	
	trigger = {
		condition = { type = trait value = ecclesiastical_education }
		condition = { type = not value = { type = trait value = merciful } }
		condition = { type = not value = { type = trait value = cruel } }
		condition = {
			type = chaplain_csc
			condition = { type = and
				condition = { type = trait value = merciful }
				condition = { type = piety value = 50 }
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# Chaplain traits

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = detached_priest }
			}
			factor = 1.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.8
		}	
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.5
		}	
	}

	immidiate = {
		effect = { type = add_trait value = merciful }
		effect = { type = piety value = 10 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait value = zealous }
				effect = { type = piety value = 15 }
		}
	}
}

# Modest

character_event = {
	id = 7815
	
	picture = "event_education"
	
	trigger = {
		condition = { type = trait value = ecclesiastical_education }
		condition = { type = not value = { type = trait value = modest } }
		condition = { type = not value = { type = trait value = proud } }
		condition = {
			type = chaplain_csc
			condition = { type = and
				condition = { type = trait value = modest }
				condition = { type = piety value = 50 }
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# Chaplain traits

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = detached_priest }
			}
			factor = 1.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.7
		}	
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.5
		}	
	}

	immidiate = {
		effect = { type = add_trait value = modest }
		effect = { type = piety value = 10 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait value = zealous }
				effect = { type = piety value = 15 }
		}
	}
}

# Temperate

character_event = {
	id = 7816
	
	picture = "event_education"
	
	trigger = {
		condition = { type = trait value = ecclesiastical_education }
		condition = { type = not value = { type = trait value = temperate } }
		condition = { type = not value = { type = trait value = indulgent } }
		condition = {
			type = chaplain_csc
			condition = { type = and
				condition = { type = trait value = temperate }
				condition = { type = piety value = 50 }
			}
		}
	}

	mean_time_to_happen = {
		months = 360

		# Chaplain traits

		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = detached_priest }
			}
			factor = 1.5
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = martial_cleric }
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = trait value = mastermind_theologian }
			}
			factor = 0.8
		}	
		modifier = {
			condition = {
				type = chaplain_csc
				condition = { type = piety value = 100 }
			}
			factor = 0.5
		}	
	}

	immidiate = {
		effect = { type = add_trait value = temperate }
		effect = { type = piety value = 10 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait value = zealous }
				effect = { type = piety value = 15 }
		}
	}
}

# Next ID = 7819