namespace = revolution

# Revolution
country_event = {
	id = revolution.1
	title = "EVTNAME3011"
	desc = "EVTDESC3011"
	picture = REVOLUTION_eventPicture
	
	major = yes
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}
	

	immediate = {
		random_owned_province = { 
			limit = {
				development = 8
			}
			spawn_rebels = {
				type = revolutionary_rebels
				size = 3		
				win = yes
				unrest = 10
			}
			
		}
		add_stability = -3
	
	
	
		set_country_flag = had_revolution
	}
	
	option = {
		name = "EVTOPTA3011"			# Dire times are ahead of us
		add_prestige = -10
	}
}


# Religious intolerance
country_event = {
	id = revolution.2
	title = "EVTNAME3012"
	desc = "EVTDESC3012"
	picture = REVOLUTION_eventPicture
	
	trigger = {
		NOT = { has_country_flag = religious_revolution }
		NOT = { religious_unity = 1.0 }
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	
	immediate = {
		set_country_flag = religious_revolution
	}
	
	option = {
		name = "EVTOPTA3012"			# One nation, one belief
		ai_chance = { factor = 75 }
		set_country_flag = religious_revolution
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "religious_intolerance"
				duration = -1
				desc = "END_OF_REVOLUTION"
			}
		}
	}
	option = {
		name = "EVTOPTB3012" # Tolerate all beliefs
		ai_chance = { factor = 25 }
		set_country_flag = religious_revolution
		if = {
			limit = {
				religion = catholic
			}
			reverse_add_opinion = { who = PAP modifier = opinion_too_tolerate }
		}
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "religious_tolerance"
				duration = -1
				desc = "END_OF_REVOLUTION"
			}
		}
	}
}

# Serfdom
country_event = {
	id = revolution.3
	title = "EVTNAME3013"
	desc = "EVTDESC3013"
	picture = REVOLUTION_eventPicture
	
	trigger = {
		NOT = { has_country_flag = serfdom }
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		set_country_flag = serfdom
	}	
	
	option = {
		name = "EVTOPTA3013"			# Restrict serfdom
		ai_chance = { factor = 30 }
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "restrict_serfdom"
				duration = -1
				desc = "END_OF_REVOLUTION"
			}
		}
	}
	option = {
		name = "EVTOPTB3013"			# Keep the masses in chains
		ai_chance = { factor = 70 }
		random_owned_province = { revolutionary_rebels = 1 }
		add_stability_or_adm_power = yes
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "enforce_serfdom"
				duration = -1
				desc = "END_OF_REVOLUTION"
			}
		}
	}
}

# Social reform
country_event = {
	id = revolution.4
	title = "EVTNAME3014"
	desc = "EVTDESC3014"
	picture = REFORM_eventPicture
	
	trigger = {
		NOT = { has_country_flag = social_reform }
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}
	immediate = { 
		set_country_flag = social_reform 
	}
	
	option = {
		name = "EVTOPTA3014"			# Suppress the free thinkers
		ai_chance = { factor = 60 }
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "suppress_free_thinkers"
				duration = -1
				desc = "END_OF_REVOLUTION"			
			}
		}
	}
	option = {
		name = "EVTOPTB3014"			# They hardly pose a threat
		ai_chance = { factor = 40 }
		random_owned_province = { revolutionary_rebels = 1 }
		random_owned_province = { revolutionary_rebels = 1 }
		random_owned_province = { revolutionary_rebels = 1 }
	}
}

# Royal Bureaucracy
country_event = {
	id = revolution.5
	title = "EVTNAME3015"
	desc = "EVTDESC3015"
	picture = REVOLUTION_eventPicture
	
	trigger = {
		NOT = { has_country_flag = royal_bureaucracy }
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}
	immediate = { 
		set_country_flag = royal_bureaucracy 
	}
	
	option = {
		name = "EVTOPTA3015"			# Reduce the royal bureaucracy
		ai_chance = { factor = 65 }
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "bureaucratic_reduction"
				duration = -1
				desc = "END_OF_REVOLUTION"
			}
		}		
	}
	option = {
		name = "EVTOPTB3015"			# Expand the royal bureaucracy
		ai_chance = { factor = 35 }
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "bureaucratic_expansion"
				duration = -1
				desc = "END_OF_REVOLUTION"
			}
		}
		add_corruption = 0.5
	}
}

