################################
# Chancellor events: 7600-7699 #
#                              #
#        Thomas Corriol        #
################################
# Triggers revised by Byakhiam 6.4.05
#####
# Lustful Chancellor: Vassal offended

character_event = {
	id = 7600
	
	picture = "event_intrigue"
	
	action_a = {#Exile Chancellor
		effect = { type = trigger for = chancellor value = 7602 }
		effect = { type = loyalty for = worst_vassal value = -0.15 }
		effect = { type = loyalty for = random_vassal value = -0.1 }
		effect = { type = random
				chance = 25
				effect = { type = add_trait value = forgiving }
		}
		effect = { type = loyalty for = worst_courtier value = 0.15 }
		effect = { type = loyalty for = random_courtier value = 0.1 }
	}

	action_b = {#Clean Chancellor
		effect = { type = loyalty for = chancellor value = 0.5 }
		effect = { type = random
				chance = 50
				effect = { type = add_trait value = arbitrary }
		}
		effect = { type = loyalty for = worst_vassal value = -0.25 }
		effect = { type = loyalty for = random_vassal value = -0.15 }
		effect = { type = loyalty for = random_vassal value = -0.1 }
		effect = { type = loyalty for = worst_courtier value = 0.25 }
		effect = { type = loyalty for = random_courtier value = 0.15 }
		effect = { type = loyalty for = random_courtier value = 0.1 }
	}

	action_c = {#Execute Chancellor
		effect = { type = death value = chancellor }
		effect = { type = random
				chance = 25
				effect = { type = add_trait value = just }
		}
		effect = { type = loyalty for = worst_courtier value = -0.15 }
		effect = { type = loyalty for = random_courtier value = -0.1 }
	}
}

# Vassal event counter-part:

character_event = {
	id = 7601
	
	picture = "event_intrigue"

	trigger = {
		condition = { type = is_vassal }
		condition = { type = is_married }
		condition = { type = gender value = male }
		condition = {
			type = liege
			condition = {
				type = chancellor_csc
				condition = {
					type = and
					condition = { type = trait value = lustful }
					condition = { type = gender value = male }
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 600

		# Spouse trait modifiers:

		modifier = {
			condition = {
				type = spouse
				condition = { type = trait value = lustful }
			}
			factor = 0.75 
		}

		modifier = {
			condition = {
				type = spouse
				condition = { type = trait value = chaste }
			}
			factor = 2 
		}
	}

	action_a = {#Behead her
		ai_chance = 50
			#start AI modifier block
			modifier = {
				condition = { type = trait value = vengeful }
				factor = 1.25
			}
			modifier = {
				condition = { type = trait value = cruel }
				factor = 1.2
			}
			#end AI modifier block
		effect = { type = prestige scale = -0.75 }
		effect = { type = loyalty value = -0.75 }
		effect = { type = add_title_claim value = liege }
		effect = { type = death value = spouse }
		effect = { type = add_trait value = vengeful }
		effect = { type = trigger for = liege value = 7600 }
	}

	action_b = {#Pretend as nothing has happened
		ai_chance = 50
			#start AI modifier block
			modifier = {
				condition = { type = trait value = forgiving }
				factor = 1.25
			}
			modifier = {
				condition = { type = trait value = merciful }
				factor = 1.2
			}
			#end AI modifier block
		effect = { type = prestige scale = -0.5 }
		effect = { type = loyalty value = -0.25 }
		effect = { type = add_trait value = merciful }
		effect = { type = add_trait value = forgiving }
		effect = { type = random
				chance = 25
				effect = { type = create_courtier value = bastard }
		}
		effect = { type = random
				chance = 50
				effect = {type = remove_trait for = spouse value = lustful }
		}
	}

}

# Chancellor event counter-part:

character_event = {
	id = 7602
	
	picture = "event_intrigue"

	action_a = {#Banned !
		effect = { type = courtier_defect value = random_neighbor }
		effect = { type = loyalty value = 1.0 }
	}

}

#####
# Energetic Chancellor: Reconcile with vassal

character_event = {
	id = 7603
	
	picture = "event_intrigue"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = has_vassal }
		condition = {
			type = chancellor_csc
			condition = { type = trait value = energetic }
		}
		condition = { 
			type = any_vassal 
			condition = { type = not value = { type = loyalty value = 0.66 } }
		}
	}

	mean_time_to_happen = {
		months = 480

		# Ruler trait modifiers:

		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.5
		}

		modifier = {
			condition = { type = trait value = forgiving }
			factor = 0.5
		}

		modifier = {
			condition = { type = trait value = trusting }
			factor = 0.75
		}

		modifier = {
			condition = { type = trait value = suspicious }
			factor = 1.25
		}

	}

	action_a = {#Reward Chancellor generously
		effect = { type = prestige value = 20 }
		effect = { type = loyalty for = worst_vassal value = 0.25 }
		effect = { type = loyalty for = random_vassal value = 0.15 }
		effect = { type = loyalty for = random_vassal value = 0.1 }
		effect = { type = gold scale = -0.15 }
		effect = { type = trigger for = chancellor value = 7604 }
	}

	action_b = {#It's just his job
		effect = { type = prestige value = 20 }
		effect = { type = loyalty for = worst_vassal value = 0.25 }
		effect = { type = loyalty for = random_vassal value = 0.15 }
		effect = { type = loyalty for = random_vassal value = 0.1 }
		effect = { type = random
				chance = 25
				effect = { type = remove_trait for = chancellor value = energetic }
				effect = { type = loyalty for = chancellor value = -0.25 }
		}
	}
}

