###################################
#
# Events for Jobs
#
# Id 7500-7999 is reserved
#
###################################
#
# Written by Niklas Strid


### Diplomacy ###

# Improve Relations
# Go player
character_event = {
	id = 7500
	desc = "EVTDESC7500"
	
	trigger = {
		is_ruler = yes
		any_courtier = {
			has_job_action = action_improve_relations
		}
	}
	
	mean_time_to_happen = {
		months = 120
		
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 7
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 8
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 9
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 10
			}
		}
	}
	
	option = {
		name = "EVTOPTCHANCELLOR"
		any_courtier = {
			limit = {
				has_job_title = job_master_of_ceremonies
			}
			location = {
				owner = {
					opinion = {
						who = ROOT
						modifier = good_relations
						months = 60
					}
				}
			}
			cancel_job_action = yes
		}
	}
}

# Improve Relations
# Hunting
character_event = {
	id = 7501
	desc = "EVTDESC7501"
	
	trigger = {
		is_ruler = yes
		any_courtier = { 
			has_job_action = action_improve_relations
		}
	}
	
	mean_time_to_happen = {
		months = 120
		
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 7
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 8
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 9
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 10
			}
		}
	}
	
	option = {
		name = "EVTOPTCHANCELLOR"
		any_courtier = {
			limit = {
				has_job_title = job_master_of_ceremonies
			}
			location = {
				owner = {
					opinion = {
						who = ROOT
						modifier = good_relations
						months = 60
					}
				}
			}
			cancel_job_action = yes
		}
	}
}

# Improve Relations
# Tea ceremony
character_event = {
	id = 7502
	desc = "EVTDESC7502"
	
	trigger = {
		is_ruler = yes
		any_courtier = { 
			has_job_action = action_improve_relations
		}
	}
	
	mean_time_to_happen = {
		months = 120
		
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 7
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 8
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 9
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_ceremonies
				diplomacy = 10
			}
		}
	}
	
	option = {
		name = "EVTOPTCHANCELLOR"
		any_courtier = {
			limit = {
				has_job_title = job_master_of_ceremonies
			}
			location = {
				owner = {
					opinion = {
						who = ROOT
						modifier = good_relations
						months = 60
					}
				}
			}
			cancel_job_action = yes
		}
	}
}

# Improve Village
# Positive
province_event = {
	id = 7503
	desc = "EVTDESC7503"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_improve_village
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 10
				}
			}
		}
	}

	immediate = {
		hidden_tooltip = {
			random_list = {
				60 = { set_province_flag = building_1_month }
				30 = { set_province_flag = building_2_month }
				10 = { set_province_flag = building_3_month }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7503"
		trigger = { has_province_flag = building_1_month }
		clr_province_flag = building_1_month
		add_construction_time = -30
	}
	option = {
		name = "EVTOPTA7503"
		trigger = { has_province_flag = building_2_month }
		clr_province_flag = building_2_month
		add_construction_time = -60
	}
	option = {
		name = "EVTOPTA7503"
		trigger = { has_province_flag = building_3_month }
		clr_province_flag = building_3_month
		add_construction_time = -90
	}
}

# Improve Village
# Negative
province_event = {
	id = 7504
	desc = "EVTDESC7504"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_improve_village
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 10
				}
			}
		}
	}

	immediate = {
		hidden_tooltip = {
			random_list = {
				60 = { set_province_flag = building_setback_1_month }
				30 = { set_province_flag = building_setback_3_month }
				10 = { set_province_flag = building_setback_6_month }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7504"
		ai_chance = { factor = 50 }
		trigger = { 
			has_province_flag = building_setback_1_month
			NOT = {
				OR = {
					has_province_flag = building_setback_3_month
					has_province_flag = building_setback_6_month
				}
			}
		}
		clr_province_flag = building_setback_1_month
		add_construction_time = 30
	}
	option = {
		name = "EVTOPTB7504"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 10 } }
			}
		}
		trigger = { 
			has_province_flag = building_setback_1_month
			NOT = {
				OR = {
					has_province_flag = building_setback_3_month
					has_province_flag = building_setback_6_month
				}
			}
		}
		clr_province_flag = building_setback_1_month
		owner = { wealth = -5 }
	}
	option = {
		name = "EVTOPTA7504"
		ai_chance = { factor = 50 }
		trigger = { 
			has_province_flag = building_setback_3_month
			NOT = {
				has_province_flag = building_setback_6_month
			}
		}
		clr_province_flag = building_setback_3_month
		add_construction_time = 90
	}
	option = {
		name = "EVTOPTB7504"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 20 } }
			}
		}
		trigger = { 
			has_province_flag = building_setback_3_month
			NOT = {
				has_province_flag = building_setback_6_month
			}
		}
		clr_province_flag = building_setback_3_month
		owner = { wealth = -10 }
	}
	option = {
		name = "EVTOPTA7504"
		ai_chance = { factor = 50 }
		trigger = { 
			has_province_flag = building_setback_6_month
		}
		clr_province_flag = building_setback_6_month
		add_construction_time = 180
	}
	option = {
		name = "EVTOPTB7504"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 40 } }
			}
		}
		trigger = { 
			has_province_flag = building_setback_6_month
		}
		clr_province_flag = building_setback_6_month
		owner = { wealth = -20 }
	}
}

