###########################
# RAJ GOE events Events
###########################

add_namespace = GOE_RAJ
add_namespace = GOE_RAJ_partition
add_namespace = GOE_RAJ_famine
add_namespace = GOE_RAJ_eic
add_namespace = GOE_RAJ_princely
add_namespace = GOE_RAJ_navy
add_namespace = GOE_RAJ_goa
add_namespace = GOE_RAJ_generals
add_namespace = GOE_RAJ_mughals_peace_deal
add_namespace = GOE_RAJ_loyalist

##DESC
#country_event = {
#	id = GOE_RAJ.X
#	title = GOE_RAJ.X.t	
#	desc = GOE_RAJ.X.desc	
#	picture = GFX_report_event_generic_sign_treaty2
#	
#	is_triggered_only = yes
#
#
#	option = { 
#		name = GOE_RAJ.X.a
#		ai_chance = {
#			base = Y
#		}
#	}
#	option = { 
#		name = GOE_RAJ.X.b
#		ai_chance = {
#			base = Y
#		}
#	}
#}

#RAJ asks the overlord to invade Bhutan
country_event = {
	id = GOE_RAJ.1
	title = GOE_RAJ.1.t	
	desc = GOE_RAJ.1.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes


	#yes
	option = { 
		name = GOE_RAJ.1.a
		ai_chance = {
			base = 1
			modifier = {
				FROM = { is_ai = yes }
				is_historical_focus_on = yes
				factor = 0
			}
		}

		RAJ = {
			country_event = { id = GOE_RAJ.2 hours = 2 random_hours = 3 }
			event_option_tooltip = GOE_RAJ.2.a
		}
	}

	#No
	option = { 
		name = GOE_RAJ.1.b
		ai_chance = {
			base = 0
			modifier = {
				FROM = { is_ai = yes }
				is_historical_focus_on = yes
				add = 1
			}
		}

		RAJ = {
			country_event = { id = GOE_RAJ.3 hours = 2 random_hours = 3 }
		}
	}
}

#UK Accepts that RAJ invades Bhutan
country_event = {
	id = GOE_RAJ.2
	title = GOE_RAJ.2.t	
	desc = GOE_RAJ.2.desc	
	picture = GFX_report_event_japan_army_mountainside
	
	is_triggered_only = yes


	option = { 
		name = GOE_RAJ.2.a
		ai_chance = {
			base = 1
		}

		declare_war_on = {
			target = BHU
			type = annex_everything
		}
	}
}

#UK Rejects that RAJ invades Bhutan
country_event = {
	id = GOE_RAJ.3
	title = GOE_RAJ.3.t	
	desc = GOE_RAJ.3.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes


	option = { 
		name = GOE_RAJ.3.a
		ai_chance = {
			base = 1
		}
	}
}


#RAJ demands Bhutan become a subject
country_event = {
	id = GOE_RAJ.4
	title = GOE_RAJ.4.t	
	desc = GOE_RAJ.4.desc	
	picture = GFX_report_event_indian_soldiers
	
	is_triggered_only = yes

	#Refuse
	option = { 
		name = GOE_RAJ.4.a
		ai_chance = {
			base = 1
		}

		FROM = {
			if = {
				limit = {
					is_subject = yes
				}
				OVERLORD = {
					country_event = { id = GOE_RAJ.1 hours = 2 random_hours = 3 }
				}
			}
			else = {
				event_option_tooltip = GOE_RAJ.5.a
				country_event = { id = GOE_RAJ.5 hours = 2 random_hours = 3 }
			}
		}
	}

	#Accept
	option = { 
		name = GOE_RAJ.4.b
		ai_chance = {
			base = 1
			modifier = {
				has_opinion = {
					target = FROM
					value > 79  # Use < or >
				}
				add = 1
			}

			modifier = {
				strength_ratio = {
					tag = FROM
					ratio > 3
				}
				add = 1.5
			}
		}


		FROM = {
			event_option_tooltip = GOE_RAJ.6.a
			country_event = { id = GOE_RAJ.6 hours = 2 random_hours = 3 }
		}

	}
}

#BHU Rejects being puppeted
country_event = {
	id = GOE_RAJ.5
	title = GOE_RAJ.5.t	
	desc = GOE_RAJ.5.desc	
	picture = GFX_report_event_chinese_soldiers_running
	
	is_triggered_only = yes


	option = { 
		name = GOE_RAJ.5.a
		ai_chance = {
			base = 1
		}
		create_wargoal = {
			type = puppet_wargoal_focus
			target = FROM
		}
	}
}

#BHU Accepts being puppeted
country_event = {
	id = GOE_RAJ.6
	title = GOE_RAJ.6.t	
	desc = GOE_RAJ.6.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes


	option = { 
		name = GOE_RAJ.6.a
		ai_chance = {
			base = 1
		}

		set_autonomy = {
			target = FROM
			autonomy_state = autonomy_dominion
			freedom_level = 1 
			end_wars  = yes 
			end_civil_wars = yes #
		}
	}
}

###AZAD HIND EVENTS

#RAJ asks for aid in war to Jap
country_event = {
	id = GOE_RAJ.7
	title = GOE_RAJ.7.t	
	desc = GOE_RAJ.7.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes


	option = { #Ok
		name = GOE_RAJ.7.a
		ai_chance = {
			base = 5
			modifier = {
				has_government = democratic
				factor = 0.5
			}

			modifier = {
				OR = {
					has_war_with = ENG
					has_war_with = USA
				}
				factor = 10
			}
			modifier = {
				FROM = {
					is_ai = no
				}
				factor = 1.35
			}
		}
		FROM = { country_event = { id = GOE_RAJ.8 hours = 13 random_hours = 12 } }
		set_country_flag = agreed_to_help_bose
		custom_effect_tooltip = GOE_RAJ.7.a_tt
	}

	#Niet
	option = { 
		name = GOE_RAJ.7.b
		ai_chance = {
			base = 1
		}

		FROM = { country_event = { id = GOE_RAJ.9 hours = 13 random_hours = 12 } }
	}
}

#JAP agrees to help
country_event = {
	id = GOE_RAJ.8
	title = GOE_RAJ.8.t	
	desc = GOE_RAJ.8.desc	
	picture = GFX_report_event_generic_sign_treaty2
	


	is_triggered_only = yes

	option = {
		name = GOE_RAJ.8.a
	}
}

#Jap no help
country_event = {
	id = GOE_RAJ.9
	title = GOE_RAJ.9.t	
	desc = GOE_RAJ.9.desc	
	picture = GFX_report_event_generic_sign_treaty2
	

	is_triggered_only = yes

	option = {
		name = GOE_RAJ.9.a
	}
}

#Bose launches civil war. Japan is called to honor its pledge
country_event = {
	id = GOE_RAJ.10
	title = GOE_RAJ.10.t	
	desc = GOE_RAJ.10.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes

	#Honor pledge
	option = {
		name = GOE_RAJ.10.a
		ai_chance = {
			base = 2.5

		}
		FROM = {
			every_other_country = {
				limit = {
					original_tag = RAJ
				}
				ROOT = {
					add_to_war = {
						targeted_alliance = RAJ
						enemy = PREV
						hostility_reason = asked_to_join
					}
				}
			}
			country_event = { id = GOE_RAJ.11 hours = 4 random_hours = 11 }
		}



	}

	#actually nah

	option = {
		name = GOE_RAJ.10.b
		add_stability = -0.5
		add_political_power = -200
		FROM = { country_event = { id = GOE_RAJ.12 hours = 4 random_hours = 12 } }
		ai_chance = {
			base = 0
			modifier = {
				NOT = { has_full_control_of_state = 528 }
				add = 1
			}

			modifier = {
				NOT = { has_full_control_of_state = 530 }
				add = 1
			}

			modifier = {
				NOT = { has_full_control_of_state = 529 }
				add = 1
			}

			modifier = {
				NOT = { has_full_control_of_state = 531 }
				add = 1
			}

			modifier = {
				NOT = { has_full_control_of_state = 532 }
				add = 1
			}

			modifier = {
				NOT = { has_full_control_of_state = 535 }
				add = 1
			}

			modifier = {
				NOT = { has_full_control_of_state = 534 }
				add = 1
			}

			modifier = {
				NOT = { has_full_control_of_state = 282 }
				add = 1
			}

			modifier = {
				NOT = { has_full_control_of_state = 533 }
				add = 1
			}

			modifier = {
				NOT = { has_full_control_of_state = 536 }
				add = 1
			}

			modifier = {
				NOT = { has_full_control_of_state = 555 }
				add = 1
			}

			modifier = {
				has_war_with = RAJ
				factor = 0
			}
		}
	}
}

# Japan Honor pledge
country_event = {
	id = GOE_RAJ.11
	title = GOE_RAJ.11.t	
	desc = GOE_RAJ.11.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			set_country_flag = JAP_honors_pledge_azad_hind
		}
	}
	#Honor pledge
	option = {
		name = GOE_RAJ.11.a
		ai_chance = {
			base = 2.5
		}

		
	}
}


# Japan breaks pledge for RAJ
country_event = {
	id = GOE_RAJ.12
	title = GOE_RAJ.12.t	
	desc = GOE_RAJ.12.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes

	#Honor pledge
	option = {
		name = GOE_RAJ.12.a
		ai_chance = {
			base = 2.5
		}
		
	}
}

# Japan hands over  the Andamans FOR RAJ
country_event = {
	id = GOE_RAJ.13
	title = GOE_RAJ.13.t	
	desc = GOE_RAJ.13.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	trigger = {
		RAJ = { has_country_flag = JAP_honors_pledge_azad_hind }
		has_war_with = 733.controller
		original_tag = JAP
		733 = { is_fully_controlled_by = JAP } 

	}
	fire_only_once = yes
	#give RAJ ANdaman
	option = {
		name = GOE_RAJ.13.a
		ai_chance = {
			base = 1
		}

		RAJ = { 
			country_event = { id = GOE_RAJ.14 hours = 4 } 
			transfer_state = 733
		}
		add_political_power = 25
		
	}

	#give RAJ ANdaman
	option = {
		name = GOE_RAJ.13.a
		ai_chance = {
			base = 0
		}
	}
}

# Japan hands over  the Andamans FOR RAJ
country_event = {
	id = GOE_RAJ.14
	title = GOE_RAJ.14.t	
	desc = GOE_RAJ.14.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	#give RAJ ANdaman
	option = {
		name = GOE_RAJ.13.a
		ai_chance = {
			base = 1
		}

		effect_tooltip = {
			JAP = { RAJ = { transfer_state = 733 } }
		}
	}

}


country_event = {
	id = GOE_RAJ.15
	title = GOE_RAJ.15.t	
	desc = GOE_RAJ.15.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	#give RAJ ANdaman
	option = {
		name = GOE_RAJ.14.a
		ai_chance = {
			base = 1
		}
	}

}


country_event = {
	id = GOE_RAJ.16
	title = GOE_RAJ.16.t	
	desc = GOE_RAJ.16.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	#give RAJ ANdaman
	option = {
		name = GOE_RAJ.16.a
		ai_chance = {
			base = 1
		}

		if = {
			limit = {
				FROM = {
					has_full_control_of_state = 992
				}
			}
			FROM = {
				add_autonomy_score = { 
					value = 80
				}
			}
			transfer_state = 992
			659 = { # Now all of Aden encompasses the Federation of South Arabia
				add_core_of = FSA
			}
			1016 = {
				add_core_of = FSA
				add_claim_by = YEM
			}
		}
	}

}


country_event = {
	id = GOE_RAJ.17
	title = GOE_RAJ.17.t	
	desc = GOE_RAJ.17.desc	
	picture = GFX_report_event_polish_army
	is_triggered_only = yes

	option = {
		name = GOE_RAJ.17.a
		ai_chance = {
			base = 1
			modifier = { 
				surrender_progress > 0.05 
				factor = 0.1
			}

			modifier = {
				surrender_progress > 0.15
				factor = 0
			}

			modifier = {
				surrender_progress < 0.15
				strength_ratio = {
					tag = FROM
					ratio > 1.35
				}
				factor = 5

			}
			
		}

		give_guarantee = TIB 
	}

	option = {
		name = GOE_RAJ.17.b
		ai_chance = {
			base = 1
			modifier = { 
				surrender_progress > 0.05 
				factor = 2
			}
			
		}
	}
}

#Bose demands return of colonies
country_event = {
	id = GOE_RAJ.18
	title = GOE_RAJ.18.t	
	desc = GOE_RAJ.18.desc	
	picture = GFX_report_event_german_troops_paris
	is_triggered_only = yes

	option = {
		name = GOE_RAJ.18.a
		FROM = {
			create_wargoal = {
				type = annex_everything
				target = PREV
			}
			country_event = { id = GOE_RAJ.19 hours = 2 }
		}

		ai_chance = {
			base = 1
		}
	}

	option = {
		name = GOE_RAJ.18.b

		FROM = { transfer_state = var:ROOT.RAJ_demand_return_state }
		ai_chance = {
			base = 1
			modifier = {
				FROM = {
					is_ai = no
				}
				factor = 1.25
			}
			modifier = { 
				has_opinion = {
					target = FROM
					value > 65 # Use < or >
				}

				factor = 1.5
			}

			modifier = {
				has_war_with_major = yes
				factor = 2
			}

			modifier = {
				has_capitulated = yes
				factor = 3
			}

			modifier = {
				is_major = yes
				factor = 0.75
			}
			
		}
		FROM = {
			country_event = { id = GOE_RAJ.20 hours = 2 }
		}
	}
}

#yes/no events
country_event = {
	id = GOE_RAJ.19
	title = GOE_RAJ.19.t	
	desc = GOE_RAJ.19.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.19.a
		ai_chance = {
			base = 1
		}
	}
}

#accept
country_event = {
	id = GOE_RAJ.20
	title = GOE_RAJ.20.t	
	desc = GOE_RAJ.20.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.19.a
		ai_chance = {
			base = 1
		}
	}
}

#Bose kicks out the British, continue war or not?
country_event = {
	id = GOE_RAJ.21
	title = GOE_RAJ.21.t	
	desc = GOE_RAJ.21.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes

	#Exit war
	option = {
		name = GOE_RAJ.21.a
		ai_chance = {
			base = 1
		}

		every_other_country = {
			limit = {
				original_tag = RAJ
				overlord = { has_war_with = ROOT }
			}

			overlord = { country_event = { id = GOE_RAJ.22 } }
		}
	}


	#continue
	option = {
		name = GOE_RAJ.21.b
		ai_chance = {
			base = 0
		}
	}
}


#Bose offers peace to UK
country_event = {
	id = GOE_RAJ.22
	title = GOE_RAJ.22.t	
	desc = GOE_RAJ.22.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes

	#continue
	option = {
		name = GOE_RAJ.22.a
		ai_chance = {
			base = 0
		}
		add_stability = -0.5
		add_war_support = -0.5
		FROM = {
			country_event = { id = GOE_RAJ.23 hours = 2 }
		}
	}


	#exit war
	option = {
		name = GOE_RAJ.22.b
		ai_chance = {
			base = 1
		}

		FROM = { 
			country_event = { id = GOE_RAJ.24  hours = 2 } 
		 }

	}
}

#UK rejects  peace
country_event = {
	id = GOE_RAJ.23
	title = GOE_RAJ.23.t	
	desc = GOE_RAJ.23.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes

	option = {
		name = GOE_RAJ.23.a
		add_war_support = 0.05
	}
}


#UK accepts  peace, to RAJ
country_event = {
	id = GOE_RAJ.24
	title = GOE_RAJ.24.t	
	desc = GOE_RAJ.24.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes


	#exit war
	option = {
		name = GOE_RAJ.24.a
		RAJ = {
			set_country_flag = stop_unrest_events
		}
		if = {
			limit = {
				659 = {
					is_controlled_by = RAJ
				}
			}
			659 = { set_state_flag = azad_hind_move_to_raj }
		}

		if = {
			limit = {
				906 = {
					is_controlled_by = RAJ
				}
			}
			906 = { set_state_flag = azad_hind_move_to_raj }
		}

		if = {
			limit = {
				658 = {
					is_controlled_by = RAJ
				}
			}
			658 = { set_state_flag = azad_hind_move_to_raj }
		}

		if = {
			limit = {
				765 = {
					is_controlled_by = RAJ
				}
			}
			765 = { set_state_flag = azad_hind_move_to_raj }
		}

		if = {
			limit = {
				422 = {
					is_controlled_by = RAJ
				}
			}
			422 = { set_state_flag = azad_hind_move_to_raj }
		}

		if = {
			limit = {
				656 = {
					is_controlled_by = RAJ
				}
			}
			656 = { set_state_flag = azad_hind_move_to_raj }
		}

		for_each_scope_loop = {
			array = RAJ.owned_states_at_game_start
			if = {
				limit = {
					owner = {
						is_subject_of = ENG
						has_war_with = RAJ
					}
				}
				set_state_flag = azad_hind_move_to_raj
			}
		}

		white_peace = {
			tag = FROM
		}

		if = {
			limit = {
				659 = {
					has_state_flag = azad_hind_move_to_raj
				}
			}
			RAJ = { transfer_state =  659 }
		}

		if = {
			limit = {
				906 = {
					has_state_flag = azad_hind_move_to_raj
				}
			}
			RAJ = { transfer_state =  906 }
		}

		if = {
			limit = {
				658 = {
					has_state_flag = azad_hind_move_to_raj
				}
			}
			RAJ = { transfer_state =  658 }
		}

		if = {
			limit = {
				765 = {
					has_state_flag = azad_hind_move_to_raj
				}
			}
			RAJ = { transfer_state =  765 }
		}

		if = {
			limit = {
				422 = {
					has_state_flag = azad_hind_move_to_raj
				}
			}
			RAJ = { transfer_state =  422 }
		}

		if = {
			limit = {
				656 = {
					has_state_flag = azad_hind_move_to_raj
				}
			}
			RAJ = { transfer_state =  656 }
		}
		RAJ = {
			if = {
				limit = {
					has_variable = revolter_tag
					var:revolter_tag = {
						exists = yes
						is_subject_of = ENG
					}
				}
				var:revolter_tag = {

					PREV = {
						annex_country = {	
							target = PREV
							transfer_troops = yes
						}
					}
				}

			}

			for_each_scope_loop = {
				array = RAJ.owned_states_at_game_start
				if = {
					limit = {
						has_state_flag = azad_hind_move_to_raj
						owner = {
							NOT = { tag = ROOT }
						}
					}
					ROOT = { transfer_state = PREV }
				}
			}
		}

		if = {
			limit = {
				JAP = { 
					has_war_with = ENG 
				}
				has_country_flag =	JAP_honors_pledge_azad_hind
			}

			JAP = {
				country_event = { id = GOE_RAJ.25 hours = 2 }
			}
		}
	}
}

#RAJ white peaces ENG, Jap can also white peace
country_event = {
	id = GOE_RAJ.25
	title = GOE_RAJ.25.t	
	desc = GOE_RAJ.25.desc	
	picture = GFX_report_event_merchant_ship_01
	is_triggered_only = yes
	option = {
		ai_chance = {
			base = 1
		}
		name = GOE_RAJ.25.a
		add_timed_idea = {
		 	idea = idea_RAJ_japanese_supremacy
		 	days = 120
		 } 
		 white_peace = {
		 	tag = ENG
		 }
		 every_enemy_country = {
		 	limit = {
		 		is_in_faction_with = ENG
		 		NOT = { original_tag = USA }
		 	}

			 white_peace = {
			 	tag = THIS
			 }
		 }
	 }
	 option = {
	 	name = GOE_RAJ.25.b
		ai_chance = {
			base = 0
		}
	 }
}

#Bose Freed from prison
country_event = {
	id = GOE_RAJ.26
	title = GOE_RAJ.26.t	
	desc = GOE_RAJ.26.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.26.a
		if = {
			limit = { has_dlc = "Graveyard of Empires" }
			RAJ_subhas_chanda_bose = {
				swap_country_leader_traits = {
					remove = in_prison 
					add = nationalistic_freedom_fighter
				}
			}
		}

	 }
}

#RAJ wants to white peace
country_event = {
	id = GOE_RAJ.27
	title = GOE_RAJ.27.t	
	desc = GOE_RAJ.27.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		ai_chance = {
			base = 0
	 		modifier = {
	 			any_state = {
	 				is_core_of = RAJ
	 				is_fully_controlled_by = ROOT	
	 			}

	 			add = 1
	 		}
		}
		name = GOE_RAJ.27.a #no
		FROM = { country_event = { id = GOE_RAJ.28 hours = 2 } }
	 }

	 option = {
	 	ai_chance = {
	 		base = 1
	 	}
	 	name = GOE_RAJ.27.b #yes
	 	white_peace = {
	 		tag = RAJ
	 	}
	 }
}


#RAJ wants to white peace
country_event = {
	id = GOE_RAJ.28
	title = GOE_RAJ.28.t	
	desc = GOE_RAJ.28.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.28.a #no
	 }
}



