namespace = FEE_Mughals_Events

#############
### Babur ###
#############

# Young Timurid prince without a kingdom
country_event = {
	id = FEE_Mughals_Events.1
	title = FEE_Mughals_Events.1.T
	desc = FEE_Mughals_Events.1.D
	picture = FORT_eventPicture

	fire_only_once = yes

	trigger = {
		tag = AFG
		religion_group = muslim
		is_year = 1500
		NOT = { is_year = 1530 }
		owns = 451
	}

	mean_time_to_happen = {
		months = 24
	}

	option = {
		name = FEE_Mughals_Events.1.OPT1
		ai_chance = {
			factor = 80
		}

		if = {
			limit = { has_heir = yes }
			kill_heir = { allow_new_heir = no }
		}
		define_ruler = {
			name = "Babur"
			dynasty = "Timurid"
			culture = uzbehk
			age = 20
			adm = 5
			dip = 6
			mil = 6
		}
		custom_tooltip = fee_mug_babur_stats_tt
		hidden_effect = {
			add_ruler_personality = patron_of_arts_personality
			add_ruler_personality = conqueror_personality
			define_ruler_to_general = {
				fire = 6
				shock = 5
				manuever = 4
				siege = 5
				trait = cannoneer_personality
			}
			set_country_flag = fee_babur
		}
	}

	option = {
		name = FEE_Mughals_Events.1.OPT2
		ai_chance = {
			factor = 10
		}

		goto = 451

		451 = {
			spawn_rebels = {
				size = 2
				type = pretender_rebels
				leader = "Babur"
				leader_dynasty = "Timurid"
			}
		}
		set_country_flag = fee_mug_fighting_babur_rebels
		custom_tooltip = fee_mug_babur_rebel_tt
	}

	option = {
		name = FEE_Mughals_Events.1.OPT3
		trigger = {
			dynasty = "Timurid"
		}
		ai_chance = {
			factor = 10
		}

		define_general = {
			name = "Babur Timurid"
			fire = 6
			shock = 5
			manuever = 4
			siege = 5
			trait = cannoneer_personality
		}
	}
}