# Improve Village
# Negative
province_event = {
	id = 7505
	desc = "EVTDESC7505"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_improve_village
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_ceremonies
					intrigue = 10
				}
			}
		}
	}

	immediate = {
		hidden_tooltip = {
			random_list = {
				60 = { set_province_flag = building_setback_1_month }
				30 = { set_province_flag = building_setback_3_month }
				10 = { set_province_flag = building_setback_6_month }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7505"
		ai_chance = { factor = 50 }
		trigger = { 
			has_province_flag = building_setback_1_month
			NOT = {
				OR = {
					has_province_flag = building_setback_3_month
					has_province_flag = building_setback_6_month
				}
			}
		}
		clr_province_flag = building_setback_1_month
		add_construction_time = 30
	}
	option = {
		name = "EVTOPTB7505"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 10 } }
			}
		}
		trigger = { 
			has_province_flag = building_setback_1_month
			NOT = {
				OR = {
					has_province_flag = building_setback_3_month
					has_province_flag = building_setback_6_month
				}
			}
		}
		clr_province_flag = building_setback_1_month
		owner = { wealth = -5 }
	}
	option = {
		name = "EVTOPTA7505"
		ai_chance = { factor = 50 }
		trigger = { 
			has_province_flag = building_setback_3_month 
			NOT = {
				has_province_flag = building_setback_6_month
			}
		}
		clr_province_flag = building_setback_3_month
		add_construction_time = 90
	}
	option = {
		name = "EVTOPTB7505"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 20 } }
			}
		}
		trigger = { 
			has_province_flag = building_setback_3_month 
			NOT = {
				has_province_flag = building_setback_6_month
			}
		}
		clr_province_flag = building_setback_3_month
		owner = {wealth = -10 }
	}
	option = {
		name = "EVTOPTA7505"
		ai_chance = { factor = 50 }
		trigger = { has_province_flag = building_setback_6_month }
		clr_province_flag = building_setback_6_month
		add_construction_time = 180
	}
	option = {
		name = "EVTOPTB7505"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 40 } }
			}
		}
		trigger = { has_province_flag = building_setback_6_month }
		clr_province_flag = building_setback_6_month
		owner = { wealth = -20 }
	}
}

