##############################
# MARSHAL
#
# Job: action_advance_mil_tech
# 	938: Military Accident
# 	939: Military Secrets Revealed!
#
# Job: action_train_troops
# 	941: Reinforcements Arrives
# 	942: Marshal tries to train troops, noble interferes
#
# Job: action_assist_arrest
# 	944: Vassal is tipped off: Starts with Marshal
#
##############################

namespace = Performance

##############################
# MARSHAL
# JOB: action_advance_mil_tech
##############################

# 938: Military Accident
character_event = {
	id = 938
	title = "EVTNAME938"
	desc = "EVTDESC938"
	picture = GFX_evt_bloody_man

	min_age = 16
	capable_only = yes
	prisoner = no

	trigger = {
		has_job_action = action_advance_mil_tech
		NOT = { has_character_modifier = in_seclusion }
		NOR = {
			can_be_maimed_trigger = yes
			trait = wounded
		}
		location = {
			owner = {
				job_marshal = { character = ROOT }
			}
		}
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 1.33
			has_global_flag = hardcore_mode
			ai = no
		}
		modifier = {
			factor = 0.9
			NOT = { opinion = { who = liege value = -100 } }
		}
		modifier = {
			factor = 0.9
			NOT = { opinion = { who = liege value = -75 } }
		}
		modifier = {
			factor = 0.9
			NOT = { opinion = { who = liege value = -50 } }
		}
		modifier = {
			factor = 0.9
			NOT = { opinion = { who = liege value = -25 } }
		}
		modifier = {
			factor = 1.05
			opinion = { who = liege value = 25 }
		}
		modifier = {
			factor = 1.05
			opinion = { who = liege value = 50 }
		}
		modifier = {
			factor = 1.05
			opinion = { who = liege value = 75 }
		}
		modifier = {
			factor = 1.05
			opinion = { who = liege value = 100 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 1 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 2 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 3 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 4 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 5 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 6 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 7 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 8 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 9 }
		}
		modifier = {
			factor = 1.05
			martial = 11
		}
		modifier = {
			factor = 1.05
			martial = 12
		}
		modifier = {
			factor = 1.05
			martial = 13
		}
		modifier = {
			factor = 1.05
			martial = 14
		}
		modifier = {
			factor = 1.05
			martial = 15
		}
		modifier = {
			factor = 1.05
			martial = 16
		}
		modifier = {
			factor = 1.05
			martial = 17
		}
		modifier = {
			factor = 1.05
			martial = 18
		}
		modifier = {
			factor = 1.05
			martial = 19
		}
		modifier = {
			factor = 1.05
			martial = 20
		}
		modifier = {
			factor = 1.05
			martial = 21
		}
		modifier = {
			factor = 1.05
			martial = 22
		}
		modifier = {
			factor = 1.05
			martial = 23
		}
		modifier = {
			factor = 1.05
			martial = 24
		}
		modifier = {
			factor = 1.05
			martial = 25
		}
	}

	immediate = {
		hidden_tooltip = {
			random_list = {
				75 = {
					set_character_flag = marshal_wounded
				}
				25 = {
					set_character_flag = marshal_maimed
				}
			}
		}
	}

	option = {
		name = "EVOPTA938"
		trigger = { has_character_flag = marshal_wounded }
		add_trait = wounded
		liege = { letter_event = { id = 20380 days = 7 tooltip = "EVTTOOLTIP20380" } }
		clr_character_flag = marshal_wounded
	}
	option = {
		name = "EVOPTB938"
		trigger = { has_character_flag = marshal_maimed }
		add_maimed_trait_effect = yes
		liege = { letter_event = { id = 20381 days = 7 tooltip = "EVTTOOLTIP20380" } }
		clr_character_flag = marshal_maimed
		set_character_flag = limb_removed
	}
}

#20380: Liege gets a letter about Marshal being wounded
letter_event = {
	id = 20380
	desc = "EVTDESC20380"

	is_triggered_only = yes

	option = {
		name = "EVTOPTA20380"
		tooltip = {
			FROM = { add_trait = wounded }
		}
	}
}