#Retire Freeman-Freeman
country_event = {
	id = GOE_RAJ.29
	title = GOE_RAJ.29.t	
	desc = GOE_RAJ.29.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.29.a #no
		ai_chance = {
			base = 3
		}
		retire_country_leader = yes
		if = {
			limit = {
				has_completed_focus = RAJ_his_majestys_loyal_government
			}
			add_country_leader_role = {
				character =  RAJ_lord_linlithgow # optional if inside character scope
				promote_leader = yes
				country_leader={
					ideology=centrism
					expire="1965.1.1.1"
					id=-1
					traits = {
						aloof_authority_alt
					}
				}
			}
		}
		else = {
		add_country_leader_role = {
			character =  RAJ_lord_linlithgow # optional if inside character scope
			promote_leader = yes
			country_leader={
				ideology=centrism
				expire="1965.1.1.1"
				id=-1
				traits = {
					aloof_authority
				}
			}
		}	
	}
	}

	#Keep Freeman-Freeman
	option = {
		name = GOE_RAJ.29.b
		ai_chance = {
			base = 0
			modifier = {
				is_historical_focus_on = no
				add = 1
			}
		}

		if = {
			limit = {
				has_completed_focus = RAJ_his_majestys_loyal_government
			}
			RAJ_freeman_freeman_thomas = {
				swap_country_leader_traits = {
					remove = staunch_imperialist
					add = staunch_imperialist_alt
					ideology = centrism
				}
			}
		}
	}
}

#UK independence
country_event = {
	id = GOE_RAJ.30
	title = GOE_RAJ.30.t	
	desc = GOE_RAJ.30.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.30.a 
		ai_chance = {
			base = 1
		}
		was_raj_a_subject = yes
		add_ideas = idea_RAJ_the_long_goodbye
		if = {
			limit = {
				is_subject = yes
				OVERLORD = { has_government = fascism }
				NOT = {
					has_autonomy_state = autonomy_satellite
				}
			}
			OVERLORD = {
				set_autonomy = {
					target=RAJ
					autonomy_state = autonomy_satellite
					freedom_level = 0 # 0-1 
					end_wars  = no # default yes. will not cancel non civil wars if set to no
					end_civil_wars = no # default yes. will not cancel civil wars if set to no
				}
			}
			raj_was_a_subject_reset_party_ideology_after_independence = yes
		}
		if = {
			limit = {
				is_subject = yes
				OVERLORD = { has_government = communism }
				NOT = {
					has_autonomy_state = autonomy_dominion
				}
			}
			OVERLORD = {
			set_autonomy = {
				target=RAJ
				autonomy_state = autonomy_dominion
				freedom_level = 0 # 0-1 
				end_wars  = no # default yes. will not cancel non civil wars if set to no
				end_civil_wars = no # default yes. will not cancel civil wars if set to no
			}
		}
			raj_was_a_subject_reset_party_ideology_after_independence = yes
		}
	}

	#Keep current leader, for some reason
	option = {
		name = GOE_RAJ.30.b
		ai_chance = {
			base = 0


		}
	}
}


#UK independence
country_event = {
	id = GOE_RAJ.31
	title = GOE_RAJ.31.t	
	desc = GOE_RAJ.31.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.31.a
		ai_chance = {
			base = 1
		}
		add_timed_idea = {
			idea = idea_RAJ_sold_parts_of_india_to_private_investors
			days = 365
		}
		custom_effect_tooltip =  GOE_RAJ.31.a_tt
	}

	option = {
		name = GOE_RAJ.31.b
		trigger = {
			is_ai = no
			FROM = { is_ai = yes }
		}

		ai_chance = {
			base = 0
		}

		add_timed_idea = {
			idea = idea_RAJ_great_depression_1
			days = 365
		}

		if = {
			limit = {
				FROM = { has_completed_focus = RAJ_great_depression_price_controls }
			}
			FROM = {	
				uncomplete_national_focus = {
					focus = RAJ_great_depression_price_controls
					uncomplete_children = yes
					refund_political_power = yes
				}
			}
		}

		FROM = { set_country_flag = ENG_rejected_eic } #activate the other AI strat


		if = {
			limit = {
				FROM = { has_idea = idea_RAJ_price_controls }
			}
			remove_ideas = {
				idea_RAJ_price_controls
			}
		} 

		if = {
			limit = {
				FROM = { has_idea = idea_RAJ_price_controls_2 }
			}
			remove_ideas = {
				idea_RAJ_price_controls_2
			}
		} 


	}
}

#UK hand over Aden
country_event = {
	id = GOE_RAJ.32
	title = GOE_RAJ.32.t	
	desc = GOE_RAJ.32.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.32.a
		ai_chance = {
			base = 1
		}


        ENG = { 
            country_event = { id = GOE_RAJ.16 hours = 2 } 
            #event_option_tooltip = GOE_RAJ.16.a
        }
        if = {
        	limit = {
        		has_completed_focus = RAJ_look_to_the_future 
        	}

        	429 = {
        		add_extra_state_shared_building_slots = 1
	        	add_building_construction = {
	        		type = industrial_complex
	        		level = 1
	        		instant_build = yes
	        	}
        	}

        }
        else_if = {
        	limit = {
        		has_completed_focus = RAJ_look_to_the_past
        	}
        	988 = {
        		add_extra_state_shared_building_slots = 1
	        	add_building_construction = {
	        		type = industrial_complex
	        		level = 1
	        		instant_build = yes
	        	}
        	}
        }
        else = {
	        random_core_state = {
	        	limit = {
	        		is_controlled_by = ROOT
	        	}
	        	prioritize = { 439 } 
	        	add_extra_state_shared_building_slots = 1
	        	add_building_construction = {
	        		type = industrial_complex
	        		level = 1
	        		instant_build = yes
	        	}
	        	
	        }
        }

        effect_tooltip = {
            RAJ = {
                add_autonomy_score = { 
                    value = 80
                }
            }
            
            ENG = {
                transfer_state = 992
                659 = { # Now all of Aden encompasses the Federation of South Arabia
                    add_core_of = FSA
                }
                1016 = {
                    add_core_of = FSA
                    add_claim_by = YEM
                }
            }
        }
	}

	option = {
		name = GOE_RAJ.32.b

	}
}

#UK - Mughal uprising
country_event = {
	id = GOE_RAJ.33
	title = GOE_RAJ.33.t	
	desc = GOE_RAJ.33.desc	
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.33.a
		ai_chance = {
			base = 1
		}
		custom_effect_tooltip = 6_month_timer_mughal_tt
		trigger = {
			NOT = {
				TAG = RAJ
			}
		}
	}
	option = {
		name = GOE_RAJ.33.c
		ai_chance = {
			base = 1
		}
		custom_effect_tooltip = GOE_RAJ_33_c_tt
		trigger = {
			TAG = RAJ
		}
	}
}

#UK 
country_event = {
	id = GOE_RAJ.34
	title = GOE_RAJ.34.t	
	desc = GOE_RAJ.34.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.34.a
		ai_chance = {
			base = 1
		}

		#hidden_effect = {
		#	every_state = {
		#		limit = {
		#			is_in_array = {
		#				array = RAJ.owned_states_at_game_start
		#				value = THIS
		#			}
		#			is_controlled_by = RAJ
		#		}
#
		#		#set_state_flag = RAJ_mughals_has_taken_this
		#	}
		#}
		#RAJ = {
		#	white_peace = {
		#		tag = ENG
		#	}
#
		#}
#
		#every_other_country = {
		#	limit = {
		#		is_in_faction_with = ENG
		#		has_war_with = RAJ
		#	}
#
		#	RAJ = {
		#		white_peace = {
		#			tag = ENG
		#		}
		#	}
		#}

		#hidden_effect = {
		#	every_state = {
		#		limit = {
		#			has_state_flag = RAJ_mughals_has_taken_this
		#		}
#
		#		RAJ = { transfer_state = PREV }
		#	}
		#}

	}
}


#Reset resesalbles can join facrtion after X time from 13_on_action
country_event = {
	id = GOE_RAJ.35
	is_triggered_only = yes
	hidden = yes
	immediate = {
		set_rule = { 
			 can_join_factions = yes 
		}
	}
}

country_event = {  #Warn about garrison not being set, hidden event
	id = GOE_RAJ.36
	is_triggered_only = yes
	hidden = yes
	immediate = {
		if = {
			limit = {
				has_country_flag = RAJ_only_send_one_event
			}
			clr_country_flag = RAJ_only_send_one_event
		}
		
		every_owned_state = {
			limit = { has_resistance = yes }
			if = {
				limit = { 
					RAJ = { NOT = { has_country_flag = RAJ_only_send_one_event } } 
				}

				if = {
					limit = { occupation_law = no_garrison }
					RAJ = { set_country_flag = RAJ_only_send_one_event }
					if = {
						limit = {
							RAJ = { NOT = { has_country_flag = RAJ_has_been_warned_about_garrison } }
						}
						RAJ = { 
							set_country_flag = RAJ_has_been_warned_about_garrison 
							country_event = {
								id = GOE_RAJ.37
								hours = 2
							}
						} 
					}
					else = {
						RAJ = { 
							country_event = {
								id = GOE_RAJ.38
								hours = 2
							}
						} 
					}
				}
			}
		}

		if = {
			limit = {
				NOT = { has_completed_focus = RAJ_give_me_blood_and_i_will_grant_you_freedom } #Invoke itself
			}

			country_event = {
				id = GOE_RAJ.36
				days = 22
				random_days = 15 
			}
		}

		if = {
			limit = {
				has_country_flag = RAJ_only_send_one_event
			}
			clr_country_flag = RAJ_only_send_one_event
		}
	}
}

country_event = { #Warn once about garrison not being set 
	id = GOE_RAJ.37
	is_triggered_only = yes
	title =  GOE_RAJ.37.t
	desc =  GOE_RAJ.37.desc
	option = {
		name = GOE_RAJ.37.a
        every_owned_state = {
            limit = { 
            	has_resistance = yes
            	occupation_law = no_garrison 
            	
            }
        	set_occupation_law = local_police_force_garrison

        }
	}
}

country_event = { #No more warning 
	id = GOE_RAJ.38
	is_triggered_only = yes
	title =  GOE_RAJ.38.t
	desc =  GOE_RAJ.38.desc
	option = {
		name = GOE_RAJ.38.a

        every_owned_state = {
        	limit = {
        		has_resistance = yes
        		occupation_law = no_garrison 
        	}
            set_occupation_law = local_police_force_garrison
            set_resistance = 0

        }
        add_stability = -0.1
	}
}

#communist seek help from the unions
country_event = { 
	id = GOE_RAJ.39
	is_triggered_only = yes
	title = GOE_RAJ.39.t
	desc = GOE_RAJ.39.desc
	picture = GFX_report_event_molotov_ribentrop_handshake
	option = {
		name = GOE_RAJ.39.a
		set_country_flag = RAJ_communist_unions_promised_worker_safety 
		add_to_variable = { RAJ_royal_indian_navy_mutiny_threshold = -0.1 tooltip = RAJ_royal_indian_navy_mutiny_threshold_tt }
		custom_effect_tooltip = GOE_RAJ.39.a_tt
		show_ideas_tooltip = idea_RAJ_increased_worker_safety

	}


	option = {
		name = GOE_RAJ.39.b
		set_country_flag = RAJ_communist_unions_promised_minimum_wage
		add_to_variable = { RAJ_royal_indian_navy_mutiny_threshold = -0.1 tooltip = RAJ_royal_indian_navy_mutiny_threshold_tt }
		custom_effect_tooltip = GOE_RAJ.39.b_tt
		show_ideas_tooltip = idea_RAJ_guaranteed_minimum_wage

	}

	#Leave
	option = {
		name = GOE_RAJ.39.c
		clr_country_flag = RAJ_communist_union_event_active
		custom_effect_tooltip = GOE_RAJ.39.c_tt
	}
}



#India starts border clahs with Pakistan punjab
country_event = { 
	id = GOE_RAJ.40
	is_triggered_only = yes
	title = GOE_RAJ.40.t
	desc = GOE_RAJ.40.desc
	picture = GFX_report_event_german_troops_paris
	
	option = {
		name = GOE_RAJ.40.a

	}
}



#India wins  Pakistan
country_event = { 
	id = GOE_RAJ.41
	is_triggered_only = yes
	title = GOE_RAJ.41.t
	desc = GOE_RAJ.41.desc
	picture = GFX_report_event_gre_city_siege
	
	option = {
		name = GOE_RAJ.41.a
		trigger = {
			tag = RAJ
		}

		transfer_state = 986
		if = {
			limit = {
				has_truce_with = PAK
			}
			set_truce = {
				target = PAK
				days = 0
			}
		}
	}

	option = {
		name = GOE_RAJ.41.b
		trigger = {
			tag = PAK
		}
		effect_tooltip = {
			986 = { set_state_owner_to = RAJ }
		}
	}
}

#
#India starts border clash with Pakistan West Bengal
country_event = { 
	id = GOE_RAJ.42
	is_triggered_only = yes
	title = GOE_RAJ.42.t
	desc = GOE_RAJ.42.desc
	picture = GFX_report_event_bul_ff_troops_yugoslavia
	
	option = {
		name = GOE_RAJ.42.a

	}
}



#India wins  Pakistan West Bengal
country_event = { 
	id = GOE_RAJ.43
	is_triggered_only = yes
	title = GOE_RAJ.43.t
	desc = GOE_RAJ.43.desc
	picture = GFX_report_event_france_tank_production
	
	option = {
		name = GOE_RAJ.43.a
		trigger = {
			tag = RAJ
		}

		transfer_state = 431
		if = {
			limit = {
				has_truce_with = PAK
			}
			set_truce = {
				target = PAK
				days = 0
			}
		}
	}

	option = {
		name = GOE_RAJ.43.b
		trigger = {
			tag = PAK
		}
		effect_tooltip = {
			431 = { set_state_owner_to = RAJ }
		}
	}
}

#India starts border clash with Pakistan Rajahstan
country_event = { 
	id = GOE_RAJ.44
	is_triggered_only = yes
	title = GOE_RAJ.44.t
	desc = GOE_RAJ.42.desc
	picture = GFX_report_event_bul_ff_troops_panzer
	
	option = {
		name = GOE_RAJ.44.a

	}
}



#India wins  Pakistan West Bengal
country_event = { 
	id = GOE_RAJ.45
	is_triggered_only = yes
	title = GOE_RAJ.45.t
	desc = GOE_RAJ.45.desc
	picture = GFX_report_event_france_tank_production
	
	option = {
		name = GOE_RAJ.45.a
		trigger = {
			tag = RAJ
		}

		transfer_state = 433
		if = {
			limit = {
				has_truce_with = PAK
			}
			set_truce = {
				target = PAK
				days = 0
			}
		}
	}

	option = {
		name = GOE_RAJ.45.b
		trigger = {
			tag = PAK
		}
		effect_tooltip = {
			433 = { set_state_owner_to = RAJ }
		}
	}
}
# Communist civil war influenced by RAJ
country_event = {
	id = GOE_RAJ.46
	title = GOE_RAJ.46.t
	desc = GOE_RAJ.46.desc
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes
	
	immediate = {
		set_variable = {
			var = raj_total_com_size
			value = party_popularity@communism
		}
	}

	option = {
		name = GOE_RAJ.46.a
		trigger = {
			num_of_controlled_states > 1
		}
		ai_chance = { 
			factor = 100
		}
		set_country_flag = had_raj_civil_war_flag
		start_civil_war = {
			ideology = communism
			size = raj_total_com_size
		}
		every_other_country = {
			limit = {
				original_tag = ROOT
				has_government = communism
			}
			FROM = {
				set_autonomy = {
					target=PREV
					autonomy_state = autonomy_puppet
					freedom_level = 0.1
					end_wars = no
					end_civil_wars = no
				}
			}
		}

		ai_chance = {
			base = 5
		}
	}


	option = {
		name = GOE_RAJ.46.b
		ai_chance = { 
			factor = 0
		}
		set_politics = {
			ruling_party = communism
			elections_allowed = no
		}
		FROM = { puppet = PREV }
		ai_chance = {
			base = 3
			modifier = {
				communism > 0.5
				factor = 3
			}
			modifier = {
				communism > 0.75
				factor = 5
			}
		}
	}

	option = {
		name = GOE_RAJ.46.c
		trigger = {
			is_ironman = no
			difficulty < 3 
		}
		add_popularity = {
			ideology = communism
			popularity = 0.1
		}

		ai_chance = {
			base = 0
		}
	}
}

##
# Notification that India is influencing us with spirit
country_event = {
	id = GOE_RAJ.47
	title = GOE_RAJ.47.t
	desc = GOE_RAJ.47.desc
	picture = GFX_report_event_china_infiltration
	
	is_triggered_only = yes
	immediate = {
		hidden_effect = {
			add_timed_idea = {
				idea = idea_RAJ_communist_propaganda
				days = 70
			}
		}
	}
	option = {
		name = worrying
		effect_tooltip = {
			add_timed_idea = {
				idea = idea_RAJ_communist_propaganda
				days = 70
			}
		}
	}
}

# Notification that India is influencing us
country_event = {
	id = GOE_RAJ.48
	title = GOE_RAJ.48.t
	desc = GOE_RAJ.48.desc
	picture = GFX_report_event_generic_bombers
	
	is_triggered_only = yes
	option = {
		name = GOE_RAJ.48.a
		add_popularity = {
			ideology = communism
			popularity = 0.06
		}
	}
}





#India loses Pakistan West Bengal
country_event = { 
	id = GOE_RAJ.49
	is_triggered_only = yes
	title = GOE_RAJ.49.t
	desc = GOE_RAJ.49.desc
	picture = GFX_report_event_france_tank_production
	
	option = {
		name = GOE_RAJ.49.a
		trigger = {
			tag = RAJ
		}
	}

	option = {
		name = GOE_RAJ.49.b
		trigger = {
			tag = PAK
		}
	}
}

#India loses Pakistan West Bengal
country_event = { 
	id = GOE_RAJ.50
	is_triggered_only = yes
	title = GOE_RAJ.50.t
	desc = GOE_RAJ.50.desc
	picture = GFX_report_event_france_tank_production
	
	option = {
		name = GOE_RAJ.50.a
		trigger = {
			tag = RAJ
		}
	}

	option = {
		name = GOE_RAJ.50.b
		trigger = {
			tag = PAK
		}
	}
}

#India loses  Pakistan
country_event = { 
	id = GOE_RAJ.51
	is_triggered_only = yes
	title = GOE_RAJ.51.t
	desc = GOE_RAJ.51.desc
	picture = GFX_report_event_gre_city_siege
	
	option = {
		name = GOE_RAJ.51.a
		trigger = {
			tag = RAJ
		}
	}

	option = {
		name = GOE_RAJ.51.b
		trigger = {
			tag = PAK
		}
	}
}

##########
#Partition
##########


country_event = {
	id = GOE_RAJ_partition.1
	title = GOE_RAJ_partition.1.t	
	desc = GOE_RAJ_partition.1.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	hidden = yes

	is_triggered_only = yes


	immediate = {
		if = {
			limit = {
				NOT = {
					has_country_flag = stop_unrest_events
				}
			}

			random_scope_in_array = {
				array = RAJ.owned_states_at_game_start 
				limit = { 
					is_controlled_by = ROOT 
					has_resistance = yes
				}

				set_variable = { RAJ.unrest_target_state = THIS }
				random_list = {
					log = yes 
					seed = random
					10 = {
						ROOT = { country_event = { id = GOE_RAJ_partition.2 hours = 2  } } #Add resistance
						modifier = {
							var:RAJ.unrest_target_state = { resistance > 97  }
							factor = 0
						}
					}

					3 = {
						ROOT = { country_event = { id = GOE_RAJ_partition.3 hours = 2  } }
						modifier = {
							var:RAJ.unrest_target_state = {
								industrial_complex < 1
								arms_factory < 1
								dockyard < 1
								infrastructure < 2 

							}
							factor = 0.5
						}

						modifier = {
							var:RAJ.unrest_target_state = { resistance > 40 }
							add = 3
						}

						modifier = {
							var:RAJ.unrest_target_state = { resistance > 60 }
							add = 10
						}
					}
					10 = {
						ROOT = { country_event = { id = GOE_RAJ_partition.4 hours = 2 } }
					}
				}
			}



			country_event = {
				id = GOE_RAJ_partition.1
				days = 180 # optional - can take hours/days/months
				random_days = 20 # optional - can take hours/days/months
			}



		}
	}
}