# Deplorable reign
country_event = {
	id = revolution.6
	title = "EVTNAME3016"
	desc = "EVTDESC3016"
	picture = REVOLUTION_eventPicture
	
	trigger = {
		NOT = { has_country_flag = deplorable_reign }
		OR = {
			NOT = { mil = 2 }
			NOT = { dip = 2 }
			NOT = { adm = 2 }
		}
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}
	
	immediate = { 
		set_country_flag = deplorable_reign 
	}	
	
	option = {
		name = "EVTOPTA3016"			# Support
		ai_chance = { factor = 60 }
		add_adm_power = -25
		add_dip_power = -25
		add_mil_power = -25
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "support_monarch"
				duration = -1
				desc = "END_OF_REVOLUTION"
			}
		}
	}
	option = {
		name = "EVTOPTB3016"			# Oppose
		ai_chance = { factor = 40 }
		random_owned_province = { revolutionary_rebels = 2 }
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "oppose_monarch"
				duration = -1
				desc = "END_OF_REVOLUTION"
			}
		}
	}
}

# The road to bankruptcy
country_event = {
	id = revolution.7
	title = "EVTNAME3017"
	desc = "EVTDESC3017"
	picture = BANKRUPTCY_eventPicture
	
	trigger = {
		NOT = { has_country_flag = road_to_bankruptcy }
		num_of_loans = 10
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}
	
	immediate = { 
		set_country_flag = road_to_bankruptcy 
	}
	
	option = {
		name = "EVTOPTA3017"			# Mint more money
		ai_chance = { factor = 30 }
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "mint_money"
				duration = -1
				desc = "END_OF_REVOLUTION"
			}
		}
	}
	option = {
		name = "EVTOPTB3017"			# We must strengthen our currency
		ai_chance = { factor = 70 }
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "fight_inflation"
				duration = -1
				desc = "END_OF_REVOLUTION"
			}
		}
	}
}

# Financial Crisis
country_event = {
	id = revolution.8
	title = "EVTNAME3018"
	desc = "EVTDESC3018"
	picture = ECONOMY_eventPicture
	
	trigger = {
		NOT = { has_country_flag = financial_crisis }
		is_bankrupt = yes
		is_at_war = yes
	}
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}
	
	immediate = { 
		set_country_flag = financial_crisis 
	}	
	
	option = {
		name = "EVTOPTA3018"			# Cut back on war expenditures
		ai_chance = { factor = 70 }
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "disarmament"
				duration = -1
				desc = "END_OF_REVOLUTION"			
			}
		}
	}
	option = {
		name = "EVTOPTB3018"			# The war has its purpose
		ai_chance = { factor = 30 }
		if = {
			limit = {
				has_disaster = revolution
			}
			add_country_modifier = {
				name = "financial_disaster"
				duration = -1
				desc = "END_OF_REVOLUTION"			
			}
		}
	}
}

# Stability returns
country_event = {
	id = revolution.9
	title = "EVTNAME3019"
	desc = "EVTDESC3019"
	picture = REVOLUTION_eventPicture
	
	major = yes	
	
	trigger = {
		has_country_flag = revolution
		had_country_flag = { flag = revolution days = 1000 }
	
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA3019"			# Restore order
		country_event = { id = revolution.20 }
		add_stability = 2
	}
}


#####Revolution Events######

country_event = {
	id = revolution.10
	title = "EVTNAME6601"
	desc = "EVTDESC6601"
	picture = REVOLUTION_eventPicture
	
	major = yes
	
	trigger = {
		revolution_target_exists = no 
		capital_scope = { 
			continent = north_america 
			controlled_by = REB
		} 
		num_of_cities = 10
		NOT = { government = revolutionary_republic }
		NOT = { government = revolutionary_empire }
		OR = {
			has_first_revolution_started = yes
			has_dlc = "Art of War"
		}
	}
	
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}


	option = {
		name = "EVTOPTA6601"
		set_revolution_target = ROOT
		disband_rebels = revolutionary_rebels
		add_mercantilism = 5
		country_event = { id = revolution.20 }
		add_stability_or_adm_power = yes
		change_government = revolutionary_republic
		kill_ruler = yes
	}
}


country_event = {
	id = revolution.13
	title = "EVTNAME6604"
	desc = "EVTDESC6604"
	picture = REVOLUTION_eventPicture

	trigger = {
		is_revolution_target = yes
		NOT = { tag = FRA }
		NOT = { has_dlc = "Art of War" }
		
		capital_scope = {
			NOT = {
				controlled_by = ROOT
				controlled_by = REB
			}
		}
	}

	mean_time_to_happen = {
		months = 1
	}

	option = {
		name = "EVTNAME6604"
		add_prestige = -50
		add_war_exhaustion = 3
		change_government = constitutional_monarchy
		kill_ruler = yes 
		set_revolution_target = ---
		capital_scope = {
			controller = {
				country_event = { id = revolution.14 }
			}
		}
	}
}