# Gardens of Babur
country_event = {
	id = FEE_Mughals_Events.2
	title = FEE_Mughals_Events.2.T
	desc = FEE_Mughals_Events.2.D
	picture = GREAT_BUILDING_eventPicture

	fire_only_once = yes

	trigger = {
		has_country_flag = fee_babur
		451 = {
			owned_by = ROOT
			NOT = {
				has_great_project = {
					type = gme_gardens_babur
					tier = 3
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	goto = 451

	option = {
		name = FEE_Mughals_Events.2.OPT1
		ai_chance = {
			factor = 80
		}

		add_years_of_income = -2
		451	= {
			add_base_tax = 1
			add_base_production = 1
			add_base_manpower = 1
			add_prosperity = 50
			if = {
				limit = {
					has_dlc = "Leviathan"
					is_expanded_mod_active = { mod = great_monuments }
					NOT = {
						has_great_project = {
							type = gme_gardens_babur
							tier = 3
						}
					}
				}
				add_great_project_tier = {
					type = gme_gardens_babur
					tier = 1
				}
			}
			else = {
				add_permanent_province_modifier = {
					name = fee_mug_bagh_babur
					duration = -1
				}
			}
		}
	}

	option = {
		name = FEE_Mughals_Events.2.OPT2
		ai_chance = {
			factor = 20
		}

		add_prestige = -5
	}
}

# Ottoman generals
country_event = {
	id = FEE_Mughals_Events.3
	title = FEE_Mughals_Events.3.T
	desc = FEE_Mughals_Events.3.D
	picture = CONQUEST_eventPicture

	fire_only_once = yes

	trigger = {
		tag = AFG
		has_country_flag = fee_babur
		has_opinion = {
			who = TUR
			value = 50
		}
	}

	mean_time_to_happen = {
		months = 120
	}

	option = {
		name = FEE_Mughals_Events.3.OPT1

		define_general = {
			fire = 6
			shock = 3
			manuever = 4
			siege = 2
			name = "Mustafa Rumi"
			trait = master_of_arms_personality
		}
		if = {
			limit = {
				is_expanded_mod_active = { mod = advisor_types }
			}
			define_advisor = {
				type = ate_advisor_master_of_artillery
				name = "Ustad Ali Quli"
				skill = 3
				cost_multiplier = 0.34
				religion = sunni
				culture = turkish
			}
		}
		else = {
			define_advisor = {
				type = commandant
				name = "Ustad Ali Quli"
				skill = 3
				cost_multiplier = 0.34
				religion = sunni
				culture = turkish
			}
		}
		set_country_flag = fee_mug_ottoman_generals
	}
}

# Modernize and train the army
country_event = {
	id = FEE_Mughals_Events.4
	title = FEE_Mughals_Events.4.T
	desc = FEE_Mughals_Events.4.D
	picture = LAND_MILITARY_eventPicture

	fire_only_once = yes

	trigger = {
		tag = AFG
		is_at_war = no
		has_country_flag = fee_babur
		has_country_flag = fee_mug_ottoman_generals
	}

	mean_time_to_happen = {
		months = 24
	}

	option = {
		name = FEE_Mughals_Events.4.OPT1
		add_mil_power = -200
		add_ruler_modifier = {
			name = fee_mug_ottoman_tactics
			duration = -1
		}
		clr_country_flag = fee_mug_ottoman_generals
	}
}

# Timurid claim on Punjab
country_event = {
	id = FEE_Mughals_Events.5
	title = FEE_Mughals_Events.5.T
	desc = FEE_Mughals_Events.5.D
	picture = BIG_BOOK_eventPicture

	fire_only_once = yes

	trigger = {
		tag = AFG
		has_country_flag = fee_babur
		NOT = { has_country_flag = fee_babur_timurid_path }
		NOT = { num_of_cities = 12 }
		is_year = 1520
		NOT = {
			any_owned_province = {
				OR = {
					area = lahore_area
					area = sind_sagar_area
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Mughals_Events.5.OPT1

		custom_tooltip = fee_mug_punjab_claim_tt
		lahore_area = { add_core = ROOT }
		sind_sagar_area = { add_core = ROOT }
		set_country_flag = fee_punjab_claim
	}
}

# Struggle for Punjab
country_event = {
	id = FEE_Mughals_Events.6
	title = FEE_Mughals_Events.6.T
	desc = FEE_Mughals_Events.6.D
	picture = 12_Maratha_Estate_eventPicture

	fire_only_once = yes

	trigger = {
		tag = AFG
		is_free_or_tributary_trigger = yes
		is_at_war = no
		has_country_flag = fee_babur
		has_country_flag = fee_punjab_claim
		lahore_area = {
			type = all
			owned_by = DLH
		}
		sind_sagar_area = {
			type = all
			owned_by = DLH
		}
		any_neighbor_province = { owned_by = DLH }
	}

	immediate = {
		hidden_effect = {
			clr_country_flag = fee_punjab_claim
		}
	}

	mean_time_to_happen = {
		months = 24
	}

	option = {
		name = FEE_Mughals_Events.6.OPT1

		DLH = {
			country_event = {
				id = FEE_Mughals_Events.7
			}
		}
	}
}

# Babur demands Punjab (Delhi)
country_event = {
	id = FEE_Mughals_Events.7
	title = FEE_Mughals_Events.7.T
	desc = FEE_Mughals_Events.7.D
	picture = BAD_WITH_MONARCH_eventPicture

	is_triggered_only = yes

	option = { # Refuse
		name = FEE_Mughals_Events.7.OPT1

		custom_tooltip = fee_mug_delhi_warning_tt
		AFG = {
			country_event = {
				id = FEE_Mughals_Events.8
				days = 60
			}
		}
	}

	option = { # Accept
		name = FEE_Mughals_Events.7.OPT2

		add_prestige = -50
		lahore_area = { cede_province = AFG }
		sind_sagar_area = { cede_province = AFG }
		ai_chance = { factor = 0 }
	}
}

# Delhi refuses our demands
country_event = {
	id = FEE_Mughals_Events.8
	title = FEE_Mughals_Events.8.T
	desc = FEE_Mughals_Events.8.D
	picture = BORDER_TENSION_eventPicture

	is_triggered_only = yes

	option = { # attack
		name = FEE_Mughals_Events.8.OPT1
		declare_war_with_cb = {
			casus_belli = cb_annex
			who = DLH
		}
		add_country_modifier = {
			name = fee_mug_babur_tactics
			duration = -1
			desc = FEE_UNTIL_WARS_ENDS_TT
		}
		hidden_effect = {
			DLH = {
				country_event = {
					id = FEE_Mughals_Events.9
				}
			}
		}
	}

	option = { # back down
		name = FEE_Mughals_Events.8.OPT2

		lahore_area = {
			remove_core = ROOT
			add_permanent_claim = ROOT
		}
		sind_sagar_area = {
			remove_core = ROOT
			add_permanent_claim = ROOT
		}
		ai_chance = { factor = 0 }
	}
}

# Babur's attack (Delhi)
country_event = {
	id = FEE_Mughals_Events.9
	title = FEE_Mughals_Events.9.T
	desc = FEE_Mughals_Events.9.D
	picture = muslim_CIVIL_WAR_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Mughals_Events.9.OPT1

		convert_ruler_to_general = 40
		custom_tooltip = fee_mug_delhi_how_to_win_tt
	}
}

# Dreams of Punjab shattered
country_event = {
	id = FEE_Mughals_Events.10
	title = FEE_Mughals_Events.10.T
	desc = FEE_Mughals_Events.10.D
	picture = COUNTRY_COLLAPSE_eventPicture
	major = yes

	trigger = {
		tag = AFG
		war_with = DLH
		has_country_modifier = fee_mug_babur_tactics
		OR = {
			capital_scope = {
				controller = {
					OR = {
						tag = DLH
						alliance_with = DLH
					}
				}
			}
			NOT = {
				war_score_against = {
					who = DLH
					value = -49
				}
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			remove_country_modifier = fee_mug_babur_tactics
		}
	}

	option = {
		name = FEE_Mughals_Events.10.OPT1

		white_peace = DLH
		add_prestige = -50
		lahore_area = { remove_core = ROOT }
		sind_sagar_area = { remove_core = ROOT }
		DLH = {
			add_prestige_or_monarch_power = { amount = 15 }
			add_legitimacy = 10
			add_treasury = 50
		}
	}
}

# Triumph over Hindustan
country_event = {
	id = FEE_Mughals_Events.11
	title = FEE_Mughals_Events.11.T
	desc = FEE_Mughals_Events.11.D
	picture = CONQUEST_eventPicture
	major = yes

	trigger = {
		tag = AFG
		war_with = DLH
		has_country_modifier = fee_mug_babur_tactics
		OR = {
			has_country_flag = fee_mug_defeated_delhi
			war_score_against = {
				who = DLH
				value = 40
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			clr_country_flag = fee_mug_defeated_delhi
			remove_country_modifier = fee_mug_babur_tactics
		}
	}

	option = {
		name = FEE_Mughals_Events.11.OPT1

		add_prestige_or_monarch_power = { amount = 50 }
		remove_ruler_personality = conqueror_personality
		add_ruler_personality = legendary_conqueror_personality
		custom_tooltip = fee_mug_annex_delhi_tt
		add_ruler_modifier = {
			name = fee_mug_babur_generalship
			duration = -1
		}
		hidden_effect = {
			white_peace = DLH
			DLH = {
				release_all_subjects = yes
				every_core_province = {
					add_core = ROOT
				}
				every_owned_province = {
					cede_province = ROOT
				}
			}
			hindusthan_region = {
				limit = {
					owned_by = ROOT
				}
				add_province_modifier = {
					name = fee_mug_memories_of_timur
					duration = 3650
				}
			}
			if = {
				limit = {
					exists = MER
				}
				MER = {
					country_event = {
						id = FEE_Mughals_Events.12
						days = 1825
					}
				}
			}
			522 = { # copy of form mughals decision from here
				move_capital_effect = yes
			}
			change_tag = MUG
			hindusthan_region = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = MUG
			}
			on_change_tag_effect = yes
			restore_country_name = yes
			swap_non_generic_missions = yes
			remove_non_electors_emperors_from_empire_effect = yes
			change_primary_culture = kanauji
			set_government_rank = 3
			522 = {
			 	add_base_tax = 1
				add_base_production = 1
			 	add_base_manpower = 1
			}
			if = {
				limit = {
					NOT = { technology_group = indian }
				}
				change_technology_group = indian
				change_unit_type = indian
			}
			if = {
				limit = {
					NOT = { government = monarchy }
					is_revolutionary = no
				}
				change_government = monarchy
			}
			if = {
				limit = {
					has_dlc = "Dharma"
					is_revolutionary = no
				}
				add_government_reform = indian_sultanate_reform
			}
			if = {
				limit = {
					OR = {
						has_dlc = "Dharma"
						has_dlc = "King of Kings"
						has_dlc = "Winds of Change"
					}
					is_revolutionary = no
				}
				add_government_reform = mughal_government
			}
			if = {
				limit = {
					OR = {
						has_dlc = "Dharma"
						has_dlc = "Domination"
					}
					reform_level = 3
				}
				add_government_reform = mansabdari_reform
			}
			if = {
				limit = {
					OR = {
						has_dlc = "Dharma"
						has_dlc = "King of Kings"
					}
					reform_level = 4
				}
				add_government_reform = zabt_reform
			}
			if = {
				limit = {
					has_reform = states_general_reform
				}
				remove_government_reform = states_general_reform
			}
			if = {
				limit = { has_custom_ideas = no }
				country_event = { id = ideagroups.1 } #Swap Ideas
			}
			every_province = {
				limit = {
					NOT = { owned_by = MUG }
					OR = {
						region = persia_region
						region = khorasan_region
						region = caucasia_region
						region = central_asia_region
					}
					is_permanent_claim = MUG
				}
				remove_claim = MUG
			}
			every_province = {
				limit = {
					NOT = { owned_by = MUG }
					OR = {
						region = persia_region
						region = khorasan_region
						region = caucasia_region
						region = central_asia_region
					}
					is_core = MUG
				}
				remove_core = MUG
			}
			set_country_flag = formed_mughal_empire_flag
		}
	}
}

# Timurid incursion in India (Mewar)
country_event = {
	id = FEE_Mughals_Events.12
	title = FEE_Mughals_Events.12.T
	desc = FEE_Mughals_Events.12.D
	picture = SPY_eventPicture

	is_triggered_only = yes

	option = { #attack
		name = FEE_Mughals_Events.12.OPT1
		ai_chance = { factor = 100 }

		custom_tooltip = fee_mug_mewar_coalition_tt
		declare_war_with_cb = {
			casus_belli = cb_humiliate
			who = MUG
		}
		add_years_of_income = 2
		add_yearly_manpower = 2
		add_country_modifier = {
			name = fee_mug_rajput_coalition
			duration = -1
			desc = FEE_UNTIL_WARS_ENDS_TT
		}
		hidden_effect = {
			MUG = {
				country_event = {
					id = FEE_Mughals_Events.13
				}
			}
		}
	}

	option = { #back down
		name = FEE_Mughals_Events.12.OPT2
		ai_chance = { factor = 0 }

		custom_tooltip = fee_mug_mewar_back_down_tt
		add_prestige = -5
	}

	after = {
		if = {
			limit = { has_country_modifier = fee_mug_rajput_coalition }
			capital_scope = {
				build_to_forcelimit = {
					infantry = 0.7
					cavalry = 0.3
				}
			}
		}
	}
}

# Rajput Attack
country_event = {
	id = FEE_Mughals_Events.13
	title = FEE_Mughals_Events.13.T
	desc = FEE_Mughals_Events.13.D
	picture = 3_Rajput_Estate__eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Mughals_Events.13.OPT1

		add_country_modifier = {
			name = fee_mug_rajput_fear
			duration = -1
			desc = FEE_UNTIL_WARS_ENDS_TT
		}
	}
}

# Rajput victory
country_event = {
	id = FEE_Mughals_Events.14
	title = FEE_Mughals_Events.14.T
	desc = FEE_Mughals_Events.14.D
	picture = COUNTRY_COLLAPSE_eventPicture
	major = yes

	trigger = {
		tag = MUG
		has_country_flag = fee_mug_fighting_rajput_coalition
		NOT = {
			war_score_against = {
				who = MER
				value = -49
			}
		}
	}

	immediate = {
		hidden_effect = {
			clr_country_flag = fee_mug_fighting_rajput_coalition
			white_peace = MER
			remove_country_modifier = fee_mug_rajput_fear
			MER = { remove_country_modifier = fee_mug_rajput_coalition }
		}
	}

	option = {
		name = FEE_Mughals_Events.14.OPT1

		tooltip = { white_peace = MER }
		release = DLH
		remove_country_modifier = fee_mug_babur_generalship
		india_superregion = {
			limit = {
				NOT = { owned_by = ROOT }
			}
			remove_core = ROOT
		}
		hidden_effect = {
			MER = {
				country_event = {
					id = FEE_Mughals_Events.15
				}
			}
		}
	}
}

# Timurid incursion expelled (Mewar)
country_event = {
	id = FEE_Mughals_Events.15
	title = FEE_Mughals_Events.15.T
	desc = FEE_Mughals_Events.15.D
	picture = 12_Maratha_Estate_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Mughals_Events.15.OPT1

		if = {
			limit = {
				NOT = { adm = 6 }
			}
			change_adm = 1
		}
		else = {
			add_adm_power = 100
		}
		if = {
			limit = {
				NOT = { dip = 6 }
			}
			change_dip = 1
		}
		else = {
			add_dip_power = 100
		}
		if = {
			limit = {
				NOT = { mil = 6 }
			}
			change_mil = 1
		}
		else = {
			add_mil_power = 100
		}
		add_country_modifier = {
			name = fee_mug_rajput_triumph
			duration = 18250
		}
		DLH = {
			country_event = {
				id = FEE_Mughals_Events.16
			}
		}
	}
}

# Rajput Demands
country_event = {
	id = FEE_Mughals_Events.16
	title = FEE_Mughals_Events.16.T
	desc = FEE_Mughals_Events.16.D
	picture = CONQUEST_eventPicture
	major = yes

	is_triggered_only = yes

	option = { # refuse
		name = FEE_Mughals_Events.16.OPT1

		MER = {
			add_casus_belli = {
				type = cb_vassalize_mission
				target = DLH
				months = 240
			}
		}
	}

	option = { # accept
		name = FEE_Mughals_Events.16.OPT2

		MER = {
			vassalize = DLH
			add_historical_friend = DLH
		}
		add_historical_friend = MER
	}
}

# Rajputs have been defeated
country_event = {
	id = FEE_Mughals_Events.17
	title = FEE_Mughals_Events.17.T
	desc = FEE_Mughals_Events.17.D
	picture = 3_Rajput_Estate__eventPicture
	major = yes

	trigger = {
		tag = MUG
		has_country_flag = fee_mug_fighting_rajput_coalition
		war_score_against = {
			who = MER
			value = 25
		}
	}

	immediate = {
		hidden_effect = {
			clr_country_flag = fee_mug_fighting_rajput_coalition
			white_peace = MER
			remove_country_modifier = fee_mug_rajput_fear
			MER = { remove_country_modifier = fee_mug_rajput_coalition }
		}
	}

	option = {
		name = FEE_Mughals_Events.17.OPT1

		tooltip = { white_peace = MER }
		add_prestige_or_monarch_power = { amount = 50 }
		add_adm_power = 100
		add_dip_power = 100
		add_mil_power = 100
	}
}

# Summer Capital
country_event = {
	id = FEE_Mughals_Events.18
	title = FEE_Mughals_Events.18.T
	desc = FEE_Mughals_Events.18.D
	picture = CITY_VIEW_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		owns_core_province = 451
		OR = {
			has_country_flag = fee_babur
			NOT = { current_age = age_of_discovery }
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Mughals_Events.18.OPT1

		451 = {
			add_base_tax = 1
			add_base_production = 1
			add_base_manpower = 1
			add_province_modifier = {
				name = fee_mug_summer_capital
				duration = -1
			}
		}
	}
}

# Death of Babur
country_event = {
	id = FEE_Mughals_Events.19
	title = FEE_Mughals_Events.19.T
	desc = FEE_Mughals_Events.19.D
	picture = KING_SICK_IN_BED_eventPicture

	fire_only_once = yes
	is_triggered_only = yes

	trigger = {
		tag = MUG
		has_country_flag = fee_babur
	}

	immediate = {
		hidden_effect = {
			clr_country_flag = fee_babur
		}
	}

	option = { # bury in capital
		name = FEE_Mughals_Events.19.OPT1

		add_country_modifier = {
			name = fee_mug_baburs_legacy
			duration = 18250
		}
	}

	option = { # bury in kabul
		name = FEE_Mughals_Events.19.OPT2

		highlight = yes
		trigger = {
			owns = 451
		}
		add_country_modifier = {
			name = fee_mug_baburs_legacy
			duration = 18250
		}
		451 = {
			add_base_production = 2
			if = {
				limit = {
					has_dlc = "Leviathan"
					is_expanded_mod_active = { mod = great_monuments }
					NOT = {
						has_great_project = {
							type = gme_gardens_babur
							tier = 3
						}
					}
				}
				if = {
					limit = {
						has_great_project = {
							type = gme_gardens_babur
							tier = 2
						}
					}
					add_great_project_tier = {
						type = gme_gardens_babur
						tier = 1
					}
				}
				else_if = {
					limit = {
						has_great_project = {
							type = gme_gardens_babur
							tier = 1
						}
					}
					add_great_project_tier = {
						type = gme_gardens_babur
						tier = 2
					}
				}
				else = {
					add_great_project_tier = {
						type = gme_gardens_babur
						tier = 3
					}
				}
			}
			else_if = {
				limit = {
					has_dlc = "Leviathan"
					is_expanded_mod_active = { mod = great_monuments }
					has_great_project = {
						type = gme_gardens_babur
						tier = 3
					}
				}
				add_base_tax = 1
				add_base_production = 1
				add_base_manpower = 1
			}
			else_if = {
				limit = {
					NOT = { has_province_modifier = fee_mug_bagh_babur }

				}
				add_permanent_province_modifier = {
					name = fee_mug_bagh_babur
					duration = -1
				}
			}
			else = {
				add_base_tax = 1
				add_base_production = 1
				add_base_manpower = 1
			}
		}
	}
}

###########################
### End of Babur Events ###
###########################

###########################
####### Misc Events #######
###########################

# Timurid partition
country_event = {
	id = FEE_Mughals_Events.20
	title = FEE_Mughals_Events.20.T
	desc = FEE_Mughals_Events.20.D
	picture = KING_SICK_IN_BED_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		religion_group = muslim
		dynasty = "Timurid"
		current_age = age_of_reformation
		OR = {
			NOT = { has_country_flag = fee_babur }
			NOT = { has_country_flag = fee_mug_akbar_the_great }
		}
		custom_trigger_tooltip = {
			tooltip = FEE_RULER_STATS_UNDER_12_TT
			variable_arithmetic_trigger = {
				custom_tooltip = FEE_CRISIS_OF_THE_MUGHAL_EMPIRE_RULER_STATS_LESS_THAN_6_TOTAL_TT
				export_to_variable = {
					which = ruler_adm_stats
					value = ADM
				}
				export_to_variable = {
					which = ruler_dip_stats
					value = DIP
				}
				export_to_variable = {
					which = ruler_mil_stats
					value = MIL
				}
				change_variable = { which = ruler_adm_stats which = ruler_dip_stats }
				change_variable = { which = ruler_adm_stats which = ruler_mil_stats }
				NOT = { check_variable = { which = ruler_adm_stats value = 12 } }
			}
		}
		any_owned_province = {
			OR = {
				area = multan_area
				region = khorasan_region
				region = west_india_region
			}
		}
	}

	mean_time_to_happen = {
		months = 6
	}

	option = {
		name = FEE_Mughals_Events.20.OPT1

		khorasan_region = {
			limit = { owned_by = ROOT }
			add_province_modifier = {
				name = fee_mug_timurid_partition
				duration = -1
				desc = FEE_UNTIL_DEATH_OF_RULER_TT
			}
		}
		west_india_region = {
			limit = { owned_by = ROOT }
			add_province_modifier = {
				name = fee_mug_timurid_partition
				duration = -1
				desc = FEE_UNTIL_DEATH_OF_RULER_TT
			}
		}
		multan_area = {
			limit = { owned_by = ROOT }
			add_province_modifier = {
				name = fee_mug_timurid_partition
				duration = -1
				desc = FEE_UNTIL_DEATH_OF_RULER_TT
			}
		}
	}
}

# Bengal proto industrialization
country_event = {
	id = FEE_Mughals_Events.21
	title = FEE_Mughals_Events.21.T
	desc = FEE_Mughals_Events.21.D
	picture = INDUSTRIALIZATION_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		has_institution = manufactories
		east_bengal_area = {
			type = all
			owned_by = ROOT
		}
		gaur_area = {
			type = all
			owned_by = ROOT
		}
		north_bengal_area = {
			type = all
			owned_by = ROOT
		}
		west_bengal_area = {
			type = all
			owned_by = ROOT
		}
	}

	mean_time_to_happen = {
		months = 60
	}

	option = {
		name = FEE_Mughals_Events.21.OPT1

		east_bengal_area = {
			add_province_modifier = {
				name = fee_mug_bengali_expansion
				duration = 21900
				desc = "until the province reaches 55 development"
			}
		}
		gaur_area = {
			add_province_modifier = {
				name = fee_mug_bengali_expansion
				duration = 21900
				desc = "until the province reaches 55 development"
			}
		}
		north_bengal_area = {
			add_province_modifier = {
				name = fee_mug_bengali_expansion
				duration = 21900
				desc = "until the province reaches 55 development"
			}
		}
		west_bengal_area = {
			add_province_modifier = {
				name = fee_mug_bengali_expansion
				duration = 21900
				desc = "until the province reaches 55 development"
			}
		}
	}
}

# Bengali province has industrialised
country_event = {
	id = FEE_Mughals_Events.22
	title = FEE_Mughals_Events.22.T
	desc = FEE_Mughals_Events.22.D
	picture = INDUSTRIALIZATION_eventPicture

	trigger = {
		tag = MUG
		any_owned_province = {
			has_province_modifier = fee_mug_bengali_expansion
			base_production = 25
			NOT = { devastation = 1 }
		}
	}

	immediate = {
		random_owned_province = {
			limit = {
				has_province_modifier = fee_mug_bengali_expansion
				base_production = 25
				NOT = { devastation = 1 }
			}
			save_event_target_as = bengali_province_industrialised
			remove_province_modifier = fee_mug_bengali_expansion
		}
	}

	goto = bengali_province_industrialised

	mean_time_to_happen = {
		months = 6
	}

	option = {
		name = FEE_Mughals_Events.22.OPT1

		event_target:bengali_province_industrialised = {
			add_institution_embracement = {
				which = industrialization
				value = 50
			}
			add_permanent_province_modifier = {
				name = fee_mug_bengali_industrialisation
				duration = -1
			}
			if = {
				limit = { has_port = yes }
				add_permanent_province_modifier = {
					name = fee_mug_bengali_shipyard
					duration = -1
				}
			}
		}
	}
}

###########################
##### Akbar The Great #####
###########################

# Akbar the Great
country_event = {
	id = FEE_Mughals_Events.23
	title = FEE_Mughals_Events.23.T
	desc = FEE_Mughals_Events.23.D
	picture = KING_SICK_IN_BED_eventPicture

	trigger = {
		tag = MUG
		religion_group = muslim
		dynasty = "Timurid"
		NOT = { has_country_flag = fee_babur }
		is_year = 1540
		NOT = { is_year = 1605 }
	}

	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = FEE_Mughals_Events.23.OPT1

		if = {
			limit = { has_heir = yes }
			kill_heir = { allow_new_heir = no }
		}
		define_ruler = {
			name = "Akbar"
			dynasty = "Timurid"
			culture = uzbehk
			religion = sunni
			age = 15
			adm = 6
			dip = 6
			mil = 6
		}
		add_ruler_personality = free_thinker_personality
		add_ruler_personality = tolerant_personality
		hidden_effect = {
			set_country_flag = fee_mug_akbar_the_great
		}
	}
}

# Jharoka Darshana
country_event = {
	id = FEE_Mughals_Events.24
	title = FEE_Mughals_Events.24.T
	desc = FEE_Mughals_Events.24.D
	picture = GOOD_WITH_MONARCH_eventPicture

	trigger = {
		tag = MUG
		OR = {
			has_country_flag = fee_mug_akbar_the_great
			AND = {
				NOT = { dynasty = "Timurid" }
				custom_trigger_tooltip = {
					tooltip = FEE_RULER_STATS_OVER_15_TT
					variable_arithmetic_trigger = {
						custom_tooltip = FEE_CRISIS_OF_THE_MUGHAL_EMPIRE_RULER_STATS_LESS_THAN_6_TOTAL_TT
						export_to_variable = {
							which = ruler_adm_stats
							value = ADM
						}
						export_to_variable = {
							which = ruler_dip_stats
							value = DIP
						}
						export_to_variable = {
							which = ruler_mil_stats
							value = MIL
						}
						change_variable = { which = ruler_adm_stats which = ruler_dip_stats }
						change_variable = { which = ruler_adm_stats which = ruler_mil_stats }
						check_variable = { which = ruler_adm_stats value = 15 }
					}
				}
			}
		}
	}

	fire_only_once = yes

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Mughals_Events.24.OPT1

		add_prestige_or_monarch_power = { amount = 10 }
		add_splendor = 50

		add_country_modifier = {
			name = fee_mug_jharoka_darshana
			duration = -1
		}
	}
}

# Abolition of Jizya
country_event = {
	id = FEE_Mughals_Events.25
	title = FEE_Mughals_Events.25.T
	desc = FEE_Mughals_Events.25.D
	picture = GOOD_WITH_MONARCH_eventPicture

	trigger = {
		tag = MUG
		religion_group = muslim
		has_estate = estate_church
		OR = {
			has_country_flag = fee_mug_akbar_the_great
			AND = {
				current_age = age_of_reformation
				has_global_modifier_value = {
					which = tolerance_heretic
					value = 2
				}
				NOT = { ruler_has_personality = cruel_personality }
				NOT = { ruler_has_personality = zealot_personality }
				NOT = { ruler_has_personality = pious_personality }
				custom_trigger_tooltip = {
					tooltip = FEE_RULER_STATS_OVER_15_TT
					variable_arithmetic_trigger = {
						custom_tooltip = FEE_CRISIS_OF_THE_MUGHAL_EMPIRE_RULER_STATS_LESS_THAN_6_TOTAL_TT
						export_to_variable = {
							which = ruler_adm_stats
							value = ADM
						}
						export_to_variable = {
							which = ruler_dip_stats
							value = DIP
						}
						export_to_variable = {
							which = ruler_mil_stats
							value = MIL
						}
						change_variable = { which = ruler_adm_stats which = ruler_dip_stats }
						change_variable = { which = ruler_adm_stats which = ruler_mil_stats }
						check_variable = { which = ruler_adm_stats value = 15 }
					}
				}
			}
		}
	}

	fire_only_once = yes

	mean_time_to_happen = {
		months = 60
	}

	option = {
		name = FEE_Mughals_Events.25.OPT1

		add_adm_power = -100
		set_estate_privilege = estate_church_fee_abolished_jizya
	}
}

# House of Worship
country_event = {
	id = FEE_Mughals_Events.26
	title = FEE_Mughals_Events.26.T
	desc = FEE_Mughals_Events.26.D
	picture = GOOD_WITH_MONARCH_eventPicture

	trigger = {
		tag = MUG
		religion_group = muslim
		OR = {
			has_country_flag = fee_mug_akbar_the_great
			AND = {
				current_age = age_of_reformation
				has_global_modifier_value = {
					which = tolerance_heretic
					value = 2
				}
				NOT = { ruler_has_personality = cruel_personality }
				NOT = { ruler_has_personality = zealot_personality }
				NOT = { ruler_has_personality = pious_personality }
				custom_trigger_tooltip = {
					tooltip = FEE_RULER_STATS_OVER_15_TT
					variable_arithmetic_trigger = {
						custom_tooltip = FEE_CRISIS_OF_THE_MUGHAL_EMPIRE_RULER_STATS_LESS_THAN_6_TOTAL_TT
						export_to_variable = {
							which = ruler_adm_stats
							value = ADM
						}
						export_to_variable = {
							which = ruler_dip_stats
							value = DIP
						}
						export_to_variable = {
							which = ruler_mil_stats
							value = MIL
						}
						change_variable = { which = ruler_adm_stats which = ruler_dip_stats }
						change_variable = { which = ruler_adm_stats which = ruler_mil_stats }
						check_variable = { which = ruler_adm_stats value = 15 }
					}
				}
			}
		}
	}

	fire_only_once = yes

	mean_time_to_happen = {
		months = 60
	}

	option = {
		name = FEE_Mughals_Events.26.OPT1

		add_ruler_modifier = {
			name = fee_mug_ibadat_khana
			duration = -1
		}
	}
}

#################
### Aurangzeb ###
#################

# A brave young prince faces off an elephant
country_event = {
	id = FEE_Mughals_Events.27
	title = FEE_Mughals_Events.27.T
	desc = FEE_Mughals_Events.27.D
	picture = FEE_BATTLE_WITH_ELEPHANT_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		religion_group = muslim
		dynasty = "Timurid"
		is_year = 1630
		num_of_owned_provinces_with = {
			value = 40
			region = west_india_region
		}
		num_of_owned_provinces_with = {
			value = 60
			region = hindusthan_region
		}
		num_of_owned_provinces_with = {
			value = 36
			region = bengal_region
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Mughals_Events.27.OPT1

		ai_chance = { factor = 0.9 }

		custom_tooltip = FEE_Mughals_Events.27.TT.1
		set_country_flag = fee_mug_prince_aurangzeb
	}

	option = {
		name = FEE_Mughals_Events.27.OPT2

		ai_chance = { factor = 0.1 }

		custom_tooltip = FEE_Mughals_Events.27.TT.2
		set_country_flag = fee_mug_declined_aurangzeb
	}
}

# Emperor at Death's doorstep
country_event = {
	id = FEE_Mughals_Events.28
	title = FEE_Mughals_Events.28.T
	desc = FEE_Mughals_Events.28.D
	picture = KING_SICK_IN_BED_eventPicture

	fire_only_once = yes
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			set_country_flag = fee_mug_emperor_at_deaths_doorstep
		}
	}

	option = {
		name = FEE_Mughals_Events.28.OPT1

		goto = 524

		trigger = {
			has_country_flag = fee_mug_prince_aurangzeb
		}

		add_stability = -1
		tooltip = {
			kill_ruler = yes
		}
		if = {
			limit = {
				has_heir = yes
			}
			hidden_effect = {
				clear_heir_education_flags = yes
				clear_heir_success_flag = yes
				clear_country_education_quality_flags = yes
			}
			kill_heir = { allow_new_heir = no }
		}
		define_ruler = {
			name = "Aurangzeb"
			dynasty = "Timurid"
			culture = uzbehk
			religion = sunni
			ADM = 4
			DIP = 5
			MIL = 6
			age = 30
		}
		if = {
			limit = {
				has_dlc = "Rights of Man"
			}
			add_ruler_personality = conqueror_personality
			add_ruler_personality = zealot_personality
		}
		set_ruler_flag = heir_finished_education
		set_ruler_flag = assigned_education
		add_best_modern_army_education = yes

		custom_tooltip = FEE_Mughals_Events.28.TT.1
		west_india_region = {
			limit = {
				owned_by = ROOT
			}
			add_province_modifier = {
				name = fee_mug_timurid_partition
				duration = -1
				desc = FEE_UNTIL_DEATH_OF_RULER_TT
			}
		}
		bengal_region = {
			limit = {
				owned_by = ROOT
			}
			add_province_modifier = {
				name = fee_mug_timurid_partition
				duration = -1
				desc = FEE_UNTIL_DEATH_OF_RULER_TT
			}
		}
		524 = {
			if = {
				limit = {
					owned_by = ROOT
				}
				spawn_rebels = {
					type = pretender_rebels
					size = 3
					leader = "Dara Shikoh"
					leader_dynasty = "Timurid"
				}
			}
		}

		clr_country_flag = fee_mug_prince_aurangzeb
		set_country_flag = fee_mug_aurangzeb_sucession_war
	}

	option = {
		name = FEE_Mughals_Events.28.OPT2

		trigger = {
			has_country_flag = fee_mug_prince_aurangzeb
			num_of_owned_provinces_with = {
				value = 30
				region = deccan_region
			}
		}

		add_stability = -1
		tooltip = {
			kill_ruler = yes
		}
		if = {
			limit = {
				has_heir = yes
			}
			hidden_effect = {
				clear_heir_education_flags = yes
				clear_heir_success_flag = yes
				clear_country_education_quality_flags = yes
			}
			kill_heir = { allow_new_heir = no }
		}
		define_ruler = {
			name = "Dara Shikoh"
			dynasty = "Timurid"
			culture = uzbehk
			religion = sunni
			ADM = 2
			DIP = 1
			MIL = 2
			age = 33
		}
		if = {
			limit = {
				has_dlc = "Rights of Man"
			}
			add_ruler_personality = tolerant_personality
			add_ruler_personality = patron_of_arts_personality
		}
		country_event = { id = FEE_Mughals_Events.29 days = 180 tooltip = FEE_Mughals_Events.28.TT.2 }

		clr_country_flag = fee_mug_prince_aurangzeb
	}

	option = {
		name = FEE_Mughals_Events.28.OPT3

		trigger = {
			has_country_flag = fee_mug_declined_aurangzeb
		}

		if = {
			limit = {
				has_heir = yes
			}
			hidden_effect = {
				clear_heir_education_flags = yes
				clear_heir_success_flag = yes
				clear_country_education_quality_flags = yes
			}
			kill_heir = { allow_new_heir = no }
		}
		define_ruler = {
			name = "Dara Shikoh"
			dynasty = "Timurid"
			culture = uzbehk
			religion = sunni
			ADM = 2
			DIP = 1
			MIL = 2
			age = 33
		}
		if = {
			limit = {
				has_dlc = "Rights of Man"
			}
			add_ruler_personality = tolerant_personality
			add_ruler_personality = patron_of_arts_personality
		}

		custom_tooltip = FEE_Mughals_Events.28.TT.1
		west_india_region = {
			limit = {
				owned_by = ROOT
			}
			add_province_modifier = {
				name = fee_mug_timurid_partition
				duration = -1
				desc = FEE_UNTIL_DEATH_OF_RULER_TT
			}
		}
		bengal_region = {
			limit = {
				owned_by = ROOT
			}
			add_province_modifier = {
				name = fee_mug_timurid_partition
				duration = -1
				desc = FEE_UNTIL_DEATH_OF_RULER_TT
			}
		}

		clr_country_flag = fee_mug_declined_aurangzeb
		set_country_flag = fee_mug_dara_shikoh
	}
}

