je_british_takeover = {
	icon = "gfx/interface/icons/event_icons/event_industry.dds"
	group = je_group_historical_content
		
	is_shown_when_inactive = {
				exists = c:BIC
				c:BIC = THIS
	}

	possible = {
		OR = {
			has_law = law_type:law_free_trade
			has_law = law_type:law_mercantilism
			NOT = { has_law = law_type:law_land_based_taxation }
			NOT = { has_law = law_type:law_serfdom }
		}
	}
	
	scripted_button = bic_loans_button
	
	on_monthly_pulse = {
		
		random_events = {
			100 = 0
			90 = 01_india_events.2 #New Direction
			1 = 01_india_events.3 #Corporate Corruption
			1 = 01_india_events.4 #Merchant Ships Sink
			1 = 01_india_events.5 #London Aghast
			1 = 01_india_events.6 #Stocks Down
					}
	}
	
	complete = {	
		scope:journal_entry = {
			is_goal_complete = yes  
			}
		NOT = {
			has_modifier = bic_bailout_modifier
			#has_modifier = sepoy_modifier
			}
		
		}			
	

	on_complete = {
			add_loyalists = {
			pop_type = capitalists
			value = 0.2
			}
			if = {
			c:GBR = {
			limit = {
				has_diplomatic_pact = {
					who = c:BIC
					type = dominion
				}
			}
			hidden_effect = {
				remove_diplomatic_pact = {
					country = c:BIC
					type = dominion
				}
			}
			create_diplomatic_pact = {
				country = c:BIC
				type = protectorate
				}
			}
		}
			add_journal_entry = { type = je_company_independence }			
			
	}

	
		
	fail = {
		OR = {
		custom_tooltip = {
			text = bic_uprising_tt	
				c:GBR = {
				has_variable = british_raj_var
				}
			}
		has_modifier = declared_bankruptcy
		
		}
	}
	
	on_fail = {
	custom_tooltip = historical_tt
	remove_modifier = uf_company_modifier
	if = {
			limit = {
				exists = c:GBR
				is_subject_of = c:GBR
				c:GBR = {
					is_country_alive = yes
					NOT = { has_variable = british_raj_var }
				}
			}
			c:GBR = {
				trigger_event = { id = raj.1 days = 0 popup = yes }
			}
		}
		hidden_effect = {
			every_scope_state = {
				limit = {
					owner = ROOT
					has_variable = bic_incorporated_state
				}
				set_state_type = incorporated
				remove_variable = bic_incorporated_state
			}
		}
	}
	
	invalid = {
		remove_modifier = uf_company_modifier
		has_variable = bic_collapse_var
		c:GBR = {
		has_variable = british_raj_var
			}
	}
	
	current_value = {
		value = root.gdp
	}

	goal_add_value = {
		value = root.gdp
		#multiply = 0.5
	}
	
	progressbar = yes

	weight = 1000
	
	should_be_pinned_by_default = yes
}


je_company_independence = {
	icon = "gfx/interface/icons/event_icons/waving_flag.dds"
	group = je_group_historical_content
		
	
	scripted_button = indian_equality_button
	scripted_button = push_for_independance_button

	complete = {			
		is_subject = no
	}
	
	on_monthly_pulse = {
		
		random_events = {
			100 = 0
			90 = 01_india_events.2 #New Direction
			1 = 01_india_events.3 #Corporate Corruption
			1 = 01_india_events.4 #Merchant Ships Sink
			1 = 01_india_events.5 #London Aghast
			1 = 01_india_events.6 #Stocks Down
					}
	}
	
	on_complete = {
		
		s:STATE_HOME_COUNTIES = { 
			if = {
				limit = {
					any_scope_state = {
						 NOT = {
							owner = ROOT
						}
					}
				}
				add_claim = ROOT 
			}
		}
		s:STATE_LANCASHIRE = { 
			if = {
				limit = {
					any_scope_state = {
						 NOT = {
							owner = ROOT
						}
					}
				}
				add_claim = ROOT 
			}
		}
		s:STATE_MIDLANDS = { 
			if = {
				limit = {
					any_scope_state = {
						 NOT = {
							owner = ROOT
						}
					}
				}
				add_claim = ROOT 
			}
		}
		s:STATE_EAST_ANGLIA = { 
			if = {
				limit = {
					any_scope_state = {
						 NOT = {
							owner = ROOT
						}
					}
				}
				add_claim = ROOT 
			}
		}
		s:STATE_WEST_COUNTRY = { 
			if = {
				limit = {
					any_scope_state = {
						 NOT = {
							owner = ROOT
						}
					}
				}
				add_claim = ROOT 
			}
		}
		s:STATE_YORKSHIRE = { 
			if = {
				limit = {
					any_scope_state = {
						 NOT = {
							owner = ROOT
						}
					}
				}
				add_claim = ROOT 
			}
		}
			
		
	}
	
	invalid = {
		has_variable = bic_collapse_var
		has_variable = british_raj_var
	}
	
	weight = 100
	
	should_be_pinned_by_default = yes
}