#20381: Liege gets a letter about Marshal being maimed
letter_event = {
	id = 20381
	desc = "EVTDESC20381"

	is_triggered_only = yes

	option = {
		name = "EVTOPTA20381"
		tooltip = {
			FROM = { add_maimed_trait_effect = yes }
		}
	}
}

# 939: Military Secrets Revealed!
character_event = {
	id = 939
	title = "EVTNAME939"
	desc = "EVTDESC939"
	picture = GFX_evt_large_army

	min_age = 16
	capable_only = yes
	prisoner = no

	trigger = {
		has_job_action = action_advance_mil_tech
		NOT = { has_character_modifier = in_seclusion }
		location = {
			owner = {
				job_marshal = {
					character = ROOT
				}
			}
		}
		location = {
			any_province_lord = {
				NOT = { is_liege_of = ROOT }
				martial = 8
				OR = {
					trait = gregarious
					diplomacy = 7
				}
				opinion = { who = ROOT value = 30 }
			}
		}
	}

	mean_time_to_happen = {
		months = 1000
		modifier = {
			factor = 0.5
			OR = {
				has_focus = focus_scholarship
				liege = { has_focus = focus_scholarship }
			}
		}
		modifier = {
			factor = 1.1
			NOT = { opinion = { who = liege value = -100 } }
		}
		modifier = {
			factor = 1.1
			NOT = { opinion = { who = liege value = -75 } }
		}
		modifier = {
			factor = 1.1
			NOT = { opinion = { who = liege value = -50 } }
		}
		modifier = {
			factor = 1.1
			NOT = { opinion = { who = liege value = -25 } }
		}
		modifier = {
			factor = 0.95
			opinion = { who = liege value = 25 }
		}
		modifier = {
			factor = 0.95
			opinion = { who = liege value = 50 }
		}
		modifier = {
			factor = 0.95
			opinion = { who = liege value = 75 }
		}
		modifier = {
			factor = 0.95
			opinion = { who = liege value = 100 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 1 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 2 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 3 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 4 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 5 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 6 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 7 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 8 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 9 }
		}
		modifier = {
			factor = 0.95
			martial = 11
		}
		modifier = {
			factor = 0.95
			martial = 12
		}
		modifier = {
			factor = 0.95
			martial = 13
		}
		modifier = {
			factor = 0.95
			martial = 14
		}
		modifier = {
			factor = 0.95
			martial = 15
		}
		modifier = {
			factor = 0.95
			martial = 16
		}
		modifier = {
			factor = 0.95
			martial = 17
		}
		modifier = {
			factor = 0.95
			martial = 18
		}
		modifier = {
			factor = 0.95
			martial = 19
		}
		modifier = {
			factor = 0.95
			martial = 20
		}
		modifier = {
			factor = 0.95
			martial = 21
		}
		modifier = {
			factor = 0.95
			martial = 22
		}
		modifier = {
			factor = 0.95
			martial = 23
		}
		modifier = {
			factor = 0.95
			martial = 24
		}
		modifier = {
			factor = 0.95
			martial = 25
		}
	}

	option = {
		name = "EVTOPTA939"
		location = {
			random_province_lord = {
				limit = {
					NOT = { is_liege_of = ROOT }
					martial = 8
					OR = {
						trait = gregarious
						diplomacy = 7
					}
					opinion = { who = ROOT value = 30 }
				}
				character_event = { id = 20390 days = 3 tooltip = "EVTTOOLTIP20390" }
			}
		}
	}
}

#20390: Noble helps
character_event = {
	id = 20390
	desc = "EVTDESC20390"
	picture = GFX_evt_large_army

	is_triggered_only = yes

	option = {
		name = "EVTOPTA20390"
		ai_chance = {
			factor = 75
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 60 }
			}
		}
		FROM = {
			character_event = { id = 20391 days = 3 tooltip = "EVTTOOLTIP20391" }
		}
	}

	option = {
		name = "EVTOPTB20390"
		ai_chance = { factor = 25 }
	}
}

#20391: Marshal
character_event = {
	id = 20391
	desc = "EVTDESC20391"
	picture = GFX_evt_large_army

	is_triggered_only = yes

	option = {
		name = "EVTOPTA20391"
		FROM = {
			reverse_opinion = {
				modifier = opinion_grateful
				who = ROOT
				years = 5
			}
		}
		liege = { letter_event = { id = 20392 tooltip = "EVTTOOLTIP20392" } }
	}
}

