########################################
# Flavor Events for Delhi
#
# Scripted by Sara Wendel-rtqvist
########################################

namespace = flavor_dlh
normal_or_historical_nations = yes

# The Marathi Revolt
country_event = {
	id = flavor_dlh.1
	title = "flavor_dlh.EVTNAME1"
	desc = "flavor_dlh.EVTDESC1"
	picture = ANGRY_MOB_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		religion_group = muslim
		is_year = 1650
		NOT = { tag = MUG }
		NOT = { exists = MAR } # Marathas
		any_owned_province = {
			OR = {
				area = maidan_area
				area = desh_area
				culture = marathi
			}
		}
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_dlh.EVTOPTA1"
		every_owned_province = {
			limit = {
				OR = {
					area = maidan_area
					area = desh_area
					culture = marathi
				}
			}
			add_core = MAR
			add_unrest = 10
		}
	}
	option = {
		name = "flavor_dlh.EVTOPTB1"
		every_owned_province = {
			limit = {
				OR = {
					area = maidan_area
					area = desh_area
					culture = marathi
				}
				is_capital = no
			}
			add_local_autonomy = 100
		}
	}
}

# Tiger on the Border
country_event = {
	id = flavor_dlh.2
	title = "flavor_dlh.EVTNAME2"
	desc = "flavor_dlh.EVTDESC2"
	picture = MILITARY_CAMP_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = DLH
		exists = MUG
		NOT = { war_with = MUG }
		any_neighbor_country = { tag = MUG }
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_dlh.EVTOPTA2"
		MUG = {
			add_opinion = {
				who = ROOT
				modifier = opinion_negotiated_peace
				years = 50
			}
		}
	}
	option = {
		name = "flavor_dlh.EVTOPTB2"
		MUG = {
			add_opinion = {
				who = ROOT
				modifier = opinion_displeased
				years = 50
			}
		}
		add_prestige = 10
	}
}

# The Lodi Dynasty
country_event = {
	id = flavor_dlh.3
	title = "flavor_dlh.EVTNAME3"
	desc = "flavor_dlh.EVTDESC3"
	picture = COURT_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = DLH
		dynasty = "00000" 
		OR = { 
			NOT = { dip = 2 } 
			NOT = { mil = 2 } 
			NOT = { adm = 2 }
			NOT = { legitimacy = 70 }
			NOT = { stability = 1 }
		}
	}
	
	mean_time_to_happen = {
		months = 24
	}
	
	option = {
		name = "flavor_dlh.EVTOPTA3"
		add_stability = -1
		add_inflation = 2
		set_country_flag = dlh_lodi_flag
	}
}

# The Incompetence of the Lodis
country_event = {
	id = flavor_dlh.4
	title = "flavor_dlh.EVTNAME4"
	desc = "flavor_dlh.EVTDESC4"
	picture = COURT_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = DLH
		dynasty = "00000" 
		OR = { 
			NOT = { dip = 3 } 
			NOT = { mil = 3 } 
			NOT = { adm = 3 }
		}
		has_country_flag = dlh_lodi_flag
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_dlh.EVTOPTA3"
		add_stability = -1
		every_owned_province = {
			limit = { is_core = DLH }
			add_unrest = 5
		}
		add_inflation = 2
		clr_country_flag = dlh_lodi_flag
	}
}


# The Rise of Bahlul Lodi
country_event = {
	id = flavor_dlh.5
	title = "flavor_dlh.5.t"
	desc = "flavor_dlh.5.d"
	picture = COURT_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = DLH
		is_at_war = no
		SRH = {
			dynasty = "00000"
			is_subject_of = ROOT
		}
		NOT = { has_global_flag = dlh_bahlul_lodi_flag }
		is_year = 1445
		NOT = { is_year = 1450 }
	}
	
	immediate = {
		set_global_flag = dlh_bahlul_lodi_flag
	}
	
	mean_time_to_happen = {
		months = 3
	}
	
	option = {
		name = "flavor_dlh.5.a" #We must rein him in.
		ai_chance = {
			factor = 100
		}
		custom_tooltip = flavor_dlh.5.a.tt
		SRH = { country_event = { id = flavor_dlh.6 } }
		add_prestige = 10
	}
	option = {
		name = "flavor_dlh.5.b" #We have lost control over Sirhind and the Punjab.
		ai_chance = {
			factor = 0
		}
		custom_tooltip = flavor_dlh.5.b.tt
		SRH = { country_event = { id = flavor_dlh.7 } }
		add_opinion = {
			 who = SRH
			 modifier = opinion_lodi_released 
		}
		tooltip = {
			free_vassal = SRH
		}
	}
}

# The Rise of Bahlul Lodi
country_event = {
	id = flavor_dlh.6
	title = "flavor_dlh.6.t"
	desc = "flavor_dlh.6.d"
	picture = COURT_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = "flavor_dlh.6.a"
		ai_chance = {
			factor = 100
		}
		DLH = {
			free_vassal = SRH
		}
		capital_scope = {
			infantry = ROOT
			infantry = ROOT
			infantry = ROOT
			infantry = ROOT
			cavalry = ROOT
			cavalry = ROOT
		}
		declare_war_with_cb = {
			who = DLH
			casus_belli = cb_core
			war_goal_province = 522
		}
	}
	option = {
		name = "flavor_dlh.6.b"
		ai_chance = {
			factor = 0
		}
		add_prestige = -5
	}
}


# The Rise of Bahlul Lodi
country_event = {
	id = flavor_dlh.7
	title = "flavor_dlh.7.t"
	desc = "flavor_dlh.7.d"
	picture = COURT_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = "flavor_dlh.7.a"
		FROM = {
			free_vassal = ROOT
			add_truce_with = ROOT
		}
		hidden_effect = { add_truce_with = FROM }
		create_alliance = FROM
		add_opinion = {
			 who = FROM
			 modifier = opinion_lodi_released 
		}
	}
}

########################################
# Additional Flavor Events for Delhi
#
# Scripted by Daniel Tolman
########################################

# The Founding of Agra
country_event = {
	id = flavor_dlh.8
	title = "flavor_dlh.EVTNAME8"
	desc = "flavor_dlh.EVTDESC8"
	picture = 9_Vaisya_Estate_eventPicture
	
	fire_only_once = yes
	
	is_triggered_only = yes
	
	trigger = {
		has_dlc = "Dharma"
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { # keep capital in Delhi
		name = "flavor_dlh.EVTOPTA8"
		capital_scope = {
			add_base_manpower = 2
			add_base_tax = 2
			add_base_production = 2
		}
		524 = {
			change_province_name = "Agra"
			rename_capital = "Agra"
		}
	}
	option = { # move capital to Agra
		name = "flavor_dlh.EVTOPTB8"
		524 = {
			move_capital_effect = yes
			change_province_name = "Agra"
			rename_capital = "Agra"
			add_base_manpower = 2
			add_base_tax = 2
			add_base_production = 2
		}
	}
}