country_event = {
	id = GOE_RAJ_partition.2
	title = GOE_RAJ_partition.2.t	
	desc = GOE_RAJ_partition.2.desc	
	picture = GFX_report_event_generic_sign_treaty2
	


	is_triggered_only = yes

	option = {
		name =  GOE_RAJ_partition.2.a
		if = {
			limit = {
				is_ai = yes	
			}
			var:RAJ.unrest_target_state = { 
				add_resistance = 15 
				custom_effect_tooltip = currentStateResistance
			}

		}
		else = {
			var:RAJ.unrest_target_state = { 
				add_resistance = 65 
				custom_effect_tooltip = currentStateResistance
			}
		}
		ai_chance = {
			base = 0
			modifier = {
				var:RAJ.unrest_target_state = { 
					resistance < 25 
				}
				add = 1
			}
		}
		clear_variable = RAJ.unrest_target_state
		hidden_effect = {
			check_painful_memory = yes
		}
		custom_effect_tooltip = GOE_RAJ_partition_become_free_to_stop_the_chaos_tt
		if = {
			limit = { has_completed_focus = RAJ_league_against_gandhism }
			hidden_effect = {
				if = {
					limit = { check_variable = { RAJ_war_support_increased < 51 } }
				}
				add_war_support = 0.05
				add_to_variable = { var = RAJ_war_support_increased value = 5}
				custom_effect_tooltip = RAJ_league_against_gandhism_tt_event
			}
		}
	}

	option = {
		name =  GOE_RAJ_partition.2.b
		ai_chance = {
			base = 1
			modifier = {
				var:RAJ.unrest_target_state = { 
					resistance > 39 
				}
				factor = 100
			}
		}
		trigger = { 
			OR = {
				var:RAJ.unrest_target_state = { 
					compliance > 24 
				}

				var:RAJ.unrest_target_state = { 
					resistance > 24 
				}
			}
		}

		if = {
			limit = {
				is_ai = yes	
			}
			var:RAJ.unrest_target_state = { 
				add_resistance = 5 
				custom_effect_tooltip = currentStateResistance
				custom_effect_tooltip = newline_tt
				add_compliance = -10
				custom_effect_tooltip = currentStateCompliance
			}

		}
		else = {
			var:RAJ.unrest_target_state = { 
				add_resistance = 20 
				custom_effect_tooltip = currentStateResistance
				custom_effect_tooltip = newline_tt
				add_compliance = -35
				custom_effect_tooltip = currentStateCompliance
			}
		}
		clear_variable = RAJ.unrest_target_state
		hidden_effect = {
			check_painful_memory = yes
		}

		if = {
			limit = { has_completed_focus = RAJ_league_against_gandhism }
			hidden_effect = {
				add_war_support = 0.05
			}
			custom_effect_tooltip = RAJ_league_against_gandhism_tt_event
		}
		custom_effect_tooltip = GOE_RAJ_partition_become_free_to_stop_the_chaos_tt
		
	}
}


#riots 
country_event = {
	id = GOE_RAJ_partition.3
	title = GOE_RAJ_partition.3.t	
	desc = GOE_RAJ_partition.3.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes

	option = {
		name =  GOE_RAJ_partition.3.a
		var:RAJ.unrest_target_state = {
			if = {
				limit = {
					industrial_complex > 0
				}
				damage_building = {
					type = industrial_complex 
					damage = 3 # levels of damage 
				}
			}

			if = {
				limit = {
					arms_factory > 0
				}
				damage_building = {
					type = arms_factory 
					damage = 3 # levels of damage 
				}
			}

			if = {
				limit = {
					dockyard > 0
				}
				damage_building = {
					type = dockyard 
					damage = 3 # levels of damage 
				}
			}


			if = {
				limit = {
					infrastructure > 0
				}
				damage_building = {
					type = infrastructure 
					damage = 3 # levels of damage 
				}
			}
		}
		clear_variable = RAJ.unrest_target_state
		hidden_effect = {
			check_painful_memory = yes
		}

		if = {
			limit = { has_completed_focus = RAJ_league_against_gandhism }
			hidden_effect = {
				add_war_support = 0.05
			}
			custom_effect_tooltip = RAJ_league_against_gandhism_tt_event
		}
		custom_effect_tooltip = GOE_RAJ_partition_become_free_to_stop_the_chaos_tt
	}
}

country_event = {
	id = GOE_RAJ_partition.4
	title = GOE_RAJ_partition.4.t	
	desc = GOE_RAJ_partition.4.desc	
	picture = GFX_report_event_generic_sign_treaty2
	



	is_triggered_only = yes

	option = {
		name =  GOE_RAJ_partition.4.a
		add_stability = -0.045
		clear_variable = RAJ.unrest_target_state
		hidden_effect = {
			check_painful_memory = yes
		}

		if = {
			limit = { has_completed_focus = RAJ_league_against_gandhism }
			hidden_effect = {
				add_war_support = 0.05
			}
			custom_effect_tooltip = RAJ_league_against_gandhism_tt_event
		}
		custom_effect_tooltip = GOE_RAJ_partition_become_free_to_stop_the_chaos_tt
	}

	option = {
		name =  GOE_RAJ_partition.4.b
		add_stability = -0.02
		add_political_power = -35
		clear_variable = RAJ.unrest_target_state
		hidden_effect = {
			check_painful_memory = yes
		}

		custom_effect_tooltip = GOE_RAJ_partition_become_free_to_stop_the_chaos_tt
	}

	option = {
		name =  GOE_RAJ_partition.4.c
		if = {
			limit = {
				is_ai = yes
			}
			var:RAJ.unrest_target_state = {
				add_resistance = 5
				custom_effect_tooltip = currentStateResistance
				custom_effect_tooltip = newline_tt
				add_compliance = -5
				custom_effect_tooltip = currentStateCompliance
			}
		}
		else = {

			var:RAJ.unrest_target_state = {
				add_resistance = 25
				custom_effect_tooltip = currentStateResistance
				custom_effect_tooltip = newline_tt
				add_compliance = -25
				custom_effect_tooltip = currentStateCompliance
			}
		}


		trigger = {
			var:RAJ.unrest_target_state = {
				compliance > 20
				resistance < 80
			}
		}
		clear_variable = RAJ.unrest_target_state

		hidden_effect = {
			check_painful_memory = yes
		}

		if = {
			limit = { has_completed_focus = RAJ_league_against_gandhism }
			hidden_effect = {
				add_war_support = 0.05
			}
			custom_effect_tooltip = RAJ_league_against_gandhism_tt_event
		}
		custom_effect_tooltip = GOE_RAJ_partition_become_free_to_stop_the_chaos_tt

	}
}

#Clashes between Muslims and Hindus
country_event = {
	id = GOE_RAJ_partition.5
	title = GOE_RAJ_partition.5.t	
	desc = GOE_RAJ_partition.5.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes

	option = { #do nothing
		name =  GOE_RAJ_partition.5.a
		every_controlled_state = {
			limit = {
				is_in_array = {
					array = RAJ.owned_states_at_game_start
					value = THIS
				}

				has_resistance = yes
			}

			add_compliance = -5
			add_resistance = 5
			
		}

		if = {
			limit = { has_completed_focus = RAJ_league_against_gandhism }
			hidden_effect = {
				add_war_support = 0.05
			}
			custom_effect_tooltip = RAJ_league_against_gandhism_tt_event
		}
	}

	option = { #intervene
		name =  GOE_RAJ_partition.5.b
		add_political_power = -40

		if = {
			limit = { has_completed_focus = RAJ_league_against_gandhism }
			hidden_effect = {
				add_war_support = 0.05
			}
			custom_effect_tooltip = RAJ_league_against_gandhism_tt_event
		}
	}
	
}


#India becomes free - RAJ

country_event = {
	id = GOE_RAJ_partition.6
	title = GOE_RAJ_partition.6.t	
	desc = GOE_RAJ_partition.6.desc	
	picture = GFX_report_event_generic_sign_treaty2
	

	immediate = {

		drop_cosmetic_tag = yes
		hidden_effect = {
			set_politics = {
				ruling_party = democratic
				elections_allowed = yes
				last_election = "1939.1.1"
				election_frequency = 48
			}
			set_rule = { can_declare_war_on_same_ideology = yes }
			set_rule = {  can_only_justify_war_on_threat_country = no }
			set_rule = { can_join_factions = no }
		}
		set_country_flag = stop_unrest_events
		if = {
			limit = {
				ROOT = { is_subject_of = ENG }
				NOT = { has_global_flag = RAJ_GOE_partition_has_happened }
			}
			ENG = { set_autonomy = { target = RAJ autonomy_state = autonomy_free } }
		}

		if = {
			limit = {
				is_in_faction_with = ENG
			}
			leave_faction = yes
		}

		if = {
			limit = {
				has_war = yes
				is_in_faction = no
			}
			set_major = yes
		}

		#setup pressure
		PAK = { 
			set_variable = { pressure_left = 6 } 
			set_variable = { default_pressure = pressure_left }
		}

		RAJ = {  
			set_variable = { pressure_left = 8 } 
			set_variable = { default_pressure = pressure_left }
		}
		if = {
			limit = {
				BAN = { exists = yes }
			}
			set_variable = { pressure_left = 3 }
			set_variable = { default_pressure = pressure_left }

		}
		
		set_global_flag = RAJ_GOE_partition_has_happened
		#The chance for Pricely states to declare independence. Only for alt hist
		if = {
			limit = {
				is_historical_focus_on = no
			}

			KAS = { #Kashmir and Jammu
				set_variable = { liberty_desire = 0 }

				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 787.arms_factory_level }
				add_to_variable = { industry = 441.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 787.industrial_complex_level }
				add_to_variable = { civs = 441.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 787.state_population_k }
				add_to_variable = { total_pop = 441.state_population_k }
				multiply_variable = { total_pop = 0.01 }


				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 100 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 2 }
				multiply_variable = { liberty_desire = historical_precedence  }
				
			
			}

			HYD = { #hyderabad
				set_variable = { liberty_desire = 0 }

				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 427.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 427.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 427.state_population_k }
				multiply_variable = { total_pop = 0.01 }


				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 100 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 2 }
				multiply_variable = { liberty_desire = historical_precedence  }
				
			}

			MPU = { #Manipir
				set_variable = { liberty_desire = 0 }

				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 990.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 990.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 990.state_population_k }
				multiply_variable = { total_pop = 0.01 }


				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 0 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 0.75 }
				multiply_variable = { liberty_desire = historical_precedence  }
				
			}


			MYS = { #Mysore
				set_variable = { liberty_desire = 0 }

				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 425.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 425.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 425.state_population_k }
				multiply_variable = { total_pop = 0.01 }

				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 0 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 0.75 }
				multiply_variable = { liberty_desire = historical_precedence  }
				
			}

			NWF = { #North Western Frontier States
				set_variable = { liberty_desire = 0 }


				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 442.arms_factory_level }
				add_to_variable = { industry = 987.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 442.industrial_complex_level }
				add_to_variable = { civs = 987.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 442.state_population_k }
				add_to_variable = { total_pop = 987.state_population_k }
				multiply_variable = { total_pop = 0.01 }


				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 100 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 0.35 }
				multiply_variable = { liberty_desire = historical_precedence  }
				
			}

			RJP = { #Rajputana
				set_variable = { liberty_desire = 0 }


				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 433.arms_factory_level }
				add_to_variable = { industry = 989.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 433.industrial_complex_level }
				add_to_variable = { civs = 989.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 433.state_population_k }
				add_to_variable = { total_pop = 989.state_population_k }
				multiply_variable = { total_pop = 0.01 }

				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 100 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 0.8 }
				multiply_variable = { liberty_desire = historical_precedence  }
			}

			
			KOL = { #Deccan states and Koliphur
				set_variable = { liberty_desire = 0 }

				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 311.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 311.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 311.state_population_k }
				multiply_variable = { total_pop = 0.01 }


				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 0 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 0.3 }
				multiply_variable = { liberty_desire = historical_precedence  }
				
			}

			#Western Indian States (Gujarat)
			WIS = { 
				set_variable = { liberty_desire = 0 }

				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 428.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 428.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 428.state_population_k }
				multiply_variable = { total_pop = 0.01 }


				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 0 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 1 }
				multiply_variable = { liberty_desire = historical_precedence  }
				
			}

			CIP = { #Central Indian states
				set_variable = { liberty_desire = 0 }

				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 437.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 437.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 437.state_population_k }
				multiply_variable = { total_pop = 0.01 }


				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 0 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 0.6 }
				multiply_variable = { liberty_desire = historical_precedence  }
				
			}

			RAS = { #Madras states
				set_variable = { liberty_desire = 0 }

				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 982.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 982.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 982.state_population_k }
				multiply_variable = { total_pop = 0.01 }


				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 0 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 0.4 }
				multiply_variable = { liberty_desire = historical_precedence  }
				
			}

			SKK = { #Sikkim states
				set_variable = { liberty_desire = 0 }

				#Industry
				set_variable = { industry = 0 }
				set_variable = { industry = 985.arms_factory_level }
				multiply_variable = { industry = 3 }

				set_variable = { civs = 0 }
				add_to_variable = { civs = 985.industrial_complex_level }
				
				multiply_variable = { civs = 1.75 }
				add_to_variable = { industry = civs }

				#Pop
				set_variable = { total_pop = 985.state_population_k }
				multiply_variable = { total_pop = 0.01 }


				multiply_variable = { painful_memory = 3 }
				add_to_variable = { liberty_desire = painful_memory }
				add_to_variable = { liberty_desire = total_pop }
				add_to_variable = { liberty_desire = industry }

				if = {
					limit = {
						is_historical_focus_on = yes
					}
					set_variable = { base_value = 0 }
				}
				else = {
					set_variable = { base_value = 5 }
				}

				add_to_variable = { liberty_desire = base_value }
				set_variable = { historical_precedence = 2 }
				multiply_variable = { liberty_desire = historical_precedence  }
				
			}
		}


		set_variable = { no_independence = 100 }
	}

	is_triggered_only = yes

	option = {
		trigger = {
			NOT = { has_completed_focus = RAJ_india_united }
		}
		name =  GOE_RAJ_partition.6.a
		if = {
			limit = {
				is_historical_focus_on = yes

			}

			RAJ = {
				add_ideas = idea_RAJ_remaining_paramilitary_organizations
				remove_ideas = {
					RAJ_marginalized_muslim_community
					RAJ_marginalized_muslim_community_angry

				}
			}

			#Hyderabad

			if = {
				limit = {
					HYD = {
						all_core_state = {
							is_controlled_by = ROOT
						}
					}
				}
				release = HYD
				HYD = {
					every_core_state = {
						limit = { is_controlled_by = PREV }
						add_to_array = { array = RAJ.states_in_play_partition }
						hidden_effect = {
							set_state_flag = prefers_raj
							set_variable = { preference = 1.5 }
							set_variable = { RAJ_pressure = 0 }
							set_variable  = { PAK_pressure = 0 }
							set_variable = { BAN_pressure = 0 }
						}
					}
				}

			}

			#Kashmir
			if = {
				limit = {
					always = yes
				}

				release = KAS
				KAS = {
					every_core_state = {
						limit = { is_controlled_by = PREV }
						add_to_array = { array = RAJ.states_in_play_partition }
						hidden_effect = {
							set_variable = { RAJ_pressure = 0 }
							set_variable  = { PAK_pressure = 0 }
							set_variable = { BAN_pressure = 0 }
							
							if = {
								limit = {
									state = 441
								}

								set_state_flag = prefers_raj
								set_variable = { preference = 1.5 }

							}
							if = {
								limit = {
									state = 787
								}
								set_state_flag = prefers_pak
								set_variable = { preference = 1.5 }
							}
						}
					}
				}
			}

			#Kalat
			if = {
				limit = {
					KLT = {
						all_core_state = {
							is_controlled_by = ROOT
						}
					}
				}
				release = KLT #kalat
				KLT = {
					every_core_state = {
						limit = { is_controlled_by = PREV }

						set_variable = { RAJ_pressure = 0 }
						set_variable  = { PAK_pressure = 0 }
						set_variable = { BAN_pressure = 0 }
						add_to_array = { array = RAJ.states_in_play_partition }
						hidden_effect = {
							set_state_flag = prefers_pak
							set_variable = { preference = 1.5 }
						}
					}
				}
			}


			#Kalat
			if = {
				limit = {
					SKK = {
						all_core_state = {
							is_controlled_by = ROOT
						}
					}
				}
				release = SKK #Sikkim
				SKK = {
					every_core_state = {
						limit = { is_controlled_by = PREV }

						set_variable = { RAJ_pressure = 0 }
						set_variable  = { PAK_pressure = 0 }
						set_variable = { BAN_pressure = 0 }
						add_to_array = { array = RAJ.states_in_play_partition }
						hidden_effect = {
							set_state_flag = prefers_raj
							set_variable = { preference = 1.5 }
						}
					}
				}
			}

			# release BAN before pakistan if united bengal
			if = {
				limit = {
					has_completed_focus = RAJ_united_bengal
				}
				release = BAN
			}

			#always release pakistan
			release = PAK
			every_unit_leader = {
				limit = {
					has_trait = loyalty_to_pakistan
				}
				set_nationality = PAK
			}
		}
		else = {
			# release BAN before pakistan if united bengal
			RAJ = {
				add_ideas = idea_RAJ_remaining_paramilitary_organizations
			}
			if = {
				limit = {
					has_completed_focus = RAJ_united_bengal
				}
				release = BAN
			}

			#always release pakistan
			release = PAK
			every_unit_leader = {
				limit = {
					has_trait = loyalty_to_pakistan
				}
				set_nationality = PAK
			}
			hidden_effect = { #
				#Kashmir
				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = KAS.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:KAS.liberty_desire = { 
						release = KAS
								#setup pressure
						PAK = { 
							add_to_variable = { pressure_left = 0.5 } 
							set_variable = { default_pressure = pressure_left }
						}

						RAJ = {  
							add_to_variable = { pressure_left = 0.8 } 
							set_variable = { default_pressure = pressure_left }
						}
						if = {
							limit = {
								BAN = { exists = yes }
							}
							add_to_variable = { pressure_left = 0.25 }
							set_variable = { default_pressure = pressure_left }

						}
						hidden_effect = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
								if = {
									limit = {
										state = 441
									}

									set_state_flag = prefers_raj
									set_variable = { preference = 1.5 }
								}
								if = {
									limit = {
										state = 787
									}
									set_state_flag = prefers_pak
									set_variable = { preference = 1.5 }
								}
							}
						}
					} 
				}

				#Hyderabad
				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = HYD.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:HYD.liberty_desire = { 
						release = HYD 
						HYD = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
								if = {
									limit = {
										state = 441
									}

									set_state_flag = prefers_raj
									set_variable = { preference = 1.5 }
								}
								if = {
									limit = {
										state = 787
									}
									set_state_flag = prefers_pak
									set_variable = { preference = 1.5 }
								}
							}
						}
					} 
				}

				#MPU
				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = MPU.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:MPU.liberty_desire = { 
						release = MPU 
						PAK = { 
							add_to_variable = { pressure_left = 0.5 } 
							set_variable = { default_pressure = pressure_left }
						}

						RAJ = {  
							add_to_variable = { pressure_left = 0.8 } 
							set_variable = { default_pressure = pressure_left }
						}
						if = {
							limit = {
								BAN = { exists = yes }
							}
							add_to_variable = { pressure_left = 0.25 }
							set_variable = { default_pressure = pressure_left }

						}
						MPU = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
							}
						}
					} 
				}

				#Mysore
				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = MYS.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:MYS.liberty_desire = { 
						release = MYS 
						PAK = { 
							add_to_variable = { pressure_left = 0.5 } 
							set_variable = { default_pressure = pressure_left }
						}

						RAJ = {  
							add_to_variable = { pressure_left = 0.8 } 
							set_variable = { default_pressure = pressure_left }
						}
						if = {
							limit = {
								BAN = { exists = yes }
							}
							add_to_variable = { pressure_left = 0.25 }
							set_variable = { default_pressure = pressure_left }

						}
						MYS = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
								set_state_flag = prefers_raj
								set_variable = { preference = 1.5 }
							}
						}
					} 
				}


				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = NWF.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:NWF.liberty_desire = { 
						release = NWF 
						PAK = { 
							add_to_variable = { pressure_left = 0.5 } 
							set_variable = { default_pressure = pressure_left }
						}

						RAJ = {  
							add_to_variable = { pressure_left = 0.8 } 
							set_variable = { default_pressure = pressure_left }
						}
						if = {
							limit = {
								BAN = { exists = yes }
							}
							add_to_variable = { pressure_left = 0.25 }
							set_variable = { default_pressure = pressure_left }

						}
						NWF = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
								set_state_flag = prefers_pak
								set_variable = { preference = 1.25 }
							}
						}
					} 
				}

				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = RJP.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:RJP.liberty_desire = { 
						PAK = { 
							add_to_variable = { pressure_left = 1.5 } 
							set_variable = { default_pressure = pressure_left }
						}

						RAJ = {  
							add_to_variable = { pressure_left = 2 } 
							set_variable = { default_pressure = pressure_left }
						}
						if = {
							limit = {
								BAN = { exists = yes }
							}
							add_to_variable = { pressure_left = 1 }
							set_variable = { default_pressure = pressure_left }

						}
						release = RJP 
						RJP = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
							}
						}
					} 
				}

				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = KOL.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:KOL.liberty_desire = { 
						PAK = { 
							add_to_variable = { pressure_left = 0.5 } 
							set_variable = { default_pressure = pressure_left }
						}

						RAJ = {  
							add_to_variable = { pressure_left = 0.8 } 
							set_variable = { default_pressure = pressure_left }
						}
						if = {
							limit = {
								BAN = { exists = yes }
							}
							add_to_variable = { pressure_left = 0.25 }
							set_variable = { default_pressure = pressure_left }

						}
						release = KOL 
						KOL = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
								set_state_flag = prefers_raj
								set_variable = { preference = 1.25 }
							}
						}
					}
				}

				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = WIS.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:WIS.liberty_desire = { 
						release = WIS 
						PAK = { 
							add_to_variable = { pressure_left = 0.5 } 
							set_variable = { default_pressure = pressure_left }
						}

						RAJ = {  
							add_to_variable = { pressure_left = 0.8 } 
							set_variable = { default_pressure = pressure_left }
						}
						if = {
							limit = {
								BAN = { exists = yes }
							}
							add_to_variable = { pressure_left = 0.25 }
							set_variable = { default_pressure = pressure_left }

						}
						WIS = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
							}
						}
					} 

				}

				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = CIP.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:CIP.liberty_desire = { 
						release = CIP
						PAK = { 
							add_to_variable = { pressure_left = 0.5 } 
							set_variable = { default_pressure = pressure_left }
						}

						RAJ = {  
							add_to_variable = { pressure_left = 0.8 } 
							set_variable = { default_pressure = pressure_left }
						}
						if = {
							limit = {
								BAN = { exists = yes }
							}
							add_to_variable = { pressure_left = 0.25 }
							set_variable = { default_pressure = pressure_left }

						}
						CIP = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
							}
						}
					} 
				}

				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = RAS.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:RAS.liberty_desire = { 
						release = RAS
						PAK = { 
							add_to_variable = { pressure_left = 0.5 } 
							set_variable = { default_pressure = pressure_left }
						}

						RAJ = {  
							add_to_variable = { pressure_left = 0.8 } 
							set_variable = { default_pressure = pressure_left }
						}
						if = {
							limit = {
								BAN = { exists = yes }
							}
							add_to_variable = { pressure_left = 0.25 }
							set_variable = { default_pressure = pressure_left }

						} 
						RAS = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
							}
						}
					} 
				}

				set_variable = { no_independence = 100 }
				subtract_from_variable = { no_independence = SKK.liberty_desire }
				random_list = {
					seed = random 
					var:no_independence = {   } 
					var:SKK.liberty_desire = { 
						release = SKK 
						SKK = {
							every_core_state = {
								limit = { is_controlled_by = PREV }

								add_to_array = { array = RAJ.states_in_play_partition }
							}
						}
					} 
				}

			}

			round_variable = pressure_left
			clamp_variable = {
				var = pressure_left
				min = 0
				max = 13
			}
			PAK = { 
				clamp_variable = {
					var = pressure_left
					min = 0
					max = 13
				}
			}

			RAJ = {  
				set_variable = { default_pressure = pressure_left }
			}
			if = {
				limit = {
					BAN = { exists = yes }
				}
				BAN = {
					if = {
						limit = {
							check_variable = { pressure_left = 0 }
						}
						add_to_variable = { pressure_left = 2 }
					}
					multiply_variable = { pressure_left = RAJ.pressure_mult }
					round_variable = pressure_left
					set_variable = { default_pressure = pressure_left }
					clamp_variable = {
						var = pressure_left
						min = 0
						max = 13
					}

				}
			}
		}



		country_event = {
			id = GOE_RAJ_partition.7
			hours = 4
		}

		custom_effect_tooltip = idea_RAJ_princely_state_aggression_tt
		hidden_effect = {
			add_timed_idea = {
				idea = idea_RAJ_princely_state_aggression #Update idea_RAJ_princely_state_aggression_tt if channging!
				days = 180
			}
		}

		if = {
			limit = {
				PAK = {
					is_subject = yes
				}
			}

			PAK = { overlord = { set_autonomy = { target = PAK autonomy_state = autonomy_free } } } 
			log = "Error: Somehow Pak is a subject after partition. Please Check"
		}


		if = {
			limit = {
				BAN = {
					is_subject = yes
				}
			}

			BAN = { overlord = { set_autonomy = { target = BAN autonomy_state = autonomy_free } } } 
			log = "Error: Somehow BAN is a subject after partition. Please Check"
		}
		hidden_effect = {
		PAK = {
			set_rule = {  can_declare_war_on_same_ideology = yes }
			set_rule = {  can_only_justify_war_on_threat_country = no }
			set_rule = { can_join_factions = no }
			if = {
				limit = { is_in_faction = yes }
				leave_faction = yes
			}
			add_ideas = neutrality_idea
		}

		BAN = {
			set_rule = {  can_declare_war_on_same_ideology = yes }
			set_rule = {  can_only_justify_war_on_threat_country = no }
			set_rule = { can_join_factions = no }
			if = {
				limit = { is_in_faction = yes }
				leave_faction = yes
			}
			add_ideas = neutrality_idea
		}
		}
		for_each_scope_loop = {
			array = RAJ.raj_releasables
		
			if = {
				limit = {
					THIS = { exists = yes }
					NOT = { original_tag = PAK }
				}

				set_rule = { can_declare_war_on_same_ideology = yes }
				set_rule = { can_only_justify_war_on_threat_country = no }
				set_rule = { can_join_factions = no }
				if = {
					limit = { is_in_faction = yes }
					leave_faction = yes
				}
				add_ideas = neutrality_idea
			}
		}

		if = {
			limit = {
				has_completed_focus = RAJ_partition_preparation
			}
			add_timed_idea = {
				idea = idea_RAJ_partition_chaos_less_bad
				days = 80
			}
		}
		else = {
			add_timed_idea = {
				idea = idea_RAJ_partition_chaos_bad
				days = 80
			}
		}

		if = {
			limit = {
				has_dlc = "Graveyard of Empires"
				ROOT = {
					original_tag = RAJ
					NOT = {
						has_completed_focus = RAJ_give_me_blood_and_i_will_grant_you_freedom
						has_completed_focus = RAJ_a_secular_state
					}
				}
			}

				#if = {
				#	limit = {
				#		ROOT = { has_completed_focus = RAJ_united_bengal }
				#	}
				#	release_puppet = BAN
				#	release_puppet = PAK
				#}
				#else = {
				#	release_puppet = PAK 
				#}


			RAJ_GOE_muhammad_ali_jinnah= {
				set_nationality = PAK
			}

			hidden_effect = {

				RAJ_GOE_muhammad_ali_jinnah = {
					add_country_leader_role = {
						promote_leader = yes
						country_leader={
							ideology=liberalism
							expire="1965.1.1.1"
							traits = { father_of_pakistan }
						}
					}
				}

				PAK = {

					set_politics = {
						ruling_party = democratic
						elections_allowed = yes

					}
					inherit_technology = RAJ
					if = {
						limit = { NOT = { has_tech = gw_artillery } }
						set_technology = {
							gw_artillery = 1
							popup = no
						}
					}

					if = {
						limit = { NOT = { has_tech = interwar_antiair } }
						set_technology = {
							interwar_antiair = 1
							popup = no
						}
					}
					division_template = {
						name = "Pakistan Fauj"
						is_locked = yes
						priority = 1
						regiments = {
							infantry = { x = 0 y = 0 }
							infantry = { x = 0 y = 1 }
							infantry = { x = 0 y = 2 }
							infantry = { x = 0 y = 3 }
							infantry = { x = 1 y = 0 }
							infantry = { x = 1 y = 1 }
							infantry = { x = 1 y = 2 }
							artillery_brigade = { x = 2 y = 0 }
						
						}
						support = {
							artillery = { x = 0 y = 0 }
							engineer = { x = 0 y = 1 }
							anti_air = { x = 0 y = 2 }
						}
					}

					division_template = {
						name = "Pakistani Armored Division"
						regiments = {
							medium_armor = { x = 0 y = 0 }
							medium_armor = { x = 0 y = 1 }
							medium_armor = { x = 0 y = 2 }
							motorized = { x = 1 y = 0 }
							motorized = { x = 1 y = 1 }
							motorized = { x = 1 y = 2 }
							motorized = { x = 1 y = 3 }
							motorized = { x = 2 y = 0 }
						}
						support = {
							engineer = { x = 0 y = 0 }
							artillery = { x = 0 y = 1 } 
							anti_air = { x = 0 y = 2 }
						}
					}

					add_equipment_to_stockpile = { 
						type = artillery_equipment_1
						amount = 530
						producer = ENG
					}

					add_equipment_to_stockpile = { 
						type = anti_air_equipment_1
						amount = 340
						producer = ENG
					}
					random_core_state = {
						limit = { is_owned_and_controlled_by = PAK }
							create_unit = {
							division = "name = \"Peshawar Division\" division_template = \"Pakistan Fauj\" start_experience_factor = 1.1 start_equipment_factor = 1 start_manpower_factor = 1"
							owner = PAK
						}
					}

					every_core_state = {
						random_select_amount = 9
						limit = { is_owned_and_controlled_by = PAK }
						create_unit = {
							division = "name = \"Pakistan Fauj\" division_template = \"Pakistan Fauj\" start_experience_factor = 0.4 start_equipment_factor = 1 start_manpower_factor = 1"
							owner = PAK
						}
					}

				}

				if = {
					limit = {
						has_dlc = "No Step Back"
					}


					set_technology = {
						basic_medium_tank_chassis = 1
						popup = no
					}

					set_technology = {
						improved_medium_tank_chassis = 1
						popup = no
					}

					create_equipment_variant = {
					    name = "M4 Sherman"
					    type = medium_tank_chassis_2
					    parent_version = 1
					    modules = {
							main_armament_slot=tank_medium_cannon
							engine_type_slot=tank_gasoline_engine
							special_type_slot_1=tank_radio_3
							special_type_slot_2=stabilizer
							special_type_slot_3=sloped_armor
							turret_type_slot=tank_medium_three_man_tank_turret
							suspension_type_slot=tank_bogie_suspension
							armor_type_slot=tank_welded_armor
					    }
					    upgrades = {
					        tank_nsb_engine_upgrade = 5
					        tank_nsb_armor_upgrade = 5
					    }
					}

					add_equipment_to_stockpile = {
						type = medium_tank_chassis_2
						amount = 120
						variant_name = "M4 Sherman"
					}
				}
				else = {
					set_technology = {
						basic_medium_tank = 1
						popup = no
					}
					set_technology = {
						improved_medium_tank = 1
						popup = no
					}
					

					add_equipment_to_stockpile = {
						type = medium_tank_equipment_2
						amount = 120
						variant_name = "M4 Sherman"
					}
				}

				PAK = {

					capital_scope = {

						create_unit = {
								division = "name = \"Pakistani Armored Division\" division_template = \"Pakistani Armored Division\" start_experience_factor = 0.4 start_equipment_factor = 1 start_manpower_factor = 1"
								owner = PAK
						}
					}
				}
			}
		}
	}

	option = {
		trigger = {
			 has_completed_focus = RAJ_india_united
		}
		name =  GOE_RAJ_partition.6.a
		RAJ = {
			add_ideas = idea_RAJ_remaining_paramilitary_organizations
		}
		add_timed_idea = {
			idea = idea_RAJ_partition_india_united
			days = 1080
		}
		country_event = {
			id = GOE_RAJ_partition.7
			hours = 4
		}
	}
}


