# Civil war
country_event = {

	id = 3091
	
	trigger = {
		NOT = { has_country_flag = civil_war } 
		NOT = { has_country_flag = total_war_series } 
		num_of_cities = 2
		war = no
		badboy = 0.30
		NOT = { ADM = 7 }
		NOT = { aristocracy_plutocracy = -2 }
		NOT = { stability = 0 }
	}

	mean_time_to_happen = {
		months = 720

		modifier = {
			factor = 0.9
			revolt_percentage = 0.1
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 0.9
			badboy = 0.45
		}
		modifier = {
			factor = 1.1
			prestige = 0.2
		}
		modifier = {
			factor = 1.1
			prestige = 0.3 
		}
		modifier = {
			factor = 1.1
			advisor = statesman
		}
		modifier = {
			factor = 1.1
			statesman = 5
		}
		modifier = {
			factor = 1.1
			statesman = 6
		}
	}
	
	title = "EVTNAME3091"
	desc = "EVTDESC3091"
	
	option = {
		name = "EVTOPTA3091"			# Support the opposition
		ai_chance = { factor = 40 }
		set_country_flag = civil_war
		random_owned = {
			limit = { is_core = THIS }
			change_controller = REB
		}
		random_owned = {
			limit = { is_core = THIS }
			change_controller = REB
		}
		add_country_modifier = {
			name = "oppose_monarch"
			duration = 300
		}
	}
	option = {
		name = "EVTOPTB3091"			# Support the Monarch
		ai_chance = { factor = 60 }
		set_country_flag = civil_war
		treasury = -70
		random_owned = {
			limit = { is_core = THIS }
			change_controller = REB
		}
		add_country_modifier = {
			name = "oppose_monarch"
			duration = 300
		}
	}
}


# A cry for help
country_event = {

	id = 3092
	
	trigger = {
		has_country_flag = civil_war
		NOT = { has_country_flag = allies }
		num_of_revolts = 0.15
		num_of_allies = 2
	}

	mean_time_to_happen = {
		months = 24

		modifier = {
			factor = 0.9
			num_of_allies = 3
		}
		modifier = {
			factor = 0.9
			num_of_allies = 4
		}
		modifier = {
			factor = 0.9
			num_of_revolts = 0.2
		}
		modifier = {
			factor = 0.9
			num_of_revolts = 0.3
		}
		modifier = {
			factor = 0.9
			stability = 0
		}
		modifier = {
			factor = 1.1
			advisor = statesman
		}
		modifier = {
			factor = 1.1
			statesman = 6
		}
		modifier = {
			factor = 1.1
			stability = 1
		}
	}
	
	title = "EVTNAME3092"
	desc = "EVTDESC3092"
	
	option = {
		name = "EVTOPTA3092"			# Request aid from your allies
		ai_chance = { factor = 40 }
		set_country_flag = allies
		random_owned = {
			limit = { is_core = THIS }
			change_controller = REB
		}
		random_owned = {
			limit = { is_core = THIS }
			create_revolt = 1
		}
		prestige = -0.05
		diplomats = -1
	}
	option = {
		name = "EVTOPTB3092"			# Rely on your own strength
		ai_chance = { factor = 60 }
		set_country_flag = allies
		random_owned = {
			limit = { is_core = THIS }
			create_revolt = 1
		}	
		random_owned = {
			limit = { is_core = THIS }
			create_revolt = 1
		}
		random_owned = {
			limit = { is_core = THIS }
			change_controller = REB
		}
	}
}


# Unscrupulous in-laws
country_event = {

	id = 3093
	
	trigger = {
		has_country_flag = civil_war
		NOT = { has_country_flag = unscrupulous_inlaws }
		num_of_royal_marriages = 2
	}

	mean_time_to_happen = {
		months = 36

		modifier = {
			factor = 0.9
			num_of_royal_marriages = 3
		}
		modifier = {
			factor = 0.9
			num_of_revolts = 0.2
		}
		modifier = {
			factor = 0.9
			num_of_revolts = 0.3
		}
		modifier = {
			factor = 0.9
			stability = 0
		}
		modifier = {
			factor = 1.1
			advisor = diplomat
		}
		modifier = {
			factor = 1.1
			diplomat = 6
		}
		modifier = {
			factor = 1.1
			DIP = 7
		}
		modifier = {
			factor = 1.1
			DIP = 8
		}
		modifier = {
			factor = 1.1
			stability = 1
		}
	}
	
	title = "EVTNAME3093"
	desc = "EVTDESC3093"
	
	option = {
		name = "EVTOPTA3093"			# Take appropriate measures
		ai_chance = { factor = 40 }
		set_country_flag = unscrupulous_inlaws
		stability = -1
		random_owned = {
			limit = { is_core = THIS }
			change_controller = REB
		}
		random_owned = {
			limit = { is_core = THIS }
			create_revolt = 1
		}
	}
	option = {
		name = "EVTOPTB3093"			# Ignore their pathetic attempts
		ai_chance = { factor = 60 }
		set_country_flag = unscrupulous_inlaws
		stability = -1
		prestige = -0.05
		centralization_decentralization = 1
	}
}