# Squeeze Peasants
# Ruthless Chancellor
province_event = {
	id = 7506
	desc = "EVTDESC7506"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_squeeze_peasants
				at_location = ROOT
			}
		}
		NOT = { has_province_modifier = lenient_tax_policy }
		NOT = { has_province_modifier = hard_tax_policy }
	}
	
	mean_time_to_happen = {
		months = 240
		
		modifier = {
			factor = 0.5
			owner = {
				any_courtier = {
					has_job_action = action_squeeze_peasants
					trait = ruthless
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTA7506"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 4
				owner = {
					OR = {
						trait = bushi
						trait = charitable
					}
				}
			}
			modifier = {
				factor = 2
				owner = {
					trait = kind
				}
			}
		}
		add_province_modifier = {
			name = lenient_tax_policy
			duration = 365
		}
	}
	option = {
		name = "EVTOPTB7506"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 4
				owner = {
					OR = {
						trait = ruthless
						trait = greedy
					}
				}
			}
			modifier = {
				factor = 2
				owner = {
					trait = ambitious
				}
			}
		}
		add_province_modifier = {
			name = hard_tax_policy
			duration = 180
		}
	}
}

# Squeeze Peasants
# Greedy Chancellor
province_event = {
	id = 7507
	desc = "EVTDESC7507"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_squeeze_peasants
				at_location = ROOT
			}
		}
		NOT = { has_province_modifier = embezzlement }
	}
	
	mean_time_to_happen = {
		months = 240
		
		modifier = {
			factor = 0.5
			owner = {
				any_courtier = {
					has_job_action = action_squeeze_peasants
					trait = greedy
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTA7507"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				owner = {
					OR = {
						trait = content
						trait = trusting
					}
				}
			}
			modifier = {
				factor = 0.2
				owner = {
					OR = {
						trait = greedy
						trait = paranoid
						trait = wroth
					}
				}
			}
		}
		add_province_modifier = {
			name = embezzlement
			duration = 180
		}
	}
	option = {
		name = "EVTOPTB7507"
		ai_chance = {
			factor = 35
			modifier = {
				factor = 2
				owner = {
					OR = {
						trait = greedy
						trait = paranoid
						trait = wroth
					}
				}
			}
			modifier = {
				factor = 0.2
				owner = {
					OR = {
						trait = content
						trait = trusting
					}
				}
			}
		}
		owner = {
			any_courtier = {
				limit = {
					has_job_title = job_master_of_ceremonies
				}
				opinion = {
					who = PREV
					modifier = bad_relations
					months = 60
				}
			}
			wealth = 5
		}
	}
	option = {
		name = "EVTOPTC7507"
		ai_chance = {
			factor = 15
			modifier = {
				factor = 2
				owner = {
					OR = {
						trait = ruthless
						trait = wroth
					}
				}
			}
			modifier = {
				factor = 0.2
				owner = {
					OR = {
						trait = bushi
						trait = kind
					}
				}
			}
		}
		owner = {
			any_courtier = {
				limit = {
					has_job_title = job_master_of_ceremonies
				}
				death = yes
			}
		}
	}
}

# Squeeze Peasants
# Kind/charitable Chancellor
province_event = {
	id = 7508
	desc = "EVTDESC7508"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_squeeze_peasants
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240
		
		modifier = {
			factor = 0.75
			owner = {
				any_courtier = {
					has_job_action = action_squeeze_peasants
					OR = {
						trait = kind
						trait = charitable
					}
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTA7508"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				owner = {
					OR = {
						trait = bushi
						trait = kind
						trait = charitable
					}
				}
			}
		}
		owner = {
			any_courtier = {
				limit = {
					has_job_title = job_master_of_ceremonies
				}
				opinion = {
					who = PREV
					modifier = good_relations
					months = 60
				}
			}
		}
	}
	option = {
		name = "EVTOPTB7508"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				owner = {
					OR = {
						trait = ruthless
						trait = wroth
						trait = greedy
					}
				}
			}
		}
		owner = {
			any_courtier = {
				limit = {
					has_job_title = job_master_of_ceremonies
				}
				opinion = {
					who = PREV
					modifier = bad_relations
					months = 60
				}
			}
			wealth = 5
		}
	}
}


### Martial ###