#Leadership event
	country_event = {
	id = GOE_RAJ_partition.7
	title = GOE_RAJ_partition.7.t	
	desc = GOE_RAJ_partition.7.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = { #Nehru
		name = GOE_RAJ_partition.7.a
		if = {
			limit = {
				NOT = {
					has_country_leader = {
						ruling_only = yes
						character = RAJ_GOE_jawaharlal_nehru 
					}
				}
			}

			retire_country_leader = yes
			add_country_leader_role = {
				character =  RAJ_GOE_jawaharlal_nehru 
				promote_leader = yes
				country_leader={
					ideology=liberalism
					expire="1965.1.1.1"
					traits = { socialist_modernizer top_down_heavy_policies }
				}
			
			}
		}
		else = {
			add_country_leader_trait = socialist_modernizer
			add_country_leader_trait = top_down_heavy_policies
		}

		ai_chance = {
			base = 10
		}
	}

	#Gandhi
	option = {
		name =  GOE_RAJ_partition.7.b
		if = {
			limit = {
				has_completed_focus = RAJ_viceroys_body_guard
				divisions_in_state = {
					state = 439
					size > 0 # use < or >
					unit = cavalry # optional. specific unit eg. mountaineers, light_tank
				}
			}
			country_event = {	#Gandhi survives
				id = GOE_RAJ_partition.8
				days = 10
				random_days = 5
			}
		}

		if = {
			limit = {
				NOT = {
					has_country_leader = {
						ruling_only = yes
						character = RAJ_mahatma_mohandas_gandhi # recommended
					}
				}
			}

			retire_country_leader = yes
			add_country_leader_role = {
				character =  RAJ_mahatma_mohandas_gandhi # optional if inside character scope
				promote_leader = yes
				country_leader={
					ideology=liberalism
					expire="1965.1.1.1"
					traits = { spiritual_leader skeptical_towards_industrialization }
				}
			
			}
		}
		else = {
			add_country_leader_trait = spiritual_leader
			add_country_leader_trait = skeptical_towards_industrialization
		}

		ai_chance = {
			base = 0
			modifier = {
				is_historical_focus_on = no
				add = 10
			}
		}

	}

	#Jinnah
	option = { 
		name = GOE_RAJ_partition.7.c
		trigger = {
			has_completed_focus = RAJ_a_secular_state	
			PAK = { exists = no }
		}


		if = {
			limit = {
				NOT = {
					has_country_leader = {
						ruling_only = yes
						character = RAJ_GOE_muhammad_ali_jinnah 
					}
				}
			}

			retire_country_leader = yes
			add_country_leader_role = {
				character =  RAJ_GOE_muhammad_ali_jinnah 
				promote_leader = yes
				country_leader={
					ideology=liberalism
					expire="1965.1.1.1"
					traits = { all_india_muslim_league_leader minority_leader }
				}
			
			}
		}
		else = {
			add_country_leader_trait = all_india_muslim_league_leader
			add_country_leader_trait = minority_leader
		}

		ai_chance = {
			base = 0
			modifier = {
				is_historical_focus_on = no
				add = 3
			}
		}
	}

	option = {
		name = GOE_RAJ_partition.7.d
		trigger = {
			NOT = {
				has_war_with = ENG
			}
		}


		if = {
			limit = {
				NOT = {
					has_country_leader = {
						ruling_only = yes
						character = RAJ_louis_mountbatten 
					}
				}
			}

			retire_country_leader = yes
			add_country_leader_role = {
				character =  RAJ_louis_mountbatten 
				promote_leader = yes
				country_leader={
					ideology=liberalism
					expire="1965.1.1.1"
					traits = { the_last_viceroy }
				}
			
			}
		}
		else = {
			add_country_leader_trait = the_last_viceroy
		}

		ai_chance = {
			base = 0
			modifier = {
				is_historical_focus_on = no
				add = 3
			}
		}
	}
}

#Gandhi survives assasination attempt
country_event = {
	id = GOE_RAJ_partition.8
	title = GOE_RAJ_partition.8.t	
	desc = GOE_RAJ_partition.8.desc	
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	immediate = {
		hidden_effect = {
			set_country_flag = gandhi_survives_assasination_attempt
			mark_focus_tree_layout_dirty = yes
		}
	}

	option = {
		name = GOE_RAJ_partition.8.a
	}
}

#Gandthi dies
country_event = {
	id = GOE_RAJ_partition.9
	title = GOE_RAJ_partition.9.t	
	desc = GOE_RAJ_partition.9.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	fire_only_once = yes
	trigger = {
		date > 1948.1.29
		has_global_flag = RAJ_GOE_partition_has_happened
		NOT = { has_country_flag = gandhi_survives_assasination_attempt }
	}

	option = {
		name = GOE_RAJ_partition.9.a
		if = {
			limit ={
				has_country_leader = {
					ruling_only = yes
					character = RAJ_mahatma_mohandas_gandhi # recommended
				}
			}

			kill_country_leader = yes
			add_country_leader_role = {
				character =  RAJ_GOE_jawaharlal_nehru # optional if inside character scope
				promote_leader = yes
				country_leader={
					ideology=liberalism
					expire="1965.1.1.1"
					id=-1
					traits = {}
				} 
			}
		}
	}
}

#War on the Indian subcontinent
country_event = {
	id = GOE_RAJ_partition.10
	title = GOE_RAJ_partition.10.t	
	desc = GOE_RAJ_partition.10.desc	
	picture = GFX_report_event_generic_sign_treaty1
	
	is_triggered_only = yes
	option = {
		name = GOE_RAJ_partition.10.a

		ai_chance = {
			base = 0.5
		}
	}
	option = {
		name = GOE_RAJ_partition.10.b
		declare_war_on = {
			target = RAJ
			type = independence_wargoal 
		}

		ai_chance = {
			base = 1
			modifier = {
				RAJ = {
					is_ai = no
				}

				add = 10
			}
		}
	}
}


###########################
##### LOYALIST BRANCH #####
###########################

#Leadership event - Loyalist Branch
country_event = {
	id = GOE_RAJ_partition.11
	title = GOE_RAJ_partition.7.t #Intended
	desc = GOE_RAJ_partition.11.desc
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = { #Nehru
		name = GOE_RAJ_partition.7.a #Intended

		ai_chance = {
			base = 10
		}

		if = {
			limit = {
				NOT = {
					has_country_leader = {
						ruling_only = yes
						character = RAJ_GOE_jawaharlal_nehru 
					}
				}
			}
			add_country_leader_role = {
				character =  RAJ_GOE_jawaharlal_nehru 
				promote_leader = yes
				country_leader={
					ideology=liberalism
					expire="1965.1.1.1"
					traits = { socialist_modernizer top_down_heavy_policies }
				}
			}
			set_politics = {
				ruling_party = democratic
				election_frequency = 48
				elections_allowed = yes
			}
		}
		else = {
			add_country_leader_trait = socialist_modernizer
			add_country_leader_trait = top_down_heavy_policies
		}
	}

	#Gandhi
	option = {
		name =  GOE_RAJ_partition.7.b #Intended

		ai_chance = {
			base = 0
			modifier = {
				is_historical_focus_on = no
				add = 10
			}
		}

		if = {
			limit = {
				NOT = { has_government = democratic }
			}
			set_politics = {
				ruling_party = democratic
				election_frequency = 48
				elections_allowed = yes
			}
		}
		custom_effect_tooltip = generic_skip_one_line_tt

		#Tooltip will be just bad, so simplifying
		effect_tooltip = {
			add_country_leader_role = {
				character =  RAJ_mahatma_mohandas_gandhi
				promote_leader = yes
				country_leader={
					ideology=liberalism
					expire="1965.1.1.1"
					traits = { spiritual_leader skeptical_towards_industrialization }
				}
			}
		}
		hidden_effect = {
			if = { #If no Country Leader role for whatever reason, add it.
				limit = {
					RAJ_mahatma_mohandas_gandhi = {
						NOT = { has_ideology = liberalism }
					}
				}
				add_country_leader_role = {
					character =  RAJ_mahatma_mohandas_gandhi
					promote_leader = yes
					country_leader={
						ideology=liberalism
						expire="1965.1.1.1"
						traits = { spiritual_leader skeptical_towards_industrialization }
					}
				}
			}
			else = {
				# Promote Gandhi if necessary
				if = {
					limit = {
						NOT = {
							has_country_leader = {
								ruling_only = no
								character = RAJ_mahatma_mohandas_gandhi
							}
						}
					}
					promote_character = RAJ_mahatma_mohandas_gandhi 
				}

				# Add Traits
				if = {
					limit = {
						NOT = { has_country_leader_with_trait = spiritual_leader }
					}
					add_country_leader_trait = spiritual_leader
				}
				if = {
					limit = {
						NOT = { has_country_leader_with_trait = skeptical_towards_industrialization }
					}
					add_country_leader_trait = skeptical_towards_industrialization
				}
			}
		}
	}
}


#Crown Commodities - RAJ grants CG bonus to UK and puppets - Event for UK and its puppets
country_event = {
	id = GOE_RAJ_loyalist.01
	title = GOE_RAJ_loyalist.01.t
	desc = GOE_RAJ_loyalist.01.desc
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	
	option = { #Ok cool tack
		name = GOE_RAJ_loyalist.01.a

		add_timed_idea = {
			idea = RAJ_exports_for_the_empire
			days = 1095
		}
	}
}