#20392: Liege
letter_event = {
	id = 20392
	desc = "EVTDESC20392"

	is_triggered_only = yes

	option = {
		name = "EVTOPTA20392"
		military_techpoints = 50
		FROM = {
			FROM = {
				reverse_opinion = {
					modifier = opinion_grateful
					who = ROOT
					years = 5
				}
			}
		}
	}
}


##############################
# MARSHAL
# JOB: action_train_troops
##############################

character_event = {
	id = Performance.941
	
	hide_window = yes
	is_triggered_only = yes
	
	capable_only = yes
	min_age = 16
	prisoner = no
	
	trigger = {
		has_job_action = action_train_troops
		NOT = { has_character_modifier = in_seclusion }
		location = {
			owner = {
				job_marshal = {
					character = ROOT
				}
			}
			NOT = { has_province_modifier = levy_reinforcements }
		}
	}
	
	immediate = {
		random_list = {
			1 = {
				character_event = { id = 941 days = 60 random = 30 }
			}
			39 = {
				modifier = {
					factor = 1.33
					has_global_flag = hardcore_mode
					ai = no
				}
				modifier = {
					factor = 1.1
					NOT = { opinion = { who = liege value = -100 } }
				}
				modifier = {
					factor = 1.1
					NOT = { opinion = { who = liege value = -75 } }
				}
				modifier = {
					factor = 1.1
					NOT = { opinion = { who = liege value = -50 } }
				}
				modifier = {
					factor = 1.1
					NOT = { opinion = { who = liege value = -25 } }
				}
				modifier = {
					factor = 0.95
					opinion = { who = liege value = 25 }
				}
				modifier = {
					factor = 0.95
					opinion = { who = liege value = 50 }
				}
				modifier = {
					factor = 0.95
					opinion = { who = liege value = 75 }
				}
				modifier = {
					factor = 0.95
					opinion = { who = liege value = 100 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 1 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 2 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 3 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 4 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 5 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 6 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 7 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 8 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 9 }
				}
				modifier = {
					factor = 0.95
					martial = 11
				}
				modifier = {
					factor = 0.95
					martial = 12
				}
				modifier = {
					factor = 0.95
					martial = 13
				}
				modifier = {
					factor = 0.95
					martial = 14
				}
				modifier = {
					factor = 0.95
					martial = 15
				}
				modifier = {
					factor = 0.95
					martial = 16
				}
				modifier = {
					factor = 0.95
					martial = 17
				}
				modifier = {
					factor = 0.95
					martial = 18
				}
				modifier = {
					factor = 0.95
					martial = 19
				}
				modifier = {
					factor = 0.95
					martial = 20
				}
				modifier = {
					factor = 0.95
					martial = 21
				}
				modifier = {
					factor = 0.95
					martial = 22
				}
				modifier = {
					factor = 0.95
					martial = 23
				}
				modifier = {
					factor = 0.95
					martial = 24
				}
				modifier = {
					factor = 0.95
					martial = 25
				}
			}
		}
	}
}

# 941: Reinforcements Arrive
character_event = {
	id = 941
	title = "EVTNAME941"
	desc = "EVTDESC941"
	picture = GFX_evt_large_army
	
	is_triggered_only = yes

	min_age = 16
	capable_only = yes
	prisoner = no

	trigger = {
		has_job_action = action_train_troops
		location = {
			owner = {
				job_marshal = {
					character = ROOT
				}
			}
			NOT = { has_province_modifier = levy_reinforcements }
		}
	}

	option = {
		name = "EVTOPTA941"
		liege = { character_event = { id = 20410 tooltip = "EVTTOOLTIP20410" } }
	}
}