# Aurangzeb seizes Deccan
country_event = {
	id = FEE_Mughals_Events.29
	title = FEE_Mughals_Events.29.T
	desc = FEE_Mughals_Events.29.D
	picture = CIVIL_WAR_eventPicture

	is_triggered_only = yes

	trigger = {
		NOT = { exists = DEC }
	}

	option = {
		name = FEE_Mughals_Events.29.OPT1

		custom_tooltip = FEE_Mughals_Events.28.TT.1
		west_india_region = {
			limit = {
				owned_by = ROOT
			}
			add_province_modifier = {
				name = fee_mug_timurid_partition
				duration = -1
				desc = FEE_UNTIL_DEATH_OF_RULER_TT
			}
		}
		bengal_region = {
			limit = {
				owned_by = ROOT
			}
			add_province_modifier = {
				name = fee_mug_timurid_partition
				duration = -1
				desc = FEE_UNTIL_DEATH_OF_RULER_TT
			}
		}
		hidden_effect = {
			deccan_region = {
				limit = {
					owned_by = ROOT
				}
				add_core = DEC
			}
		}
		release = DEC
		declare_war = DEC
		add_country_modifier = {
			name = fee_mug_deserted_army
			duration = -1
			desc = FEE_UNTIL_WARS_ENDS_TT
		}
		hidden_effect = {
			DEC = {
				change_government = monarchy
				adopt_reform_progress = ROOT
				embrace_institutions_of = ROOT
				add_treasury = 10000
				add_manpower = 300
				define_ruler = {
					name = "Aurangzeb"
					dynasty = "Timurid"
					culture = uzbehk
					religion = sunni
					ADM = 4
					DIP = 5
					MIL = 6
					age = 30
				}
				if = {
					limit = {
						has_dlc = "Rights of Man"
					}
					add_ruler_personality = conqueror_personality
					add_ruler_personality = zealot_personality
				}
				set_ruler_flag = heir_finished_education
				set_ruler_flag = assigned_education
				add_best_modern_army_education = yes
				add_country_modifier = {
					name = fee_mug_aurangzeb_leadership
					duration = -1
					desc = FEE_UNTIL_WARS_ENDS_TT
				}
				capital_scope = {
					build_to_forcelimit = {
						infantry = 0.5
						cavalry = 0.25
						artillery = 0.25
					}
				}
			}
		}
	}
}