# Improve Castle
# Positive
province_event = {
	id = 7509
	desc = "EVTDESC7509"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_improve_castle
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 10
				}
			}
		}
	}

	immediate = {
		hidden_tooltip = {
			random_list = {
				60 = { set_province_flag = building_1_month }
				30 = { set_province_flag = building_2_month }
				10 = { set_province_flag = building_3_month }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7509"
		trigger = { has_province_flag = building_1_month }
		clr_province_flag = building_1_month
		add_construction_time = -30
	}
	option = {
		name = "EVTOPTA7509"
		trigger = { has_province_flag = building_2_month }
		clr_province_flag = building_2_month
		add_construction_time = -60
	}
	option = {
		name = "EVTOPTA7509"
		trigger = { has_province_flag = building_3_month }
		clr_province_flag = building_3_month
		add_construction_time = -90
	}
}

# Improve Castle
# Negative
province_event = {
	id = 7510
	desc = "EVTDESC7510"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_improve_castle
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 10
				}
			}
		}
	}

	immediate = {
		hidden_tooltip = {
			random_list = {
				60 = { set_province_flag = building_setback_1_month }
				30 = { set_province_flag = building_setback_3_month }
				10 = { set_province_flag = building_setback_6_month }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7510"
		ai_chance = { factor = 50 }
		trigger = { 
			has_province_flag = building_setback_1_month
			NOT = {
				OR = {
					has_province_flag = building_setback_3_month
					has_province_flag = building_setback_6_month 
				}
			}
		}
		clr_province_flag = building_setback_1_month
		add_construction_time = 30
	}
	option = {
		name = "EVTOPTB7510"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 10 } }
			}
		}
		trigger = { 
			has_province_flag = building_setback_1_month
			NOT = {
				OR = {
					has_province_flag = building_setback_3_month
					has_province_flag = building_setback_6_month 
				}
			}
		}
		clr_province_flag = building_setback_1_month
		owner = { wealth = -5 }
	}
	option = {
		name = "EVTOPTA7510"
		ai_chance = { factor = 50 }
		trigger = { 
			has_province_flag = building_setback_3_month
			NOT = {
				has_province_flag = building_setback_6_month
			}
		}
		clr_province_flag = building_setback_3_month
		add_construction_time = 90
	}
	option = {
		name = "EVTOPTB7510"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 20 } }
			}
		}
		trigger = { 
			has_province_flag = building_setback_3_month
			NOT = {
				has_province_flag = building_setback_6_month
			}
		}
		clr_province_flag = building_setback_3_month
		owner = { wealth = -10 }
	}
	option = {
		name = "EVTOPTA7510"
		ai_chance = { factor = 50 }
		trigger = { has_province_flag = building_setback_6_month }
		clr_province_flag = building_setback_6_month
		add_construction_time = 180
	}
	option = {
		name = "EVTOPTB7510"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 40 } }
			}
		}
		trigger = { has_province_flag = building_setback_6_month }
		clr_province_flag = building_setback_6_month
		owner = { wealth = -20 }
	}
}

# Improve Castle
# Negative
province_event = {
	id = 7511
	desc = "EVTDESC7511"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_improve_castle
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 10
				}
			}
		}
	}

	immediate = {
		hidden_tooltip = {
			random_list = {
				60 = { set_province_flag = building_setback_1_month }
				30 = { set_province_flag = building_setback_3_month }
				10 = { set_province_flag = building_setback_6_month }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7511"
		ai_chance = { factor = 50 }
		trigger = { 
			has_province_flag = building_setback_1_month
			NOT = {
				OR = {
					has_province_flag = building_setback_3_month
					has_province_flag = building_setback_6_month
				}
			}
		}
		clr_province_flag = building_setback_1_month
		add_construction_time = 30
	}
	option = {
		name = "EVTOPTB7511"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 10 } }
			}
		}
		trigger = { 
			has_province_flag = building_setback_1_month 
			NOT = {
				OR = {
					has_province_flag = building_setback_3_month
					has_province_flag = building_setback_6_month
				}
			}
		}
		clr_province_flag = building_setback_1_month
		owner = { wealth = -5 }
	}
	option = {
		name = "EVTOPTA7511"
		ai_chance = { factor = 50 }
		trigger = { 
			has_province_flag = building_setback_3_month
			NOT = {
				has_province_flag = building_setback_6_month
			}
		}
		clr_province_flag = building_setback_3_month
		add_construction_time = 90
	}
	option = {
		name = "EVTOPTB7511"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 20 } }
			}
		}
		trigger = { 
			has_province_flag = building_setback_3_month
			NOT = {
				has_province_flag = building_setback_6_month
			}
		}
		clr_province_flag = building_setback_3_month
		owner = { wealth = -10 }
	}
	option = {
		name = "EVTOPTA7511"
		ai_chance = { factor = 50 }
		trigger = { has_province_flag = building_setback_6_month }
		clr_province_flag = building_setback_6_month
		add_construction_time = 180
	}
	option = {
		name = "EVTOPTB7511"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				owner = { NOT = { wealth = 40 } }
			}
		}
		trigger = { has_province_flag = building_setback_6_month }
		clr_province_flag = building_setback_6_month
		owner = { wealth = -20 }
	}
}