country_event = {
	id = revolution.14
	title = "EVTNAME6605"
	desc = "EVTDESC6605"
	picture = REVOLUTION_eventPicture

	is_triggered_only = yes

	option = {
		name = "EVTNAME6605"
		add_stability = 6
		add_prestige = 200
	}
}

country_event = {
	id = revolution.15
	title = "EVTNAME6606"
	desc = "EVTDESC6606"
	picture = REVOLUTION_eventPicture
	
	trigger = {
		has_first_revolution_started = no
		tag = FRA
		revolution_target_exists = no
		capital_scope = {
			continent = europe
			controlled_by = REB
		}
		num_of_cities = 10
		NOT = { government = revolutionary_republic }
		NOT = { government = revolutionary_empire }
	}
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}


	option = {
		name = "EVTOPTA6606"
		disband_rebels = revolutionary_rebels
		add_mercantilism = 5
		country_event = { id = revolution.20 }
		add_stability_or_adm_power = yes
		change_government = revolutionary_republic
		set_revolution_target = ROOT
		hidden_effect = {
			country_event = { id = revolution.17 }
		}
	}
}

country_event = {
	id = revolution.16
	title = "EVTNAME6607"
	desc = "EVTDESC6607"
	picture = REVOLUTION_eventPicture

	trigger = {
		tag = FRA
		is_revolution_target = yes
		NOT = { has_dlc = "Art of War" }
		capital_scope = {
			NOT = {
				controlled_by = ROOT
				controlled_by = REB
			}
		}
	}

	mean_time_to_happen = {
		months = 1
	}

	option = {
		name = "EVTOPTA6607"
		add_prestige = -50
		add_war_exhaustion = 3
		change_government = constitutional_monarchy
		set_revolution_target = ---
		hidden_effect = {
			FRA = {
				country_event = { id = revolution.18 }
			}
		}
		capital_scope = {	
			controller = {
				country_event = { id = revolution.14 }
			}
		}
	}
}

country_event = {
	id = revolution.17
	title = "EVTNAME6608"
	desc = "EVTDESC6608"
	picture = REVOLUTION_eventPicture

	is_triggered_only = yes

	option = {
		name = "EVTOPTA6608"
		kill_ruler = yes
	}
}

country_event = {
	id = revolution.18
	title = "EVTNAME6609"
	desc = "EVTDESC6609"
	picture = REVOLUTION_eventPicture

	is_triggered_only = yes

	option = {
		name = "EVTOPTA6609"
		kill_ruler = yes
	}
}

country_event = {
	id = revolution.19
	title = "EVTNAME6610"
	desc = "EVTDESC6610"
	picture = REVOLUTION_eventPicture

	trigger = {
		tag = FRA
		is_revolution_target = yes
		NOT = {
			OR = {
				government = revolutionary_republic
				government = revolutionary_empire
			}
		}
	}

	mean_time_to_happen = {
		months = 36
	}

	option = {
		name = "EVTOPTA6610"
		change_government = revolutionary_republic
		kill_ruler = yes
		add_stability_or_adm_power = yes
	}
}

country_event = {
	id = revolution.20
	title = revolution.20.t
	desc = revolution.20.d
	picture = REVOLUTION_eventPicture

	is_triggered_only = yes

	option = {
		name = revolution.20.a
		end_disaster = revolution


		clr_country_flag = religious_revolution
		clr_country_flag = serfdom
		clr_country_flag = social_reform
		clr_country_flag = royal_bureaucracy
		clr_country_flag = deplorable_reign
		clr_country_flag = road_to_bankruptcy
		clr_country_flag = financial_crisis		
		remove_country_modifier = religious_intolerance
		remove_country_modifier = religious_tolerance
		remove_country_modifier = restrict_serfdom
		remove_country_modifier = enforce_serfdom
		remove_country_modifier = suppress_free_thinkers
		remove_country_modifier = bureaucratic_reduction
		remove_country_modifier = bureaucratic_expansion
		remove_country_modifier = support_monarch
		remove_country_modifier = oppose_monarch
		remove_country_modifier = mint_money
		remove_country_modifier = fight_inflation
		remove_country_modifier = disarmament
		remove_country_modifier = financial_disaster
	}
}