je_kingly_state = {
	icon = "gfx/interface/icons/event_icons/waving_flag.dds"
	group = je_group_historical_content
	
	is_shown_when_inactive = {
		any_primary_culture = {
				has_discrimination_trait = south_asian_heritage
			}
		OR = {
		root = {
		has_diplomatic_pact = {
			who = c:BIC
			type = puppet
			}
		}
		root = {
		has_diplomatic_pact = {
			who = c:BIC
			type = dominion
			}
		}
		}		
	}

	possible = {
		NOT = {
		has_law = law_type:law_multicultural
		}
	}
	
	scripted_button = kingly_state_button
	scripted_button = ban_sati_button
	
	complete = {			
		c:BIC = {
		relations:root >= relations_threshold:amicable
			}
		has_law = law_type:law_multicultural
		has_law = law_type:law_total_separation
		NOT = {
			has_law = law_type:law_closed_borders
		}
		NOT = {
			has_modifier = sati_modifier
		}
	}
	
	on_complete = {
			c:BIC = {
		create_diplomatic_pact = {
            country = root
            type = protectorate
			}
		}
		#trigger_event = { id = 01_afghanistan_events.16 popup = yes }
	}
	
	current_value = {
		value = root.gdp
	}

	goal_add_value = {
		value = root.gdp
		multiply = 5
	}
	
	invalid = {
		is_subject = no
		}

	weight = 100
	
	should_be_pinned_by_default = yes
}

je_religious_tolerance = {
	icon = "gfx/interface/icons/event_icons/event_scales.dds"
	group = je_group_historical_content
		
	modifiers_while_active = {
		religious_tolerance_modifier
	}
	
	complete = {			
		has_law = law_type:law_total_separation
	}
	
	on_complete = {
		add_loyalists = {
		religion = rel:sunni
		value = 0.1
		}
		add_loyalists = {
		religion = rel:shiite
		value = 0.1
		}
	}
	
	timeout = 10950
	
	
	on_timeout = {
		add_radicals = {
		religion = rel:sunni
		value = 0.1
		}
		add_radicals = {
		religion = rel:shiite
		value = 0.1
		}
	}

	weight = 100
	
	should_be_pinned_by_default = yes
}


je_an_indian_india = {
	icon = "gfx/interface/icons/event_icons/waving_flag.dds"
	group = je_group_historical_content
	
	is_shown_when_inactive = {
	NOT = {
		this = c:NEP
		}
		any_primary_culture = {
				has_discrimination_trait = south_asian_heritage
			}
		is_subject = no		
	}
	
	scripted_button = foster_indian_agitation_button
	scripted_button = lead_the_charge_button
	scripted_button = indian_union_button
	
	complete = {			
		custom_tooltip = {
			text = form_india_tt			
		exists = c:BHT
		this = c:BHT
		}
		is_subject = no
	}
	
	on_complete = {
		add_loyalists = {
		
		value = 0.1
		}
		
	}
	

	weight = 100
	
	should_be_pinned_by_default = yes
}

je_our_own_state = {
	icon = "gfx/interface/icons/event_icons/waving_flag.dds"
	group = je_group_historical_content
	
	is_shown_when_inactive = {
		any_primary_culture = {
				has_discrimination_trait = south_asian_heritage
			}
		OR = {
		root = {
		has_diplomatic_pact = {
			who = c:BIC
			type = puppet
			}
		}
		root = {
		has_diplomatic_pact = {
			who = c:BIC
			type = dominion
				}
			}
		}	
	}
	
	possible = {
		has_technology_researched = nationalism
		c:BIC = {
		relations:root <= relations_threshold:neutral
			}
		}
	
	scripted_button = foster_indian_agitation_button
	
	complete = {			
		is_subject = no
	}
	
	on_complete = {
		add_loyalists = {
		value = 0.1
		}
		
	}

	weight = 100
	
	should_be_pinned_by_default = yes
}

je_remove_the_caste = {
	icon = "gfx/interface/icons/event_icons/event_scales.dds"
	group = je_group_historical_content
	
	is_shown_when_inactive = {
		has_modifier = caste_system_modifier		
	}

	possible = {
		NOT = {
		has_law = law_type:law_multicultural
		}
	}
	
	complete = {			
		has_law = law_type:law_multicultural	
	}
	

	
	on_complete = {
		remove_modifier = caste_system_modifier
		if = {
			limit = {
				NOT = {
					this = c:BIC
					}
				}		
		remove_modifier = brahmins_modifier
		remove_modifier = kshatriyas_modifier
		remove_modifier = vaishyas_modifier
		remove_modifier = shudras_modifier
		}
			#trigger_event = { id = 01_afghanistan_events.16 popup = yes }
	}
	
	fail = {
		has_law = law_type:law_ethnostate
		}
		
	on_fail = {
	
	}

	weight = 100
	
	should_be_pinned_by_default = yes
}

je_koh_i_nor = {
	icon = "gfx/interface/icons/event_icons/event_portrait.dds"
	group = je_group_historical_content
	
	is_shown_when_inactive = {
		this = c:GBR		
	}

	possible = {
		
		OR = {
		c:PAN = {
		is_subject_of = c:GBR
			}
		c:PAN = {
		is_subject_of = c:BIC
			}
			
		}
	}
	
	modifiers_while_active = {
		koh_i_noor_modifier
	}
	
	scripted_button = sell_koh_i_nor_button
	
	fail = {

		this = c:PAN
		
		OR = {
		c:PAN = {
		is_subject_of = c:GBR
			}
		c:PAN = {
		is_subject_of = c:BIC
			}
			
		}
	}
		
	on_fail = {
		custom_tooltip = historical_tt
		if = {
		limit = {
		this = c:PAN
		}
		c:GBR = {
			add_journal_entry = {
			type = je_koh_i_nor
				}
			}
		}
	}

	weight = 100
	
	should_be_pinned_by_default = yes
}