#The Empire's Workshop - RAJ grants civs to UK and puppets - Event for UK and its puppets
country_event = {
	id = GOE_RAJ_loyalist.02
	title = GOE_RAJ_loyalist.02.t
	desc = GOE_RAJ_loyalist.02.desc
	picture = GFX_report_event_generic_construction_site
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			random_core_state = {
				limit = {
					is_fully_controlled_by = PREV
					free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}
				}
				set_variable = { ROOT.RAJ_crown_commodities_civ_built_flag = THIS }
			}
		}
	}
	
	option = { #Ok cool tack
		name = GOE_RAJ_loyalist.02.a

		if = {
			limit = {
				tag = ENG
			}
			var:RAJ_crown_commodities_civ_built_flag = {
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
			}
		}
		else = {
			var:RAJ_crown_commodities_civ_built_flag = {
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
		}
		clear_variable = RAJ_crown_commodities_civ_built_flag
	}
}


#RAJ proposes to invade Iran preemptively - Event for UK (as overlord)
country_event = {
	id = GOE_RAJ_loyalist.03
	title = GOE_RAJ_loyalist.03.t
	desc = GOE_RAJ_loyalist.03.desc
	picture = GFX_report_event_PER_iran_invasion
	is_triggered_only = yes

	option = { #Yes go ahead
		name = GOE_RAJ_loyalist.03.a

		ai_chance = {
			base = 10
			modifier = {
				factor = 0.5
				is_historical_focus_on = yes
			}
		}

		effect_tooltip = {
			FROM = {
				declare_war_on = {
					target = PER
					type = annex_everything
				}
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = GOE_RAJ_loyalist.04 hours = 8 random_hours = 2 } }
		}
	}

	option = { #No way
		name = GOE_RAJ_loyalist.03.b

		ai_chance = {
			base = 10
			modifier = { #Say yes to player always
				factor = 0
				FROM = { is_ai = no }
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = GOE_RAJ_loyalist.05 hours = 8 random_hours = 2 } }
		}
	}
}

#RAJ proposes to invade Iran preemptively - UK accepts - Event for RAJ
country_event = {
	id = GOE_RAJ_loyalist.04
	title = GOE_RAJ_loyalist.04.t
	desc = GOE_RAJ_loyalist.04.desc
	picture = GFX_report_event_PER_iran_invasion
	is_triggered_only = yes

	option = { #Yes go ahead
		name = GOE_RAJ_loyalist.04.a

		declare_war_on = {
			target = PER
			type = annex_everything
		}
	}
}

#RAJ proposes to invade Iran preemptively - UK refuses - Event for RAJ
country_event = {
	id = GOE_RAJ_loyalist.05
	title = GOE_RAJ_loyalist.05.t
	desc = GOE_RAJ_loyalist.05.desc
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes

	option = { #Yes go ahead
		name = GOE_RAJ_loyalist.05.a

		
	}
}

#South East Asia Command - Pick Specialization - Event for RAJ
country_event = {
	id = GOE_RAJ_loyalist.06
	title = GOE_RAJ_loyalist.06.t
	desc = GOE_RAJ_loyalist.06.desc
	picture = GFX_report_event_indian_soldiers
	is_triggered_only = yes

	option = { #Defensive
		name = GOE_RAJ_loyalist.06.a

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				is_historical_focus_on = yes
			}
		}

		custom_effect_tooltip = RAJ_modify_south_east_asia_command_dm_tt
		add_to_variable = { RAJ_south_east_asia_command_dm_max_dig_in_factor = 0.1 tooltip = max_dig_in_factor_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_recon_factor_while_entrenched = 0.2 tooltip = recon_factor_while_entrenched_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_army_core_defence_factor = 0.1 tooltip = army_core_defence_factor_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_army_core_attack_factor = 0.1 tooltip = army_core_attack_factor_tt }
		
		custom_effect_tooltip = generic_skip_one_line_tt
		army_experience = 50

		custom_effect_tooltip = generic_skip_one_line_tt
		add_tech_bonus = {
			name = RAJ_south_east_asia_command
			bonus = 0.7
			uses = 2
			category = cat_fortification
			category = mio_cat_artillery
		}
	}

	option = { #Offensive
		name = GOE_RAJ_loyalist.06.b

		ai_chance = {
			base = 1
		}

		custom_effect_tooltip = RAJ_modify_south_east_asia_command_dm_tt
		add_to_variable = { RAJ_south_east_asia_command_dm_army_attack_speed_factor = 0.1 tooltip = army_attack_speed_factor_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_breakthrough_factor = 0.05 tooltip = breakthrough_factor_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_coordination_bonus = 0.02 tooltip = coordination_bonus_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_max_planning_factor = 0.1 tooltip = max_planning_factor_tt }
		
		custom_effect_tooltip = generic_skip_one_line_tt
		army_experience = 50

		custom_effect_tooltip = generic_skip_one_line_tt
		add_tech_bonus = {
			name = RAJ_south_east_asia_command
			bonus = 0.7
			uses = 2
			category = armor
			category = support_tech
		}
	}

	option = { #Airforce
		name = GOE_RAJ_loyalist.06.c

		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}

		custom_effect_tooltip = RAJ_modify_south_east_asia_command_dm_tt
		add_to_variable = { RAJ_south_east_asia_command_dm_air_mission_efficiency = 0.1 tooltip = air_mission_efficiency_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_navy_anti_air_attack_factor = 0.1 tooltip = navy_anti_air_attack_factor_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_air_ace_generation_chance_factor = 0.3 tooltip = air_ace_generation_chance_factor_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_static_anti_air_hit_chance_factor = 0.2 tooltip = static_anti_air_hit_chance_factor_tt }

		custom_effect_tooltip = generic_skip_one_line_tt
		air_experience = 50

		custom_effect_tooltip = generic_skip_one_line_tt
		add_tech_bonus = {
			name = RAJ_south_east_asia_command
			bonus = 0.7
			uses = 2
			category = air_equipment
			category = cat_anti_air
		}
	}

	option = { #Naval
		name = GOE_RAJ_loyalist.06.d

		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}

		custom_effect_tooltip = RAJ_modify_south_east_asia_command_dm_tt
		add_to_variable = { RAJ_south_east_asia_command_dm_industrial_capacity_dockyard = 0.1 tooltip = industrial_capacity_dockyard_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_navy_org_factor = 0.1 tooltip = navy_org_factor_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_naval_coordination = 0.1 tooltip = naval_coordination_tt }
		add_to_variable = { RAJ_south_east_asia_command_dm_naval_morale_factor = 0.15 tooltip = naval_morale_factor_tt }
		
		custom_effect_tooltip = generic_skip_one_line_tt
		navy_experience = 50

		custom_effect_tooltip = generic_skip_one_line_tt
		add_tech_bonus = {
			name = RAJ_south_east_asia_command
			bonus = 0.7
			uses = 2
			category = naval_equipment
			category = marine_tech
		}
	}
}

#RAJ asks to annex MAL - Event for independent MAL
country_event = {
	id = GOE_RAJ_loyalist.07
	title = GOE_RAJ_loyalist.07.t
	desc = GOE_RAJ_loyalist.07.desc
	picture = GFX_report_event_indian_parade
	is_triggered_only = yes

	option = { #Nope! -> So default option is NOT to hand over MAL (player MAL will never get this event anyways)
		name = GOE_RAJ_loyalist.07.a

		ai_chance = {
			base = 1
			modifier = {
				factor = 0.5
				FROM = { is_ai = no }
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = GOE_RAJ_loyalist.09 hours = 8 random_hours = 2 } }
		}
	}

	option = { #Alright sure!
		name = GOE_RAJ_loyalist.07.b

		ai_chance = {
			base = 100
			modifier = { #Do not annoy enemy players if RAJ is AI
				factor = 0
				any_enemy_country = {
					is_ai = no
				}
				FROM = { is_ai = yes }
			}
		}

		effect_tooltip = {
			FROM = {
				annex_country = {
					target = ROOT
					transfer_troops = yes
				}
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = GOE_RAJ_loyalist.10 hours = 8 random_hours = 2 } }
		}
	}
}

#RAJ asks to annex MAL - Event for MAL's overlord (usually ENG)
country_event = {
	id = GOE_RAJ_loyalist.08
	title = GOE_RAJ_loyalist.07.t #Intended
	desc = GOE_RAJ_loyalist.08.desc
	picture = GFX_report_event_indian_parade
	is_triggered_only = yes

	option = { #Nope! -> So default option is NOT to hand over MAL
		name = GOE_RAJ_loyalist.08.a

		ai_chance = {
			base = 1
			modifier = {
				factor = 0.5
				FROM = { is_ai = no }
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = GOE_RAJ_loyalist.09 hours = 8 random_hours = 2 } }
		}
	}

	option = { #Alright sure!
		name = GOE_RAJ_loyalist.08.b

		ai_chance = {
			base = 100
			modifier = { #Do not annoy enemy players if RAJ is AI
				factor = 0
				any_enemy_country = {
					is_ai = no
				}
				FROM = { is_ai = yes }
			}
		}

		effect_tooltip = {
			FROM = {
				annex_country = {
					target = MAL
					transfer_troops = yes
				}
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = GOE_RAJ_loyalist.10 hours = 8 random_hours = 2 } }
		}
	}
}

#RAJ asks to annex BRM - Event for independent BRM
country_event = {
	id = GOE_RAJ_loyalist.77
	title = GOE_RAJ_loyalist.77.t
	desc = GOE_RAJ_loyalist.07.desc #Intended
	picture = GFX_report_event_indian_parade
	is_triggered_only = yes

	option = { #Nope! -> So default option is NOT to hand over BRM (player BRM will never get this event anyways)
		name = GOE_RAJ_loyalist.07.a

		ai_chance = {
			base = 1
			modifier = {
				factor = 0.5
				FROM = { is_ai = no }
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = GOE_RAJ_loyalist.09 hours = 8 random_hours = 2 } }
		}
	}

	option = { #Alright sure!
		name = GOE_RAJ_loyalist.07.b

		ai_chance = {
			base = 100
			modifier = { #Do not annoy enemy players if RAJ is AI
				factor = 0
				any_enemy_country = {
					is_ai = no
				}
				FROM = { is_ai = yes }
			}
		}

		effect_tooltip = {
			FROM = {
				annex_country = {
					target = ROOT
					transfer_troops = yes
				}
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = GOE_RAJ_loyalist.10 hours = 8 random_hours = 2 } }
		}
	}
}

#RAJ asks to annex BRM - Event for BRM's overlord (usually ENG)
country_event = {
	id = GOE_RAJ_loyalist.88
	title = GOE_RAJ_loyalist.77.t #Intended
	desc = GOE_RAJ_loyalist.08.desc #Intended
	picture = GFX_report_event_indian_parade
	is_triggered_only = yes

	option = { #Nope! -> So default option is NOT to hand over BRM
		name = GOE_RAJ_loyalist.08.a #Intended

		ai_chance = {
			base = 1
			modifier = {
				factor = 0.5
				FROM = { is_ai = no }
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = GOE_RAJ_loyalist.09 hours = 8 random_hours = 2 } }
		}
	}

	option = { #Alright sure!
		name = GOE_RAJ_loyalist.08.b #Intended

		ai_chance = {
			base = 100
			modifier = { #Do not annoy enemy players if RAJ is AI
				factor = 0
				any_enemy_country = {
					is_ai = no
				}
				FROM = { is_ai = yes }
			}
		}

		effect_tooltip = {
			FROM = {
				annex_country = {
					target = BRM
					transfer_troops = yes
				}
			}
		}

		hidden_effect = {
			FROM = { country_event = { id = GOE_RAJ_loyalist.10 hours = 8 random_hours = 2 } }
		}
	}
}

#Rejected MAL annexation - Event for RAJ (coming from independent MAL or MAL's Overlord)
country_event = {
	id = GOE_RAJ_loyalist.09
	title = GOE_RAJ_loyalist.09.t
	desc = GOE_RAJ_loyalist.09.desc
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes

	option = { #Buuuuu lame
		name = GOE_RAJ_loyalist.09.a

		
	}
}

#Accepted MAL annexation - Event for RAJ (coming from independent MAL or MAL's Overlord)
country_event = {
	id = GOE_RAJ_loyalist.10
	title = GOE_RAJ_loyalist.10.t
	desc = GOE_RAJ_loyalist.10.desc
	picture = GFX_report_event_indian_parade
	is_triggered_only = yes

	option = { #Good stuff
		name = GOE_RAJ_loyalist.10.a

		if = {
			limit = {
				event_target:RAJ_annexing_country_target = {
					tag = BRM
				}
			}
			annex_country = {
				target = BRM
				transfer_troops = yes
			}
		}
		else = {
			annex_country = {
				target = MAL
				transfer_troops = yes
			}
		}
	}
}

#The Jewel Becomes the Crown - Do we want Churchill?- Event for RAJ
country_event = {
	id = GOE_RAJ_loyalist.11
	title = GOE_RAJ_loyalist.11.t
	desc = GOE_RAJ_loyalist.11.desc
	picture = GFX_report_event_degaulle_churchill
	is_triggered_only = yes

	option = { #Churchill as Country Leader
		name = GOE_RAJ_loyalist.11.a

		trigger = {
			NOT = { has_completed_focus = RAJ_the_indian_parliament }
		}

		ai_chance = {
			base = 100
		}

		if = {
			limit = {
				NOT = { has_government = democratic }
			}
			set_politics = {
				ruling_party = democratic
				last_election = "1936.1.1"
				election_frequency = 48
				elections_allowed = yes
			}
		}
		ENG = {
			#Store if Churchill was the country leader in the UK before being transferred, so he can come back
			hidden_effect = {
				if = {
					limit = {
						has_country_leader = {
							character = ENG_winston_churchill
							ruling_only = yes
						}
					}
					set_country_flag = RAJ_churchill_was_leading_before_transfer_to_raj_flag
				}
				if = { #DO not send event if UK is already in a path where Churchill is useless
					limit = {
						NOT = {
							has_completed_focus = ENG_organize_the_blackshirts
							has_completed_focus = ENG_concessions_to_the_trade_unions
						}
					}
					country_event = GOE_RAJ_loyalist.12
				}
			}
			ENG_winston_churchill = {
				set_character_flag = RAJ_churchill_as_country_leader_flag
				set_nationality = ROOT
				promote_character = yes
			}
		}
	}

	option = { #Churchill as Advisor
		name = GOE_RAJ_loyalist.11.b

		ai_chance = {
			base = 1
		}

		ENG = {
			#Store if Churchill was the country leader in the UK before being transferred, so he can come back
			hidden_effect = {
				if = {
					limit = {
						has_country_leader = {
							character = ENG_winston_churchill
							ruling_only = yes
						}
					}
					set_country_flag = RAJ_churchill_was_leading_before_transfer_to_raj_flag
				}
				if = { #DO not send event if UK is already in a path where Churchill is useless
					limit = {
						NOT = {
							has_completed_focus = ENG_organize_the_blackshirts
							has_completed_focus = ENG_concessions_to_the_trade_unions
						}
					}
					country_event = GOE_RAJ_loyalist.12
				}
			}

			ENG_winston_churchill = {
				set_nationality = ROOT
			}
			custom_effect_tooltip = available_political_advisor
			show_ideas_tooltip = ENG_winston_churchill

			# Hire Churchill directly, for free, if empty slot
			effect_tooltip = { #Tooltip needs to be inside ENG scope, effect needs to be outside
				if = {
					limit = {
						ROOT = {
							amount_taken_ideas = {
								slots = political_advisor
								amount < 3
							}
						}
					}
					add_ideas = ENG_winston_churchill
				}
			}
		}

		hidden_effect = { #Effect needs to be hidden since Churchill is not in RAJ when tooltip is displayed
			if = {
				limit = {
					has_character = ENG_winston_churchill
					amount_taken_ideas = {
						slots = political_advisor
						amount < 3
					}
				}
				add_ideas = ENG_winston_churchill
			}
		}
	}

	option = { #Yeet this man to outer space tack!
		name = GOE_RAJ_loyalist.11.c

		ai_chance = {
			base = 1
		}

	}
}

#The Jewel Becomes the Crown - Churchill is gone! - Event for ENG (if player was using Churchill when he leaves)
country_event = {
	id = GOE_RAJ_loyalist.12
	title = GOE_RAJ_loyalist.12.t
	desc = GOE_RAJ_loyalist.12.desc
	picture = GFX_report_event_degaulle_churchill
	is_triggered_only = yes

	option = { #Bye bye I guess
		name = GOE_RAJ_loyalist.12.a

		custom_effect_tooltip = { #MM: This is not an effect_tooltip due to the character being transferred in the previous event already, so there would be no Churchill in ENG
			localization_key = generic_character_transferred_to_country_tt
			CHARACTER = ENG_winston_churchill
			ORIGINAL_COUNTRY_FLAG = [ENG.GetFlag]
			TARGET_COUNTRY_FLAG = [ROOT.GetFlag]
			TARGET_COUNTRY = [ROOT.GetNameDefCap]
		}
	}
}

#The Jewel Becomes the Crown - Churchill is back! - Event for ENG (if player was using Churchill when he left)
country_event = {
	id = GOE_RAJ_loyalist.13
	title = GOE_RAJ_loyalist.13.t
	desc = GOE_RAJ_loyalist.13.desc
	picture = GFX_report_event_degaulle_churchill
	is_triggered_only = yes

	option = { #Put him back in charge!
		name = GOE_RAJ_loyalist.13.a

		ai_chance = {
			base = 0
		}

		if = {
			limit = {
				has_country_flag = RAJ_churchill_was_leading_before_transfer_to_raj_flag
			}
			ENG_winston_churchill = { promote_character = yes }
		}
	}

	option = { #We are good without him
		name = GOE_RAJ_loyalist.13.b

		ai_chance = {
			base = 1
		}
	}
}

#Exploit the Frontier - RAJ wants resource rights on Burma's Tungsten - Event for BRM or ENG (if overlord of BRM)
country_event = {
	id = GOE_RAJ_loyalist.14
	title = GOE_RAJ_loyalist.14.t
	desc = GOE_RAJ_loyalist.14.desc
	picture = GFX_report_event_FIN_petsamo_mine
	is_triggered_only = yes

	option = { #YES
		name = GOE_RAJ_loyalist.14.a

		ai_chance = {
			base = 1
		}

		var:288.controller = {
			give_resource_rights = {
				receiver = FROM
				state = 288
				resources = { tungsten }
			}
		}

		hidden_effect = {
			#If this is overlord dealing with BRM resources, and BRM is a player, send them an event so they are aware
			if = {
				limit = {
					var:288.controller = {
						is_subject_of = ROOT
					}
				}
				var:288.controller = { country_event = GOE_RAJ_loyalist.15 }
			}

			#Feedback event to RAJ
			FROM = { country_event = { id = GOE_RAJ_loyalist.16 hours = 4 random_hours = 2 } }
		}
	}

	option = { #NON
		name = GOE_RAJ_loyalist.14.b

		ai_chance = {
			base = 0
		}

		hidden_effect = {
			#Feedback event to RAJ
			FROM = { country_event = { id = GOE_RAJ_loyalist.17 hours = 4 random_hours = 2 } }
		}
	}
}

#Exploit the Frontier - ENG granted resource rights on our Tungsten to the RAJ - Event for puppet BRM (if player) when overlord grants resource rights
country_event = {
	id = GOE_RAJ_loyalist.15
	title = GOE_RAJ_loyalist.15.t
	desc = GOE_RAJ_loyalist.15.desc
	picture = GFX_report_event_FIN_petsamo_mine
	is_triggered_only = yes

	option = { #Bye Bye Tungsten!
		name = GOE_RAJ_loyalist.15.a

		effect_tooltip = {
			give_resource_rights = {
				receiver = RAJ
				state = 288
				resources = { tungsten }
			}
		}
	}
}

#Exploit the Frontier - Resource rights granted! - Event for RAJ
country_event = {
	id = GOE_RAJ_loyalist.16
	title = GOE_RAJ_loyalist.16.t
	desc = GOE_RAJ_loyalist.16.desc
	picture = GFX_report_event_FIN_petsamo_mine
	is_triggered_only = yes

	option = { #Hola Tungsten!
		name = GOE_RAJ_loyalist.16.a

		effect_tooltip = {
			var:288.controller = {
				give_resource_rights = {
					receiver = ROOT
					state = 288
					resources = { tungsten }
				}
			}
		}
	}
}

#Exploit the Frontier - Resource rights denied! - Event for RAJ
country_event = {
	id = GOE_RAJ_loyalist.17
	title = GOE_RAJ_loyalist.17.t
	desc = GOE_RAJ_loyalist.17.desc
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes

	option = { #Hola Tungsten!
		name = GOE_RAJ_loyalist.17.a

	}
}





##########
# FAMINE #
##########