# Restore Order
# Positive
province_event = {
	id = 7512
	desc = "EVTDESC7512"
	
	trigger = {
		owner = {
			any_courtier = {
				has_job_action = action_restore_order
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240
		
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 10
				}
			}
		}
	}
	
	immediate = {
		hidden_tooltip = {
			random_list = {
				60 = { set_province_flag = restore_order_1 }
				30 = { set_province_flag = restore_order_2 }
				10 = { set_province_flag = restore_order_3 }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7512"
		trigger = { has_province_flag = restore_order_1 }
		clr_province_flag = restore_order_1
		revolt_risk = -1
	}
	option = {
		name = "EVTOPTA7512"
		trigger = { has_province_flag = restore_order_2 }
		clr_province_flag = restore_order_2
		revolt_risk = -2
	}
	option = {
		name = "EVTOPTA7512"
		trigger = { has_province_flag = restore_order_3 }
		clr_province_flag = restore_order_3
		revolt_risk = -3
	}
}

# Restore Order
# Negative
province_event = {
	id = 7513
	desc = "EVTDESC7513"
	
	trigger = {
		owner = {
			any_courtier = {
				has_job_action = action_restore_order
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 10
				}
			}
		}
	}
	
	immediate = {
		hidden_tooltip = {
			random_list = {
				60 = { set_province_flag = restore_order_1 }
				30 = { set_province_flag = restore_order_2 }
				10 = { set_province_flag = restore_order_3 }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7513"
		trigger = { has_province_flag = restore_order_1 }
		clr_province_flag = restore_order_1
		revolt_risk = 1
	}
	option = {
		name = "EVTOPTA7513"
		trigger = { has_province_flag = restore_order_2 }
		clr_province_flag = restore_order_2
		revolt_risk = 2
	}
	option = {
		name = "EVTOPTA7513"
		trigger = { has_province_flag = restore_order_3 }
		clr_province_flag = restore_order_3
		revolt_risk = 3
	}
}

# Restore Order
# Negative
province_event = {
	id = 7514
	desc = "EVTDESC7514"
	
	trigger = {
		owner = {
			any_courtier = {
				has_job_action = action_restore_order
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 10
				}
			}
		}
	}
	
	immediate = {
		hidden_tooltip = {
			random_list = {
				70 = { set_province_flag = marshal_kidnapped_1 }
				30 = { set_province_flag = marshal_kidnapped_2 }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7514"
		ai_chance = {
			factor = 25
			modifier = {
				factor = 4
				owner = {
					OR = {
						trait = ruthless
						trait = proud
					}
				}
			}
		}
		owner = {
			any_courtier = {
				limit = { has_job_title = job_master_of_arms }
				death = yes
			}
		}
	}
	option = {
		name = "EVTOPTB7514"
		ai_chance = {
			factor = 75
			modifier = {
				factor = 2
				owner = {
					OR = {
						trait = bushi
						trait = kind
					}
				}
			}
		}
		trigger = { has_province_flag = marshal_kidnapped_1 }
		clr_province_flag = marshal_kidnapped_1
		add_province_modifier = {
			name = lenient_tax_policy
			duration = 365
		}
	}
	option = {
		name = "EVTOPTB7514"
		ai_chance = {
			factor = 75
			modifier = {
				factor = 1.5
				owner = {
					OR = {
						trait = bushi
						trait = kind
					}
				}
			}
		}
		trigger = { has_province_flag = marshal_kidnapped_2 }
		clr_province_flag = marshal_kidnapped_2
		add_province_modifier = {
			name = lenient_tax_policy
			duration = 730
		}
	}
}

# Restore Order
# Negative
province_event = {
	id = 7515
	desc = "EVTDESC7515"
	
	trigger = {
		owner = {
			any_courtier = {
				has_job_action = action_restore_order
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_arms
					intrigue = 10
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTA7515"
		owner = {
			any_courtier = {
				limit = { has_job_title = job_master_of_arms }
				death = yes
			}
		}
	}
}


### Intrigue ###

# Improve Guilds
# Positive
province_event = {
	id = 7516
	desc = "EVTDESC7516"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_improve_guilds
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_the_guard
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_the_guard
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_the_guard
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 0.95
			owner = {
				any_courtier = {
					has_job_title = job_master_of_the_guard
					intrigue = 10
				}
			}
		}
	}

	immediate = {
		hidden_tooltip = {
			random_list = {
				60 = { set_province_flag = building_1_month }
				30 = { set_province_flag = building_2_month }
				10 = { set_province_flag = building_3_month }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7516"
		trigger = { has_province_flag = building_1_month }
		clr_province_flag = building_1_month
		add_construction_time = -30
	}
	option = {
		name = "EVTOPTA7516"
		trigger = { has_province_flag = building_2_month }
		clr_province_flag = building_2_month
		add_construction_time = -60
	}
	option = {
		name = "EVTOPTA7516"
		trigger = { has_province_flag = building_3_month }
		clr_province_flag = building_3_month
		add_construction_time = -90
	}
}

# Improve Guilds
# Negative
province_event = {
	id = 7517
	desc = "EVTDESC7517"
	
	trigger = {
		owner = {
			any_courtier = { 
				has_job_action = action_improve_guilds
				at_location = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_the_guard
					intrigue = 7
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_the_guard
					intrigue = 8
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_the_guard
					intrigue = 9
				}
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				any_courtier = {
					has_job_title = job_master_of_the_guard
					intrigue = 10
				}
			}
		}
	}

	immediate = {
		hidden_tooltip = {
			random_list = {
				60 = { set_province_flag = building_1_month }
				30 = { set_province_flag = building_2_month }
				10 = { set_province_flag = building_3_month }
			}
		}
	}
	
	option = {
		name = "EVTOPTA7517"
		trigger = { has_province_flag = building_1_month }
		clr_province_flag = building_1_month
		add_construction_time = 30
	}
	option = {
		name = "EVTOPTA7517"
		trigger = { has_province_flag = building_2_month }
		clr_province_flag = building_2_month
		add_construction_time = 60
	}
	option = {
		name = "EVTOPTA7517"
		trigger = { has_province_flag = building_3_month }
		clr_province_flag = building_3_month
		add_construction_time = 90
	}
}

# Sow Dissent
# Planting a rumour
character_event = {
	id = 7518
	desc = "EVTDESC7518"
	
	trigger = {
		is_ruler = yes
		any_courtier = {
			has_job_action = action_sow_dissent
			location = {
				owner = {
					liege = {
						NOT = {
							has_opinion_modifier = {
								who = PREV
								modifier = bad_relation_with_liege
							}
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 100
		
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_the_guard
				intrigue = 7
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_the_guard
				intrigue = 8
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_the_guard
				intrigue = 9
			}
		}
		modifier = {
			factor = 0.95
			any_courtier = {
				has_job_title = job_master_of_the_guard
				intrigue = 10
			}
		}
	}
	
	option = {
		name = "EVTOPTA7518"
		any_courtier = {
			limit = {
				has_job_action = action_sow_dissent
			}
			location = {
				owner = {
					liege = {
						reverse_opinion = {
							who = PREV
							modifier = bad_relation_with_liege
							months = 60
						}
					}
				}
			}
			cancel_job_action = yes
		}
	}
}