# Dara's Victory
country_event = {
	id = FEE_Mughals_Events.30
	title = FEE_Mughals_Events.30.T
	desc = FEE_Mughals_Events.30.D
	picture = GOOD_WITH_MONARCH_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		has_country_modifier = fee_mug_deserted_army
		war_with = DEC
		war_score_against = {
			who = DEC
			value = 50
		}
	}

	mean_time_to_happen = {
		months = 1
	}

	option = {
		name = FEE_Mughals_Events.30.OPT1

		white_peace = DEC
		custom_tooltip = FEE_MUG_ANNEX_DEC_TT
		hidden_effect = {
			DEC = {
				every_owned_province = {
					cede_province = ROOT
				}
			}
		}
	}
}

# Aurangzeb's Victory
country_event = {
	id = FEE_Mughals_Events.31
	title = FEE_Mughals_Events.31.T
	desc = FEE_Mughals_Events.31.D
	picture = BAD_WITH_MONARCH_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		has_country_modifier = fee_mug_deserted_army
		war_with = DEC
		DEC = {
			war_score_against = {
				who = ROOT
				value = 50
			}
		}
	}

	mean_time_to_happen = {
		months = 1
	}

	option = {
		name = FEE_Mughals_Events.31.OPT1

		white_peace = DEC
		custom_tooltip = FEE_MUG_ANNEX_DEC_TT
		hidden_effect = {
			DEC = {
				every_owned_province = {
					cede_province = ROOT
				}
			}
		}

		add_stability = -1
		tooltip = {
			kill_ruler = yes
		}
		if = {
			limit = {
				has_heir = yes
			}
			hidden_effect = {
				clear_heir_education_flags = yes
				clear_heir_success_flag = yes
				clear_country_education_quality_flags = yes
			}
			kill_heir = { allow_new_heir = no }
		}
		define_ruler = {
			name = "Aurangzeb"
			dynasty = "Timurid"
			culture = uzbehk
			religion = sunni
			ADM = 4
			DIP = 5
			MIL = 6
			age = 30
		}
		if = {
			limit = {
				has_dlc = "Rights of Man"
			}
			add_ruler_personality = conqueror_personality
			add_ruler_personality = zealot_personality
		}
		set_ruler_flag = heir_finished_education
		set_ruler_flag = assigned_education
		add_best_modern_army_education = yes

		set_country_flag = fee_mug_aurangzeb_sucession_war
	}
}