#Brown spot disease
country_event = {
	id = GOE_RAJ_famine.1
	title = GOE_RAJ_famine.1.t	
	desc = GOE_RAJ_famine.1.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	immediate = {
		hidden_effect = {
			country_event = { id =  GOE_RAJ_famine.2 days = 20 random_days = 55 }
		}
	}

	trigger = {
		has_dlc = "Graveyard of Empires"
		has_idea = RAJ_risk_of_famine
		original_tag = RAJ
		any_of_scopes = {
			array =  RAJ.owned_states_at_game_start 
			controller = {
				has_war_with = RAJ
				NOT = { original_tag = RAJ }
				NOT = {
					is_in_array = {
						array = RAJ.raj_releasables
						value = THIS
					}	
				}
				NOT = { is_subject_of = RAJ }
			}
			NOT = { has_state_flag = RAJ_time_to_retake_state_famine }
			NOT = { state = 992 }
		}

	}

	fire_only_once = yes

	mean_time_to_happen = {
	    months = 1
	    days = 10
	}
	option = {
		name = GOE_RAJ_famine.1.a
		add_stability = -0.01
		
	}
}

#Cyclone strikes
country_event = {
	id = GOE_RAJ_famine.2
	title = GOE_RAJ_famine.2.t	
	desc = GOE_RAJ_famine.2.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	fire_only_once = yes
	is_triggered_only = yes
	immediate = {
		hidden_effect = {
			country_event = { id =  GOE_RAJ_famine.3 days = 1 random_days = 55 }
		}
	}

	option = {
		name = GOE_RAJ_famine.2.a
		var:global.famine_state = {
			damage_building = {
				type = industrial_complex 
				damage = 2 # levels of damage 
			}

			damage_building = {
				type = infrastructure 
				damage = 2 # levels of damage 
			}
		}
	}
}

#Unreliable forecasts
country_event = {
	id = GOE_RAJ_famine.3
	title = GOE_RAJ_famine.3.t	
	desc = GOE_RAJ_famine.3.desc	
	picture = GFX_report_event_generic_sign_treaty2
	fire_only_once = yes
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			country_event = { id = GOE_RAJ_famine.4 days = 1 random_days = 55 }
		}
	}


	option = {
		name = GOE_RAJ_famine.3.a
		add_stability = -0.02
		
	}
}

#Provincial Trade Barriers
country_event = {
	id = GOE_RAJ_famine.4
	title = GOE_RAJ_famine.4.t	
	desc = GOE_RAJ_famine.4.desc	
	picture = GFX_report_event_generic_sign_treaty2
    fire_only_once = yes
	immediate = {
		hidden_effect = {
			country_event = { id =  GOE_RAJ_famine.5 days = 1 random_days = 55 }
		}
	}
	
	is_triggered_only = yes


	option = {
		name = GOE_RAJ_famine.4.a
		add_stability = -0.02
		
	}
}

# Price Chaos in [?global.famine_state.GetName]
country_event = {
	id = GOE_RAJ_famine.5
	title = GOE_RAJ_famine.5.t	
	desc = GOE_RAJ_famine.5.desc	
	picture = GFX_report_event_generic_sign_treaty2
	fire_only_once = yes
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			country_event = { id =  GOE_RAJ_famine.6 days = 20 random_days = 55 }
		}
	}
	option = {
		name = GOE_RAJ_famine.5.a
		add_war_support = -0.02
		
	}
}


#"Prioritized Distribution in [?global.famine_state.GetName]"
country_event = {
	id = GOE_RAJ_famine.6
	title = GOE_RAJ_famine.6.t	
	desc = GOE_RAJ_famine.6.desc	
	picture = GFX_report_event_generic_sign_treaty2
	fire_only_once = yes
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			country_event = { id =  GOE_RAJ_famine.7 days = 20 random_days = 55 }
		}
	}

	option = {
		name = GOE_RAJ_famine.6.a
		if = {
			limit = {
				var:global.famine_state = {
					has_resistance = yes
				}
			}

			if = {
				limit = {
					is_ai = yes
				}
				var:global.famine_state = { add_resistance = 5 }
			}
			else = {
				var:global.famine_state = { add_resistance = 30 }
			}
			
		}
		
	}
}


#Famine starts 
country_event = {
	id = GOE_RAJ_famine.7
	title = GOE_RAJ_famine.7.t	
	desc = GOE_RAJ_famine.7.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes
	#fire_only_once = yes
	immediate = {
		set_country_flag = RAJ_famine_has_started
		set_variable = { RAJ_famine_political_power_factor = -0.15 }
		set_variable = { RAJ_famine_stability_factor = -0.15 }
		if = { 
			limit = { NOT = { has_country_flag  = RAJ_famine_has_started } }
			set_country_flag = RAJ_famine_has_started #for easier debugging
		}

		#Amount of times famine can spread
		set_variable_to_random = { 
			var = RAJ_famine_spread_times 
			min = RAJ_famine_spread_times_min # optional 
			max = RAJ_famine_spread_times_max # optional 
			integer = yes
		} 
	}
	option = {

		name = GOE_RAJ_famine.7.a
		unlock_decision_category_tooltip = RAJ_GOE_famine_cat
		if = { #If by some chance the state is lost pre famine or cheesed away, take another one 
			limit = {
				var:global.famine_state = {
					NOT = { is_controlled_by = ROOT }
				}
			}

			random_scope_in_array = {
				array = RAJ.owned_states_at_game_start
				limit = { 
					is_controlled_by = ROOT 
					is_core_of = ROOT
				}
				set_variable = { global.famine_state = THIS }
			}
			
		}


		var:global.famine_state = {
			add_dynamic_modifier = {
				modifier = idea_RAJ_famine_state
			}

			if = {
				limit = { is_core_of = ROOT }

				set_state_flag = pre_famine_core
				remove_core_of = ROOT
				
				if = {
					limit = { has_resistance = no }
					start_resistance = yes
					force_enable_resistance = { 
						clear = no
						occupier = ROOT
						occupied = DIP
					}
				}
				
			}
			add_core_of = DIP
		}

		hidden_effect = {
			calculate_famine_shield_and_risk = yes
			calculate_famine_black_market = yes
		}
		subtract_from_variable = { RAJ_famine_spread_times = 1 }
		ROOT= { add_dynamic_modifier = { modifier = idea_RAJ_famine_country } }
		hidden_effect =  { country_event = { id =  GOE_RAJ_famine.8 days = 30 random_days = 2 } }
		custom_effect_tooltip = GOE_RAJ_famine.7.tt
		
	}
}

#Famine selector 
country_event = {
	id = GOE_RAJ_famine.8
	title = GOE_RAJ_famine.8.t	
	desc = GOE_RAJ_famine.8.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	hidden = yes
	is_triggered_only = yes
	#fire_only_once = yes

	immediate = {
		if = {
			limit = { 
				has_dynamic_modifier = {
				 	modifier = idea_RAJ_famine_country
				 }
				 NOT = { has_country_flag = famine_is_over }
			}
			calculate_famine_shield_and_risk = yes
			random_list = {
				log = no 
				seed = random 

				var:RAJ_famine_shield = {
					#othing happens, preventative measures stopped famine from spreading, reduces the time famine is active
					subtract_from_variable = { RAJ_famine_spread_times = 3 }
					add_to_variable = { RAJ_famine_reduction_from_shield = 3 } #these needs to be the same
					add_to_variable = { RAJ_times_shield_has_blocked_spread = 1 }

					subtract_from_variable = { RAJ_famine_spread_times_max = 3 }
					subtract_from_variable = { RAJ_famine_spread_times_min = 3 }
					

				}
				
				var:RAJ_famine_spreads = {


					subtract_from_variable = { RAJ_famine_spread_times = 1 }
					subtract_from_variable = { RAJ_famine_spread_times_max = 1 }
					subtract_from_variable = { RAJ_famine_spread_times_min = 1 }


					random_state = {
						limit = {
							has_dynamic_modifier = { modifier = idea_RAJ_famine_state }
							 any_neighbor_state = {
							 	NOT = {  has_dynamic_modifier = { modifier = idea_RAJ_famine_state } }
							 }
						}
						random_neighbor_state = {
							limit = {
							 	NOT = {  
			 						has_dynamic_modifier = { modifier = idea_RAJ_famine_state }
							 	}
							}
							if = {
								limit = { is_in_array = { RAJ.owned_states_at_game_start = THIS } }
								add_dynamic_modifier = { modifier = idea_RAJ_famine_state }

								ROOT = {  
									add_to_variable = { RAJ_famine_political_power_factor = -0.1 }
									add_to_variable = { RAJ_famine_stability_factor = -0.1 }
								}

								if = {
									limit = {
										is_core_of = ROOT
									}

									set_state_flag = pre_famine_core
									remove_core_of = ROOT
								}
								add_core_of = DIP
								if = {
									limit = {
										has_resistance = no
									}
									start_resistance = yes
									force_enable_resistance = {
										occupier = ROOT
										occupied = DIP
									}
								}
							}

						}
					}

				}
			}
			calculate_famine_black_market = yes
			if = {
				limit = {
					check_variable = { RAJ_famine_spread_times > 0 }
				}

				hidden_effect =  { country_event = { id =  GOE_RAJ_famine.8 days = 30 random_days = 2 } }
			}
			else = { #end of famine
				every_state = {
					
					if = {
						limit = { has_dynamic_modifier = { modifier = idea_RAJ_famine_state } }
						remove_dynamic_modifier = { modifier = idea_RAJ_famine_state }
					}

				}

				remove_dynamic_modifier = { modifier = idea_RAJ_famine_country }
				country_event = { id = GOE_RAJ_famine.13 hours = 1 }
			}
			
		}
	}
}

#RAJ Asks for Aid
country_event = {
	id = GOE_RAJ_famine.9
	title = GOE_RAJ_famine.9.t	
	desc = GOE_RAJ_famine.9.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes
	#fire_only_once = yes

	#no
	option = {
		name = GOE_RAJ_famine.9.a
		FROM = {
			country_event = { id = GOE_RAJ_famine.10 days = 5 random_days = 4 }

			add_opinion_modifier = {
				target = PREV
				modifier = RAJ_did_not_help_famine
			}
			if = {
				limit = { 
					FROM = { 
						is_subject = yes
						is_subject_of = ROOT 
					} 
				}
				effect_tooltip = { 
					FROM = { 
						add_autonomy_ratio = {  #UPDATE GOE_RAJ_famine.10 if changing
						 	value = 0.1 
						 } 
					} 
				}
			}
		}

		ai_chance = {
			base = 1
			modifier = {
				has_country_leader = {
					character = ENG_winston_churchill 
				}

				factor = 6
			}
		}
	}

	#yes
	option = {
		name = GOE_RAJ_famine.9.b
		add_political_power = 150
		add_equipment_to_stockpile = { 
			type = convoy_1
			amount = -75
			producer = ROOT
		}



		add_timed_idea = {
			idea = idea_RAJ_famine_assistance_to_raj
			days = 365
		}

		FROM = {
			country_event = { id = GOE_RAJ_famine.11 days = 5 random_days = 4 }
			add_opinion_modifier = {
				target = PREV
				modifier = RAJ_did_help_famine
			}
		}



		ai_chance = {
			base = 2
			modifier = {
				OR = {
					original_tag = AUS
					original_tag = IRQ
					is_in_faction_with = FROM
				}
				factor = 3
			}
		}
	}

	#yes but less
	option = {
		name = GOE_RAJ_famine.9.c
		add_political_power = 50
		add_equipment_to_stockpile = { 
			type = convoy_1
			amount = -25
			producer = ROOT
		}

		add_timed_idea = {
			idea = idea_RAJ_famine_assistance_to_raj
			days = 90
		}

		FROM = {
			country_event = { id = GOE_RAJ_famine.12 days = 5 random_days = 4 }
			add_opinion_modifier = {
				target = PREV
				modifier = RAJ_did_help_famine
			}
		}


		ai_chance = {
			base = 3
			modifier = {
				is_in_faction_with = FROM
				original_tag = CAN
				factor = 3
			}
		}
	}

	#yes
}

#FROM refuses
country_event = {
	id = GOE_RAJ_famine.10
	title = GOE_RAJ_famine.10.t	
	desc = GOE_RAJ_famine.10.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes
	option = {
		name = GOE_RAJ_famine.10.a
		if = {
			limit = {
				is_subject = yes
				is_subject_of = FROM
			}
			FROM = {  #update GOE_RAJ_famine.9 if changing
				add_autonomy_ratio = { 
				 	value = 0.1 
				 } 
			} 
		}

	}
}

#FROM delivers big aid
country_event = {
	id = GOE_RAJ_famine.11
	title = GOE_RAJ_famine.11.t	
	desc = GOE_RAJ_famine.11.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes
	option = {
		name = GOE_RAJ_famine.11.a
		add_to_variable = { RAJ_famine_shield = 4 tooltip = RAJ_famine_shield_tt  }
		hidden_effect = { calculate_famine_shield_and_risk = yes }

	}
}

#FROM delivers small aid
country_event = {
	id = GOE_RAJ_famine.12
	title = GOE_RAJ_famine.12.t	
	desc = GOE_RAJ_famine.12.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	is_triggered_only = yes
	option = {
		name = GOE_RAJ_famine.12.a
		add_to_variable = { RAJ_famine_shield = 2 tooltip = RAJ_famine_shield_tt  }
		hidden_effect = { calculate_famine_shield_and_risk = yes }

	}
}

##End of Famine
country_event = {
	id = GOE_RAJ_famine.13
	title = GOE_RAJ_famine.13.t	
	desc = GOE_RAJ_famine.13.desc	
	picture = GFX_report_event_generic_sign_treaty2
	
	immediate = {
		set_country_flag = famine_is_over
	}

	is_triggered_only = yes
	option = {
		name = GOE_RAJ_famine.13.a
		add_stability = 0.1
		every_state = {
			limit = {
				has_state_flag = pre_famine_core
			}
			add_core_of = ROOT
			
			if = {
				limit = {
					is_core_of = DIP
				}
				remove_core_of = DIP
			}
			
		}
	}
}


#taxes
country_event = {
	id = GOE_RAJ_eic.1
	is_triggered_only = yes
	hidden = yes
	immediate = {
		calc_expected_consumer_goods_for_taxes = yes
		country_event = {
			id = GOE_RAJ_eic.1
			days = 12 # optional - can take hours/days/months
		}
	}
}

#pick leader trait
country_event = {
	id = GOE_RAJ_eic.2
	title = GOE_RAJ_eic.2.t	
	desc = GOE_RAJ_eic.2.desc	
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes

	option = {
		name = GOE_RAJ_eic.2.a
		add_country_leader_trait = flexible_industrialist
	}

	option = {
		name = GOE_RAJ_eic.2.b
		add_country_leader_trait = frugal_pennypincher
	}

	option = {
		name = GOE_RAJ_eic.2.c
		add_country_leader_trait = the_government_connection
	}

	option = {
		name = GOE_RAJ_eic.2.d
		add_country_leader_trait = ruthless_tycoon
	}
}

#opium trade
country_event = {
	id = GOE_RAJ_eic.3
	title = GOE_RAJ_eic.3.t	
	desc = GOE_RAJ_eic.3.desc	
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes

	option = {
		name = GOE_RAJ_eic.3.a
		FROM = {
			country_event = { id = GOE_RAJ_eic.4 days = 3 random_days = 2 }
			effect_tooltip = {
				create_wargoal = {
					type = annex_everything
					target = ROOT
				}
			}
		}

		ai_chance = {
			base = 0
			modifier = {
				has_stability < 0.35
				add = 3
			}
		}
	}

	option = {
		name = GOE_RAJ_eic.3.b
		add_ideas = idea_RAJ_permit_opium_trade
		custom_effect_tooltip = RAJ_force_china_to_accept_opium_trade_tt
		if = {
			limit = {
				original_tag = CHI
			}
			FROM = { 
				transfer_state = 743 
				country_event = { id = GOE_RAJ_eic.5 days = 3 random_days = 2 }
			}

		}
		else_if = {
			limit = {
				original_tag = GXC
			}

			FROM = { 
				transfer_state = 591 
				country_event = { id = GOE_RAJ_eic.5 days = 3 random_days = 2 }
			} 
		}
		else = {
			if = {
				limit = {
					controls_state = 743
					owns_state = 743
				}

				FROM = { 
					transfer_state = 743 
					country_event = { id = GOE_RAJ_eic.5 days = 3 random_days = 2 }
				}
			}
		}

		ai_chance = {
			base = 5
			modifier = {
				original_tag = CHI
				NOT = { controls_state = 743 }
				factor = 0
			}

			modifier = {
				original_tag = GXC
				NOT = { controls_state = 591 }
				factor = 0
			}

			modifier = {
				original_tag = GER
				NOT = { controls_state = 743 }
				factor = 0
			}
		}
	}
}


#pick leader trait
country_event = {
	id = GOE_RAJ_eic.4
	title = GOE_RAJ_eic.4.t	
	desc = GOE_RAJ_eic.4.desc	
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes

	option = {
		name = GOE_RAJ_eic.4.a
		create_wargoal = {
			type = annex_everything
			target = FROM
		}
	}
}


country_event = {
	id = GOE_RAJ_eic.5
	title = GOE_RAJ_eic.5.t	
	desc = GOE_RAJ_eic.5.desc	
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes

	option = {
		name = GOE_RAJ_eic.5.a
		hidden_effect = {
			set_global_flag = worldwide_opium_trade #walthu
		}
	}
}

#RAJ wants to buy some land
country_event = {
	id = GOE_RAJ_eic.6
	title = GOE_RAJ_eic.6.t	
	desc = GOE_RAJ_eic.6.desc	
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes

	option = { #not this state
		name = GOE_RAJ_eic.6.a
		hidden_effect = {
			FROM = { clr_country_flag = is_trying_to_buy_land } 
		}

		event_target:RAJ_i_want_to_buy_this_land = {
			set_state_flag = {
				flag = rejected_selling_this_state_to_eic
				days = 120
				value = 1
			}
		}
		clear_global_event_target = RAJ_i_want_to_buy_this_land
		custom_effect_tooltip = GOE_RAJ_eic.6.a_tt
		FROM = { country_event = { id = GOE_RAJ_eic.7 hours = 2 } }
		ai_chance = {
			base = 1
			modifier = {
				event_target:RAJ_i_want_to_buy_this_land = {
					check_variable = { state_strategic_value > 270 }
				}
				factor = 8
			}

			modifier = {
				event_target:RAJ_i_want_to_buy_this_land = {
					check_variable = { state_strategic_value > 200 }
				}
				add = 1
			}

			modifier = {
				event_target:RAJ_i_want_to_buy_this_land = {
					check_variable = { state_strategic_value > 230 }
				}
				add = 1
			}

			modifier = {
				event_target:RAJ_i_want_to_buy_this_land = {
					check_variable = { state_strategic_value > 150 }
				}
				add = 1
			}

			modifier = {
				event_target:RAJ_i_want_to_buy_this_land = {
					check_variable = { state_strategic_value > 100 }
				}
				add = 1
			}

			modifier = {
				event_target:RAJ_i_want_to_buy_this_land = {
					check_variable = { state_strategic_value > 60 }
				}
				factor = 1
			}

			modifier = {
				event_target:RAJ_i_want_to_buy_this_land = {
					check_variable = { state_strategic_value < 60 } #
				}
				factor = 0.7
			}

			modifier = {
				original_tag = RAJ
				factor = 0
			}
		}
	}

	option = { #not ever stop bothering me
		name = GOE_RAJ_eic.6.b

		ai_chance = {
			base = 0
		}

		hidden_effect = {
			set_country_flag = rejected_ever_selling_land_to_eic
			FROM = { 
				clr_country_flag = is_trying_to_buy_land 
			} 
			clear_global_event_target = RAJ_i_want_to_buy_this_land

		}
		custom_effect_tooltip = GOE_RAJ_eic.6.b_tt
		FROM = { country_event = { id = GOE_RAJ_eic.8 hours = 2 } }
	}

	option = { #yes ok
		name = GOE_RAJ_eic.6.c
		if = {
			limit = {
				has_event_target = RAJ_i_want_to_buy_this_land
				event_target:RAJ_i_want_to_buy_this_land = {
					is_in_array = {
						array = RAJ.owned_states_at_game_start
						value = THIS
					}
				}
			}

			add_offsite_building = {
				type = industrial_complex
				level = 1
			}
			RAJ = { hidden_effect = { set_country_flag = use_rebate } }

		}
		else = {
			if = {
				limit = {
					AND = {
						OR = {
							event_target:RAJ_i_want_to_buy_this_land = { has_state_category = wasteland }
							event_target:RAJ_i_want_to_buy_this_land = { has_state_category = enclave }
							event_target:RAJ_i_want_to_buy_this_land = { has_state_category = tiny_island }
						}
						NOT = {
							OR = {
								event_target:RAJ_i_want_to_buy_this_land = { state = 446 }
								event_target:RAJ_i_want_to_buy_this_land = { state = 685 }
							}
						}
					}
				}
				ROOT = { 
					add_offsite_building = {
						type = industrial_complex
						level = 1
					}
				}
			}
			else_if = {
				limit = {
					OR = {
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = pastoral }
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = small_island }
					}
				}
				ROOT = { 
					add_offsite_building = {
						type = industrial_complex
						level = 3
					}
				}
			}
			else_if = {
				limit = {
					event_target:RAJ_i_want_to_buy_this_land = { has_state_category = rural }
				}
				ROOT = { 
					add_offsite_building = {
						type = industrial_complex
						level = 4
					}
				}
			}
			else_if = {
				limit = {
					OR = {
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = town }
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = large_town }
					}
				}
				ROOT = { 
					add_offsite_building = {
						type = industrial_complex
						level = 6
					}
				}
			}
			else_if = {
				limit = {
					OR = {
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = city }
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = large_city }
					}
				}
				ROOT = { 
					add_offsite_building = {
						type = industrial_complex
						level = 8
					}
				}
			}
			else_if = {
				limit = {
					event_target:RAJ_i_want_to_buy_this_land = { has_state_category = metropolis }
				}
				ROOT = { 
					add_offsite_building = {
						type = industrial_complex
						level = 10
					}
				}
			}
			else_if = {
				limit = {
					event_target:RAJ_i_want_to_buy_this_land = { has_state_category = megalopolis }
				}
				ROOT = { 
					add_offsite_building = {
						type = industrial_complex
						level = 15
					}
				}
			}
			else_if = {
				limit = {
					OR = {
						event_target:RAJ_i_want_to_buy_this_land = { state = 446 }
						event_target:RAJ_i_want_to_buy_this_land = { state = 685 }
					}
				}
				ROOT = { 
					add_offsite_building = {
						type = industrial_complex
						level = 8
					}
				}
			}
			else = {
				ROOT = { 
					add_offsite_building = {
						type = industrial_complex
						level = 5
					}
				}
			}
		}

		RAJ = {  
			transfer_state = event_target:RAJ_i_want_to_buy_this_land 
			country_event = { id = GOE_RAJ_eic.9 hours = 2 }

		}
		hidden_effect = {

		}

		ai_chance = {
			base = 2.25
			
		}
	}
}