# 20410: Liege
character_event = {
	id = 20410
	desc = EVTDESC20410
	picture = GFX_evt_large_army
	
	is_triggered_only = yes
	
	notification = yes
	
	immediate = {
		FROM = {
			location = {
				add_province_modifier = {
					name = levy_reinforcements
					duration = 365
				}
			}
		}
		if = {
			limit = {
				has_dlc = "Reapers"
			}
			custom_tooltip = {
				text = increase_prosperity_custom_tooltip
				hidden_tooltip = {
					FROM = {
						location = {
							change_variable = { which = prosperity_value value = 6 }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTA20410"
	}
}


# 942: Marshal tries to train troops, noble interferes
character_event = {
	id = 942
	title = "EVTNAME942"
	desc = "EVTDESC942"
	picture = GFX_evt_large_army

	min_age = 16
	capable_only = yes
	prisoner = no

	trigger = {
		has_job_action = action_train_troops
		NOT = { has_character_modifier = in_seclusion }
		location = {
			owner = {
				job_marshal = {
					character = ROOT
				}
			}
		}
		location = {
			any_province_lord = {
				NOR = { 
					is_liege_of = ROOT
					character = ROOT
				}
				independent = no
				OR = {
					trait = ambitious
					trait = deceitful
				}
			}
			NOT = { has_province_modifier = levy_reinforcements }
		}
	}

	mean_time_to_happen = {
		months = 720

		modifier = {
			factor = 0.9
			NOT = { opinion = { who = liege value = -100 } }
		}
		modifier = {
			factor = 0.9
			NOT = { opinion = { who = liege value = -75 } }
		}
		modifier = {
			factor = 0.9
			NOT = { opinion = { who = liege value = -50 } }
		}
		modifier = {
			factor = 0.9
			NOT = { opinion = { who = liege value = -25 } }
		}
		modifier = {
			factor = 1.05
			opinion = { who = liege value = 25 }
		}
		modifier = {
			factor = 1.05
			opinion = { who = liege value = 50 }
		}
		modifier = {
			factor = 1.05
			opinion = { who = liege value = 75 }
		}
		modifier = {
			factor = 1.05
			opinion = { who = liege value = 100 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 1 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 2 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 3 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 4 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 5 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 6 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 7 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 8 }
		}
		modifier = {
			factor = 0.95
			NOT = { martial = 9 }
		}
		modifier = {
			factor = 1.05
			martial = 11
		}
		modifier = {
			factor = 1.05
			martial = 12
		}
		modifier = {
			factor = 1.05
			martial = 13
		}
		modifier = {
			factor = 1.05
			martial = 14
		}
		modifier = {
			factor = 1.05
			martial = 15
		}
		modifier = {
			factor = 1.05
			martial = 16
		}
		modifier = {
			factor = 1.05
			martial = 17
		}
		modifier = {
			factor = 1.05
			martial = 18
		}
		modifier = {
			factor = 1.05
			martial = 19
		}
		modifier = {
			factor = 1.05
			martial = 20
		}
		modifier = {
			factor = 1.05
			martial = 21
		}
		modifier = {
			factor = 1.05
			martial = 22
		}
		modifier = {
			factor = 1.05
			martial = 23
		}
		modifier = {
			factor = 1.05
			martial = 24
		}
		modifier = {
			factor = 1.05
			martial = 25
		}
	}

	option = {
		name = "EVTOPTA942"
		location = {
			random_province_lord = {
				limit = {
					NOT = { is_liege_of = ROOT }
					independent = no
					OR = {
						trait = ambitious
						trait = deceitful
					}
				}
				character_event = { id = 20420 days = 7 tooltip = "EVTTOOLTIP20420" }
			}
		}
	}
}

#20420: Noble reacts
character_event = {
	id = 20420
	desc = "EVTDESC20420"
	picture = GFX_evt_council

	is_triggered_only = yes

	option = {
		name = "EVTOPTA20420"
		ai_chance = { factor = 100 }
		FROM = {
			liege = {
				opinion = {
					modifier = opinion_angry
					who = ROOT
					years = 5
				}
				letter_event = { id = 20421 tooltip = "EVTTOOLTIP20421" }
			}
		}
	}
	option = {
		name = "EVTOPTB20420"
		ai_chance = { factor = 0 }
	}
}

#20421: Marshal writes to Liege
letter_event = {
	id = 20421
	desc = "EVTDESC20421"

	show_from_from = yes

	is_triggered_only = yes

	option = {
		name = "EVTOPTA20421"
		FROM = {
			FROM = {
				location = {
					add_province_modifier = {
						name = missing_reinforcements
						duration = 1825
					}
				}
			}
		}
		hidden_tooltip = {
			remove_opinion = {
				modifier = opinion_angry
				who = FROM
			}
		}
		opinion = {
			modifier = opinion_angry
			who = FROM
			years = 5
		}
	}
}


##############################
# MARSHAL
# JOB: action_organize_raid
##############################

# 20221: The Marshal has managed to raise an eager force of raiders
character_event = {
	id = 20221
	title = EVTNAME20221
	desc = EVTDESC20221
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war

	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		has_job_action = action_organize_raid
		NOT = { has_character_modifier = in_seclusion }
		liege = {
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
			OR = {
				NOT = { has_character_flag = tribal_organize_raid_troops }
				had_character_flag = { flag = tribal_organize_raid_troops days = 3650 }
			}
			war = no
		}
		location = {
			county = { is_occupied = no }
			ROOT = {
				liege = { is_capital = PREVPREV }
			}
		}
	}
	
	mean_time_to_happen = {
		months = 120
		
		modifier = {
			factor = 3.0
			liege = {
				tier = count
			}
		}
		
		modifier = {
			factor = 1.25
			NOT = { martial = 2 }
		}
		modifier = {
			factor = 1.25
			NOT = { martial = 3 }
		}
		modifier = {
			factor = 1.25
			NOT = { martial = 4 }
		}
		modifier = {
			factor = 1.25
			NOT = { martial = 5 }
		}
		modifier = {
			factor = 0.75
			martial = 9
		}
		modifier = {
			factor = 0.75
			martial = 10
		}
		modifier = {
			factor = 0.75
			martial= 11
		}
		modifier = {
			factor = 0.75
			martial = 12
		}
		modifier = {
			factor = 0.75
			martial = 13
		}
	}
	
	option = {
		name = EVTOPTA20221
		
		prestige = 50
		hidden_tooltip  = {
			liege = { character_event = { id = 20222 } }
		}
	}
}

# 20222: The liege is informed
character_event = {
	id = 20222
	desc = EVTDESC20222
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	immediate = {
		capital_scope = {
			ROOT = {
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					match_character = THIS
					match_mult = 0.025
					match_min = 100
					match_max = 3000
					attrition = 1.0
					cannot_inherit = yes
					earmark = tribal_organize_raid
					is_looter = yes
					can_toggle_looting = no
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					match_character = THIS
					match_mult = 0.025
					match_min = 100
					match_max = 3000
					attrition = 1.0
					cannot_inherit = yes
					earmark = tribal_organize_raid
					is_looter = yes
					can_toggle_looting = no
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					match_character = THIS
					match_mult = 0.025
					match_min = 100
					match_max = 3000
					attrition = 1.0
					cannot_inherit = yes
					earmark = tribal_organize_raid
					is_looter = yes
					can_toggle_looting = no
				}
			}
		}
		
		clr_character_flag = tribal_organize_raid_troops
		set_character_flag = tribal_organize_raid_troops
		
		character_event = { id = 20223 days = 182 random = 30 }
	}
	
	option = {
		name = EVTOPTA20222
		opinion = {
			who = FROM
			modifier = opinion_grateful
			months = 60
		}
	}
}

# 20223: Hidden ping event to check the status of the raiders
character_event = {
	id = 20223
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				has_earmarked_regiments_not_raiding = tribal_organize_raid
			}
			if = {
				limit = {
					had_character_flag = { flag = tribal_organize_raid_troops days = 122 }
				}
				character_event = { id = 20224 }
			}
			if = {
				limit = {
					NOT = { had_character_flag = { flag = tribal_organize_raid_troops days = 122 } }
				}
				character_event = { id = 20223 days = 30 }
			}
		}
	}
}