# Father's Wish
country_event = {
	id = FEE_Mughals_Events.32
	title = FEE_Mughals_Events.32.T
	desc = FEE_Mughals_Events.32.D
	picture = COURT_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		has_country_flag = fee_mug_dara_shikoh
		OR = {
			AND = {
				NOT = { exists = BNG }
				bengal_region = {
					owned_by = ROOT
				}
			}
			bengal_region = {
				owned_by = ROOT
				any_core_country = { exists = no }
			}
		}
		OR = {
			AND = {
				NOT = { exists = DEC }
				deccan_region = {
					owned_by = ROOT
				}
			}
			deccan_region = {
				owned_by = ROOT
				any_core_country = { exists = no }
			}
		}
		OR = {
			AND = {
				NOT = { exists = GUJ }
				west_india_region = {
					owned_by = ROOT
				}
			}
			west_india_region = {
				owned_by = ROOT
				any_core_country = { exists = no }
			}
		}
	}

	mean_time_to_happen = {
		months = 3
	}

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					NOT = { exists = BNG }
				}
				BNG = { save_event_target_as = new_bengal_owner }
			}
			else = {
				random_owned_province = {
					limit = {
						region = bengal_region
						any_core_country = { exists = no }
					}
					random_core_country = {
						limit = {
							exists = no
						}
						save_event_target_as = new_bengal_owner
					}
				}
			}
			if = {
				limit = {
					NOT = { exists = DEC }
				}
				DEC = { save_event_target_as = new_deccan_owner }
			}
			else = {
				random_owned_province = {
					limit = {
						region = deccan_region
						any_core_country = { exists = no }
					}
					random_core_country = {
						limit = {
							exists = no
						}
						save_event_target_as = new_deccan_owner
					}
				}
			}
			if = {
				limit = {
					NOT = { exists = GUJ }
				}
				GUJ = { save_event_target_as = new_west_india_owner }
			}
			else = {
				random_owned_province = {
					limit = {
						region = west_india_region
						any_core_country = { exists = no }
					}
					random_core_country = {
						limit = {
							exists = no
						}
						save_event_target_as = new_west_india_owner
					}
				}
			}
		}
	}

	option = {
		name = FEE_Mughals_Events.32.OPT1

		hidden_effect = {
			bengal_region = {
				limit = {
					owned_by = ROOT
				}
				add_core = event_target:new_bengal_owner
			}
			deccan_region = {
				limit = {
					owned_by = ROOT
				}
				add_core = event_target:new_deccan_owner
			}
			west_india_region = {
				limit = {
					owned_by = ROOT
				}
				add_core = event_target:new_west_india_owner
			}
		}
		release = event_target:new_bengal_owner
		release = event_target:new_deccan_owner
		release = event_target:new_west_india_owner
		custom_tooltip = FEE_Mughals_Events.32.TT.1
		hidden_effect = {
			every_core_province = {
				add_core = event_target:new_bengal_owner
				add_core = event_target:new_deccan_owner
				add_core = event_target:new_west_india_owner
			}
			event_target:new_bengal_owner = {
				change_government = monarchy
				adopt_reform_progress = ROOT
				embrace_institutions_of = ROOT
				change_religion = ROOT
				define_ruler = {
					dynasty = "Timurid"
					culture = uzbehk
					religion = sunni
				}
			}
			event_target:new_deccan_owner = {
				change_government = monarchy
				adopt_reform_progress = ROOT
				embrace_institutions_of = ROOT
				change_religion = ROOT
				define_ruler = {
					dynasty = "Timurid"
					culture = uzbehk
					religion = sunni
				}
			}
			event_target:new_west_india_owner = {
				change_government = monarchy
				adopt_reform_progress = ROOT
				embrace_institutions_of = ROOT
				change_religion = ROOT
				define_ruler = {
					dynasty = "Timurid"
					culture = uzbehk
					religion = sunni
				}
			}
		}
	}

	option = {
		name = FEE_Mughals_Events.32.OPT2

		add_stability = -2
		add_ruler_modifier = {
			name = fee_mug_overthrown_the_emperor
			duration = -1
		}
		custom_tooltip = FEE_Mughals_Events.32.TT.2
		hidden_effect = {
			every_owned_province = {
				limit = {
					has_province_modifier = fee_mug_timurid_partition
				}
				remove_province_modifier = fee_mug_timurid_partition
			}
		}
	}
}