#Reject buying this state
country_event = {
	id = GOE_RAJ_eic.7
	title = GOE_RAJ_eic.7.t	
	desc = GOE_RAJ_eic.7.desc	
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes

	option = {
		name = GOE_RAJ_eic.7.a
		hidden_effect = {
			clr_country_flag = is_trying_to_buy_land 
		}
	}
}

#RAJ wants to buy some land
country_event = {
	id = GOE_RAJ_eic.8
	title = GOE_RAJ_eic.8.t	
	desc = GOE_RAJ_eic.8.desc	
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	option = {
		name = GOE_RAJ_eic.8.a
		hidden_effect = {
			clr_country_flag = is_trying_to_buy_land 
		}
	}
}

#RAJ wants to buy some land
country_event = {
	id = GOE_RAJ_eic.9
	title = GOE_RAJ_eic.9.t	
	desc = GOE_RAJ_eic.9.desc	
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes

	option = {
		name = GOE_RAJ_eic.9.a
		hidden_effect = {
			clr_country_flag = is_trying_to_buy_land 
		}
		if = {
			limit = {
				RAJ = { has_country_flag = use_rebate }
			}
			

			RAJ = {
				for_loop_effect = {
					end = 1
					value = temp
					random_controlled_state = {
						limit = {
							industrial_complex > 0
							NOT = { state = event_target:RAJ_i_want_to_buy_this_land  }
						}
						remove_building = {
							type = industrial_complex 
							level = 1
						}
					}
				}
			}
		}
		else = {
			if = {
				limit = {
					AND = {
						OR = {
							event_target:RAJ_i_want_to_buy_this_land = { has_state_category = wasteland }
							event_target:RAJ_i_want_to_buy_this_land = { has_state_category = enclave }
							event_target:RAJ_i_want_to_buy_this_land = { has_state_category = tiny_island }
						}
						NOT = {
							OR = {
									event_target:RAJ_i_want_to_buy_this_land = { state = 446 }
									event_target:RAJ_i_want_to_buy_this_land = { state = 685 }
							}
						}
					}
				}
				RAJ = {
					for_loop_effect = {
						end = 1
						value = temp
						random_controlled_state = {
							limit = {
								industrial_complex > 0
								NOT = { state = event_target:RAJ_i_want_to_buy_this_land  }
							}
							remove_building = {
								type = industrial_complex 
								level = 1
							}
						}
					}
				}
			}
			else_if = {
				limit = {
					OR = {
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = pastoral }
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = small_island }
					}
				}
				RAJ = {
					for_loop_effect = {
						end = 3
						value = temp
						random_controlled_state = {
							limit = {
								industrial_complex > 0
								NOT = { state = event_target:RAJ_i_want_to_buy_this_land  }
							}
							remove_building = {
								type = industrial_complex 
								level = 1
							}
						}
					}
				}
			}
			else_if = {
				limit = {
					event_target:RAJ_i_want_to_buy_this_land = { has_state_category = rural }
				}
				RAJ = {
					for_loop_effect = {
						end = 4
						value = temp
						random_controlled_state = {
							limit = {
								industrial_complex > 0
								NOT = { state = event_target:RAJ_i_want_to_buy_this_land  }
							}
							remove_building = {
								type = industrial_complex 
								level = 1
							}
						}
					}
				}
			}
			else_if = {
				limit = {
					OR = {
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = town }
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = large_town }
					}
				}
				RAJ = {
					for_loop_effect = {
						end = 6
						value = temp
						random_controlled_state = {
							limit = {
								industrial_complex > 0
								NOT = { state = event_target:RAJ_i_want_to_buy_this_land  }
							}
							remove_building = {
								type = industrial_complex 
								level = 1
							}
						}
					}
				}
			}
			else_if = {
				limit = {
					OR = {
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = city }
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = large_city }
					}
				}
				RAJ = {
					for_loop_effect = {
						end = 8
						value = temp
						random_controlled_state = {
							limit = {
								industrial_complex > 0
								NOT = { state = event_target:RAJ_i_want_to_buy_this_land  }
							}
							remove_building = {
								type = industrial_complex 
								level = 1
							}
						}
					}
				}
			}
			else_if = {
				limit = {
					event_target:RAJ_i_want_to_buy_this_land = { has_state_category = metropolis }
				}
				RAJ = {
					for_loop_effect = {
						end = 10
						value = temp
						random_controlled_state = {
							limit = {
								industrial_complex > 0
								NOT = { state = event_target:RAJ_i_want_to_buy_this_land  }
							}
							remove_building = {
								type = industrial_complex 
								level = 1
							}
						}
					}
				}
			}
			else_if = {
				limit = {
					OR = {
						event_target:RAJ_i_want_to_buy_this_land = { has_state_category = megalopolis }
					}
				}
				RAJ = {
					for_loop_effect = {
						end = 15
						value = temp
						random_controlled_state = {
							limit = {
								industrial_complex > 0
								NOT = { state = event_target:RAJ_i_want_to_buy_this_land  }
							}
							remove_building = {
								type = industrial_complex 
								level = 1
							}
						}
					}
				}
			}
			else_if = {
				limit = {
					OR = {
						event_target:RAJ_i_want_to_buy_this_land = { state = 446 }
						event_target:RAJ_i_want_to_buy_this_land = { state = 685 }
					}
				}
				RAJ = {
					for_loop_effect = {
						end = 8
						value = temp
						random_controlled_state = {
							limit = {
								industrial_complex > 0
								NOT = { state = event_target:RAJ_i_want_to_buy_this_land  }
							}
							remove_building = {
								type = industrial_complex 
								level = 1
							}
						}
					}
				}
			}
			else = {
				RAJ = {
					for_loop_effect = {
						end = 5
						value = temp
						random_controlled_state = {
							limit = {
								industrial_complex > 0
								NOT = { state = event_target:RAJ_i_want_to_buy_this_land  }
							}
							remove_building = {
								type = industrial_complex 
								level = 1
							}
						}
					}
				}
			}
		}
		hidden_effect = { RAJ = { clr_country_flag = use_rebate } }
		clear_global_event_target = RAJ_i_want_to_buy_this_land
		
		hidden_effect = {
				clr_country_flag = is_trying_to_buy_land 	
		}
		hidden_effect = { controlled_civilian_factories_excluding_trade = yes }
	}
}

#RAJ wants to buy some people
country_event = {
	id = GOE_RAJ_eic.10
	title = GOE_RAJ_eic.10.t	
	desc = GOE_RAJ_eic.10.desc	
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes

	#no
	option = {
		name = GOE_RAJ_eic.10.a
		ai_chance = {
			base = 1
			modifier = {
				industrial_complex > 25
				add = 0.5
			}

			modifier = {
				var:RAJ_wants_to_buy_army_chief = {
					skill > 3
				}
				add = 1
			}

			modifier = {
				var:RAJ_wants_to_buy_army_chief = {
					skill > 4
				}
				add = 5
			}

			modifier = {
				check_variable = { army_leaders^num < 5 }
				add = 10
				is_major = yes
			}

			modifier = {
				check_variable = { army_leaders^num < 3 }
				add = 10
				is_major = no
			}
		}
		FROM = { 
			country_event = { id = GOE_RAJ_eic.11 hours = 2 } 
		}

		var:RAJ_wants_to_buy_army_chief = {
			set_character_flag = RAJ_not_for_sale
		}
		clear_variable = RAJ_wants_to_buy_army_chief

	}

	option = {
		name = GOE_RAJ_eic.10.b
		ai_chance = {
			base = 0
		}
		set_country_flag = RAJ_stop_bothering_me_about_army_leaders
	}

	#ok
	option = {
		name = GOE_RAJ_eic.10.c
		ai_chance = {
			base = 1
			modifier = {
				industrial_complex < 10
				add = 2
			}

			modifier = {
				var:RAJ_wants_to_buy_army_chief = {
					skill < 2
				}
				add = 10
			}

			modifier = {
				var:RAJ_wants_to_buy_army_chief = {
					skill < 3
				}
				add = 5
			}

			modifier = {
				check_variable = { army_leaders^num > 5 }
				add = 10
				is_major = yes
			}

			modifier = {
				check_variable = { army_leaders^num > 3 }
				add = 10
				is_major = no
			}
		}
		add_offsite_building = {
			type = industrial_complex 
			level = 4
		}

		var:RAJ_wants_to_buy_army_chief = {
			set_nationality = FROM
		}
		FROM = { 
			country_event = { id = GOE_RAJ_eic.13 hours = 2 } 
		}

		clear_variable = RAJ_wants_to_buy_army_chief
	}
}

#not this one
country_event = {
	id = GOE_RAJ_eic.11
	title = GOE_RAJ_eic.11.t	
	desc = GOE_RAJ_eic.11.desc	
	is_triggered_only = yes
	option = {
		name = GOE_RAJ_eic.11.a
		add_political_power = 5
		clr_country_flag = is_haggling_for_army_leader	
		hidden_effect = { controlled_civilian_factories_excluding_trade = yes }
	}
}


#stop bothering me
country_event = {
	id = GOE_RAJ_eic.12
	title = GOE_RAJ_eic.12.t	
	desc = GOE_RAJ_eic.12.desc	
	is_triggered_only = yes
	option = {
		name = GOE_RAJ_eic.13.a
		add_political_power = 5
		clr_country_flag = is_haggling_for_army_leader	
		hidden_effect = { controlled_civilian_factories_excluding_trade = yes }
	}
}


country_event = {
	id = GOE_RAJ_eic.13
	title = GOE_RAJ_eic.13.t	
	desc = GOE_RAJ_eic.13.desc	
	is_triggered_only = yes
	option = {
		name = GOE_RAJ_eic.12.a
		add_political_power = 5
		clr_country_flag = is_haggling_for_army_leader	
		every_controlled_state = {
			random_select_amount = 4
			limit = { industrial_complex > 0 }
			remove_building = {
				type = industrial_complex 
				level = 1
			}
		}
		hidden_effect = { controlled_civilian_factories_excluding_trade = yes }
	}
}

# pick a leader - the legacy of babur
country_event = {
	id = GOE_RAJ_princely.1
	title = GOE_RAJ_princely.1.t
	desc = GOE_RAJ_princely.1.desc
	is_triggered_only = yes
	picture = GFX_report_event_indian_soldiers
	option = {
		name = GOE_RAJ_princely.1.a
		HYD = {
			RAJ_mir_osman_ali_khan = {
				set_nationality = RAJ
				set_character_flag = is_mughal_emperor
			}
			promote_character = RAJ_mir_osman_ali_khan
		}	
	}
	option = {
		name = GOE_RAJ_princely.1.b
			RAJ = {
			    add_country_leader_role = {
				    character = RAJ_mirza_khurshid_jah_bahadur
				    promote_leader = yes
				    country_leader = {
				        ideology = despotism
				        expire = "1965.1.1.1"
				        traits = { RAJ_heir_of_the_empire }
				        id=-1
				    }
				}
			}
			#retire_country_leader = yes
	}
	option = {
		name = GOE_RAJ_princely.1.c
		KLT = {
			RAJ_ahmad_yar_khan = {
				set_nationality = RAJ
				set_character_flag = is_mughal_emperor
			}
			promote_character = RAJ_ahmad_yar_khan
		}	
	}
	option = {
		name = GOE_RAJ_princely.1.d
		BAN = {
			RAJ_huseyn_shaheed_suhrawardy = {
				set_nationality = RAJ
				set_character_flag = is_mughal_emperor
			}
			promote_character = RAJ_huseyn_shaheed_suhrawardy
		}	
	}
}

country_event = {
	id = GOE_RAJ_princely.2
	title = GOE_RAJ_princely.2.t
	desc = GOE_RAJ_princely.2.desc
	is_triggered_only = yes
	picture = GFX_report_event_indian_soldiers
	option = {
		name = GOE_RAJ_princely.2.a
		BAN = {
			RAJ_huseyn_shaheed_suhrawardy = {
				set_nationality = RAJ
				set_character_flag = is_mughal_emperor
			}
			promote_character = RAJ_huseyn_shaheed_suhrawardy
		}	
	}
	#option = {
	#	name = GOE_RAJ_princely.2.b
	#	KAS = {
	#		RAJ_maharaja_hari_singh = {
	#			set_nationality = RAJ
	#			set_character_flag = is_mughal_emperor
	#		}
	#		promote_character = RAJ_maharaja_hari_singh
	#	}	
	#}
	#option = {
	#	name = GOE_RAJ_princely.2.c
	#	MPU = {
	#		RAJ_bodh_chandra_singh = {
	#			set_nationality = RAJ
	#			set_character_flag = is_mughal_emperor
	#		}
	#		promote_character = RAJ_bodh_chandra_singh
	#	}	
	#}
	option = {
		name = GOE_RAJ_princely.2.d
		ROOT = {
			country_event = { id = GOE_RAJ_princely.1 }
		}
	}
}

#country_event = {
#	id = GOE_RAJ_princely.3
#	title = GOE_RAJ_princely.3.t
#	desc = GOE_RAJ_princely.3.desc
#	is_triggered_only = yes
#	picture = GFX_report_event_indian_soldiers
	#option = {
	#	name = GOE_RAJ_princely.3.a
	#	RJP = {
	#		RAJ_umed_singh = {
	#			set_nationality = RAJ
	#			set_character_flag = is_mughal_emperor
	#		}
	#		promote_character = RAJ_umed_singh
	#	}	
	#}
	#option = {
	#	name = GOE_RAJ_princely.3.b
	#	WIS = {
	#		RAJ_pratap_singh_rao_gaekwad = {
	#			set_nationality = RAJ
	#			set_character_flag = is_mughal_emperor
	#		}
	#		promote_character = RAJ_pratap_singh_rao_gaekwad
	#	}	
	#}
	#option = {
	#	name = GOE_RAJ_princely.3.c
	#	MYS = {
	#		RAJ_maharaja_jayachamarajendra_wadiyar = {
	#			set_nationality = RAJ
	#			set_character_flag = is_mughal_emperor
	#		}
	#		promote_character = RAJ_maharaja_jayachamarajendra_wadiyar
	#	}	
	#}
#	option = {
#		name = GOE_RAJ_princely.3.d
#		ROOT = {
#			country_event = { id = GOE_RAJ_princely.1 }
#		}
#	}
#}


# (RAJ) proposes naval agreement
country_event = {
	id = GOE_RAJ_navy.1
	picture = GFX_report_event_generic_read_write
	title = GOE_RAJ_navy.1.t
	desc = GOE_RAJ_navy.1.desc
	is_triggered_only = yes
	option = { #yes
		name = GOE_RAJ_navy.1.a

		ai_chance = {
			base = 0.9
		}

		ENG = {
			add_ideas = RAJ_british_naval_agreement
		}
		RAJ = {
			add_ideas = RAJ_british_naval_agreement
			country_event = { id = GOE_RAJ_navy.2 days = 1 }
		}
	}
	option = { #no
		name = GOE_RAJ_navy.1.b

		ai_chance = {
			base = 0.1
		}

		RAJ = {
			country_event = { id = GOE_RAJ_navy.3 days = 1 }
		}
	}
}


# (ENG) accepts!
country_event = {
	id = GOE_RAJ_navy.2
	picture = GFX_report_event_generic_sign_treaty2
	title = GOE_RAJ_navy.2.t
	desc = GOE_RAJ_navy.2.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_navy.2.a
		effect_tooltip = {
			add_ideas = RAJ_british_naval_agreement
			ENG = { add_ideas = RAJ_british_naval_agreement }
		}
	}
}
# (ENG) rejects!
country_event = {
	id = GOE_RAJ_navy.3
	picture = GFX_report_event_generic_read_write
	title = GOE_RAJ_navy.3.t
	desc = GOE_RAJ_navy.3.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_navy.3.a
	}
}

# (RAJ) requests transfer of british commanders
country_event = {
	id = GOE_RAJ_navy.4
	picture = GFX_report_event_british_inspect_troops
	title = GOE_RAJ_navy.4.t
	desc = GOE_RAJ_navy.4.desc
	is_triggered_only = yes
	option = { #yes
		name = GOE_RAJ_navy.4.a

		random_navy_leader = {
			limit = {
				skill < 4
			}
			set_nationality = RAJ
			set_character_flag = transfered_commander_raj_navy
		}

		add_political_power = 200
		add_cic = 1500

		ai_chance = {
			base = 0.7
		}

		RAJ = {
			country_event = { id = GOE_RAJ_navy.5 days = 1}
		}

	}
	option = { #no
		name = GOE_RAJ_navy.4.b

		ai_chance = {
			base = 0.3
		}

		RAJ = {
			country_event = { id = GOE_RAJ_navy.6 days = 1}
		}

	}
}

# (ENG) accepts!
country_event = {
	id = GOE_RAJ_navy.5
	picture = GFX_report_event_generic_sign_treaty2
	title = GOE_RAJ_navy.5.t
	desc = GOE_RAJ_navy.5.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_navy.5.a

		RAJ = {
			effect_tooltip = {
				every_navy_leader = {
					limit = {
						has_character_flag = transfered_commander_raj_navy
					}
				}
				custom_effect_tooltip = GOE_RAJ_transfered_commander_tt
			}
		}

	}
}
# (ENG) rejects!
country_event = {
	id = GOE_RAJ_navy.6
	picture = GFX_report_event_generic_read_write
	title = GOE_RAJ_navy.6.t
	desc = GOE_RAJ_navy.6.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_navy.6.a
	}
}

# (RAJ) proposes purchasing decommissioned ships
country_event = {
	id = GOE_RAJ_navy.7
	picture = GFX_report_event_usa_destroyers
	title = GOE_RAJ_navy.7.t
	desc = GOE_RAJ_navy.7.desc
	is_triggered_only = yes
	option = { #yes
		name = GOE_RAJ_navy.7.a

		ai_chance = {
			base = 0.9
		}

		if = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ENG = {
				add_cic = 2000
				create_equipment_variant = {
					name="C Class Calcutta"
					type = ship_hull_cruiser_1
					modules={
						fixed_ship_engine_slot=cruiser_ship_engine_1
						mid_1_custom_slot=ship_light_medium_battery_1
						fixed_ship_battery_slot=ship_light_battery_1
						fixed_ship_fire_control_system_slot=ship_fire_control_system_1
					}
				}
			}

			RAJ = {
				create_ship = {
					type = ship_hull_cruiser_1
					equipment_variant = "C Class Calcutta"
					creator = ENG
					name = "C Class Calcutta"
				}
				create_ship = {
					type = ship_hull_cruiser_1
					equipment_variant = "C Class Calcutta"
					creator = ENG
					name = "C Class Calcutta"
				}
				create_ship = {
					type = ship_hull_cruiser_1
					equipment_variant = "C Class Calcutta"
					creator = ENG
					name = "C Class Calcutta"
				}
				create_ship = {
					type = ship_hull_cruiser_1
					equipment_variant = "C Class Calcutta"
					creator = ENG
					name = "C Class Calcutta"
				}
				country_event = { id = GOE_RAJ_navy.8 days = 1 }
			}
		}
		else = {
			ENG = {
				add_cic = 2000
				create_equipment_variant = {
					name="C Class Calcutta"
					type = light_cruiser_1
					modules= {
						fixed_ship_anti_air_slot=ship_anti_air_1
						fixed_ship_engine_slot=cruiser_ship_engine_1
						mid_1_custom_slot=ship_torpedo_1
						mid_2_custom_slot=ship_anti_air_1
						rear_1_custom_slot=ship_light_medium_battery_1
						fixed_ship_battery_slot=ship_light_medium_battery_1
						fixed_ship_fire_control_system_slot=ship_fire_control_system_0
					}
				}
			}

			RAJ = {
				create_ship = {
					type = light_cruiser_1
					equipment_variant = "C Class Calcutta"
					creator = ENG
					name = "C Class Calcutta"
				}
				create_ship = {
					type = light_cruiser_1
					equipment_variant = "C Class Calcutta"
					creator = ENG
					name = "C Class Calcutta"
				}
				create_ship = {
					type = light_cruiser_1
					equipment_variant = "C Class Calcutta"
					creator = ENG
					name = "C Class Calcutta"
				}
				create_ship = {
					type = light_cruiser_1
					equipment_variant = "C Class Calcutta"
					creator = ENG
					name = "C Class Calcutta"
				}
				country_event = { id = GOE_RAJ_navy.8 days = 1 }
			}
		}

	}
	option = { #no
		name = GOE_RAJ_navy.7.b

		ai_chance = {
			base = 0.1
		}

		RAJ = {
			country_event = { id = GOE_RAJ_navy.9 days = 1 }
		}
	}
}