character_event = {
	id = 7604
	
	picture = "event_moneycollection"
	
	action_a = {#You have been rewarded
		effect = { type = prestige value = 20 }
		effect = { type = gold scale = 0.15 }
	}
}

#####
# Lazy Chancellor: An occasion missed

character_event = {
	id = 7605
	
	picture = "event_intrigue"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = has_vassal }
		condition = {
			type = chancellor_csc
			condition = { type = and
				condition = { type = trait value = lazy }
				condition = { type = or 
					condition = { type = not value = { type = is_married } }
					condition = { type = gender value = male }
				}
			}
		}
		condition = { 
			type = any_vassal 
			condition = { type = not value = { type = loyalty value = 0.66 } }
		}
	}

	mean_time_to_happen = {
		months = 600

		# Ruler trait modifiers:

		modifier = {
			condition = { type = trait value = energetic }
			factor = 1.5
		}

		modifier = {
			condition = { type = trait value = lazy }
			factor = 0.5
		}

		modifier = {
			condition = { type = trait value = trusting }
			factor = 0.75
		}

		modifier = {
			condition = { type = trait value = suspicious }
			factor = 1.25
		}

	}

	action_a = {#Fine Chancellor
		effect = { type = loyalty for = worst_vassal value = -0.15 }
		effect = { type = loyalty for = random_vassal value = -0.1 }
		effect = { type = trigger for = chancellor value = 7606 }
		effect = { type = loyalty for = chancellor value = -0.4 }
		effect = { type = random
				chance = 25
				effect = { type = remove_trait for = chancellor value = lazy }
		}
		effect = { type = gold scale = 0.02 }
	}

	action_b = {#No big deal
		effect = { type = loyalty for = worst_vassal value = -0.15 }
		effect = { type = loyalty for = random_vassal value = -0.1 }
		effect = { type = loyalty for = chancellor value = 0.4 }
		effect = { type = random
				chance = 10
				effect = { type = add_trait value = lazy }
		}
	}

	action_c = {#Exile Chancellor
		effect = { type = loyalty for = worst_vassal value = -0.15 }
		effect = { type = loyalty for = random_vassal value = -0.1 }
		effect = { type = trigger for = chancellor value = 7602 }
		effect = { type = random
				chance = 25
				effect = { type = add_trait value = arbitrary }
		}
		effect = { type = loyalty for = worst_courtier value = -0.25 }
		effect = { type = loyalty for = random_courtier value = -0.15 }
		effect = { type = loyalty for = random_courtier value = -0.1 }
	}
}

character_event = {
	id = 7606
	
	picture = "event_moneycollection"
	
	action_a = {#You have been fine
		effect = { type = gold scale = -0.02 }
	}
}