# Aurangzeb, Seizer of the World
country_event = {
	id = FEE_Mughals_Events.33
	title = FEE_Mughals_Events.33.T
	desc = FEE_Mughals_Events.33.D
	picture = ASSASSINATION_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		has_country_flag = fee_mug_aurangzeb_sucession_war
		NOT = { num_of_rebel_armies = 1 }
		NOT = { num_of_rebel_controlled_provinces = 1 }
	}

	mean_time_to_happen = {
		months = 1
	}

	option = {
		name = FEE_Mughals_Events.33.OPT1

		custom_tooltip = FEE_Mughals_Events.33.TT.1
		add_stability = -1
		add_ruler_modifier = {
			name = fee_mug_overthrown_the_emperor
			duration = -1
		}
		custom_tooltip = FEE_Mughals_Events.32.TT.2
		hidden_effect = {
			every_owned_province = {
				limit = {
					has_province_modifier = fee_mug_timurid_partition
				}
				remove_province_modifier = fee_mug_timurid_partition
			}
		}
		clr_country_flag = fee_mug_aurangzeb_sucession_war
		set_country_flag = fee_mug_aurangzeb_alamgir
	}
}

# Pashtun Uprising
country_event = {
	id = FEE_Mughals_Events.34
	title = FEE_Mughals_Events.34.T
	desc = FEE_Mughals_Events.34.D
	picture = ANGRY_MOB_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		num_of_owned_provinces_with = {
			value = 5
			culture = afghani
		}
		OR = {
			has_country_flag = fee_mug_aurangzeb_alamgir
			is_year = 1670
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Mughals_Events.34.OPT1

		custom_tooltip = FEE_Mughals_Events.34.TT.1
		tooltip = {
			add_province_modifier = {
				name = fee_mug_closed_trade_route
				duration = 3650
			}
		}
		hidden_effect = {
			kabulistan_area = {
				limit = {
					owned_by = ROOT
				}
				add_province_modifier = {
					name = fee_mug_closed_trade_route
					duration = 3650
				}
			}
			sind_sagar_area = {
				limit = {
					owned_by = ROOT
				}
				add_province_modifier = {
					name = fee_mug_closed_trade_route
					duration = 3650
				}
			}
			multan_area = {
				limit = {
					owned_by = ROOT
				}
				add_province_modifier = {
					name = fee_mug_closed_trade_route
					duration = 3650
				}
			}
		}
		custom_tooltip = FEE_Mughals_Events.34.TT.2
		tooltip = {
			add_province_modifier = {
				name = fee_mug_pashtun_revolt
				duration = 10950
			}
		}
		hidden_effect = {
			every_owned_province = {
				limit = {
					culture = afghani
				}
				particularist_rebels = 3
				add_province_modifier = {
					name = fee_mug_pashtun_revolt
					duration = 10950
				}
			}
		}

		set_country_flag = fee_mug_pashtun_uprising
	}
}