# Rebel forces take over
province_event = {

	id = 3094
	
	trigger = {
		owner = {
			has_country_flag = civil_war
			war = no
			NOT = { has_country_flag = rebel_control }
			NOT = { MIL = 6 }
		}
	}
	
	mean_time_to_happen = {
		months = 24

		modifier = {
			factor = 0.9
			owner = { NOT = { advisor = statesman } }
		}
		modifier = {
			factor = 1.1
			owner = { advisor = statesman }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { ADM = 5 } }
		}
		modifier = {
			factor = 1.1
			owner = { ADM = 7 }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { stability = 0 } }
		}
		modifier = {
			factor = 1.1
			owner = { stability = 2 }
		}
		modifier = {
			factor = 1.1
			has_building = constable
		}
		modifier = {
			factor = 1.1
			owner = { is_monarch_leader = yes }
		}
	}
	
	title = "EVTNAME3094"
	desc = "EVTDESC3094"
	
	option = {
		name = "EVTOPTA3094"			# We must regroup before they attack again
		owner = {
			set_country_flag = rebel_control
			treasury = -60
			add_country_modifier = {
				name = "battle_preparations"
				duration = 300
			}
			random_owned = {
				limit = { is_core = THIS }
				create_revolt = 1
			}		
		}
		change_controller = REB
	}
	option = {
		name = "EVTOPTB3094"			# We'll have to accept defeat, for now
		owner = {
			set_country_flag = rebel_control
			prestige = -0.05
			add_country_modifier = {
				name = "decreased_morale"
				duration = 300
			}
			random_owned = {
				limit = { is_core = THIS }
				create_revolt = 1
			}
		}
		change_controller = REB
	}
}



# Army deserters
province_event = {

	id = 3095
	
	trigger = {
		owner = {
			has_country_flag = civil_war
			war = no
			NOT = { has_country_flag = deserting_troops }
		}
	}
	
	mean_time_to_happen = {
		months = 24

		modifier = {
			factor = 1.1
			owner = { is_monarch_leader = yes }
		}
		modifier = {
			factor = 0.9
			NOT = { prestige = 0.01 }
		}
		modifier = {
			factor = 1.1
			owner = { ADM = 7 }
		}
		modifier = {
			factor = 1.1
			owner = { ADM = 8 }
		}
		modifier = {
			factor = 1.1
			owner = { MIL = 7 }
		}
		modifier = {
			factor = 1.1
			owner = { MIL = 8 }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { ADM = 5 } }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { ADM = 4 } }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { MIL = 5 } }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { MIL = 4 } }
		}		
	}
	
	title = "EVTNAME3095"
	desc = "EVTDESC3095"
	
	option = {
		name = "EVTOPTA3095"			# Try to strengthen their morale
		owner = {
			set_country_flag = deserting_troops
			treasury = -60
			add_country_modifier = {
				name = "morale_boost"
				duration = 300
			}
		}
	}
	option = {
		name = "EVTOPTB3095"			# We have no resources for that
		owner = {
			set_country_flag = deserting_troops
			add_country_modifier = {
				name = "deserters"
				duration = 300
			}
		}
		change_manpower = -1
	}
}


# Retreating rebels
country_event = {

	id = 3096
	
	trigger = {
		has_country_flag = civil_war
		MIL = 5
	}
	
	mean_time_to_happen = {
		months = 48

		modifier = {
			factor = 0.9
			stability = 1
		}
		modifier = {
			factor = 0.9
			stability = 2
		}
		modifier = {
			factor = 0.9
			stability = 3
		}
		modifier = {
			factor = 0.9
			prestige = 0.2
		}
		modifier = {
			factor = 0.9
			prestige = 0.3
		}
		modifier = {
			factor = 0.9
			prestige = 0.4
		}
		modifier = {
			factor = 1.1
			NOT = { prestige = 0.01 }
		}
		modifier = {
			factor = 1.1
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 1.1
			has_country_flag = deserting_troops
		}
	}
	
	title = "EVTNAME3096"
	desc = "EVTDESC3096"
	
	option = {
		name = "EVTOPTA3096"			# Prepare for a final battle
		clr_country_flag = civil_war
		clr_country_flag = allies
		clr_country_flag = unscrupulous_inlaws
		clr_country_flag = rebel_control
		clr_country_flag = deserting_troops
		treasury = -65
		add_country_modifier = {
			name = "battle_preparations"
			duration = 100
		}
	}
	option = {
		name = "EVTOPTB3096"			# Let them run
		clr_country_flag = civil_war
		clr_country_flag = allies
		clr_country_flag = unscrupulous_inlaws
		clr_country_flag = rebel_control
		clr_country_flag = deserting_troops	
		stability = 2
		badboy = -3
	}
}