# (ENG) accepts!
country_event = {
	id = GOE_RAJ_navy.8
	picture = GFX_report_event_generic_sign_treaty2
	title = GOE_RAJ_navy.8.t
	desc = GOE_RAJ_navy.8.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_navy.8.a

		effect_tooltip = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				ENG = {
					add_cic = 2000
					create_equipment_variant = {
						name="C Class Calcutta"
						type = ship_hull_cruiser_1
						modules={
							fixed_ship_engine_slot=cruiser_ship_engine_1
							mid_1_custom_slot=ship_light_medium_battery_1
							fixed_ship_battery_slot=ship_light_battery_1
							fixed_ship_fire_control_system_slot=ship_fire_control_system_1
						}
					}
				}

				RAJ = {
					create_ship = {
						type = ship_hull_cruiser_1
						equipment_variant = "C Class Calcutta"
						creator = ENG
						name = "C Class Calcutta"
					}
					create_ship = {
						type = ship_hull_cruiser_1
						equipment_variant = "C Class Calcutta"
						creator = ENG
						name = "C Class Calcutta"
					}
					create_ship = {
						type = ship_hull_cruiser_1
						equipment_variant = "C Class Calcutta"
						creator = ENG
						name = "C Class Calcutta"
					}
					create_ship = {
						type = ship_hull_cruiser_1
						equipment_variant = "C Class Calcutta"
						creator = ENG
						name = "C Class Calcutta"
					}
					country_event = { id = GOE_RAJ_navy.8 days = 1 }
				}
			}
			else = {
				ENG = {
					add_cic = 2000
					create_equipment_variant = {
						name="C Class Calcutta"
						type = light_cruiser_1
						modules= {
							fixed_ship_anti_air_slot=ship_anti_air_1
							fixed_ship_engine_slot=cruiser_ship_engine_1
							mid_1_custom_slot=ship_torpedo_1
							mid_2_custom_slot=ship_anti_air_1
							rear_1_custom_slot=ship_light_medium_battery_1
							fixed_ship_battery_slot=ship_light_medium_battery_1
							fixed_ship_fire_control_system_slot=ship_fire_control_system_0
						}
					}
				}

				RAJ = {
					create_ship = {
						type = light_cruiser_1
						equipment_variant = "C Class Calcutta"
						creator = ENG
						name = "C Class Calcutta"
					}
					create_ship = {
						type = light_cruiser_1
						equipment_variant = "C Class Calcutta"
						creator = ENG
						name = "C Class Calcutta"
					}
					create_ship = {
						type = light_cruiser_1
						equipment_variant = "C Class Calcutta"
						creator = ENG
						name = "C Class Calcutta"
					}
					create_ship = {
						type = light_cruiser_1
						equipment_variant = "C Class Calcutta"
						creator = ENG
						name = "C Class Calcutta"
					}
					country_event = { id = GOE_RAJ_navy.8 days = 1 }
				}
			}
		}
	}
}
# (ENG) rejects!
country_event = {
	id = GOE_RAJ_navy.9
	picture = GFX_report_event_generic_read_write
	title = GOE_RAJ_navy.9.t
	desc = GOE_RAJ_navy.9.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_navy.9.a
	}
}

# (RAJ) obtain modern ship contracts
country_event = {
	id = GOE_RAJ_navy.10
	picture = GFX_report_event_usa_british_sailors_destroyers
	title = GOE_RAJ_navy.10.t
	desc = GOE_RAJ_navy.10.desc
	is_triggered_only = yes
	option = { #yes
		name = GOE_RAJ_navy.10.a

		ai_chance = {
			base = 0.9
		}

		if = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ENG = {
				add_cic = 3000
				create_equipment_variant = {
					name="S Class Calcutta"
					type = ship_hull_cruiser_2
					modules={
						fixed_ship_engine_slot=cruiser_ship_engine_2
						front_1_custom_slot=ship_light_medium_battery_1
						mid_1_custom_slot=ship_light_battery_1
						fixed_ship_battery_slot=ship_light_medium_battery_1
						fixed_ship_fire_control_system_slot=ship_fire_control_system_1
					}
				}
			}

			RAJ = {

				create_ship = {
					type = ship_hull_cruiser_2
					equipment_variant = "S Class Calcutta"
					creator = ENG
					name = "S Class Calcutta"
				}
				create_ship = {
					type = ship_hull_cruiser_2
					equipment_variant = "S Class Calcutta"
					creator = ENG
					name = "S Class Calcutta"
				}
				create_ship = {
					type = ship_hull_cruiser_2
					equipment_variant = "S Class Calcutta"
					creator = ENG
					name = "S Class Calcutta"
				}
				create_ship = {
					type = ship_hull_cruiser_2
					equipment_variant = "S Class Calcutta"
					creator = ENG
					name = "S Class Calcutta"
				}
				create_ship = {
					type = ship_hull_cruiser_2
					equipment_variant = "S Class Calcutta"
					creator = ENG
					name = "S Class Calcutta"
				}
				country_event = { id = GOE_RAJ_navy.11 days = 1 }
			}
		}

		else = {
			ENG = {
				add_cic = 3000
				create_equipment_variant = {
					name="S Class Calcutta"
					type = light_cruiser_2
					modules = {
						fixed_ship_anti_air_slot=ship_anti_air_3
						fixed_ship_engine_slot=cruiser_ship_engine_2
						mid_1_custom_slot=ship_torpedo_2
						mid_2_custom_slot=ship_anti_air_3
						rear_1_custom_slot=ship_light_medium_battery_2
						fixed_ship_battery_slot=ship_light_medium_battery_2
						fixed_ship_fire_control_system_slot=ship_fire_control_system_0
					}
				}
			}

			RAJ = {

				create_ship = {
					type = light_cruiser_2
					equipment_variant = "S Class Calcutta"
					creator = ENG
					name = "S Class Calcutta"
				}
				create_ship = {
					type = light_cruiser_2
					equipment_variant = "S Class Calcutta"
					creator = ENG
					name = "S Class Calcutta"
				}
				create_ship = {
					type = light_cruiser_2
					equipment_variant = "S Class Calcutta"
					creator = ENG
					name = "S Class Calcutta"
				}
				create_ship = {
					type = light_cruiser_2
					equipment_variant = "S Class Calcutta"
					creator = ENG
					name = "S Class Calcutta"
				}
				create_ship = {
					type = light_cruiser_2
					equipment_variant = "S Class Calcutta"
					creator = ENG
					name = "S Class Calcutta"
				}
				country_event = { id = GOE_RAJ_navy.11 days = 1 }
			}
		}
	}
	option = { #no
		name = GOE_RAJ_navy.10.b

		ai_chance = {
			base = 0.1
		}

		RAJ = {
			country_event = { id = GOE_RAJ_navy.12 days = 1 }
		}
	}
}

# (ENG) accepts!
country_event = {
	id = GOE_RAJ_navy.11
	picture = GFX_report_event_generic_sign_treaty2
	title = GOE_RAJ_navy.11.t
	desc = GOE_RAJ_navy.11.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_navy.11.a

		effect_tooltip = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				ENG = {
					add_cic = 3000
					create_equipment_variant = {
						name="S Class Calcutta"
						type = ship_hull_cruiser_2
						modules={
							fixed_ship_engine_slot=cruiser_ship_engine_2
							front_1_custom_slot=ship_light_medium_battery_1
							mid_1_custom_slot=ship_light_battery_1
							fixed_ship_battery_slot=ship_light_medium_battery_1
							fixed_ship_fire_control_system_slot=ship_fire_control_system_1
						}
					}
				}

				RAJ = {

					create_ship = {
						type = ship_hull_cruiser_2
						equipment_variant = "S Class Calcutta"
						creator = ENG
						name = "S Class Calcutta"
					}
					create_ship = {
						type = ship_hull_cruiser_2
						equipment_variant = "S Class Calcutta"
						creator = ENG
						name = "S Class Calcutta"
					}
					create_ship = {
						type = ship_hull_cruiser_2
						equipment_variant = "S Class Calcutta"
						creator = ENG
						name = "S Class Calcutta"
					}
					create_ship = {
						type = ship_hull_cruiser_2
						equipment_variant = "S Class Calcutta"
						creator = ENG
						name = "S Class Calcutta"
					}
					create_ship = {
						type = ship_hull_cruiser_2
						equipment_variant = "S Class Calcutta"
						creator = ENG
						name = "S Class Calcutta"
					}
					country_event = { id = GOE_RAJ_navy.11 days = 1 }
				}
			}

			else = {
				ENG = {
					add_cic = 3000
					create_equipment_variant = {
						name="S Class Calcutta"
						type = light_cruiser_2
						modules = {
							fixed_ship_anti_air_slot=ship_anti_air_3
							fixed_ship_engine_slot=cruiser_ship_engine_2
							mid_1_custom_slot=ship_torpedo_2
							mid_2_custom_slot=ship_anti_air_3
							rear_1_custom_slot=ship_light_medium_battery_2
							fixed_ship_battery_slot=ship_light_medium_battery_2
							fixed_ship_fire_control_system_slot=ship_fire_control_system_0
						}
					}
				}

				RAJ = {

					create_ship = {
						type = light_cruiser_2
						equipment_variant = "S Class Calcutta"
						creator = ENG
						name = "S Class Calcutta"
					}
					create_ship = {
						type = light_cruiser_2
						equipment_variant = "S Class Calcutta"
						creator = ENG
						name = "S Class Calcutta"
					}
					create_ship = {
						type = light_cruiser_2
						equipment_variant = "S Class Calcutta"
						creator = ENG
						name = "S Class Calcutta"
					}
					create_ship = {
						type = light_cruiser_2
						equipment_variant = "S Class Calcutta"
						creator = ENG
						name = "S Class Calcutta"
					}
					create_ship = {
						type = light_cruiser_2
						equipment_variant = "S Class Calcutta"
						creator = ENG
						name = "S Class Calcutta"
					}
					country_event = { id = GOE_RAJ_navy.11 days = 1 }
				}
			}
		}
	}
}
# (ENG) rejects!
country_event = {
	id = GOE_RAJ_navy.12
	picture = GFX_report_event_generic_read_write
	title = GOE_RAJ_navy.12.t
	desc = GOE_RAJ_navy.12.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_navy.12.a
	}
}

# India demands goa
country_event = {
	id = GOE_RAJ_goa.1
	picture = GFX_report_event_generic_military_parade
	title = GOE_RAJ_goa.1.t
	desc = GOE_RAJ_goa.1.desc
	is_triggered_only = yes
	option = { # give them
		name = GOE_RAJ_goa.1.a
		RAJ = {
			country_event = { id = GOE_RAJ_goa.2 days = 1 }
			321 = {
				transfer_state_to = RAJ
			}
		}
	}
	option = { # dont
		name = GOE_RAJ_goa.1.b
		RAJ = {
			country_event = { id = GOE_RAJ_goa.3 days = 1 }
		}
		effect_tooltip = {
			RAJ = {
				create_wargoal = {
					type = take_claimed_state
					target = POR
					generator = { 321 }
				}
			}
		}
	}
}

# portugal releases goa
country_event = {
	id = GOE_RAJ_goa.2
	picture = GFX_report_event_generic_sign_treaty3
	title = GOE_RAJ_goa.2.t
	desc = GOE_RAJ_goa.2.desc
	is_triggered_only = yes
	option = { # yay
		name = GOE_RAJ_goa.2.a
		effect_tooltip = {
			321 = {
				transfer_state_to = RAJ
			}
		}
	}
}

# portugal refuses
country_event = {
	id = GOE_RAJ_goa.3
	picture = GFX_report_event_generic_sign_treaty3
	title = GOE_RAJ_goa.3.t
	desc = GOE_RAJ_goa.3.desc
	is_triggered_only = yes
	option = { # this means war!
		name = GOE_RAJ_goa.3.a
		RAJ = {
			create_wargoal = {
				type = take_claimed_state
				target = POR
				generator = { 321 }
			}
		}
	}
}

### GOE_RAJ_generals

# colonial cadet exchange request - RAJ->ENG
country_event = {
	id = GOE_RAJ_generals.1
	picture = GFX_report_event_indian_soldiers
	title = GOE_RAJ_generals.1.t
	desc = GOE_RAJ_generals.1.desc
	is_triggered_only = yes
	option = { # yes
		name = GOE_RAJ_generals.1.a

		ai_chance = {
			base = 0.9
		}

		ENG = {
			add_political_power = 200
		}

		custom_effect_tooltip = newline_tt

		RAJ = {
			country_event = { id = GOE_RAJ_generals.2 days = 1 }
			add_manpower = -100000
			add_timed_idea = {
			 	idea = idea_RAJ_soldiers_training_in_britain
			 	days = 365
			 }
            custom_effect_tooltip = RAJ_colonial_cadet_exchange_tt
			effect_tooltip = {
	            effect_tooltip = {
                    division_template = {
                        name = "Royal Indian Infantry"
                        is_locked = yes
                        support={
                            artillery={ x=0 y=0 }
                            recon={ x=0 y=1 }
                        }
                        regiments={
                            infantry={ x=0 y=0 }
                            infantry={ x=0 y=1 }
                            infantry={ x=0 y=2 }
                            infantry={ x=1 y=0 }
                            infantry={ x=1 y=1 }
                            infantry={ x=1 y=2 }
                            infantry={ x=2 y=0 }
                            infantry={ x=2 y=1 }
                            infantry={ x=2 y=2 }
                        }
                    }

                    random_core_state = {
                        prioritize = { 439 }
                        create_unit = {
                            division = "name = \"Royal Indian Infantry\" division_template = \"Royal Indian Infantry\" start_experience_factor = 0.7 start_equipment_factor = 1.0 start_manpower_factor = 1.0"
                            owner = RAJ
                            allow_spawning_on_enemy_provs = no 
                            count = 10
                        }
                    }
	            }
			}
		}
	}
	option = { # no
		name = GOE_RAJ_generals.1.b

		ai_chance = {
			base = 0.1
		}

		RAJ = {
			country_event = { id = GOE_RAJ_generals.3 days = 1 }
		}
	}
}

# colonial cadet exchange response yes - ENG->RAJ
country_event = {
	id = GOE_RAJ_generals.2
	picture = GFX_report_event_generic_sign_treaty2
	title = GOE_RAJ_generals.2.t
	desc = GOE_RAJ_generals.2.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_generals.2.a
		effect_tooltip = {
			add_timed_idea = {
			 	idea = idea_RAJ_soldiers_training_in_britain
			 	days = 365
			 }
		}
	}
}

# colonial cadet exchange response no ENG->RAJ
country_event = {
	id = GOE_RAJ_generals.3
	picture = GFX_report_event_generic_read_write
	title = GOE_RAJ_generals..t
	desc = GOE_RAJ_generals.3.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_generals.2.a
	}
}

# join the shadow scheme request - RAJ->ENG
#country_event = {
#	id = GOE_RAJ_generals.4
#	picture = GFX_report_event_generic_factory
#	title = GOE_RAJ_generals.4.t
#	desc = GOE_RAJ_generals.4.desc
#	is_triggered_only = yes
#	option = { # yes
#		name = GOE_RAJ_generals.4.a
#
#		ai_chance = {
#			base = 0.9
#		}
#
#		RAJ = {
#			country_event = { id = GOE_RAJ_generals.5 days = 1 }
#		}
#	}
#	option = { # no
#		name = GOE_RAJ_generals.4.b
#
#		ai_chance = {
#			base = 0.1
#		}
#
#		RAJ = {
#			country_event = { id = GOE_RAJ_generals.6 days = 1 }
#		}
#	}
#}
#
## join the shadow scheme response yes - ENG->RAJ
#country_event = {
#	id = GOE_RAJ_generals.5
#	picture = GFX_report_event_generic_sign_treaty2
#	title = GOE_RAJ_generals.5.t
#	desc = GOE_RAJ_generals.5.desc
#	is_triggered_only = yes
#	option = { #ok
#		name = GOE_RAJ_generals.2.a
#	}
#}
#
## join the shadow scheme response no ENG->RAJ
#country_event = {
#	id = GOE_RAJ_generals.6
#	picture = GFX_report_event_generic_read_write
#	title = GOE_RAJ_generals.6.t
#	desc = GOE_RAJ_generals.6.desc
#	is_triggered_only = yes
#	option = { #ok
#		name = GOE_RAJ_generals.2.a
#	}
#}

# purchase british supply equipment request - RAJ->ENG
country_event = {
	id = GOE_RAJ_generals.7
	picture = GFX_report_event_generic_truck
	title = GOE_RAJ_generals.7.t
	desc = GOE_RAJ_generals.7.desc
	is_triggered_only = yes
	option = { # yes
		name = GOE_RAJ_generals.7.a

		ai_chance = {
			base = 0.9
		}

		ENG = {
			add_political_power = 150
			add_cic = 5000
		}

		RAJ = {
			country_event = { id = GOE_RAJ_generals.8 days = 1 }
			add_equipment_to_stockpile = { 
				type = motorized_equipment
				amount = 1000
				producer = ENG
			}
			add_equipment_to_stockpile = { 
				type = train_equipment
				amount = 10
				producer = ENG
			}
			add_equipment_to_stockpile = { 
				type = support_equipment
				amount = 1000
				producer = ENG
			}

		}
	}
}

# purchase british supply equipment response yes - ENG->RAJ
country_event = {
	id = GOE_RAJ_generals.8
	picture = GFX_report_event_generic_sign_treaty2
	title = GOE_RAJ_generals.8.t
	desc = GOE_RAJ_generals.8.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_generals.2.a

		effect_tooltip = {
			RAJ = {
				add_equipment_to_stockpile = { 
					type = motorized_equipment_1
					amount = 600
					producer = ENG
				}
				add_equipment_to_stockpile = { 
					type = train_equipment
					amount = 10
					producer = ENG
				}
				add_equipment_to_stockpile = { 
					type = support_equipment
					amount = 500
					producer = ENG
				}
			}
		}
	}
}

# purchase british supply equipment response no ENG->RAJ
country_event = {
	id = GOE_RAJ_generals.9
	picture = GFX_report_event_generic_read_write
	title = GOE_RAJ_generals.9.t
	desc = GOE_RAJ_generals.9.desc
	is_triggered_only = yes
	option = { #ok
		name = GOE_RAJ_generals.2.a
	}
}

country_event = {
	id = GOE_RAJ_mughals_peace_deal.1
	picture = GFX_report_event_generic_read_write
	title = GOE_RAJ_mughals_peace_deal.1.t
	desc = GOE_RAJ_mughals_peace_deal.1.desc
	is_triggered_only = yes
	fire_only_once = yes
	option = { #ok
		name = GOE_RAJ_mughals_peace_deal.1.a
		every_enemy_country = {
			limit = { 
				OR = {
					original_tag = ENG
					is_in_faction_with = ENG
					has_country_flag = RAJ_mughal_was_in_faction_with_eng
					original_tag = RAJ
				}
			}
			white_peace = ROOT
		}
		IF = {
			limit = {
				RAJ = { has_country_flag = RAJ_mughal_captured_states }
			}
			event_target:UK_INDIA = {
				every_owned_state = {
					limit = {
						OR = {
							state = 440
							state = 986
							state = 439
							state = 441
							state = 787
						}
					}
					transfer_state_to = RAJ
					add_core_of = RAJ
				}
			}
		}

		every_state = {	
			limit = {
				has_state_flag = RAJ_mughal_captured_states
			}
			transfer_state_to = RAJ
			add_core_of = RAJ
		}
	}
}