# 20224: The men are displeased and disband
character_event = {
	id = 20224
	desc = EVTDESC20224
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA20224
		if = {
			limit = { ai = no }
			scaled_wealth = -0.5
		}
		clr_character_flag = tribal_organize_raid_troops
		disband_event_forces = tribal_organize_raid
	}
}


##############################
# MARSHAL
# JOB: action_assist_arrest
##############################

# 944: Marshal attempts to cow the province's peasants
character_event = {
	id = 944
	desc = EVTDESC944
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_war
	
	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		has_job_action = action_assist_arrest
		NOT = { has_character_modifier = in_seclusion }
		NOR = {
			trait = wounded
			is_maimed_trigger = yes
		}
		liege = {
			ROOT = {
				location = {
					owner = {
						OR = {
							character = PREVPREVPREV
							is_liege_or_above = PREVPREVPREV
						}
					}
					OR = {
						NOT = { culture = PREVPREV }
						NOT = { religion = PREVPREV }
						has_province_modifier = heretic_stronghold
						has_province_modifier = neglected_development
						has_province_modifier = local_death_cult
						has_province_modifier = construction_accident
						has_province_modifier = peasant_unrest
						has_province_modifier = religious_unrest
						has_province_modifier = cultural_unrest
						has_province_modifier = extra_tax
						has_province_modifier = active_inquisition
						has_province_modifier = burnt_the_land
						has_province_modifier = recently_burnt_the_land
						has_province_modifier = recently_burnt_the_land_not_owner
						has_province_modifier = decadence_unrest
						has_province_modifier = iconoclast_blowback
						has_province_modifier = paulician_suppression
					}
					NOR = {
						has_province_modifier = recent_revolt
						has_province_modifier = theological_dialogue
						has_province_modifier = recent_county_uprising
						has_province_modifier = wald_charity
						has_province_modifier = marshal_province_angry
						has_province_modifier = marshal_province_cowed
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 480
		
		modifier = {
			factor = 1.1
			NOT = { opinion = { who = liege value = -100 } }
		}
		modifier = {
			factor = 1.1
			NOT = { opinion = { who = liege value = -75 } }
		}
		modifier = {
			factor = 1.1
			NOT = { opinion = { who = liege value = -50 } }
		}
		modifier = {
			factor = 1.1
			NOT = { opinion = { who = liege value = -25 } }
		}
		modifier = {
			factor = 0.9
			opinion = { who = liege value = 25 }
		}
		modifier = {
			factor = 0.9
			opinion = { who = liege value = 50 }
		}
		modifier = {
			factor = 0.9
			opinion = { who = liege value = 75 }
		}
		modifier = {
			factor = 0.9
			opinion = { who = liege value = 100 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 1 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 2 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 3 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 4 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 5 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 6 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 7 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 8 }
		}
		modifier = {
			factor = 1.05
			NOT = { martial = 9 }
		}
		modifier = {
			factor = 0.95
			martial = 11
		}
		modifier = {
			factor = 0.95
			martial = 12
		}
		modifier = {
			factor = 0.95
			martial = 13
		}
		modifier = {
			factor = 0.95
			martial = 14
		}
		modifier = {
			factor = 0.95
			martial = 15
		}
		modifier = {
			factor = 0.95
			martial = 16
		}
		modifier = {
			factor = 0.95
			martial = 17
		}
		modifier = {
			factor = 0.95
			martial = 18
		}
		modifier = {
			factor = 0.95
			martial = 19
		}
		modifier = {
			factor = 0.95
			martial = 20
		}
		modifier = {
			factor = 0.95
			martial = 21
		}
		modifier = {
			factor = 0.95
			martial = 22
		}
		modifier = {
			factor = 0.95
			martial = 23
		}
		modifier = {
			factor = 0.95
			martial = 24
		}
		modifier = {
			factor = 0.95
			martial = 25
		}
	}

	option = {
		name = EVTOPTA944 #Put them down
		ai_chance = {
			factor = 75
			modifier = {
				factor = 5
				trait = kind
			}
			modifier = {
				factor = 2.5
				trait = brave
			}
			modifier = {
				factor = 2
				trait = slothful
			}
			modifier = {
				factor = 2
				trait = patient
			}
			modifier = {
				factor = 0.5
				trait = diligent
			}
			modifier = {
				factor = 0.5
				trait = wroth
			}
			modifier = {
				factor = 0.25
				trait = craven
			}
			modifier = {
				factor = 0
				OR = {
					trait = cruel
					trait = impaler
					trait = lunatic
					trait = possessed
				}
			}
		}
		if = {
			limit = { trait = kind }
			random = {
				chance = 25
				remove_trait = kind
			}
		}
		if = {
			limit = {
				NOT = { trait = brave }
				NOT = { trait = craven }
			}
			random = {
				chance = 10
				add_trait = brave
			}
		}
		if = {
			limit = { trait = craven }
			random = {
				chance = 10
				remove_trait = craven
			}
		}
		random = {
			chance = 30
			modifier = {
				factor = 0.5
				trait = craven
			}
			modifier = {
				factor = 2.0
				OR = {
					trait = brave
					trait = lunatic
					trait = drunkard
					trait = infirm
				}
			}
			modifier = {
				factor = 1.5
				OR = {
					trait = possessed
					trait = stressed
				}
			}
			modifier = {
				factor = 1.05
				NOT = { martial = 1 }
			}
			modifier = {
				factor = 1.05
				NOT = { martial = 2 }
			}
			modifier = {
				factor = 1.05
				NOT = { martial = 3 }
			}
			modifier = {
				factor = 1.05
				NOT = { martial = 4 }
			}
			modifier = {
				factor = 1.05
				NOT = { martial = 5 }
			}
			modifier = {
				factor = 1.05
				NOT = { martial = 6 }
			}
			modifier = {
				factor = 1.05
				NOT = { martial = 7 }
			}
			modifier = {
				factor = 1.05
				NOT = { martial = 8 }
			}
			modifier = {
				factor = 1.05
				NOT = { martial = 9 }
			}
			modifier = {
				factor = 0.95
				martial = 11
			}
			modifier = {
				factor = 0.95
				martial = 12
			}
			modifier = {
				factor = 0.95
				martial = 13
			}
			modifier = {
				factor = 0.95
				martial = 14
			}
			modifier = {
				factor = 0.95
				martial = 15
			}
			modifier = {
				factor = 0.95
				martial = 16
			}
			modifier = {
				factor = 0.95
				martial = 17
			}
			modifier = {
				factor = 0.95
				martial = 18
			}
			modifier = {
				factor = 0.95
				martial = 19
			}
			modifier = {
				factor = 0.95
				martial = 20
			}
			modifier = {
				factor = 0.95
				martial = 21
			}
			modifier = {
				factor = 0.95
				martial = 22
			}
			modifier = {
				factor = 0.95
				martial = 23
			}
			modifier = {
				factor = 0.95
				martial = 24
			}
			modifier = {
				factor = 0.95
				martial = 25
			}
			add_trait = wounded
		}
		random_list = {
			50 = {
				modifier = {
					factor = 1.5
					trait = kind
				}
				modifier = {
					factor = 1.1
					trait = patient
				}
				modifier = {
					factor = 1.1
					trait = just
				}
				location = {
					add_province_modifier = {
						name = marshal_province_cowed
						duration = 1825
					}
				}
				hidden_tooltip = {
					character_event = { id = 20425 }
				}
			}
			50 = {
				modifier = {
					factor = 1.5
					trait = lunatic
				}
				modifier = {
					factor = 1.5
					trait = cruel
				}
				modifier = {
					factor = 1.1
					trait = wroth
				}
				modifier = {
					factor = 1.1
					trait = arbitrary
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 1 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 2 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 3 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 4 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 5 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 6 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 7 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 8 }
				}
				modifier = {
					factor = 1.05
					NOT = { martial = 9 }
				}
				modifier = {
					factor = 0.95
					martial = 11
				}
				modifier = {
					factor = 0.95
					martial = 12
				}
				modifier = {
					factor = 0.95
					martial = 13
				}
				modifier = {
					factor = 0.95
					martial = 14
				}
				modifier = {
					factor = 0.95
					martial = 15
				}
				modifier = {
					factor = 0.95
					martial = 16
				}
				modifier = {
					factor = 0.95
					martial = 17
				}
				modifier = {
					factor = 0.95
					martial = 18
				}
				modifier = {
					factor = 0.95
					martial = 19
				}
				modifier = {
					factor = 0.95
					martial = 20
				}
				modifier = {
					factor = 0.95
					martial = 21
				}
				modifier = {
					factor = 0.95
					martial = 22
				}
				modifier = {
					factor = 0.95
					martial = 23
				}
				modifier = {
					factor = 0.95
					martial = 24
				}
				modifier = {
					factor = 0.95
					martial = 25
				}
				location = {
					add_province_modifier = {
						name = marshal_province_angry
						duration = 1825
					}
				}
				hidden_tooltip = {
					character_event = { id = 20427 }
				}
			}
		}
	}
	option = {
		name = EVTOPTB944 #Let them go
		ai_chance = {
			factor = 25
		}
		if = {
			limit = {
				NOT = { trait = brave }
				NOT = { trait = craven }
			}
			random = {
				chance = 10
				add_trait = craven
			}
		}
		if = {
			limit = { trait = brave }
			random = {
				chance = 10
				remove_trait = brave
			}
		}
		if = {
			limit = {
				NOT = { trait = kind }
				NOT = { trait = cruel }
			}
			random = {
				chance = 25
				add_trait = kind
			}
		}
		if = {
			limit = { trait = cruel }
			random = {
				chance = 25
				remove_trait = cruel
			}
		}
	}
}

# 20425: Marshal was successful in cowing the peasants
character_event = {
	id = 20425
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_war
	
	desc = {
		trigger = { trait = wounded }
		text = EVTDESC20425_wounded
	}
	desc = {
		trigger = { NOT = { trait = wounded } }
		text = EVTDESC20425
	}
	
	is_triggered_only = yes
	hide_from = yes
	
	option = {
		name = EXCELLENT
		hidden_tooltip = {
			liege = { letter_event = { id = 20426 } }
			if = {
				limit = {
					location = {
						owner = {
							NOT = { is_liege_of = ROOT }
						}
					}
				}
				location = {
					owner = {
						letter_event = { id = 20426 }
						any_liege = {
							limit = {
								NOT = { character = PREV }
								NOT = { is_liege_of = ROOT }
							}
							letter_event = { id = 20426 }
						}
					}
				}
			}
		}
	}
}

# 20426: Liege informed
letter_event = {
	id = 20426
	border = GFX_event_letter_frame_war
	
	desc = {
		trigger = {
			NOT = { is_liege_of = FROM }
		}
		text = EVTDESC20426_owner
	}
	desc = {
		trigger = {
			is_liege_of = FROM
			FROM = { trait = wounded }
		}
		text = EVTDESC20426_wounded
	}
	desc = {
		trigger = {
			is_liege_of = FROM
			FROM = { NOT = { trait = wounded } }
		}
		text = EVTDESC20426
	}
	
	is_triggered_only = yes
	
	option = {
		name = EXCELLENT
		FROM = {
			location = {
				add_province_modifier = {
					name = marshal_province_cowed
					duration = 1825
				}
			}
		}
	}
}

# 20427: Marshal angered the peasants instead
character_event = {
	id = 20427
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_war
	
	desc = {
		trigger = { trait = wounded }
		text = EVTDESC20427_wounded
	}
	desc = {
		trigger = { NOT = { trait = wounded } }
		text = EVTDESC20427
	}
	
	is_triggered_only = yes
	hide_from = yes
	
	option = {
		name = CURSES
		hidden_tooltip = {
			liege = { letter_event = { id = 20428 } }
			if = {
				limit = {
					location = {
						owner = {
							NOT = { is_liege_of = ROOT }
						}
					}
				}
				location = {
					owner = {
						letter_event = { id = 20426 }
						any_liege = {
							limit = {
								NOT = { character = PREV }
								NOT = { is_liege_of = ROOT }
							}
							letter_event = { id = 20426 }
						}
					}
				}
			}
		}
	}
}

# 20428: Liege informed
letter_event = {
	id = 20428
	border = GFX_event_letter_frame_war
	
	desc = {
		trigger = {
			NOT = { is_liege_of = FROM }
		}
		text = EVTDESC20428_owner
	}
	desc = {
		trigger = {
			is_liege_of = FROM
			FROM = { trait = wounded }
		}
		text = EVTDESC20428_wounded
	}
	desc = {
		trigger = {
			is_liege_of = FROM
			FROM = { NOT = { trait = wounded } }
		}
		text = EVTDESC20428
	}
	
	is_triggered_only = yes
	
	option = {
		name = CURSES
		FROM = {
			location = {
				add_province_modifier = {
					name = marshal_province_angry
					duration = 1825
				}
			}
		}
	}
}