# Deal with the Pashtuns personally
country_event = {
	id = FEE_Mughals_Events.35
	title = FEE_Mughals_Events.35.T
	desc = FEE_Mughals_Events.35.D
	picture = CONQUEST_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		has_country_flag = fee_mug_pashtun_uprising
	}

	mean_time_to_happen = {
		months = 24
	}

	option = {
		name = FEE_Mughals_Events.35.OPT1

		add_years_of_income = -0.5
		custom_tooltip = FEE_Mughals_Events.35.TT
		hidden_effect = {
			every_owned_province = {
				limit = {
					culture = afghani
				}
				add_devastation = 25
				random = {
					chance = 50
					add_base_tax = -1
					add_base_production = -1
					add_base_manpower = -1
				}
			}
			every_owned_province = {
				remove_province_modifier = fee_mug_closed_trade_route
				remove_province_modifier = fee_mug_pashtun_revolt
			}
		}
		clr_country_flag = fee_mug_pashtun_uprising
	}
}

# Crisis of the Rathore Tribe
country_event = {
	id = FEE_Mughals_Events.36
	title = FEE_Mughals_Events.36.T
	desc = FEE_Mughals_Events.36.D
	picture = NEW_HEIR_eventPicture

	fire_only_once = yes

	goto = 514

	trigger = {
		tag = MUG
		is_year = 1675
		NOT = { is_year = 1700 }
		mewar_area = {
			type = all
			owned_by = ROOT
		}
		marwar_area = {
			type = all
			owned_by = ROOT
		}
		OR = {
			has_country_flag = fee_mug_aurangzeb_alamgir
			AND = {
				has_dlc = "Rights of Man"
				NOT = { ruler_has_personality = tolerant_personality }
			}
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Mughals_Events.36.OPT1

		514 = {
			noble_rebels = 3
		}
		if = {
			limit = {
				has_estate = estate_rajput
			}
			add_ruler_modifier = {
				name = fee_mug_meddling_in_rajput_politics
				duration = -1
			}
		}
		hidden_effect = {
			country_event = { id = FEE_Mughals_Events.37 days = 180 }
		}
	}
}

# Rathore Rebellion
country_event = {
	id = FEE_Mughals_Events.37
	title = FEE_Mughals_Events.37.T
	desc = FEE_Mughals_Events.37.D
	picture = BATTLE_eventPicture

	is_triggered_only = yes

	goto = highlight_province

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					mewar_area = {
						owned_by = ROOT
					}
					NOT = { owns = 514 }
				}
				random_owned_province = {
					limit = {
						area = mewar_area
					}
					save_event_target_as = highlight_province
				}
			}
			else = {
				514 = {
					save_event_target_as = highlight_province
				}
			}
		}
	}

	option = {
		name = FEE_Mughals_Events.37.OPT1

		514 = {
			if = {
				limit = {
					owned_by = ROOT
				}
				noble_rebels = 3
			}
		}
		mewar_area = {
			limit = {
				owned_by = ROOT
			}
			noble_rebels = 3
		}
		custom_tooltip = FEE_Mughals_Events.37.TT
		tooltip = {
			add_province_modifier = {
				name = fee_mug_rajput_guerillas
				duration = -1
				desc = FEE_UNTIL_DEATH_OF_RULER_TT
			}
		}
		hidden_effect = {
			every_owned_province = {
				limit = {
					culture = rajput
				}
				add_province_modifier = {
					name = fee_mug_rajput_guerillas
					duration = -1
					desc = FEE_UNTIL_DEATH_OF_RULER_TT
				}
			}
		}
		set_country_flag = fee_mug_rathore_rebellion
	}
}

# [Root.Heir.GetName] attempts to overthrow me
country_event = {
	id = FEE_Mughals_Events.38
	title = FEE_Mughals_Events.38.T
	desc = FEE_Mughals_Events.38.D
	picture = ACCUSATION_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		has_heir = yes
		has_country_flag = fee_mug_rathore_rebellion
		has_country_flag = fee_mug_aurangzeb_alamgir
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Mughals_Events.38.OPT1

		custom_tooltip = FEE_Mughals_Events.38.TT
		kill_heir = { }
	}
}

# Abolition of Jharoka Darshana
country_event = {
	id = FEE_Mughals_Events.39
	title = FEE_Mughals_Events.39.T
	desc = FEE_Mughals_Events.39.D
	picture = COURT_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		religion_group = muslim
		has_country_modifier = fee_mug_jharoka_darshana
		OR = {
			has_country_flag = fee_mug_aurangzeb_alamgir
			AND = {
				OR = {
					current_age = age_of_absolutism
					current_age = age_of_revolutions
				}
				OR = {
					AND = {
						uses_piety = yes
						NOT = { piety = 0.5 }
					}
					AND = {
						has_dlc = "Rights of Man"
						OR = {
							ruler_has_personality = cruel_personality
							ruler_has_personality = zealot_personality
							ruler_has_personality = pious_personality
							ruler_has_personality = greedy_personality
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Mughals_Events.39.OPT1

		add_piety = 0.25
		remove_country_modifier = fee_mug_jharoka_darshana
	}
}

# Cheap Throne Room
country_event = {
	id = FEE_Mughals_Events.40
	title = FEE_Mughals_Events.40.T
	desc = FEE_Mughals_Events.40.D
	picture = BANKRUPTCY_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		OR = {
			has_country_flag = fee_mug_aurangzeb_alamgir
			num_of_loans = 1
		}
	}

	mean_time_to_happen = {
		months = 96
	}

	option = {
		name = FEE_Mughals_Events.40.OPT1

		add_prestige = -50
		if = {
			limit = {
				has_dlc = "Mandate of Heaven"
			}
			add_splendor = -600
		}
		add_years_of_income = 0.5
		add_piety = -0.25
		add_ruler_modifier = {
			name = fee_mug_cheap_throne_room
			duration = -1
		}
	}
}

# Implementation of Jizya
country_event = {
	id = FEE_Mughals_Events.41
	title = FEE_Mughals_Events.41.T
	desc = FEE_Mughals_Events.41.D
	picture = CORRUPTION_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		religion_group = muslim
		has_estate_privilege = estate_church_fee_abolished_jizya
		OR = {
			has_country_flag = fee_mug_aurangzeb_alamgir
			AND = {
				OR = {
					current_age = age_of_absolutism
					current_age = age_of_revolutions
				}
				OR = {
					NOT = { ADM = 4 }
					AND = {
						has_dlc = "Rights of Man"
						OR = {
							ruler_has_personality = zealot_personality
							ruler_has_personality = pious_personality
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 60
	}

	option = {
		name = FEE_Mughals_Events.41.OPT1

		add_adm_power = -50
		remove_estate_privilege = estate_church_fee_abolished_jizya
		set_estate_privilege = estate_church_fee_reestablished_jizya
	}
}

# Conqueror of the World
country_event = {
	id = FEE_Mughals_Events.42
	title = FEE_Mughals_Events.42.T
	desc = FEE_Mughals_Events.42.D
	picture = GOOD_WITH_MONARCH_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		has_country_flag = fee_mug_aurangzeb_alamgir
		num_of_owned_provinces_with = {
			value = 200
			superregion = india_superregion
		}
	}

	mean_time_to_happen = {
		months = 1
	}

	option = {
		name = FEE_Mughals_Events.42.OPT1

		add_ruler_modifier = {
			name = fee_mug_alamgir
			duration = -1
		}
		if = {
			limit = {
				ruler_has_personality = conqueror_personality
			}
			remove_ruler_personality = conqueror_personality
			add_ruler_personality = legendary_conqueror_personality
		}
		else_if = {
			limit = {
				has_dlc = "Rights of Man"
				NOT = { months_of_ruling = 300 } # less than 3 personalities
			}
			add_ruler_personality = legendary_conqueror_personality
		}
		add_power_projection = {
			type = 10_permanent_power_projection
			amount = 10
		}
		custom_tooltip = FEE_Mughals_Events.42.TT
		set_country_flag = fee_mug_perma_pp_removed_on_ruler_death
	}
}

# Travelling physician from France
country_event = {
	id = FEE_Mughals_Events.43
	title = FEE_Mughals_Events.43.T
	desc = FEE_Mughals_Events.43.D
	picture = ADVISOR_eventPicture

	fire_only_once = yes

	trigger = {
		tag = MUG
		is_year = 1658
		OR = {
			has_country_flag = fee_mug_aurangzeb_alamgir
			AND = {
				OR = {
					has_dlc = "Rights of Man"
					has_dlc = "Emperor"
				}
				is_great_power = yes
			}
		}
	}

	mean_time_to_happen = {
		months = 60
	}

	option = {
		name = FEE_Mughals_Events.43.OPT1

		if = {
			limit = {
				is_expanded_mod_active = { mod = advisor_types }
			}
			define_advisor = {
				type = ate_advisor_court_physician
				skill = 2
				name = "François Bernier"
				cost_multiplier = 0.34
			}
		}
		else = {
			define_advisor = {
				type = natural_scientist
				skill = 2
				name = "François Bernier"
				cost_multiplier = 0.34
			}
		}
	}
}

# Marathas Raid
country_event = {
	id = FEE_Mughals_Events.44
	title = FEE_Mughals_Events.44.T
	desc = FEE_Mughals_Events.44.D
	picture = SIEGE_eventPicture

	fire_only_once = yes

	goto = 544

	trigger = {
		tag = MUG
		is_year = 1657
		owns = 544
	}

	mean_time_to_happen = {
		months = 1
	}

	option = {
		name = FEE_Mughals_Events.44.OPT1

		544 = {
			area = {
				limit = {
					owned_by = ROOT
				}
				add_devastation = 50
			}
		}
		if = {
			limit = {
				exists = MAR
			}
			MAR = {
				country_event = { id = FEE_Mughals_Events.45 }
			}
		}
	}
}

# Raid of [544.GetName]
country_event = {
	id = FEE_Mughals_Events.45
	title = FEE_Mughals_Events.45.T
	desc = FEE_Mughals_Events.45.D
	picture = CORRUPTION_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Mughals_Events.45.OPT1

		add_treasury = 1500
	}
}